|
--- |
|
license: mit |
|
task_categories: |
|
- text-generation |
|
- reinforcement-learning |
|
language: |
|
- en |
|
tags: |
|
- chess |
|
- games |
|
- pgn |
|
- strategy |
|
- board-games |
|
pretty_name: Oden WorldChess Dataset |
|
size_categories: |
|
- 1M<n<10M |
|
dataset_info: |
|
features: |
|
- name: event |
|
dtype: string |
|
- name: site |
|
dtype: string |
|
- name: date |
|
dtype: string |
|
- name: round |
|
dtype: string |
|
- name: white |
|
dtype: string |
|
- name: black |
|
dtype: string |
|
- name: result |
|
dtype: string |
|
- name: white_elo |
|
dtype: string |
|
- name: black_elo |
|
dtype: string |
|
- name: eco |
|
dtype: string |
|
- name: opening |
|
dtype: string |
|
- name: variation |
|
dtype: string |
|
- name: white_title |
|
dtype: string |
|
- name: black_title |
|
dtype: string |
|
- name: time_control |
|
dtype: string |
|
- name: termination |
|
dtype: string |
|
- name: moves |
|
sequence: string |
|
- name: moves_san |
|
dtype: string |
|
- name: positions_fen |
|
sequence: string |
|
- name: num_moves |
|
dtype: int32 |
|
- name: tags |
|
sequence: string |
|
- name: source_file |
|
dtype: string |
|
- name: all_headers |
|
dtype: string |
|
splits: |
|
- name: train |
|
num_examples: 4047908 |
|
--- |
|
|
|
# Oden Chess Dataset |
|
|
|
<div align="center"> |
|
<img src="https://images.unsplash.com/photo-1528819622765-d6bcf132f793?w=800" alt="Chess pieces" width="600"> |
|
</div> |
|
|
|
## Dataset Summary |
|
|
|
The **Oden Chess Dataset** is a comprehensive collection of over 4 million chess games compiled from top players, major tournaments, and categorized by opening systems. This dataset provides rich annotations including move sequences, board positions, player information, and game metadata, making it ideal for chess AI research, opening analysis, and statistical studies. |
|
|
|
## Dataset Details |
|
|
|
- **Total Games**: 4,047,908 |
|
- **Source Files**: 299 PGN files |
|
- **Total Size**: ~2.6 GB (original PGN format) |
|
- **Total SizeHF**: 10.1 GB |
|
- **Time Period**: Historical games to 2024 |
|
- **Languages**: English (PGN notation is universal) |
|
|
|
## Dataset Structure |
|
|
|
### Data Fields |
|
|
|
Each game in the dataset contains the following fields: |
|
|
|
| Field | Type | Description | |
|
|-------|------|-------------| |
|
| `event` | string | Tournament or match name | |
|
| `site` | string | Location where the game was played | |
|
| `date` | string | Date in YYYY.MM.DD format | |
|
| `round` | string | Round number in tournament | |
|
| `white` | string | Name of player with white pieces | |
|
| `black` | string | Name of player with black pieces | |
|
| `result` | string | Game result: "1-0" (white wins), "0-1" (black wins), "1/2-1/2" (draw), "*" (unfinished) | |
|
| `white_elo` | string | White player's ELO rating | |
|
| `black_elo` | string | Black player's ELO rating | |
|
| `eco` | string | Encyclopedia of Chess Openings (ECO) code | |
|
| `opening` | string | Opening name | |
|
| `variation` | string | Opening variation | |
|
| `white_title` | string | White player's title (GM, IM, FM, etc.) | |
|
| `black_title` | string | Black player's title | |
|
| `time_control` | string | Time control format | |
|
| `termination` | string | How the game ended | |
|
| `moves` | list[string] | List of moves in Standard Algebraic Notation (SAN) | |
|
| `moves_san` | string | All moves as a single string | |
|
| `positions_fen` | list[string] | Board position in FEN notation after each move | |
|
| `num_moves` | int32 | Total number of moves in the game | |
|
| `tags` | list[string] | Categorical tags based on source | |
|
| `source_file` | string | Original PGN filename | |
|
| `all_headers` | string | JSON string of all PGN headers | |
|
|
|
### Data Organization |
|
|
|
The dataset is organized into three main categories: |
|
|
|
1. **Players**: Games from individual top players including world champions and grandmasters |
|
2. **Openings**: Games categorized by opening systems: |
|
- Classical King Pawn (e.g., Italian Game, Spanish Opening) |
|
- Classical Queen Pawn (e.g., Queen's Gambit) |
|
- Modern King Pawn (e.g., Sicilian Defense, French Defense) |
|
- Modern Queen Pawn (e.g., King's Indian, Nimzo-Indian) |
|
- Flank and Unorthodox (e.g., English Opening, Bird's Opening) |
|
3. **Tournaments**: Games from major championships including World Championships, Candidates tournaments, and other elite events |
|
|
|
## Usage Examples |
|
|
|
### Loading the Dataset |
|
|
|
```python |
|
from datasets import load_dataset |
|
|
|
# Load the full dataset |
|
dataset = load_dataset("BBSRguy/Oden-worldchess") |
|
|
|
# Access the training split |
|
chess_games = dataset['train'] |
|
|
|
# View a sample game |
|
sample_game = chess_games[0] |
|
print(f"White: {sample_game['white']} ({sample_game['white_elo']})") |
|
print(f"Black: {sample_game['black']} ({sample_game['black_elo']})") |
|
print(f"Result: {sample_game['result']}") |
|
print(f"Opening: {sample_game['eco']} - {sample_game['opening']}") |
|
print(f"Moves: {sample_game['moves_san'][:50]}...") |
|
``` |
|
|
|
### Filtering Games |
|
|
|
```python |
|
# Filter games by player |
|
carlsen_games = chess_games.filter( |
|
lambda x: 'Carlsen' in x['white'] or 'Carlsen' in x['black'] |
|
) |
|
|
|
# Filter games by opening |
|
sicilian_games = chess_games.filter( |
|
lambda x: x['eco'].startswith('B') if x['eco'] else False |
|
) |
|
|
|
# Filter games by result |
|
decisive_games = chess_games.filter( |
|
lambda x: x['result'] in ['1-0', '0-1'] |
|
) |
|
|
|
# Filter long games |
|
long_games = chess_games.filter( |
|
lambda x: x['num_moves'] > 100 |
|
) |
|
``` |
|
|
|
### Analyzing Positions |
|
|
|
```python |
|
import chess |
|
import chess.svg |
|
|
|
# Reconstruct a game position |
|
game = chess_games[0] |
|
board = chess.Board() |
|
|
|
# Play through the moves |
|
for move in game['moves']: |
|
board.push_san(move) |
|
|
|
# Or directly load a position |
|
position_after_10_moves = game['positions_fen'][10] |
|
board = chess.Board(position_after_10_moves) |
|
``` |
|
|
|
### Statistical Analysis |
|
|
|
```python |
|
import pandas as pd |
|
|
|
# Convert to pandas for analysis |
|
df = chess_games.to_pandas() |
|
|
|
# Result distribution |
|
print(df['result'].value_counts()) |
|
|
|
# Most common openings |
|
print(df['eco'].value_counts().head(10)) |
|
|
|
# Average game length by result |
|
print(df.groupby('result')['num_moves'].mean()) |
|
|
|
# Top players by number of games |
|
all_players = pd.concat([df['white'], df['black']]) |
|
print(all_players.value_counts().head(20)) |
|
``` |
|
|
|
## Applications |
|
|
|
This dataset is suitable for: |
|
|
|
1. **Chess Engine Development** |
|
- Training neural networks for position evaluation |
|
- Move prediction and game analysis |
|
- Opening book generation |
|
|
|
2. **Statistical Analysis** |
|
- Player performance metrics |
|
- Opening popularity and success rates |
|
- Game length patterns |
|
- ELO rating analysis |
|
|
|
3. **Machine Learning Research** |
|
- Sequence modeling with chess moves |
|
- Pattern recognition in positions |
|
- Reinforcement learning for chess AI |
|
|
|
4. **Educational Tools** |
|
- Opening repertoire builders |
|
- Tactical pattern recognition |
|
- Historical game analysis |
|
|
|
## Dataset Creation |
|
|
|
### Source Data |
|
|
|
The dataset was compiled from publicly available PGN files including: |
|
- Individual collections of top-rated players |
|
- Major tournament archives |
|
- Opening-specific game collections |
|
|
|
### Processing |
|
|
|
Games were processed to: |
|
- Extract all metadata from PGN headers |
|
- Convert moves to a standardized format |
|
- Generate FEN positions for each move |
|
- Categorize games by source type |
|
- Handle various PGN format variations |
|
|
|
## Considerations |
|
|
|
### Data Quality |
|
|
|
- Some games may have incomplete metadata (missing ELO ratings, dates, etc.) |
|
- A small number of games contain annotation errors from source files |
|
- Time controls and termination reasons may not be available for older games |
|
|
|
### Ethical Considerations |
|
|
|
- All games are from public sources and chess games are not copyrightable |
|
- Player names are included as they appear in public tournament records |
|
- No private or sensitive information is included |
|
|
|
## Citation |
|
|
|
If you use this dataset in your research, please cite: |
|
|
|
```bibtex |
|
@dataset{oden-worldchess, |
|
title = {Oden World Chess Dataset}, |
|
author = {BBSRguy}, |
|
year = {2025}, |
|
month = {6}, |
|
publisher = {HuggingFace}, |
|
howpublished = {\url{https://huggingface.co/datasets/BBSRguy/Oden-worldchess}}, |
|
note = {A comprehensive chess dataset with 4M+ games from top players and tournaments} |
|
} |
|
``` |
|
|
|
## License |
|
|
|
This dataset is released under the MIT License. Chess games themselves are factual records of public events and are not subject to copyright. |
|
|
|
## Acknowledgments |
|
|
|
Thanks to all the chess organizations, players, and enthusiasts who have made these games publicly available for analysis and study. 😊 🙏 |