Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,192 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc0-1.0
|
3 |
+
task_categories:
|
4 |
+
- text-generation
|
5 |
+
language:
|
6 |
+
- en
|
7 |
+
pretty_name: Lichess Games
|
8 |
+
size_categories:
|
9 |
+
- 100B<n<1T
|
10 |
+
---
|
11 |
+
# Dataset Card for Lichess Games
|
12 |
+
|
13 |
+
## Dataset Description
|
14 |
+
|
15 |
+
- **Homepage:**
|
16 |
+
- **Repository:**
|
17 |
+
- **Paper:**
|
18 |
+
- **Leaderboard:**
|
19 |
+
- **Point of Contact:**
|
20 |
+
|
21 |
+
### Dataset Summary
|
22 |
+
|
23 |
+
This is an easy-to-use huggingface dataset to access the [lichess game database](https://database.lichess.org/). For now it supports only the standard games
|
24 |
+
but other variant will be added shortly.
|
25 |
+
|
26 |
+
|
27 |
+
### Supported Tasks and Leaderboards
|
28 |
+
|
29 |
+
It is intended for pretraining text generation models for chess games (in a PGN format).
|
30 |
+
|
31 |
+
## Dataset Structure
|
32 |
+
|
33 |
+
### Data Instances
|
34 |
+
|
35 |
+
Available configs consist on the year and month of the file as described here: https://database.lichess.org/.
|
36 |
+
For example to get a small sample one can try to download the dataset for june 2013 (~40mo).
|
37 |
+
|
38 |
+
```python
|
39 |
+
from datasets import load_dataset
|
40 |
+
|
41 |
+
dataset = load_dataset("lichess_games", "2013-06", streaming=True)
|
42 |
+
```
|
43 |
+
|
44 |
+
Examples (3 rows from june 2013):
|
45 |
+
|
46 |
+
```
|
47 |
+
|
48 |
+
{'text': '[Event "Rated Bullet game"]\n'
|
49 |
+
'[Site "https://lichess.org/in28emmw"]\n'
|
50 |
+
'[Date "????.??.??"]\n'
|
51 |
+
'[Round "?"]\n'
|
52 |
+
'[White "Kazuma"]\n'
|
53 |
+
'[Black "kikeillana"]\n'
|
54 |
+
'[Result "1-0"]\n'
|
55 |
+
'[BlackElo "1684"]\n'
|
56 |
+
'[BlackRatingDiff "-9"]\n'
|
57 |
+
'[ECO "A07"]\n'
|
58 |
+
'[Opening "King\'s Indian Attack: Keres Variation #2"]\n'
|
59 |
+
'[Termination "Normal"]\n'
|
60 |
+
'[TimeControl "60+0"]\n'
|
61 |
+
'[UTCDate "2013.05.31"]\n'
|
62 |
+
'[UTCTime "22:00:22"]\n'
|
63 |
+
'[WhiteElo "1756"]\n'
|
64 |
+
'[WhiteRatingDiff "+11"]\n'
|
65 |
+
'\n'
|
66 |
+
'1. Nf3 d5 2. g3 Bg4 3. Bg2 Bxf3 4. Bxf3 e6 5. O-O Bb4 6. d4 Nd7 7. '
|
67 |
+
'c3 Ba5 8. Bf4 Bb6 9. b4 a6 10. a4 c6 11. Nd2 Ngf6 12. e4 dxe4 13. '
|
68 |
+
'Nxe4 Nxe4 14. Bxe4 f6 15. c4 h6 16. c5 Bc7 17. Qb3 Bxf4 18. Qxe6+ '
|
69 |
+
'Qe7 19. Bg6+ Kd8 20. Qxe7+ Kxe7 21. gxf4 Rhe8 22. Bxe8 Rxe8 23. '
|
70 |
+
'Rfe1+ Kf7 24. Rxe8 Kxe8 25. Re1+ Kf7 26. Re4 g6 27. Kg2 f5 28. Re3 '
|
71 |
+
'h5 29. Kf3 Kg7 30. Re7+ Kf6 31. Rxd7 g5 32. Rxb7 1-0'}
|
72 |
+
{'text': '[Event "Rated Bullet game"]\n'
|
73 |
+
'[Site "https://lichess.org/e174t8h7"]\n'
|
74 |
+
'[Date "????.??.??"]\n'
|
75 |
+
'[Round "?"]\n'
|
76 |
+
'[White "Aceves"]\n'
|
77 |
+
'[Black "calculus"]\n'
|
78 |
+
'[Result "0-1"]\n'
|
79 |
+
'[BlackElo "1568"]\n'
|
80 |
+
'[BlackRatingDiff "+9"]\n'
|
81 |
+
'[ECO "D00"]\n'
|
82 |
+
'[Opening "Queen\'s Pawn Game #3"]\n'
|
83 |
+
'[Termination "Time forfeit"]\n'
|
84 |
+
'[TimeControl "60+1"]\n'
|
85 |
+
'[UTCDate "2013.05.31"]\n'
|
86 |
+
'[UTCTime "22:02:13"]\n'
|
87 |
+
'[WhiteElo "1487"]\n'
|
88 |
+
'[WhiteRatingDiff "-9"]\n'
|
89 |
+
'\n'
|
90 |
+
'1. d4 d5 2. e3 Nf6 3. c3 Bg4 4. Qc2 e6 5. Bd3 Bd6 6. Nd2 c6 7. e4 '
|
91 |
+
'dxe4 8. Nxe4 Nxe4 9. Bxe4 Bc7 10. Bxh7 g6 11. h3 Bf5 12. Qe2 Rxh7 '
|
92 |
+
'13. Be3 Qd6 14. Nf3 Nd7 15. Ng5 Rh8 16. g3 f6 17. Bf4 e5 18. dxe5 '
|
93 |
+
'fxe5 19. Bxe5 Qxe5 20. Qe3 Qxe3+ 21. fxe3 Bxg3+ 22. Ke2 Bh4 23. Nf3 '
|
94 |
+
'Be4 24. Rad1 O-O-O 25. Rhf1 Rhf8 26. Nd4 Rxf1 27. Rxf1 Ne5 28. Ne6 '
|
95 |
+
'Re8 29. Ng7 Re7 30. Rf4 Bd3+ 31. Kd2 Rxg7 32. Rxh4 Nf3+ 33. Kd1 Nxh4 '
|
96 |
+
'34. Kd2 Bf5 0-1'}
|
97 |
+
{'text': '[Event "Rated Blitz game"]\n'
|
98 |
+
'[Site "https://lichess.org/d4ui60z6"]\n'
|
99 |
+
'[Date "????.??.??"]\n'
|
100 |
+
'[Round "?"]\n'
|
101 |
+
'[White "melro"]\n'
|
102 |
+
'[Black "patrimpas"]\n'
|
103 |
+
'[Result "0-1"]\n'
|
104 |
+
'[BlackElo "1912"]\n'
|
105 |
+
'[BlackRatingDiff "+0"]\n'
|
106 |
+
'[ECO "B20"]\n'
|
107 |
+
'[Opening "Sicilian Defense: Staunton-Cochrane Variation"]\n'
|
108 |
+
'[Termination "Normal"]\n'
|
109 |
+
'[TimeControl "240+0"]\n'
|
110 |
+
'[UTCDate "2013.05.31"]\n'
|
111 |
+
'[UTCTime "22:02:15"]\n'
|
112 |
+
'[WhiteElo "1144"]\n'
|
113 |
+
'[WhiteRatingDiff "-1"]\n'
|
114 |
+
'\n'
|
115 |
+
'1. e4 c5 2. c4 Nc6 3. d3 g6 4. Bd2 Bg7 5. Bc3 Nf6 6. Nd2 d6 7. Rb1 '
|
116 |
+
'O-O 8. Bxf6 Bxf6 9. b3 Qa5 10. a4 Bc3 11. f3 e6 12. Ne2 Bg7 13. g4 '
|
117 |
+
'd5 14. h3 Nd4 15. Nxd4 cxd4 16. Be2 dxe4 17. fxe4 Bh6 18. Rb2 e5 19. '
|
118 |
+
'O-O Be3+ 20. Kh1 Qd8 21. Nf3 Bf4 22. Rf2 h5 23. Rg2 hxg4 24. hxg4 '
|
119 |
+
'Kg7 25. Kg1 Rh8 26. Kf2 Qf6 27. Qc2 Rh3 28. Qd1 Be3+ 29. Ke1 Rh1+ '
|
120 |
+
'30. Rg1 0-1'}
|
121 |
+
```
|
122 |
+
|
123 |
+
### Data Fields
|
124 |
+
|
125 |
+
Only a single column "text". Each row contains a single game in PGN format.
|
126 |
+
|
127 |
+
### Data Splits
|
128 |
+
|
129 |
+
No splits only the file per dates.
|
130 |
+
|
131 |
+
### Source Data
|
132 |
+
|
133 |
+
The underlying data are provided and maintained by the Lichess team and provided under CC0 license (https://database.lichess.org/). I only provide the huggingface interface here.
|
134 |
+
|
135 |
+
#### Initial Data Collection and Normalization
|
136 |
+
|
137 |
+
The data comes from all the standard rated games played on lichess.org. Every rated game played on lichess and its metadata are recorded and stored by lichess.
|
138 |
+
Lichess.org provides a forever free to use, libre and open-source plateform to play chess online.
|
139 |
+
|
140 |
+
### Annotations
|
141 |
+
|
142 |
+
Some of the games (~6% according to lichess: https://database.lichess.org/) comes annotated (directly in the PGN format) with computer analysis of the move:
|
143 |
+
|
144 |
+
```
|
145 |
+
About 6% of the games include Stockfish analysis evaluations: [%eval 2.35] (235 centipawn advantage), [%eval #-4] (getting mated in 4), always from White's point of view.
|
146 |
+
|
147 |
+
The WhiteElo and BlackElo tags contain Glicko2 ratings.
|
148 |
+
|
149 |
+
Games contain clock information as PGN %clk comments since April 2017.
|
150 |
+
|
151 |
+
Variant games have a Variant tag, e.g., [Variant "Antichess"].
|
152 |
+
```
|
153 |
+
|
154 |
+
### Personal and Sensitive Information
|
155 |
+
|
156 |
+
The metadata of the different PGN contains information of the players (their pseudo on lichess), the date and times when the game happened, the strength of the players
|
157 |
+
(in terms of ELO rating) and a link to the game on the platform.
|
158 |
+
|
159 |
+
|
160 |
+
An example of metadata from one the games.
|
161 |
+
|
162 |
+
```
|
163 |
+
[Event "Rated Bullet tournament https://lichess.org/tournament/yc1WW2Ox"]
|
164 |
+
[Site "https://lichess.org/PpwPOZMq"]
|
165 |
+
[Date "2017.04.01"]
|
166 |
+
[Round "-"]
|
167 |
+
[White "Abbot"]
|
168 |
+
[Black "Costello"]
|
169 |
+
[Result "0-1"]
|
170 |
+
[UTCDate "2017.04.01"]
|
171 |
+
[UTCTime "11:32:01"]
|
172 |
+
[WhiteElo "2100"]
|
173 |
+
[BlackElo "2000"]
|
174 |
+
[WhiteRatingDiff "-4"]
|
175 |
+
[BlackRatingDiff "+1"]
|
176 |
+
[WhiteTitle "FM"]
|
177 |
+
[ECO "B30"]
|
178 |
+
[Opening "Sicilian Defense: Old Sicilian"]
|
179 |
+
[TimeControl "300+0"]
|
180 |
+
[Termination "Time forfeit"]
|
181 |
+
```
|
182 |
+
|
183 |
+
|
184 |
+
## Additional Information
|
185 |
+
|
186 |
+
### Licensing Information
|
187 |
+
|
188 |
+
Lichess provides all the data under CC0.
|
189 |
+
|
190 |
+
### Citation Information
|
191 |
+
|
192 |
+
TO COME.
|