nelson2424 commited on
Commit
53ed559
·
1 Parent(s): d861f95

Created the documentation for the first version of the dataset.

Browse files
Files changed (1) hide show
  1. README.md +110 -2
README.md CHANGED
@@ -4,7 +4,115 @@ configs:
4
  - config_name: V1_small
5
  data_files:
6
  - split: train
7
- path: "V1_small/train.csv"
8
  - split: test
9
- path: "V1_small/test.csv"
 
 
 
 
 
 
 
10
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  - config_name: V1_small
5
  data_files:
6
  - split: train
7
+ path: V1_small/train.csv
8
  - split: test
9
+ path: V1_small/test.csv
10
+ task_categories:
11
+ - text-classification
12
+ - text-generation
13
+ - text2text-generation
14
+ language:
15
+ - en
16
+ pretty_name: Cot-dataset
17
  ---
18
+
19
+ # Version 1 of the dataset
20
+ ## Structure of the dataset:
21
+ - ### Opening_type:
22
+ The title of the opening being played.
23
+ - ### Context:
24
+ A string representing a list of moves, each move is represented by the previous state of the board, the move that is going to be made, and the effect that the move had on the board.<br>
25
+
26
+ - The <b>board</b> is represented as an 8*8 grid of characters where each character represents a piece or an empty square:<br>
27
+
28
+ ~~~
29
+ r . . q k b n r
30
+ p p p . p . p p
31
+ . . n . . p . .
32
+ . . . p . b . .
33
+ . . . P . . . B
34
+ . . . . P N . .
35
+ P P P . . P P P
36
+ R N . Q K B . R
37
+ ~~~
38
+
39
+ - The <b>move</b> is represented by the uci format g8f6, specifying that the piece is square g8 moves to the square f6
40
+ - The <b>type of move</b> is represented by a list of integers separated by ',' where each integer represents the effect that the move will have on the board.
41
+ - 0 if it is a move without capture
42
+ - 1 if it is a move with capture
43
+ - 2 if a check is being made
44
+ - 3 if it is check mate
45
+ - 4 if it is en passant capture
46
+ - 5 if it is king side castling
47
+ - 6 if it is queenside castling
48
+ - 7 if it is a draw by stalemate
49
+ - 8 if there is a draw by insufficient material
50
+ - 9 if it is a draw by seventy-five moves rule
51
+ - 10 if it is a draw by fivefold repetition
52
+
53
+ - The whole context can look something like this:
54
+ After each board, there is a move, and the effect of the move generates the next board. A context list always ends with a board because the following two columns represent the move to be played and the effect that it'll have on the next board.
55
+ ~~~
56
+ r . . q k b n r
57
+ p p p . p . p p
58
+ . . n . . p . .
59
+ . . . p . b . .
60
+ . . . P . . . B
61
+ . . . . P N . .
62
+ P P P . . P P P
63
+ R N . Q K B . R
64
+ m:e7e5
65
+ t:0
66
+ r . . q k b n r
67
+ p p p . . . p p
68
+ . . n . . p . .
69
+ . . . p p b . .
70
+ . . . P . . . B
71
+ . . . . P N . .
72
+ P P P . . P P P
73
+ R N . Q K B . R
74
+ m:d4e5
75
+ t:1
76
+ r . . q k b n r
77
+ p p p . . . p p
78
+ . . n . . p . .
79
+ . . . p P b . .
80
+ . . . . . . . B
81
+ . . . . P N . .
82
+ P P P . . P P P
83
+ R N . Q K B . R
84
+ m:f6e5
85
+ t:1
86
+ r . . q k b n r
87
+ p p p . . . p p
88
+ . . n . . . . .
89
+ . . . p p b . .
90
+ . . . . . . . B
91
+ . . . . P N . .
92
+ P P P . . P P P
93
+ R N . Q K B . R
94
+ ~~~
95
+ - ## Move_type_pred:
96
+ - Follows the same format described in the context column with <b>Type move</b>
97
+ - ## Move_pred:
98
+ - Follows the same format described in the context column with <b>move</b>
99
+
100
+ ## Creation process:
101
+ - ### Loading the Dataset:
102
+ - The code loads a dataset of chess games in PGN format using the Hugging Face **datasets** library. The dataset is called [patrickfrank1/chess-pgn-games](https://huggingface.co/datasets/patrickfrank1/chess-pgn-games)!.
103
+ - ### Parsing and Organizing Game Text:
104
+ - It extracts game text from the dataset and organizes it based on metadata and moves information.
105
+ - ### Parsing Game Information:
106
+ - It extracts relevant information from the game headers, such as player Elo ratings and opening names.
107
+ - ### Iterating Through Games:
108
+ - It iterates through each game and processes it if it has a specified opening and if at least one player has an Elo rating greater than 1700.
109
+ - ### Sampling Moves for Context:
110
+ - For selected games, it randomly samples subarrays of moves from the mainline of the game.
111
+ - ### Recording Context Information:
112
+ - It records the board state, move information, and move type prediction for each move in the sampled context.
113
+ - ### Storing Processed Data:
114
+ - The extracted information is stored in a dictionary and then converted to a data frame. The data frame is uploaded to the Huggingface Dataset hub. (As you can see)
115
+ - The code to create this dataset can be found here: [chess_openings_teacher/ML/Dataset_Creation](https://github.com/bit2424/chess_openings_teacher/tree/main/ML/Dataset_Creation)!
116
+ ## Intuitions behind the design:
117
+ - The idea is that by creating the whole board grid, the model can learn to grasp the effect that a move has on the board and create a richer representation of the game.
118
+ - One of the aims of this representation is to help predict logical moves even without needing the game's history, just using the current state of the board in the grid representation.