christopher's picture
Update README.md
2046a97 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: 61786821797
      num_examples: 442684690
  download_size: 22010230074
  dataset_size: 61786821797
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-*
tags:
  - chess
  - stockfish
  - lichess
  - games

Dataset Card for the Lichess Evaluations dataset

Dataset Description

173,866,932 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 442,684,690 rows.

This dataset is updated monthly, and was last updated on January 5th, 2025.

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.