遇见数据集

aicrowd/ChessExplained

收藏
Hugging Face2025-11-16 更新2025-12-20 收录
官方服务:

资源简介:

--- license: mit tags: - chess task_categories: - reinforcement-learning --- # ChessExplained_500k_v0 Dataset ## Overview This dataset contains approximately 500,000 chess positions with explanations for optimal moves, prepared for Supervised Fine-Tuning (SFT). The data is tokenized using **Qwen/Qwen3-8B** tokenizer. ## Format - **File**: JSONL format (one JSON object per line) - **Fields**: - `text`: Full conversation in Qwen chat format with special tokens - `fen`: Position in FEN notation - `move`: Best move in UCI notation - `explanation`: Natural language explanation for the move ## Explanation Generation Process Each explanation is generated through the following pipeline: 1. **Position Analysis**: Extract current position features from the FEN 2. **Best Move Calculation**: Determine optimal move using Stockfish engine 3. **Move Application**: Apply the move and extract new position features 4. **Position Evaluation**: Use Stockfish evaluation to classify the position: - Winning (|eval| > 2) - Drawish (|eval| ≤ 2) 5. **Feature Extraction**: Identify key tactical/strategic elements by comparing position features: - Attacking new pieces - Escaping attacks - Forced checkmates - Captures - Pawn promotions - Checks - Center control - Pins - King safety improvements - Rooks on 7th rank ## Explanation Template Explanations are generated by comparing position features before and after the best move. The system detects tactical/strategic changes and constructs natural language explanations. **Standard format:** ``` After {piece} {action} {square}, this causes {color} to {reason(s)}. So {move_SAN} is the most logical. {evaluation}. ``` **Detected features include:** - Checkmate delivery - Castling (kingside/queenside) - Giving check - Captures - Pawn promotions - Escaping attacks - Attacking new pieces - Gaining center control - Creating pins - Placing rook on 7th/2nd rank **Fallback:** When no specific tactical features are detected, the explanation describes piece development (early game) or repositioning (mid/late game). ## Example Entry ```json { "text": "<|im_start|>user\nYou are an expert chess player...", "fen": "rnbq1rk1/ppp1bpp1/4pn1p/3p4/2PP4/2N1PN2/PP1B1PPP/R2QKB1R b KQ - 0 7", "move": "c7c5", "explanation": "After Pawn moves to c5, this causes Black to attacks the pawn on d4. So c5 is the most logical. Position is drawish." } ``` ``` <|im_start|>user You are an expert chess player looking at the following position in FEN format: r3kb1N/pp2p2p/n5p1/2p5/2BP2q1/7b/PPP2P2/R1BQK3 b q - 3 16 Briefly, FEN describes chess pieces by single letters [PNBRKQ] for white and [pnbrkq] for black. The pieces found in each rank are specified, starting at the top of the board (a8..h8) and describing all eight ranks. Within each rank, all 8 positions must be specified, with one or more empty squares noted with a digit [1..8]. For example, /8/ is an empty rank (no pieces), while /4P3/ specifies four empty squares, a white pawn, and three more empty squares. Here is an additional visualization of the board (♔♕♖♗♘♙ = White pieces, ♚♛♜♝♞♟ = Black pieces): a b c d e f g h +---------------+ 8 | ♜ · · · ♚ ♝ · ♘ | 8 7 | ♟ ♟ · · ♟ · · ♟ | 7 6 | ♞ · · · · · ♟ · | 6 5 | · · ♟ · · · · · | 5 4 | · · ♗ ♙ · · ♛ · | 4 3 | · · · · · · · ♝ | 3 2 | ♙ ♙ ♙ · · ♙ · · | 2 1 | ♖ · ♗ ♕ ♔ · · · | 1 +---------------+ a b c d e f g h The current side to move is black. The possible legal moves for the side to move are: ['f8g7', 'f8h6', 'e8d8', 'e8d7', 'a8d8', 'a8c8', 'a8b8', 'a6b8', 'a6c7', 'a6b4', 'g4c8', 'g4d7', 'g4e6', 'g4h5', 'g4g5', 'g4f5', 'g4h4', 'g4f4', 'g4e4', 'g4d4', 'g4g3', 'g4f3', 'g4g2', 'g4e2', 'g4g1', 'g4d1', 'h3g2', 'h3f1', 'e8c8', 'c5d4', 'h7h6', 'e7e6', 'b7b6', 'g6g5', 'h7h5', 'e7e5', 'b7b5']. Your task is to select the best move for the side to move. Please choose a move from this list, and output it in the following format: <uci_move>one_move_from_the_list</uci_move>. An example of a valid move for this position is <uci_move>f8g7</uci_move>. Think about the move and output it in the following format: <think>your_thinking</think> <uci_move>one_move_from_the_list</uci_move>. <|im_end|> <|im_start|>assistant <think> After Queen moves to g1, this causes Black to give check, moves away from attack, attacks the pawn on f2, creates a pin. So Qg1+ is the most logical. Black has a huge advantage. </think> <uci_move>g4g1</uci_move><|im_end|> ```

许可证协议:MIT协议 标签: - 国际象棋 任务类别: - 强化学习(reinforcement-learning) # ChessExplained_500k_v0 数据集 ## 概述 本数据集包含约50万个带最优走法解析的国际象棋局面,专为监督微调(Supervised Fine-Tuning, SFT)打造。数据已使用**Qwen/Qwen3-8B**分词器完成分词。 ## 数据格式 - **文件格式**:JSONL格式(每行对应一个JSON对象) - **字段说明**: - `text`:采用Qwen对话格式的完整会话,包含特殊标记 - `fen`:采用FEN(Forsyth-Edwards Notation)记法的国际象棋局面 - `move`:采用UCI(Universal Chess Interface)记法的最优走法 - `explanation`:该走法的自然语言解析说明 ## 解析生成流程 每条解析均通过以下流水线生成: 1. **局面分析**:从FEN记法中提取当前局面特征 2. **最优走法计算**:使用Stockfish引擎确定当前局面的最优走法 3. **走法应用**:执行该最优走法并提取新的局面特征 4. **局面评估**:通过Stockfish引擎的评估结果对局面进行分类: - 胜势(|eval| > 2) - 和棋倾向(|eval| ≤ 2) 5. **特征提取**:通过对比前后局面特征,识别关键战术/战略元素,包括: - 进攻新棋子 - 规避敌方攻击 - 强制将死 - 吃子 - 兵升变 - 将军 - 控制中路 - 棋子牵制 - 王安全提升 - 车占据第7横排 ## 解析模板 解析内容通过对比最优走法执行前后的局面特征生成,系统将检测战术/战略层面的变化,并据此构建自然语言解析文本。 **标准格式**: 在{棋子} {动作} {格子}后,该走法将导致{方} {原因}。因此{move_SAN}是最合理的选择。{局面评估}。 **检测到的特征包括**: - 直接将死对手 - 王翼/后翼易位 - 发起将军 - 吃子操作 - 兵升变 - 规避敌方攻击 - 进攻新棋子 - 获取中路控制权 - 制造棋子牵制 - 将车放置在第7/第2横排 **备用方案**:当未检测到特定战术特征时,解析内容将描述开局阶段的棋子发展思路,或中、残局阶段的棋子重定位策略。 ## 示例条目 json { "text": "<|im_start|>user 你是一名专业国际象棋棋手……", "fen": "rnbq1rk1/ppp1bpp1/4pn1p/3p4/2PP4/2N1PN2/PP1B1PPP/R2QKB1R b KQ - 0 7", "move": "c7c5", "explanation": "在兵行进至c5后,黑方将进攻d4位的兵。因此c5是最合理的走法。当前局面为和棋倾向。" } <|im_start|>user 你是一名专业国际象棋棋手,当前需要分析以下FEN记法描述的局面: r3kb1N/pp2p2p/n5p1/2p5/2BP2q1/7b/PPP2P2/R1BQK3 b q - 3 16 FEN记法的简要说明:使用单字母[PNBRKQ]表示白方棋子,[pnbrkq]表示黑方棋子。从棋盘顶部(a8到h8)开始依次描述8个横排的棋子分布,每个横排需完整标注8个位置,空方格用数字[1..8]表示。例如,/8/代表该横排无任何棋子,/4P3/代表该横排有4个空方格、1个白兵,随后再跟随3个空方格。 以下为该棋盘的可视化展示(♔♕♖♗♘♙ = 白方棋子,♚♛♜♝♞♟ = 黑方棋子): a b c d e f g h +---------------+ 8 | ♜ · · · ♚ ♝ · ♘ | 8 7 | ♟ ♟ · · ♟ · · ♟ | 7 6 | ♞ · · · · · ♟ · | 6 5 | · · ♟ · · · · · | 5 4 | · · ♗ ♙ · · ♛ · | 4 3 | · · · · · · · ♝ | 3 2 | ♙ ♙ ♙ · · ♙ · · | 2 1 | ♖ · ♗ ♕ ♔ · · · | 1 +---------------+ a b c d e f g h 当前行棋方为黑方。 该方的合法可选走法包括:['f8g7', 'f8h6', 'e8d8', 'e8d7', 'a8d8', 'a8c8', 'a8b8', 'a6b8', 'a6c7', 'a6b4', 'g4c8', 'g4d7', 'g4e6', 'g4h5', 'g4g5', 'g4f5', 'g4h4', 'g4f4', 'g4e4', 'g4d4', 'g4g3', 'g4f3', 'g4g2', 'g4e2', 'g4g1', 'g4d1', 'h3g2', 'h3f1', 'e8c8', 'c5d4', 'h7h6', 'e7e6', 'b7b6', 'g6g5', 'h7h5', 'e7e5', 'b7b5']。 你的任务是为当前行棋方选择最优走法,请从上述列表中选取并按照以下格式输出: <uci_move>所选走法</uci_move>。 该局面的一个有效走法示例为<uci_move>f8g7</uci_move>。 请按照以下格式进行思考并输出: <think>你的思考过程</think> <uci_move>所选走法</uci_move>。 <|im_end|> <|im_start|>assistant <think> 在皇后行进至g1后,黑方将发起将军、脱离敌方攻击、进攻f2位的兵并制造牵制。因此Qg1+是最合理的走法。黑方此时拥有巨大优势。 </think> <uci_move>g4g1</uci_move><|im_end|>

提供机构:
aicrowd
二维码
社区交流群
二维码
科研交流群
商业服务