chess-evaluations / README.md
christopher's picture
Update README.md
f314fd4 verified
metadata
license: cc0-1.0
size_categories:
  - 100M<n<1B
dataset_info:
  features:
    - name: fen
      dtype: string
    - name: line
      dtype: string
    - name: depth
      dtype: int64
    - name: knodes
      dtype: int64
    - name: cp
      dtype: int64
    - name: mate
      dtype: int64
  splits:
    - name: train
      num_bytes: 38754621005
      num_examples: 276985422
  download_size: 13405623635
  dataset_size: 38754621005
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-*
tags:
  - chess
  - stockfish

Dataset Card for the Lichess Evaluations dataset

Dataset Description

100,731,099 chess positions evaluated with Stockfish at various depths and node count. Produced by, and for, the Lichess analysis board, running various flavours of Stockfish within user browsers. This version of the dataset is a de-normalized version of the original dataset and contains 276,985,422 rows.

This dataset is updated monthly, and was last updated on October 15th, 2024.

Dataset Creation

from datasets import load_dataset

dset = load_dataset("json", data_files="lichess_db_eval.jsonl", split="train")

def batch_explode_rows(batch):
    exploded = {"fen": [], "line": [], "depth": [], "knodes": [], "cp": [], "mate": []}
    for fen, evals in zip(batch["fen"], batch["evals"]):
        for eval_ in evals:
            for pv in eval_["pvs"]:
                exploded["fen"].append(fen)
                exploded["line"].append(pv["line"])
                exploded["depth"].append(eval_["depth"])
                exploded["knodes"].append(eval_["knodes"])
                exploded["cp"].append(pv["cp"])
                exploded["mate"].append(pv["mate"])
    return exploded

dset = dset.map(batch_explode_rows, batched=True, batch_size=64, num_proc=12, remove_columns=dset.column_names)

dset.push_to_hub("Lichess/chess-evaluations")

Dataset Usage

Using the datasets library:

from datasets import load_dataset
dset = load_dataset("Lichess/chess-evaluations", split="train")

Dataset Details

Dataset Sample

One row of the dataset looks like this:

{
  "fen": "2bq1rk1/pr3ppn/1p2p3/7P/2pP1B1P/2P5/PPQ2PB1/R3R1K1 w - -",
  "line": "g2e4 f7f5 e4b7 c8b7 f2f3 b7f3 e1e6 d8h4 c2h2 h4g4",
  "depth": 36,
  "knodes": 206765,
  "cp": 311,
  "mate": None
}

Dataset Fields

Every row of the dataset contains the following fields:

  • fen: string, the position FEN only contains pieces, active color, castling rights, and en passant square.
  • line: string, the principal variation, in UCI format.
  • depth: string, the depth reached by the engine.
  • knodes: int, the number of kilo-nodes searched by the engine.
  • cp: int, the position's centipawn evaluation. This is None if mate is certain.
  • mate: int, the position's mate evaluation. This is None if mate is not certain.