prdev commited on
Commit
42862cd
·
verified ·
1 Parent(s): 39bfb07

Upload folder using huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. README.md +59 -0
  2. dataset.py +66 -0
  3. train-00000-of-01024.msgpack.zst +3 -0
  4. train-00001-of-01024.msgpack.zst +3 -0
  5. train-00002-of-01024.msgpack.zst +3 -0
  6. train-00003-of-01024.msgpack.zst +3 -0
  7. train-00004-of-01024.msgpack.zst +3 -0
  8. train-00005-of-01024.msgpack.zst +3 -0
  9. train-00006-of-01024.msgpack.zst +3 -0
  10. train-00007-of-01024.msgpack.zst +3 -0
  11. train-00008-of-01024.msgpack.zst +3 -0
  12. train-00009-of-01024.msgpack.zst +3 -0
  13. train-00010-of-01024.msgpack.zst +3 -0
  14. train-00011-of-01024.msgpack.zst +3 -0
  15. train-00012-of-01024.msgpack.zst +3 -0
  16. train-00013-of-01024.msgpack.zst +3 -0
  17. train-00014-of-01024.msgpack.zst +3 -0
  18. train-00015-of-01024.msgpack.zst +3 -0
  19. train-00016-of-01024.msgpack.zst +3 -0
  20. train-00017-of-01024.msgpack.zst +3 -0
  21. train-00018-of-01024.msgpack.zst +3 -0
  22. train-00019-of-01024.msgpack.zst +3 -0
  23. train-00020-of-01024.msgpack.zst +3 -0
  24. train-00021-of-01024.msgpack.zst +3 -0
  25. train-00022-of-01024.msgpack.zst +3 -0
  26. train-00023-of-01024.msgpack.zst +3 -0
  27. train-00024-of-01024.msgpack.zst +3 -0
  28. train-00025-of-01024.msgpack.zst +3 -0
  29. train-00026-of-01024.msgpack.zst +3 -0
  30. train-00027-of-01024.msgpack.zst +3 -0
  31. train-00028-of-01024.msgpack.zst +3 -0
  32. train-00029-of-01024.msgpack.zst +3 -0
  33. train-00030-of-01024.msgpack.zst +3 -0
  34. train-00031-of-01024.msgpack.zst +3 -0
  35. train-00032-of-01024.msgpack.zst +3 -0
  36. train-00033-of-01024.msgpack.zst +3 -0
  37. train-00034-of-01024.msgpack.zst +3 -0
  38. train-00035-of-01024.msgpack.zst +3 -0
  39. train-00036-of-01024.msgpack.zst +3 -0
  40. train-00037-of-01024.msgpack.zst +3 -0
  41. train-00038-of-01024.msgpack.zst +3 -0
  42. train-00039-of-01024.msgpack.zst +3 -0
  43. train-00040-of-01024.msgpack.zst +3 -0
  44. train-00041-of-01024.msgpack.zst +3 -0
  45. train-00042-of-01024.msgpack.zst +3 -0
  46. train-00043-of-01024.msgpack.zst +3 -0
  47. train-00044-of-01024.msgpack.zst +3 -0
  48. train-00045-of-01024.msgpack.zst +3 -0
  49. train-00046-of-01024.msgpack.zst +3 -0
  50. train-00047-of-01024.msgpack.zst +3 -0
README.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ task_categories:
4
+ - tabular-classification
5
+ - other
6
+ tags:
7
+ - chess
8
+ - game-ai
9
+ - evaluation
10
+ size_categories:
11
+ - 1B<n<10B
12
+ ---
13
+
14
+ # ChessBenchmate Aggregated Dataset
15
+
16
+ This dataset is a transformed version of the ChessBenchmate dataset, aggregating all legal moves and their Stockfish evaluations per chess position.
17
+
18
+ ## Dataset Structure
19
+
20
+ Each record contains:
21
+ - `fen`: Chess position in FEN notation
22
+ - `moves`: Dictionary mapping UCI moves to their evaluations
23
+ - `win_prob`: Win probability from 0.0 to 1.0 (Stockfish evaluation)
24
+ - `mate`: Mate indicator (None = no forced mate, '#' = immediate checkmate, integer = mate-in-N)
25
+
26
+ ## File Format
27
+
28
+ - Format: MessagePack binary (streamed records)
29
+ - Files: 1024 shards (`train-XXXXX-of-01024.msgpack`)
30
+ - Estimated: ~3.6B unique positions
31
+
32
+ ## Usage
33
+
34
+ ```python
35
+ import msgpack
36
+
37
+ def load_positions(filepath):
38
+ """Stream positions from a msgpack file."""
39
+ with open(filepath, 'rb') as f:
40
+ unpacker = msgpack.Unpacker(f, raw=False)
41
+ for record in unpacker:
42
+ yield record
43
+
44
+ # Example
45
+ for record in load_positions('train-00000-of-01024.msgpack'):
46
+ fen = record['fen']
47
+ moves = record['moves']
48
+ for move, eval in moves.items():
49
+ print(f"{move}: win_prob={eval['win_prob']:.3f}, mate={eval['mate']}")
50
+ break
51
+ ```
52
+
53
+ ## Source
54
+
55
+ Transformed from [ChessBenchmate](https://huggingface.co/datasets/Lichess/chessbenchmate) dataset.
56
+
57
+ ## License
58
+
59
+ MIT License (same as source dataset)
dataset.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Dataset loader for ChessBenchmate Aggregated dataset."""
3
+
4
+ import msgpack
5
+ from pathlib import Path
6
+ from typing import Iterator, Dict, Any
7
+
8
+
9
+ def stream_positions(data_dir: str, shard_range: tuple = None) -> Iterator[Dict[str, Any]]:
10
+ """Stream positions from all shards.
11
+
12
+ Args:
13
+ data_dir: Directory containing the .msgpack files
14
+ shard_range: Optional (start, end) tuple to limit shards
15
+
16
+ Yields:
17
+ Dict with 'fen' and 'moves' keys
18
+ """
19
+ data_path = Path(data_dir)
20
+ shard_files = sorted(data_path.glob('train-*.msgpack'))
21
+
22
+ if shard_range:
23
+ start, end = shard_range
24
+ shard_files = shard_files[start:end]
25
+
26
+ for shard_file in shard_files:
27
+ with open(shard_file, 'rb') as f:
28
+ unpacker = msgpack.Unpacker(f, raw=False)
29
+ for record in unpacker:
30
+ yield record
31
+
32
+
33
+ def count_positions(data_dir: str) -> tuple:
34
+ """Count total positions and moves in the dataset.
35
+
36
+ Returns:
37
+ Tuple of (num_positions, num_moves)
38
+ """
39
+ total_positions = 0
40
+ total_moves = 0
41
+
42
+ for record in stream_positions(data_dir):
43
+ total_positions += 1
44
+ total_moves += len(record['moves'])
45
+
46
+ return total_positions, total_moves
47
+
48
+
49
+ if __name__ == '__main__':
50
+ import sys
51
+
52
+ if len(sys.argv) < 2:
53
+ print("Usage: python dataset.py <data_dir>")
54
+ sys.exit(1)
55
+
56
+ data_dir = sys.argv[1]
57
+
58
+ print(f"Sampling positions from {data_dir}...")
59
+ for i, record in enumerate(stream_positions(data_dir)):
60
+ print(f"\nPosition {i+1}:")
61
+ print(f" FEN: {record['fen']}")
62
+ print(f" Moves: {len(record['moves'])}")
63
+ for move, eval in list(record['moves'].items())[:3]:
64
+ print(f" {move}: win_prob={eval['win_prob']:.3f}, mate={eval['mate']}")
65
+ if i >= 4:
66
+ break
train-00000-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0cfcb156c2a8cf6fbe1764faa0dc23ef3d355510d92b37e7e1c1264987b142fa
3
+ size 72116154
train-00001-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9424c6fc464cc66dce4e68e157857fab7f912fa18d97a31115220a1c9885a462
3
+ size 72286391
train-00002-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:da10f9f38ef9d6b218b38289cdb720236b53b01e61e6e0996e4b7c7b3b6546b8
3
+ size 72347952
train-00003-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5163d107b239b7b3c59105145a1f89ae6ff4b499b02317dea618ca6edfc1b4c6
3
+ size 72101818
train-00004-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8f0fe4430d76f6b516ef58915505284b5073ce747ac00f2f6aef3c64a287217
3
+ size 72316580
train-00005-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64080795e93a0aa0c224b9969caced79e8e4217485002d07aeef294a75364dc4
3
+ size 72186840
train-00006-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ace6b2414fb2b711cf8ca6118583e32784479587ad19d95f2e4fb220feea93fc
3
+ size 72286867
train-00007-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aef0eb6d701f0f38196030aefadf5e00daf38060a0726c2226b55567687f61d1
3
+ size 72454842
train-00008-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:644a4499e1ce82183b25adf3bf53ce3fd5f40fa4b6c6973091b584d8b44a9117
3
+ size 72231565
train-00009-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a6fa4dacf67baf48f1c09a67444dbeae1e8ad575228e0c1cffa4a43c77acee06
3
+ size 72178028
train-00010-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b04d406b65087e41183315f86e513d420da93daaf24b071d614c4cbf0adb72ce
3
+ size 72542933
train-00011-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eea8d9977fa6be7d2cc10947fb5369e6b960e45e1e4627edf57e0f4e23499d1f
3
+ size 72353888
train-00012-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:efd3fd4521cc9ecd109f215eb4fa1af80ec117ddaa0504664ca4eaccab80a041
3
+ size 72220318
train-00013-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:499e4d4319ecbf7621fd99037596ac663d321578524e44614ca42c284968bf87
3
+ size 72498425
train-00014-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3413e2a2e1184d3f298d3dd7036491cdf8a492c347a209b88dfbce29a381642
3
+ size 72247831
train-00015-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4199c2c36fee44f2b9275175092c3732d7616d6baa48889789ec8c793e867e9f
3
+ size 72198570
train-00016-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:399a9ba3a6afe54b1ad7a14bfb82c8b39e3c0c984f5bdc4f04ef93dd60592de9
3
+ size 72365726
train-00017-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f120dcd6e1e04b011e6c0ead8d604704ccaf6f0f63386ffaa2403ce4fe5b9a6
3
+ size 72417006
train-00018-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6853b092926cc2bc081a2cc2e67e162b80d09b609b6d311fb1c710dedc42b83d
3
+ size 72508621
train-00019-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62b1347f82d6d25653a16f4f80403ea50d7eaf1b91d2ffb975b49fabb45e5b70
3
+ size 72308799
train-00020-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f957ee69ed43a513372096cc8cea6658918cc43fe9296bcffb4002a9a3ebc7d
3
+ size 72198168
train-00021-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:94cd9341dda6b11a55b5ebe7b0f7a2c613730afd2169730373599ff832ee2410
3
+ size 72332416
train-00022-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:beb9aa7bda4eb86e80840e744ab6ec907e319763b4fd205046c249357f637439
3
+ size 72303580
train-00023-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b592134fecd4b7241ade2354f6e382a94997333f59cb011f8f88e456157fa140
3
+ size 72377202
train-00024-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c31091d79841dc3f27bfcc9c928e23e5f27298b8d31a58d983e8c4b9e968dbb
3
+ size 72278473
train-00025-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d813f6c1b0f6ade2559500827dc5daf6cc6bf0262ef3f170b2e4f6d8b4612fac
3
+ size 72355242
train-00026-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fba3fa0966373958822ebffc55d7060ae2b3247dd29bce032a515283ffec23f3
3
+ size 72355922
train-00027-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc210ba6c77aab0dbe75eb65700059c6316c9a2bb0e659b3e8fc9c53afc819a1
3
+ size 72356369
train-00028-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2615ad76e7cfe7c2104ff6944c26aff84ee32f828d9f4c036d81848e858792d9
3
+ size 72197807
train-00029-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ddba9edb3d32f418244277f27ea16b43db321d88a81a3e8dd1ef2cd78e62e040
3
+ size 71988792
train-00030-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:14c03bced2d56f8c7eb92d2234f022d36009e3bb2c28dc17fd387023334ce574
3
+ size 72046882
train-00031-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb94234a81e2317f2f757cc962c1dc3129cd367ff98c242995be15383e53cf65
3
+ size 72268243
train-00032-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1bac699fe6f9806c48e464e2687b6cc53886f4d63616dc02f00a98f09e16caa9
3
+ size 72301785
train-00033-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a9e665798ce5ba369498e1d1c267d18ae9978beed150c6471e67410ab1bbe4bb
3
+ size 72294461
train-00034-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5d63dbf19a6c8858e71055ef4372d3373fbcabee2c51e132d7ad377c71b66d1c
3
+ size 72225129
train-00035-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5fef421465ec34e60fff7a90c1963fd31ef27fa64b3cdbcd57bb5f0af8da76fc
3
+ size 72508472
train-00036-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:de1def5d86d07e936c62cb53ba0ec1af0726a67834cb1ba06499e394bb585f09
3
+ size 72320843
train-00037-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:79d609f3086a6aef9e58ead60c60aed6ad7fa682eea0e8fd569a6ccb6a63a955
3
+ size 72220636
train-00038-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e8cb5b67d841d5dc76cfaec80b30bebd18fd58cb2b77bc8aa1130c37bf1d697d
3
+ size 72267504
train-00039-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:12104fb8fd4966750be41e33a6d3931a0699da7690002bd019469b66f834aff2
3
+ size 72241567
train-00040-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:729b4549ed09f868eaead647467d9fea584b955f69c6c28714a2f1fa244178ec
3
+ size 72394606
train-00041-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3e82a0a941447b44b964781f41ff1e6ee286d7893eb1444780a0f75001e72ec7
3
+ size 72375461
train-00042-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:07c2df2de99007aa6d04daf0e75ddb34ec313dedcb466a4fb9050516d140c22f
3
+ size 72329994
train-00043-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:59af8e7a47b59a2dd7b42d16ed348073b73b69222fc9299c3d8955d341b40b1b
3
+ size 72345790
train-00044-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2978513fe807298d545ae7a4cd8dd1c3aedd00d527de08c7f3b5dd550d2acbaa
3
+ size 72090537
train-00045-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6e0846034ad0ccf46d1c39e0364ba2a7665b4661b2c46530a218d4fab7e2da9f
3
+ size 72186343
train-00046-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a041e25164e39b7a050d4c3d8414526162a5d67873d79b217bfde9e913e4062e
3
+ size 72259090
train-00047-of-01024.msgpack.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a88a594720ab9e624a7eb56b814400510e5fa614df6f510f0db58483a7203759
3
+ size 72327809