yp-edu/stockfish-debug
收藏数据集卡片 for stockfish-debug
列信息
数据集包含以下列:
- fen: 棋盘的FEN字符串。
- move: 所下的棋步。
- result: 游戏的结果(未完成的游戏用
"-"表示)。
数据详情
预处理
Stockfish游戏数据由BlueSunflower/chess_games_base提供,预处理代码如下:
python import jsonlines import chess import tqdm
def preprocess_games(in_path, out_path): with jsonlines.open(in_path) as reader: with jsonlines.open(out_path, "w") as writer: for obj in tqdm.tqdm(reader): state_action = [] parsed_moves = [m for m in obj["moves"].split() if not m.endswith(".")] board = chess.Board() for m in parsed_moves: fen = board.fen() move = board.push_san(m) state_action.append({"fen": fen, "move":move.uci()}) outcome = board.outcome() if outcome is None: result = "-" else: result = outcome.result() writer.write_all([ {**sa, "result":result} for sa in state_action ])
数据文件
- 训练集:
train.jsonl - 测试集:
test.jsonl
使用数据集
使用基本的dataset代码:
python from datasets import load_dataset
dataset = load_dataset("yp-edu/stockfish-debug")



