Datasets:
image
imagewidth (px) 390
390
| target
stringclasses 448
values | turn
stringclasses 2
values |
---|---|---|
Rg5# | black |
|
Qxe7# | white |
|
Rd8# | white |
|
Rxh5# | white |
|
Qxf2# | black |
|
Ra7# | white |
|
hxg8=Q# | white |
|
Qxg2# | black |
|
Bg6# | white |
|
Qxf7# | white |
|
Qg1# | black |
|
Ng3# | black |
|
Qb2# | black |
|
Qh7# | white |
|
Rxf8# | white |
|
Qe7# | white |
|
Qh8# | white |
|
Qf7# | white |
|
Qxe6# | white |
|
Qc6# | white |
|
Bg5# | white |
|
Rc8# | white |
|
Qe8# | white |
|
Qxg2# | black |
|
Qf7# | white |
|
Qxh8# | white |
|
f3# | black |
|
Bg6# | white |
|
Qh2# | black |
|
Qxf2# | black |
|
Qg3# | black |
|
Qh7# | white |
|
Qxa1# | black |
|
Qxf2# | black |
|
Qxb4# | black |
|
R1h7# | white |
|
Qh7# | white |
|
Qh4# | white |
|
Rf2# | black |
|
Qc4# | white |
|
Qxf8# | white |
|
Qd4# | white |
|
Qh2# | black |
|
Qf7# | white |
|
Qxf7# | white |
|
Rh2# | black |
|
Qxh7# | white |
|
Ra1# | black |
|
Qe8# | white |
|
Qxb2# | black |
|
Qxe7# | white |
|
Rh8# | white |
|
Rc1# | black |
|
Bxf6# | white |
|
Qc8# | white |
|
Rb8# | black |
|
f1=Q# | black |
|
Bxf7# | white |
|
Qb4# | black |
|
Qxd8# | white |
|
Qxf2# | black |
|
Qh2# | black |
|
Rd8# | white |
|
Rxf6# | white |
|
Qb1# | black |
|
Rh8# | white |
|
Qc8# | white |
|
Qxh7# | white |
|
Qg7# | white |
|
Rh8# | white |
|
Qh5# | white |
|
Rc1# | black |
|
Qxh2# | black |
|
Rxe6# | white |
|
Rh6# | white |
|
Qe4# | white |
|
Rf4# | white |
|
Rd1# | black |
|
Qxg7# | white |
|
Qf2# | black |
|
Rh1# | white |
|
Rf7# | white |
|
Qxd1# | black |
|
f6# | white |
|
Qxh3# | black |
|
Rxa2# | white |
|
Qd8# | white |
|
Qc2# | black |
|
Qxf1# | black |
|
Rb1# | black |
|
Qg8# | white |
|
Qe4# | black |
|
Qf7# | white |
|
Rxh2# | black |
|
Qxh3# | black |
|
Nf7# | white |
|
Rh8# | white |
|
Qh5# | white |
|
Qa3# | black |
|
Rb1# | black |
End of preview. Expand
in Dataset Viewer.
Dataset Card for BIG-Bench Checkmate In One Move (Images)
Description
This is an adapted version of the BIG-Bench Checkmate in One Move task as originally made by Nitish Keskar (nkeskar@salesforce.com). Copying the original task description:
The goal of this task is to probe the ability of language models to play chess in standard algebraic notation (SAN). The input to the model is a sequence of moves such that a next possible move is a checkmate. We curate 3,500 games and measure the performance of the system in exact match accuracy.
This version simply replaces the text input with images of the board state before the checkmate move.
Example
turn: black
target: Rg5#
Generation Code
The code used to generate this was:
def svg_to_png(svg_data, output_file):
"""Convert SVG data to PNG and save it"""
# Convert SVG to PNG using cairosvg
png_data = cairosvg.svg2png(bytestring=svg_data)
# Write the PNG data to the output file
with open(output_file, "wb") as f:
f.write(png_data)
def pgn_to_images(pgn, f_name):
"""Convert a PGN file to an image of the final board position"""
pgn = io.StringIO(pgn)
game = chess.pgn.read_game(pgn)
board = game.board()
for move in game.mainline_moves():
board.push(move)
svg = chess.svg.board(board)
turn_str = "white" if board.turn == chess.WHITE else "black"
# use a temporary file to convert the SVG to PNG
with open("temp.svg", "w") as f:
f.write(svg)
with open("temp.svg", "rb") as f:
svg_data = f.read()
svg_to_png(svg_data, f_name)
os.remove("temp.svg")
return turn_str
Thanks to the python chess library and cairosvg for making this possible.
- Downloads last month
- 44