Update README.md
Browse files
README.md
CHANGED
@@ -12,18 +12,14 @@ size_categories:
|
|
12 |
|
13 |
## Dataset Description
|
14 |
|
15 |
-
- **Homepage:**
|
16 |
-
- **
|
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).
|
@@ -124,6 +120,25 @@ Examples (3 rows from june 2013):
|
|
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.
|
|
|
12 |
|
13 |
## Dataset Description
|
14 |
|
15 |
+
- **Homepage:** https://database.lichess.org/
|
16 |
+
- **Point of Contact:** maxime.darrin@outlook.com
|
|
|
|
|
|
|
17 |
|
18 |
### Dataset Summary
|
19 |
|
20 |
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
|
21 |
but other variant will be added shortly.
|
22 |
|
|
|
23 |
### Supported Tasks and Leaderboards
|
24 |
|
25 |
It is intended for pretraining text generation models for chess games (in a PGN format).
|
|
|
120 |
|
121 |
Only a single column "text". Each row contains a single game in PGN format.
|
122 |
|
123 |
+
### How to use with python-chess
|
124 |
+
|
125 |
+
```python
|
126 |
+
from datasets import load_dataset
|
127 |
+
import chess.pgn
|
128 |
+
import io
|
129 |
+
|
130 |
+
|
131 |
+
dataset = load_dataset("lichess_games", "2013-06", streaming=True)
|
132 |
+
|
133 |
+
for d in dataset['train']:
|
134 |
+
pgn = io.StringIO(d['text'])
|
135 |
+
game = chess.pgn.read_game(pgn)
|
136 |
+
print(game.headers['White'], game.headers['Black'])
|
137 |
+
print(game.headers['Result'])
|
138 |
+
print(game.mainline_moves())
|
139 |
+
break
|
140 |
+
```
|
141 |
+
|
142 |
### Data Splits
|
143 |
|
144 |
No splits only the file per dates.
|