SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2507.12075 · ACL · 2025

BOOKCOREF: Coreference Resolution at Book Scale

Roberto Navigli, Giuliano Martinelli, Tommaso Bonomo, Pere-Lluís Cabot

arXiv · PDF · Open in the Atlas

Code that ran

13 of 19 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 7 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 5 failures of our instrument; 6 no recorded run), measured 2026-11-24; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2507.12075.json · badge: /api/ran/2507.12075.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
booknlp/booknlp canonical (classifier label)
classifier basis: census
7 ran · 5 no recorded run
sapienzanlp/bookcoref canonical (classifier label)
classifier basis: census
4 ran · 0 no recorded run
raduangelescu/gutenbergpy canonical (classifier label)
classifier basis: census
2 ran · 1 no recorded run
FunctionStatusWhere it lives
b3 Ran
ran, honoured the contract we drafted
booknlp/booknlp/booknlp/common/b3.py
code served (permissive licence) · get_code("895e9e6408195ade")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# The function b3 takes two dicts: gold and system
# Each dict maps mentions (keys) to entity_ids (values)
# The function clusters mentions by entity_id and computes precision, recall, F-score

gold = {
    "mention_1": "entity_A",
    "mention_2": "entity_A",
    "mention_3": "entity_B",
    "mention_4": "entity_B",
    "mention_5": "entity_B",
}

system = {
    "mention_1": "entity_A",
    "mention_2": "entity_A",
    "mention_3": "entity_B",
    "mention_4": "entity_C",
    "mention_5": "entity_B",
}

ARGS = {
    "gold": gold,
    "system": system,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
b_cubed Ran
ran, honoured the contract we drafted
sapienzanlp/bookcoref/src/metrics.py
pointer only (licence: NONE) · get_code("e8ce0142bdf8a593")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, sapienzanlp/bookcoref when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

check_span_f1_two_dicts Ran
ran, honoured the contract we drafted
booknlp/booknlp/booknlp/common/sequence_eval.py
code served (permissive licence) · get_code("5256a47babf18d08")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Analyze the function:
# - check_span_f1_two_dicts(gold, pred) takes two parameters
# - Both gold and pred are iterated over with "for g in gold" and "in pred"
# - They support len() function
# - They support membership testing with "in"
# - The function checks if elements from gold are in pred
# - This suggests they should be dict-like or set-like structures

# Create sample data: gold and pred should be dict-like or iterable containers
# that support membership testing. Using sets or dicts here.

gold = {("entity", 0, 5), ("person", 10, 15), ("location", 20, 25)}
pred = {("entity", 0, 5), ("person", 10, 15), ("org", 30, 35)}

ARGS = {
    "gold": gold,
    "pred": pred
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
check_span_f1_two_dicts_subcat Ran
ran, honoured the contract we drafted
booknlp/booknlp/booknlp/common/sequence_eval.py
code served (permissive licence) · get_code("693291b9ea284745")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

# The function expects two arguments: gold and pred
# Both are iterables of tuples with format: (doc, lab, start, end)
# where lab contains a category prefix like 'PRON_', 'NOM_', or 'PROP_'

# Create gold spans
gold = [
    ('doc1', 'PRON_PER', 0, 5),
    ('doc1', 'NOM_COMMON', 10, 15),
    ('doc2', 'PROP_NAME', 3, 8),
    ('doc2', 'PRON_PER', 20, 25),
]

# Create pred spans - some match gold, some don't
pred = [
    ('doc1', 'PRON_PER', 0, 5),      # matches gold
    ('doc1', 'NOM_COMMON', 10, 15),  # matches gold
    ('doc2', 'PROP_NAME', 3, 8),     # matches gold
    ('doc2', 'PRON_PER', 21, 26),    # doesn't match gold
    ('doc3', 'NOM_COMMON', 5, 10),   # doesn't match gold
]

ARGS = {
    'gold': gold,
    'pred': pred,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
extract_mentions_to_clusters Ran
ran; our contract draft was wrong, not the code
sapienzanlp/bookcoref/evaluate.py
pointer only (licence: NONE); the stored copy get_code serves, from OnlpLab/hebrew_coreference, is pointer only (licence: NONE) · get_code("c8b68cc19699ed51")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, sapienzanlp/bookcoref when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

f1 Ran
ran, honoured the contract we drafted
sapienzanlp/bookcoref/src/metrics.py
pointer only (licence: NONE) · get_code("5dc251a1bb16c94f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, sapienzanlp/bookcoref when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_accuracy Ran
ran, honoured the contract we drafted
booknlp/booknlp/booknlp/common/sequence_eval.py
code served (permissive licence) · get_code("6db9b749b1cf20d3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - golds: indexed with range(len(golds)), compared with == to preds[i]
# - preds: indexed with range(len(golds)), compared with == to golds[i]
# - tagset: not used in the function body at all

# golds and preds should be sequences of comparable elements
# They need to have the same length
# Simple lists or arrays of tags/labels work

golds = ['tag1', 'tag2', 'tag1', 'tag2']
preds = ['tag1', 'tag2', 'tag1', 'tag3']
tagset = {'tag1', 'tag2', 'tag3'}

ARGS = {
    'golds': golds,
    'preds': preds,
    'tagset': tagset
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_text_dir_from_index Ran
ran; our contract draft was wrong, not the code
raduangelescu/gutenbergpy/gutenbergpy/textget.py
code served (permissive licence) · get_code("d7d166817f8547c4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function takes a single parameter 'index' and returns a formatted string
# No complex operations are performed on the index, just string formatting

ARGS = {
    'index': 0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
is_iterable Ran
ran, violated the contract we drafted
raduangelescu/gutenbergpy/gutenbergpy/orderedset.py
code served (permissive licence) · get_code("8fe3d90cbc1825eb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

ARGS = {
    "obj": [1, 2, 3]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
muc Ran
ran, honoured the contract we drafted
sapienzanlp/bookcoref/src/metrics.py
pointer only (licence: NONE) · get_code("8b30464b3ec47d85")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, sapienzanlp/bookcoref when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

read_data Ran
ran; our contract draft was wrong, not the code
booknlp/booknlp/booknlp/common/b3.py
code served (permissive licence) · get_code("e9279a1c7675d69d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os

# Create a temporary file with tab-separated data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("index1\tgold_label_1\tsystem_label_1\n")
temp_file.write("index2\tgold_label_2\tsystem_label_2\n")
temp_file.write("index3\tgold_label_3\tsystem_label_3\n")
temp_file.close()

ARGS = {
    'filename': temp_file.name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read_filenames Ran
ran; our contract draft was wrong, not the code
booknlp/booknlp/booknlp/common/sequence_layered_reader.py
code served (permissive licence) · get_code("ee0416a19662a3a8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os

# Create a temporary file with tab-separated paths
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("path/to/input1.txt\tpath/to/output1.txt\n")
temp_file.write("path/to/input2.txt\tpath/to/output2.txt\n")
temp_file.write("path/to/input3.txt\tpath/to/output3.txt\n")
temp_file.close()

ARGS = {
    'filename': temp_file.name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read_tagset Ran
ran; our contract draft was wrong, not the code
booknlp/booknlp/booknlp/common/sequence_layered_reader.py
code served (permissive licence) · get_code("f01b46480d5b9cf7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os

# Create a temporary file with tag data in the expected format
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("tag1\t0\n")
temp_file.write("tag2\t1\n")
temp_file.write("tag3\t2\n")
temp_file.write("tag4\t5\n")
temp_file.close()

ARGS = {
    "filename": temp_file.name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_batches Not yet run
unverified (harvested, no recorded run)
booknlp/booknlp/booknlp/common/layered_reader.py
code served (permissive licence) · get_code("e82b6bd0ee287315")
How it ran

no invocation recorded.

get_conll Not yet run
unverified (harvested, no recorded run)
booknlp/booknlp/booknlp/common/calc_coref_metrics.py
code served (permissive licence) · get_code("31e88963870daa6e")
How it ran

no invocation recorded.

get_coref_score Not yet run
unverified (harvested, no recorded run)
booknlp/booknlp/booknlp/common/calc_coref_metrics.py
code served (permissive licence) · get_code("77160c524b15c159")
How it ran

no invocation recorded.

log_sum_exp Not yet run
unverified (harvested, no recorded run)
booknlp/booknlp/booknlp/common/crf.py
code served (permissive licence) · get_code("457e7ee196816a9e")
How it ran

no invocation recorded.

read_booknlp Not yet run
unverified (harvested, no recorded run)
booknlp/booknlp/booknlp/common/sequence_layered_reader.py
code served (permissive licence) · get_code("0406188b40d61958")
How it ran

no invocation recorded.

strip_headers Not yet run
unverified (harvested, no recorded run)
raduangelescu/gutenbergpy/gutenbergpy/textget.py
code served (permissive licence) · get_code("e21efdbec3dfd897")
How it ran

no invocation recorded.

Also present in other papers' code

Of 19 samples lifted from this paper's linked repositories, 19 carry a function identity and 0 do not. Of the 19 distinct functions with an identity, 4 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 1 later) and 15 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
f1 12 other papers
12 dated earlier
1804.05392 (2018-04)
Higher-order Coreference Resolution with Coarse-to-fine Inference
1907.10529 (2019-07)
SpanBERT: Improving Pre-training by Representing and Predicting Spans
2021.naacl-main.125 (2021 (year only))
Incorporating Syntax and Semantics in Coreference Resolution with Heterogeneous Graph Attention Network
and 9 more not named here
muc 3 other papers
3 dated earlier
2205.12644 (2022-05)
LingMess: Linguistically Informed Multi Expert Scorers for Coreference Resolution
2024.acl-srw.56 (2024 (year only))
Z-coref: Thai Coreference and Zero Pronoun Resolution
2407.21489 (2024-07)
Maverick: Efficient and Accurate Coreference Resolution Defying Recent Trends
b_cubed 1 other paper
1 dated earlier
2407.21489 (2024-07)
Maverick: Efficient and Accurate Coreference Resolution Defying Recent Trends
extract_mentions_to_clusters 1 other paper
1 later
2604.17108 (2026-04)
Beyond Word Boundaries: A Hebrew Coreference Benchmark and an Evaluation Protocol for Morphologically Complex Text

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Coreference Resolution systems are typically evaluated on benchmarks containing small-to medium-scale documents. When it comes to evaluating long texts, however, existing benchmarks, such as LitBank, remain limited in length and do not adequately assess system capabilities at the book scale, i.e., when coreferring mentions span hundreds of thousands of tokens. To fill this gap, we first put forward a novel automatic pipeline that produces high-quality Coreference Resolution annotations on full narrative texts. Then, we adopt this pipeline to create the first book-scale coreference benchmark, BOOKCOREF, with an average document length of more than 200,000 tokens. We carry out a series of experiments showing the robustness of our automatic procedure and demonstrating the value of our resource, which enables current long-document coreference systems to gain up to +20 CoNLL-F1 points when evaluated on full books. Moreover, we report on the new challenges introduced by this unprecedented book-scale setting, highlighting that current models fail to deliver the same performance they achieve on smaller documents. We release our data and code to encourage research and development of new book-scale Coreference Resolution systems at https://github.com/sapienzanlp/bookcoref.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2507.12075")
get_code_for_paper("2507.12075")
have("2507.12075")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2507.12075.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2507.12075.svg)](https://syntology.ai/paper/2507.12075)

Connect an agent — have() is free.