SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1907.10529 · 2019

SpanBERT: Improving Pre-training by Representing and Predicting Spans

arXiv · PDF · Open in the Atlas

Code that ran

9 of 15 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; 1 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 4 failures of our instrument; 6 no recorded run), measured 2026-11-21; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/1907.10529.json · badge: /api/ran/1907.10529.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
facebookresearch/SpanBERT canonical (classifier label)
classifier basis: classifier_2025
2 ran · 1 no recorded run
amore-upf/masked-coreference community (classifier label)
classifier basis not recorded on the link
7 ran · 4 no recorded run
copy not recorded community
not in the paper's declared repositories
0 ran · 1 no recorded run
FunctionStatusWhere it lives
b_cubed Ran
ran on a synthesized input
amore-upf/masked-coreference/metrics.py
code served (permissive licence) · get_code("599218961a8155ee")
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.

from collections import Counter

# b_cubed computes B³ metric for coreference resolution
# It takes:
# - clusters: list of lists, where each inner list contains mention indices
# - mention_to_gold: dict mapping mention indices to gold cluster assignments
# - selected_mentions: optional, not used in the function body

# Construct test data
clusters = [
    [0, 1, 2],      # cluster 1 with 3 mentions
    [3, 4],         # cluster 2 with 2 mentions
    [5],            # singleton cluster (skipped)
    [6, 7, 8, 9],   # cluster 3 with 4 mentions
]

# mention_to_gold maps each mention to its gold cluster assignment
# Using tuples as the values (as seen in the function: tuple(mention_to_gold[m]))
mention_to_gold = {
    0: (0, 0),      # mention 0 belongs to gold cluster 0
    1: (0, 0),      # mention 1 belongs to gold cluster 0
    2: (0, 1),      # mention 2 belongs to gold cluster 0 (different tuple)
    3: (1, 0),      # mention 3 belongs to gold cluster 1
    4: (1, 0),      # mention 4 belongs to gold cluster 1
    5: (2, 0),      # mention 5 belongs to gold cluster 2
    6: (3, 0),      # mention 6 belongs to gold cluster 3
    7: (3, 0),      # mention 7 belongs to gold cluster 3
    8: (3, 1),      # mention 8 belongs to gold cluster 3
    9: (3, 1),      # mention 9 belongs to gold cluster 3
}

selected_mentions = None

ARGS = {
    "clusters": clusters,
    "mention_to_gold": mention_to_gold,
    "selected_mentions": selected_mentions,
}
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
convert_examples_to_features Ran
ran; our contract draft was wrong, not the code
facebookresearch/SpanBERT/code/run_tacred.py
pointer only (licence: NOASSERTION) · get_code("3860f4e19d89be73")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/SpanBERT (NOASSERTION). 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.

convert_token Ran
ran; our contract draft was wrong, not the code
facebookresearch/SpanBERT/code/run_tacred.py
pointer only (licence: NOASSERTION) · get_code("1731b0e57e413f9d")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/SpanBERT (NOASSERTION). 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
amore-upf/masked-coreference/metrics.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from sapienzanlp/bookcoref, is pointer only (licence: NONE) · get_code("5dc251a1bb16c94f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from sapienzanlp/bookcoref, and GitHub detected no licence in that repository 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_activation Ran
ran; our contract draft was wrong, not the code
amore-upf/masked-coreference/bert/modeling.py
code served (permissive licence) · get_code("5681f7dd9b6e3679")
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) and returned function. 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 tensorflow as tf
import six

# Test cases for get_activation function
# The function takes activation_string as parameter and returns either None or a callable

ARGS = {
    "activation_string": "relu"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
six, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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_doc_key Ran
ran; our contract draft was wrong, not the code
amore-upf/masked-coreference/conll.py
code served (permissive licence) · get_code("f300a33fe05fc609")
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

def get_doc_key(doc_id, part):
    return '{}_{}'.format(doc_id, int(part))

ARGS = {
    'doc_id': 'doc_123',
    'part': 5
}
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
get_sentence_map Ran
ran on a synthesized input
amore-upf/masked-coreference/minimize.py
code served (permissive licence) · get_code("de32dc1a0c359c0d")
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 list, ndim 1, dtype family int; 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 torch
import numpy as np

# Analyzing the function:
# - segments: needs to be a list of lists/sequences where each has length >= 2
# - sentence_end: needs to be a list/array of binary values (0 or 1) with length equal to sum([len(s) - 2 for s in segments])

# Create valid arguments
torch.manual_seed(0)

# segments: list of segments, each segment is a sequence
# The function iterates through segments and for each segment of length n, 
# it expects n-2 entries in sentence_end
segment1 = [0, 1, 2, 3]  # length 4, contributes 2 entries to sentence_end
segment2 = [0, 1, 2]     # length 3, contributes 1 entry to sentence_end
segment3 = [0, 1, 2, 3, 4]  # length 5, contributes 3 entries to sentence_end

segments = [segment1, segment2, segment3]

# Total entries needed in sentence_end: (4-2) + (3-2) + (5-2) = 2 + 1 + 3 = 6
# sentence_end should be binary values (0 or 1) indicating sentence boundaries
sentence_end = [1, 0, 1, 0, 1, 1]

ARGS = {
    "segments": segments,
    "sentence_end": sentence_end
}
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 list, ndim 1, dtype family int — a list 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
normalize_word Ran
ran on a synthesized input
amore-upf/masked-coreference/minimize.py
code served (permissive licence) · get_code("3b625164c1147fcf")
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.

ARGS = {
    'word': '/.',
    'language': 'arabic'
}
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 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
official_conll_eval Ran
ran on a synthesized input
amore-upf/masked-coreference/conll.py
code served (permissive licence) · get_code("5712dc7b00cdd758")
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 re
import subprocess
import tempfile
import os

# Create temporary files with mock data
gold_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
predicted_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')

# Write minimal valid CoNLL format data
gold_content = """#begin document (doc1); part 000
doc1	0	0	The	DT	(TOP(S(NP*)	-	-	-	-	*	(0
doc1	0	1	cat	NN	*)	-	-	-	-	*	0)
doc1	0	2	sat	VBD	(VP*)	-	-	-	-	*	-
#end document
"""

predicted_content = """#begin document (doc1); part 000
doc1	0	0	The	DT	(TOP(S(NP*)	-	-	-	-	*	(0
doc1	0	1	cat	NN	*)	-	-	-	-	*	0)
doc1	0	2	sat	VBD	(VP*)	-	-	-	-	*	-
#end document
"""

gold_file.write(gold_content)
gold_file.close()

predicted_file.write(predicted_content)
predicted_file.close()

# Create a mock scorer script that outputs valid coreference results
scorer_dir = tempfile.mkdtemp()
scorer_script = os.path.join(scorer_dir, 'scorer.pl')
os.makedirs(os.path.dirname(scorer_script), exist_ok=True)

with open(scorer_script, 'w') as f:
    f.write("""#!/usr/bin/env perl
print "Coreference: Recall: (1 / 1) 100.0%\\tPrecision: (1 / 1) 100.0%\\tF1: 100.0%\\n";
""")
os.chmod(scorer_script, 0o755)

# Patch the subprocess to handle our mock script
original_popen = subprocess.Popen

class MockPopen:
    def __init__(self, cmd, **kwargs):
        self.returncode = 0
        self.stdout = kwargs.get('stdout')
    
    def communicate(self):
        stdout = b"Coreference: Recall: (1 / 1) 100.0%\tPrecision: (1 / 1) 100.0%\tF1: 100.0%\n"
        return stdout, None
    
    def wait(self):
        return 0

subprocess.Popen = MockPopen

ARGS = {
    'gold_path': gold_file.name,
    'predicted_path': predicted_file.name,
    'metric': 'muc',
    'official_stdout': False
}
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
convert_examples_to_features Not yet run
unverified (harvested, no recorded run)
facebookresearch/SpanBERT/code/run_squad.py
pointer only (licence: NOASSERTION) · get_code("da5d9e9f738be2ba")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/SpanBERT (NOASSERTION). 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. No invocation recorded.

evaluate_conll Not yet run
unverified (harvested, no recorded run)
amore-upf/masked-coreference/conll.py
code served (permissive licence) · get_code("ea92f536bea4cbd4")
How it ran

no invocation recorded.

gelu Not yet run
unverified (harvested, no recorded run)
amore-upf/masked-coreference/bert/modeling.py
code served (permissive licence) · get_code("ecab128238ebf253")
How it ran

no invocation recorded.

get_assignment_map_from_checkpoint Not yet run
unverified (harvested, no recorded run)
amore-upf/masked-coreference/bert/modeling.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from toggle1995/RIS-DMMI, is pointer only (licence: NONE) · get_code("50958618b65e514e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from toggle1995/RIS-DMMI, and GitHub detected no licence in that repository 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. No invocation recorded.

read_doc_keys Not yet run
unverified (harvested, no recorded run)
amore-upf/masked-coreference/evaluate.py
code served (permissive licence) · get_code("edcb69a1bdf0f631")
How it ran

no invocation recorded.

simple_accuracy Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from ink-usc/expl-refinement
pointer only · get_code("3c241ecfe3749a6d")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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. No invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 12 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 0 the same month, 12 later) and 3 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
simple_accuracy 59 other papers
4 dated earlier, 55 later
1506.05865 (2015-06)
LCSTS: A Large Scale Chinese Short Text Summarization Dataset
1509.01626 (2015-09)
Character-level Convolutional Networks for Text Classification *
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
and 56 more not named here
get_activation 32 other papers
9 dated earlier, 23 later · 1 only as an assembly brick
1804.05392 (2018-04)
Higher-order Coreference Resolution with Coarse-to-fine Inference
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1901.04085 (2019-01)
Passage Re-ranking with BERT
and 29 more not named here
get_assignment_map_from_checkpoint 26 other papers
9 dated earlier, 17 later
1804.05392 (2018-04)
Higher-order Coreference Resolution with Coarse-to-fine Inference
1808.09781 (2018-08)
Self-Attentive Sequential Recommendation
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
and 23 more not named here
gelu 16 other papers
8 dated earlier, 8 later · 2 only as an assembly brick
1706.03762 (2017-06)
Attention Is All You Need
1804.05392 (2018-04)
Higher-order Coreference Resolution with Coarse-to-fine Inference
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
and 13 more not named here
f1 12 other papers
1 dated earlier, 11 later
1804.05392 (2018-04)
Higher-order Coreference Resolution with Coarse-to-fine Inference
2021.naacl-main.125 (2021 (year only))
Incorporating Syntax and Semantics in Coreference Resolution with Heterogeneous Graph Attention Network
2109.04901 (2021-09)
Document-level Entity-based Extraction as Template Generation
and 9 more not named here
get_doc_key 8 other papers
1 dated earlier, 7 later
1804.05392 (2018-04)
Higher-order Coreference Resolution with Coarse-to-fine Inference
2021.naacl-main.125 (2021 (year only))
Incorporating Syntax and Semantics in Coreference Resolution with Heterogeneous Graph Attention Network
2109.06067 (2021-09)
Packed Levitated Marker for Entity and Relation Extraction
and 5 more not named here
evaluate_conll 4 other papers
4 later
2109.06067 (2021-09)
Packed Levitated Marker for Entity and Relation Extraction
2202.10710 (2022-02)
Incorporating Constituent Syntax for Coreference Resolution
2025.findings-emnlp.1354 (2025 (year only))
Dependency Parsing-Based Syntactic Enhancement of Relation Extraction in Scientific Texts
and 1 more not named here
normalize_word 4 other papers
1 dated earlier, 3 later
1804.05392 (2018-04)
Higher-order Coreference Resolution with Coarse-to-fine Inference
2021.naacl-main.125 (2021 (year only))
Incorporating Syntax and Semantics in Coreference Resolution with Heterogeneous Graph Attention Network
2202.10710 (2022-02)
Incorporating Constituent Syntax for Coreference Resolution
and 1 more not named here
official_conll_eval 2 other papers
1 dated earlier, 1 later
1804.05392 (2018-04)
Higher-order Coreference Resolution with Coarse-to-fine Inference
2202.10710 (2022-02)
Incorporating Constituent Syntax for Coreference Resolution
convert_token 1 other paper
1 later
2104.08398 (2021-04)
Re-TACRED: Addressing Shortcomings of the TACRED Dataset
get_sentence_map 1 other paper
1 later
2202.10710 (2022-02)
Incorporating Constituent Syntax for Coreference Resolution
read_doc_keys 1 other paper
1 later
2202.10710 (2022-02)
Incorporating Constituent Syntax for Coreference Resolution

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-21.

Repositories linked to this paper

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

Abstract

We present SpanBERT, a pre-training method that is designed to better represent and predict spans of text. Our approach extends BERT by (1) masking contiguous random spans, rather than random tokens, and (2) training the span boundary representations to predict the entire content of the masked span, without relying on the individual token representations within it. SpanBERT consistently outperforms BERT and our better-tuned baselines, with substantial gains on span selection tasks such as question answering and coreference resolution. In particular, with the same training data and model size as BERT-large, our single model obtains 94.6% and 88.7% F1 on SQuAD 1.1 and 2.0, respectively. We also achieve a new state of the art on the OntoNotes coreference resolution task (79.6\% F1), strong performance on the TACRED relation extraction benchmark, and even show gains on GLUE.

For agents

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

get_harvested_code_for_paper("1907.10529")
get_code_for_paper("1907.10529")
have("1907.10529")

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

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

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

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

Connect an agent — have() is free.