alexandreduplessis commited on
Commit
2876b99
·
verified ·
1 Parent(s): e2aabe3

Chess Challenge submission by alexandreduplessis

Browse files
Files changed (7) hide show
  1. README.md +26 -0
  2. config.json +20 -0
  3. model.safetensors +3 -0
  4. special_tokens_map.json +6 -0
  5. tokenizer.py +356 -0
  6. tokenizer_config.json +50 -0
  7. vocab.json +155 -0
README.md ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ tags:
4
+ - chess
5
+ - llm-course
6
+ - chess-challenge
7
+ license: mit
8
+ ---
9
+
10
+ # chess_basic_tokenizer
11
+
12
+ Chess model submitted to the LLM Course Chess Challenge.
13
+
14
+ ## Submission Info
15
+
16
+ - **Submitted by**: [alexandreduplessis](https://huggingface.co/alexandreduplessis)
17
+ - **Parameters**: 714,112
18
+ - **Organization**: LLM-course
19
+
20
+ ## Model Details
21
+
22
+ - **Architecture**: Chess Transformer (GPT-style)
23
+ - **Vocab size**: 153
24
+ - **Embedding dim**: 128
25
+ - **Layers**: 4
26
+ - **Heads**: 4
config.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "ChessForCausalLM"
4
+ ],
5
+ "bos_token_id": 1,
6
+ "dropout": 0.1,
7
+ "eos_token_id": 2,
8
+ "layer_norm_epsilon": 1e-05,
9
+ "model_type": "chess_transformer",
10
+ "n_ctx": 256,
11
+ "n_embd": 128,
12
+ "n_head": 4,
13
+ "n_inner": 384,
14
+ "n_layer": 4,
15
+ "pad_token_id": 0,
16
+ "tie_weights": true,
17
+ "torch_dtype": "float32",
18
+ "transformers_version": "4.55.0",
19
+ "vocab_size": 153
20
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca2797084e913631bccb1517918a225573b12c3eb0c789a4c989be718051f1d2
3
+ size 2860848
special_tokens_map.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "[BOS]",
3
+ "eos_token": "[EOS]",
4
+ "pad_token": "[PAD]",
5
+ "unk_token": "[UNK]"
6
+ }
tokenizer.py ADDED
@@ -0,0 +1,356 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Custom Chess Tokenizer for the Chess Challenge.
3
+
4
+ This tokenizer treats each move as a single token using the extended UCI notation
5
+ from the Lichess dataset (e.g., WPe2e4, BNg8f6).
6
+
7
+ The dataset format uses:
8
+ - W/B prefix for White/Black
9
+ - Piece letter: P=Pawn, N=Knight, B=Bishop, R=Rook, Q=Queen, K=King
10
+ - Source and destination squares (e.g., e2e4)
11
+ - Special suffixes: (x)=capture, (+)=check, (+*)=checkmate, (o)/(O)=castling
12
+ """
13
+
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ import os
18
+ from pathlib import Path
19
+ from typing import Dict, List, Optional
20
+
21
+ from transformers import PreTrainedTokenizer
22
+
23
+ import re
24
+
25
+
26
+
27
+ class ChessTokenizer(PreTrainedTokenizer):
28
+ """
29
+ A custom tokenizer for chess moves using extended UCI notation.
30
+
31
+ This tokenizer maps each possible chess move to a unique token ID.
32
+ The vocabulary is built from the training dataset to ensure all moves
33
+ encountered during training have a corresponding token.
34
+
35
+ Example:
36
+ >>> tokenizer = ChessTokenizer()
37
+ >>> tokenizer.encode("WPe2e4 BPe7e5")
38
+ [1, 42, 87, 2] # [BOS, e2e4, e7e5, EOS]
39
+ """
40
+
41
+ model_input_names = ["input_ids", "attention_mask"]
42
+ vocab_files_names = {"vocab_file": "vocab.json"}
43
+
44
+ # Special tokens
45
+ PAD_TOKEN = "[PAD]"
46
+ BOS_TOKEN = "[BOS]"
47
+ EOS_TOKEN = "[EOS]"
48
+ UNK_TOKEN = "[UNK]"
49
+
50
+ _MOVE_RE = re.compile(
51
+ r'^(?P<color>[WB])(?P<piece>[PNBRQK])(?P<from>[a-h][1-8])(?P<to>[a-h][1-8])(?P<rest>.*)$'
52
+ )
53
+
54
+ _SUFFIX_MAP = {
55
+ "(x)": "cap",
56
+ "(+)": "check",
57
+ "(+*)": "mate",
58
+ "(o)": "castle_k",
59
+ "(O)": "castle_q",
60
+ }
61
+
62
+ _PROMO_RE = re.compile(r'=?([QRBNqrbn])') # accepts "=Q" or "q" style
63
+
64
+
65
+ def __init__(
66
+ self,
67
+ vocab_file: Optional[str] = None,
68
+ vocab: Optional[Dict[str, int]] = None,
69
+ **kwargs,
70
+ ):
71
+ """
72
+ Initialize the chess tokenizer.
73
+
74
+ Args:
75
+ vocab_file: Path to a JSON file containing the vocabulary mapping.
76
+ vocab: Dictionary mapping tokens to IDs (alternative to vocab_file).
77
+ **kwargs: Additional arguments passed to PreTrainedTokenizer.
78
+ """
79
+ # Initialize special tokens
80
+ self._pad_token = self.PAD_TOKEN
81
+ self._bos_token = self.BOS_TOKEN
82
+ self._eos_token = self.EOS_TOKEN
83
+ self._unk_token = self.UNK_TOKEN
84
+
85
+ # Remove any duplicate special-token entries passed through kwargs
86
+ # to avoid "multiple values for keyword" errors when loading from disk.
87
+ kwargs.pop("pad_token", None)
88
+ kwargs.pop("bos_token", None)
89
+ kwargs.pop("eos_token", None)
90
+ kwargs.pop("unk_token", None)
91
+
92
+ # Load or create vocabulary
93
+ if vocab is not None:
94
+ self._vocab = vocab
95
+ elif vocab_file is not None and os.path.exists(vocab_file):
96
+ with open(vocab_file, "r", encoding="utf-8") as f:
97
+ self._vocab = json.load(f)
98
+ else:
99
+ # Create a minimal vocabulary with just special tokens
100
+ # The full vocabulary should be built from the dataset
101
+ self._vocab = self._create_default_vocab()
102
+
103
+ # Create reverse mapping
104
+ self._ids_to_tokens = {v: k for k, v in self._vocab.items()}
105
+
106
+ # Call parent init AFTER setting up vocab
107
+ super().__init__(
108
+ pad_token=self._pad_token,
109
+ bos_token=self._bos_token,
110
+ eos_token=self._eos_token,
111
+ unk_token=self._unk_token,
112
+ **kwargs,
113
+ )
114
+
115
+ def _decompose_move(self, tok: str) -> List[str]:
116
+ """
117
+ Convert e.g. 'WPe2e4(x)' -> ['WP', 'e2_f', 'e4_t', 'cap']
118
+ """
119
+ m = self._MOVE_RE.match(tok)
120
+ if not m:
121
+ return [self.UNK_TOKEN]
122
+
123
+ color = m.group("color")
124
+ piece = m.group("piece")
125
+ from_sq = m.group("from")
126
+ to_sq = m.group("to")
127
+ rest = m.group("rest") or ""
128
+
129
+ out = [f"{color}{piece}", f"{from_sq}_f", f"{to_sq}_t"]
130
+
131
+ for raw, mapped in self._SUFFIX_MAP.items():
132
+ if raw in rest:
133
+ out.append(mapped)
134
+
135
+ # Promotion (rare depending on dataset formatting, but safe)
136
+ pm = self._PROMO_RE.search(rest)
137
+ if pm:
138
+ p = pm.group(1).lower()
139
+ if p in ("q", "r", "b", "n"):
140
+ out.append(f"promo_{p}")
141
+
142
+ return out
143
+ def _create_default_vocab(self) -> Dict[str, int]:
144
+ """
145
+ Create a minimal default vocabulary with just special tokens.
146
+
147
+ For the full vocabulary, use `build_vocab_from_dataset()`.
148
+ This minimal vocab is just a placeholder - you should build from data.
149
+ """
150
+ special_tokens = [self.PAD_TOKEN, self.BOS_TOKEN, self.EOS_TOKEN, self.UNK_TOKEN]
151
+ vocab = {token: idx for idx, token in enumerate(special_tokens)}
152
+ return vocab
153
+
154
+ @classmethod
155
+ def build_vocab_from_iterator(
156
+ cls,
157
+ iterator,
158
+ min_frequency: int = 1,
159
+ ) -> "ChessTokenizer":
160
+ """
161
+ Build a tokenizer vocabulary from an iterator of game strings.
162
+
163
+ Args:
164
+ iterator: An iterator yielding game strings (space-separated moves).
165
+ min_frequency: Minimum frequency for a token to be included.
166
+
167
+ Returns:
168
+ A ChessTokenizer with the built vocabulary.
169
+ """
170
+ from collections import Counter
171
+
172
+ token_counts = Counter()
173
+
174
+ for game in iterator:
175
+ moves = game.strip().split()
176
+ token_counts.update(moves)
177
+
178
+ # Filter by frequency
179
+ tokens = [
180
+ token for token, count in token_counts.items()
181
+ if count >= min_frequency
182
+ ]
183
+
184
+ # Sort for reproducibility
185
+ tokens = sorted(tokens)
186
+
187
+ # Build vocabulary
188
+ special_tokens = [cls.PAD_TOKEN, cls.BOS_TOKEN, cls.EOS_TOKEN, cls.UNK_TOKEN]
189
+ vocab = {token: idx for idx, token in enumerate(special_tokens + tokens)}
190
+
191
+ return cls(vocab=vocab)
192
+
193
+ @classmethod
194
+ def build_vocab_from_dataset(
195
+ cls,
196
+ dataset_name: str = "dlouapre/lichess_2025-01_1M",
197
+ split: str = "train",
198
+ column: str = "text",
199
+ min_frequency: int = 500,
200
+ max_samples: Optional[int] = 100000,
201
+ ) -> "ChessTokenizer":
202
+ """
203
+ Build a tokenizer vocabulary from a Hugging Face dataset.
204
+
205
+ Args:
206
+ dataset_name: Name of the dataset on Hugging Face Hub.
207
+ split: Dataset split to use.
208
+ column: Column containing the game strings.
209
+ min_frequency: Minimum frequency for a token to be included (default: 500).
210
+ max_samples: Maximum number of samples to process (default: 100k).
211
+
212
+ Returns:
213
+ A ChessTokenizer with the built vocabulary.
214
+ """
215
+ from datasets import load_dataset
216
+
217
+ dataset = load_dataset(dataset_name, split=split)
218
+
219
+ if max_samples is not None:
220
+ dataset = dataset.select(range(min(max_samples, len(dataset))))
221
+
222
+ def game_iterator():
223
+ for example in dataset:
224
+ yield example[column]
225
+
226
+ return cls.build_vocab_from_iterator(game_iterator(), min_frequency=min_frequency)
227
+
228
+ @property
229
+ def vocab_size(self) -> int:
230
+ """Return the size of the vocabulary."""
231
+ return len(self._vocab)
232
+
233
+ def get_vocab(self) -> Dict[str, int]:
234
+ """Return the vocabulary as a dictionary."""
235
+ return dict(self._vocab)
236
+
237
+ # def _tokenize(self, text: str) -> List[str]:
238
+ # """
239
+ # Tokenize a string of moves into a list of tokens.
240
+
241
+ # Args:
242
+ # text: A string of space-separated moves.
243
+
244
+ # Returns:
245
+ # List of move tokens.
246
+ # """
247
+ # return text.strip().split()
248
+ def _tokenize(self, text: str) -> List[str]:
249
+ parts = text.strip().split()
250
+ out: List[str] = []
251
+ special = {self.PAD_TOKEN, self.BOS_TOKEN, self.EOS_TOKEN, self.UNK_TOKEN}
252
+
253
+ for p in parts:
254
+ if p in special:
255
+ out.append(p)
256
+ else:
257
+ out.extend(self._decompose_move(p))
258
+ return out
259
+
260
+
261
+ @classmethod
262
+ def build_structured_vocab(cls) -> "ChessTokenizer":
263
+ special = [cls.PAD_TOKEN, cls.BOS_TOKEN, cls.EOS_TOKEN, cls.UNK_TOKEN]
264
+
265
+ # 12 color+piece tokens
266
+ cp = [f"{c}{p}" for c in ("W", "B") for p in ("P", "N", "B", "R", "Q", "K")]
267
+
268
+ files = "abcdefgh"
269
+ ranks = "12345678"
270
+
271
+ from_tokens = [f"{f}{r}_f" for f in files for r in ranks] # 64
272
+ to_tokens = [f"{f}{r}_t" for f in files for r in ranks] # 64
273
+
274
+ suffix = ["cap", "check", "mate", "castle_k", "castle_q"]
275
+ promo = [f"promo_{p}" for p in ("q", "r", "b", "n")]
276
+
277
+ tokens = special + cp + from_tokens + to_tokens + suffix + promo
278
+ vocab = {t: i for i, t in enumerate(tokens)}
279
+ return cls(vocab=vocab)
280
+
281
+ def _convert_token_to_id(self, token: str) -> int:
282
+ """Convert a token to its ID."""
283
+ return self._vocab.get(token, self._vocab.get(self.UNK_TOKEN, 0))
284
+
285
+ def _convert_id_to_token(self, index: int) -> str:
286
+ """Convert an ID to its token."""
287
+ return self._ids_to_tokens.get(index, self.UNK_TOKEN)
288
+
289
+ def convert_tokens_to_string(self, tokens: List[str]) -> str:
290
+ """Convert a list of tokens back to a string."""
291
+ # Filter out special tokens for cleaner output
292
+ special = {self.PAD_TOKEN, self.BOS_TOKEN, self.EOS_TOKEN, self.UNK_TOKEN}
293
+ return " ".join(t for t in tokens if t not in special)
294
+
295
+ def save_vocabulary(
296
+ self,
297
+ save_directory: str,
298
+ filename_prefix: Optional[str] = None,
299
+ ) -> tuple:
300
+ """
301
+ Save the vocabulary to a JSON file.
302
+
303
+ Args:
304
+ save_directory: Directory to save the vocabulary.
305
+ filename_prefix: Optional prefix for the filename.
306
+
307
+ Returns:
308
+ Tuple containing the path to the saved vocabulary file.
309
+ """
310
+ if not os.path.isdir(save_directory):
311
+ os.makedirs(save_directory, exist_ok=True)
312
+
313
+ vocab_file = os.path.join(
314
+ save_directory,
315
+ (filename_prefix + "-" if filename_prefix else "") + "vocab.json",
316
+ )
317
+
318
+ with open(vocab_file, "w", encoding="utf-8") as f:
319
+ json.dump(self._vocab, f, ensure_ascii=False, indent=2)
320
+
321
+ return (vocab_file,)
322
+
323
+
324
+ def count_vocab_from_dataset(
325
+ dataset_name: str = "dlouapre/lichess_2025-01_1M",
326
+ split: str = "train",
327
+ column: str = "text",
328
+ max_samples: Optional[int] = 10000,
329
+ ) -> Dict[str, int]:
330
+ """
331
+ Count token frequencies in a dataset (useful for vocabulary analysis).
332
+
333
+ Args:
334
+ dataset_name: Name of the dataset on Hugging Face Hub.
335
+ split: Dataset split to use.
336
+ column: Column containing the game strings.
337
+ max_samples: Maximum number of samples to process.
338
+
339
+ Returns:
340
+ Dictionary mapping tokens to their frequencies.
341
+ """
342
+ from collections import Counter
343
+ from datasets import load_dataset
344
+
345
+ dataset = load_dataset(dataset_name, split=split)
346
+
347
+ if max_samples is not None:
348
+ dataset = dataset.select(range(min(max_samples, len(dataset))))
349
+
350
+ token_counts = Counter()
351
+
352
+ for example in dataset:
353
+ moves = example[column].strip().split()
354
+ token_counts.update(moves)
355
+
356
+ return dict(token_counts)
tokenizer_config.json ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "[BOS]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "[EOS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "[UNK]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ }
35
+ },
36
+ "auto_map": {
37
+ "AutoTokenizer": [
38
+ "tokenizer.ChessTokenizer",
39
+ null
40
+ ]
41
+ },
42
+ "bos_token": "[BOS]",
43
+ "clean_up_tokenization_spaces": false,
44
+ "eos_token": "[EOS]",
45
+ "extra_special_tokens": {},
46
+ "model_max_length": 1000000000000000019884624838656,
47
+ "pad_token": "[PAD]",
48
+ "tokenizer_class": "ChessTokenizer",
49
+ "unk_token": "[UNK]"
50
+ }
vocab.json ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "[PAD]": 0,
3
+ "[BOS]": 1,
4
+ "[EOS]": 2,
5
+ "[UNK]": 3,
6
+ "WP": 4,
7
+ "WN": 5,
8
+ "WB": 6,
9
+ "WR": 7,
10
+ "WQ": 8,
11
+ "WK": 9,
12
+ "BP": 10,
13
+ "BN": 11,
14
+ "BB": 12,
15
+ "BR": 13,
16
+ "BQ": 14,
17
+ "BK": 15,
18
+ "a1_f": 16,
19
+ "a2_f": 17,
20
+ "a3_f": 18,
21
+ "a4_f": 19,
22
+ "a5_f": 20,
23
+ "a6_f": 21,
24
+ "a7_f": 22,
25
+ "a8_f": 23,
26
+ "b1_f": 24,
27
+ "b2_f": 25,
28
+ "b3_f": 26,
29
+ "b4_f": 27,
30
+ "b5_f": 28,
31
+ "b6_f": 29,
32
+ "b7_f": 30,
33
+ "b8_f": 31,
34
+ "c1_f": 32,
35
+ "c2_f": 33,
36
+ "c3_f": 34,
37
+ "c4_f": 35,
38
+ "c5_f": 36,
39
+ "c6_f": 37,
40
+ "c7_f": 38,
41
+ "c8_f": 39,
42
+ "d1_f": 40,
43
+ "d2_f": 41,
44
+ "d3_f": 42,
45
+ "d4_f": 43,
46
+ "d5_f": 44,
47
+ "d6_f": 45,
48
+ "d7_f": 46,
49
+ "d8_f": 47,
50
+ "e1_f": 48,
51
+ "e2_f": 49,
52
+ "e3_f": 50,
53
+ "e4_f": 51,
54
+ "e5_f": 52,
55
+ "e6_f": 53,
56
+ "e7_f": 54,
57
+ "e8_f": 55,
58
+ "f1_f": 56,
59
+ "f2_f": 57,
60
+ "f3_f": 58,
61
+ "f4_f": 59,
62
+ "f5_f": 60,
63
+ "f6_f": 61,
64
+ "f7_f": 62,
65
+ "f8_f": 63,
66
+ "g1_f": 64,
67
+ "g2_f": 65,
68
+ "g3_f": 66,
69
+ "g4_f": 67,
70
+ "g5_f": 68,
71
+ "g6_f": 69,
72
+ "g7_f": 70,
73
+ "g8_f": 71,
74
+ "h1_f": 72,
75
+ "h2_f": 73,
76
+ "h3_f": 74,
77
+ "h4_f": 75,
78
+ "h5_f": 76,
79
+ "h6_f": 77,
80
+ "h7_f": 78,
81
+ "h8_f": 79,
82
+ "a1_t": 80,
83
+ "a2_t": 81,
84
+ "a3_t": 82,
85
+ "a4_t": 83,
86
+ "a5_t": 84,
87
+ "a6_t": 85,
88
+ "a7_t": 86,
89
+ "a8_t": 87,
90
+ "b1_t": 88,
91
+ "b2_t": 89,
92
+ "b3_t": 90,
93
+ "b4_t": 91,
94
+ "b5_t": 92,
95
+ "b6_t": 93,
96
+ "b7_t": 94,
97
+ "b8_t": 95,
98
+ "c1_t": 96,
99
+ "c2_t": 97,
100
+ "c3_t": 98,
101
+ "c4_t": 99,
102
+ "c5_t": 100,
103
+ "c6_t": 101,
104
+ "c7_t": 102,
105
+ "c8_t": 103,
106
+ "d1_t": 104,
107
+ "d2_t": 105,
108
+ "d3_t": 106,
109
+ "d4_t": 107,
110
+ "d5_t": 108,
111
+ "d6_t": 109,
112
+ "d7_t": 110,
113
+ "d8_t": 111,
114
+ "e1_t": 112,
115
+ "e2_t": 113,
116
+ "e3_t": 114,
117
+ "e4_t": 115,
118
+ "e5_t": 116,
119
+ "e6_t": 117,
120
+ "e7_t": 118,
121
+ "e8_t": 119,
122
+ "f1_t": 120,
123
+ "f2_t": 121,
124
+ "f3_t": 122,
125
+ "f4_t": 123,
126
+ "f5_t": 124,
127
+ "f6_t": 125,
128
+ "f7_t": 126,
129
+ "f8_t": 127,
130
+ "g1_t": 128,
131
+ "g2_t": 129,
132
+ "g3_t": 130,
133
+ "g4_t": 131,
134
+ "g5_t": 132,
135
+ "g6_t": 133,
136
+ "g7_t": 134,
137
+ "g8_t": 135,
138
+ "h1_t": 136,
139
+ "h2_t": 137,
140
+ "h3_t": 138,
141
+ "h4_t": 139,
142
+ "h5_t": 140,
143
+ "h6_t": 141,
144
+ "h7_t": 142,
145
+ "h8_t": 143,
146
+ "cap": 144,
147
+ "check": 145,
148
+ "mate": 146,
149
+ "castle_k": 147,
150
+ "castle_q": 148,
151
+ "promo_q": 149,
152
+ "promo_r": 150,
153
+ "promo_b": 151,
154
+ "promo_n": 152
155
+ }