SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1904.09675 · ICLR · 2019

BERTScore: Evaluating Text Generation with BERT

Tianyi Zhang, Kilian Weinberger, Yoav Artzi, Varsha Kishore, Felix Wu

arXiv · PDF · Open in the Atlas

Code that ran

44 of 76 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 2 violated it and 5 have no contract verdict; 34 failures of our instrument; 32 no recorded run), measured 2026-11-23; 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/1904.09675.json · badge: /api/ran/1904.09675.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
lovit/ko-BERTScore community
Papers with Code archive
9 ran · 4 no recorded run
neulab/code-bert-score community
Papers with Code archive
7 ran · 7 no recorded run
facebookresearch/vizseq community
Papers with Code archive
7 ran · 3 no recorded run
Tiiiger/bert_score marked official in Papers with Code
Papers with Code archive
6 ran · 4 no recorded run
cyr19/reproducibility community
Papers with Code archive
5 ran · 8 no recorded run
danieldeutsch/bert_score_content_analysis community
Papers with Code archive
5 ran · 4 no recorded run
yuhui-zh15/nlg_metrics community
Papers with Code archive
3 ran · 2 no recorded run
sebiancoder/bertscorevisualizer community
Papers with Code archive
1 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
BERTScoreScorer Ran
ran on a synthesized input · constructed an object; no result was computed
facebookresearch/vizseq/vizseq/scorers/bert_score.py
code served (permissive licence) · get_code("c8edeba2ca8fea59")
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 an instance of its own class, BERTScoreScorer: the run constructed the object and did not call it, so no result was computed. 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 numpy as np
from typing import List, Dict, Optional, Callable
from unittest.mock import Mock

torch = None
try:
    import torch
    import torch.nn as nn
    torch.manual_seed(0)
except ImportError:
    pass

# Helper functions that appear to be used in the class
def map_optional(value, fn):
    if value is None:
        return None
    return fn(value)

def _available_cpu_count():
    return 4

def _max_workers_for_platform(cpu_count, platform):
    if platform == 'win32':
        return min(cpu_count, MAX_WINDOWS_WORKERS)
    return cpu_count

def _batch(data, n_batches):
    """Batch data into n_batches chunks"""
    batch_size = max(1, len(data) // n_batches)
    for i in range(0, len(data), batch_size):
        yield data[i:i + batch_size]

MAX_WINDOWS_WORKERS = 61
PRECISION = 3

# Create minimal mock sent_score_func that matches SENT_SCORE_FN_TYPE
def mock_sent_score_func(hypo: List[str], ref: List[List[str]], extra_args: Optional[Dict] = None) -> List[float]:
    """Mock scoring function that returns random scores"""
    return [np.random.rand() for _ in hypo]

# Build sample data
hypothesis = ["hello world", "test sentence"]
references = [
    ["hello world", "test sentence"],
    ["hi earth", "test case"]
]
tags = [["tag1"], ["tag2"]]

# Build the ARGS dictionary with all parameters for VizSeqScorer
ARGS = {
    "corpus_level": True,
    "sent_level": True,
    "n_workers": 1,
    "verbose": False,
    "extra_args": {"model": "test"}
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
bert_score, langid, numpy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BERTScoreScorer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BERTScoreScorer 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
BERTScorer Ran
ran on a synthesized input · constructed an object; no result was computed
sebiancoder/bertscorevisualizer/backend/BERTScorer/bertscorer.py
pointer only (licence: NOASSERTION) · get_code("41873629d485d64d")
How it ran

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

VizSeqScore Ran
ran on a synthesized input · constructed an object; no result was computed
facebookresearch/vizseq/vizseq/scorers/bert_score.py
code served (permissive licence) · get_code("d7146a26ef592a40")
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 an instance of its own class, VizSeqScore: the run constructed the object and did not call it, so no result was computed. 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 numpy as np
from typing import Any, List, Optional, Tuple, Dict, Callable, NamedTuple

PRECISION = 3

def map_optional(obj: Optional[Any], map_fn: Callable[[Any], Any]) -> Optional[Any]:
    return None if obj is None else map_fn(obj)

class VizSeqScore(NamedTuple):
    corpus_score: Optional[float] = None
    sent_scores: Optional[List[float]] = None
    group_scores: Optional[Dict[str, float]] = None

    @classmethod
    def make(cls, corpus_score: Optional[float], sent_scores: Optional[List[float]], group_scores: Optional[Dict[str, float]]):
        return cls(map_optional(corpus_score, lambda x: np.round(x, PRECISION)), map_optional(sent_scores, lambda x: [np.round(xx, PRECISION) for xx in x]), map_optional(group_scores, lambda x: {k: np.round(v, PRECISION) for k, v in x.items()}))

    def to_dict(self):
        return {'corpus_score': self.corpus_score, 'sent_scores': self.sent_scores, 'group_scores': self.group_scores}


# Setup valid arguments for VizSeqScore constructor
ARGS = {
    'corpus_score': 0.8524,
    'sent_scores': [0.7234, 0.8901, 0.6543],
    'group_scores': {'group_a': 0.7856, 'group_b': 0.8234}
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type VizSeqScore — the run constructed an instance of its own class and did not call it; no shape is 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
VizSeqScorer Ran
ran on a synthesized input · constructed an object; no result was computed
facebookresearch/vizseq/vizseq/scorers/bert_score.py
code served (permissive licence) · get_code("330236fc4b93abc7")
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 an instance of its own class, VizSeqScorer: the run constructed the object and did not call it, so no result was computed. 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 numpy as np
from typing import Any, List, Optional, Dict, Callable

# Define ARGS dictionary with all parameters for VizSeqScorer.__init__
ARGS = {
    'corpus_level': True,
    'sent_level': False,
    'n_workers': 2,
    'verbose': False,
    'extra_args': {'key': 'value'}
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type VizSeqScorer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a VizSeqScorer 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
_available_cpu_count Ran
ran on a synthesized input
facebookresearch/vizseq/vizseq/scorers/bert_score.py
code served (permissive licence) · get_code("034176029000712f")
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 int, ndim 0, dtype family int, 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 os
from pathlib import Path
import math
from multiprocessing import cpu_count

def _cgroup_cpu_quota() -> float | None:
    try:
        quota, period = Path('/sys/fs/cgroup/cpu.max').read_text().split()
        if quota != 'max':
            return int(quota) / int(period)
    except (OSError, ValueError):
        pass
    try:
        root = Path('/sys/fs/cgroup/cpu')
        quota = int((root / 'cpu.cfs_quota_us').read_text())
        period = int((root / 'cpu.cfs_period_us').read_text())
        if quota > 0 and period > 0:
            return quota / period
    except (OSError, ValueError):
        pass
    return None

def _available_cpu_count() -> int:
    try:
        n_cpus = len(os.sched_getaffinity(0))
    except AttributeError:
        n_cpus = cpu_count()
    quota = _cgroup_cpu_quota()
    if quota is not None:
        n_cpus = min(n_cpus, max(1, int(math.floor(quota))))
    return n_cpus

ARGS = {}
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 int, ndim 0, dtype family int, 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
_batch Ran
ran; our contract draft was wrong, not the code
facebookresearch/vizseq/vizseq/scorers/bert_score.py
code served (permissive licence) · get_code("d05d990ceb06d2c9")
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 generator. 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 _batch takes a list and divides it into n_batches
# It uses: len(a_list), integer division, modulo, range(), slicing
# No special attributes or methods are called on elements

a_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
n_batches = 3

ARGS = {
    'a_list': a_list,
    'n_batches': n_batches
}
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 generator — a generator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a generator 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
_max_workers_for_platform Ran
ran, honoured the contract we drafted
facebookresearch/vizseq/vizseq/scorers/bert_score.py
code served (permissive licence) · get_code("ee17bb43374f3ef2")
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 int, ndim 0, dtype family int, 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

ARGS = {
    'n_cpus': 8,
    'platform': 'linux'
}
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 int, ndim 0, dtype family int, 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
apply_idf Ran
ran; our contract draft was wrong, not the code
lovit/ko-BERTScore/KoBERTScore/score.py
pointer only (licence: NONE) · get_code("95e240faa9326986")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lovit/ko-BERTScore 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.

bert_encode Ran
ran; our contract draft was wrong, not the code
cyr19/reproducibility/bert_score/scorer.py
pointer only (licence: NONE) · get_code("e41bf854cd7b9a83")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cyr19/reproducibility 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.

bert_encode Ran
ran; our contract draft was wrong, not the code
yuhui-zh15/nlg_metrics/nlg_metrics/bertscore/bert_util.py
pointer only (licence: NONE) · get_code("29119b8712ceae26")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, yuhui-zh15/nlg_metrics 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.

bert_encode Ran
ran; our contract draft was wrong, not the code
neulab/code-bert-score/code_bert_score/scorer.py
code served (permissive licence) · get_code("949db13a96d3ef67")
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 Tensor, ndim 3, dtype family float, shape (2, 20, 4) 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 torch.nn as nn
from transformers import GPT2Tokenizer

torch.manual_seed(0)

# Create a minimal mock model that matches how bert_encode uses it
class MockBertModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(100, 4)
    
    def forward(self, input_ids, attention_mask=None):
        # Return tuple: (last_hidden_state, all_hidden_states)
        # last_hidden_state shape: (batch, seq_len, hidden_dim)
        batch_size = input_ids.shape[0]
        seq_len = input_ids.shape[1]
        last_hidden_state = torch.randn(batch_size, seq_len, 4)
        # all_hidden_states is a tuple of layer outputs for all_layers=True case
        all_hidden_states = tuple(torch.randn(batch_size, seq_len, 4) for _ in range(3))
        return (last_hidden_state, all_hidden_states)

# Create a minimal mock tokenizer
class MockTokenizer:
    def __init__(self):
        self.model_max_length = 16

# Create small tensors for input
batch_size = 2
total_seq_length = 20
hidden_dim = 4

model = MockBertModel()
x = torch.randint(0, 100, (batch_size, total_seq_length))
attention_mask = torch.ones(batch_size, total_seq_length, dtype=torch.long)
tokenizer = MockTokenizer()

ARGS = {
    "model": model,
    "x": x,
    "attention_mask": attention_mask,
    "tokenizer": tokenizer,
    "all_layers": False,
    "chunk_overlap": 0.5,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 20, 4) — shape (2, 20, 4) 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
bert_forwarding Ran
ran; our contract draft was wrong, not the code
lovit/ko-BERTScore/KoBERTScore/score.py
pointer only (licence: NONE) · get_code("369342a5449a0bfd")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lovit/ko-BERTScore 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.

cache_scibert Ran
ran; our contract draft was wrong, not the code
cyr19/reproducibility/bert_score/scorer.py
pointer only (licence: NONE) · get_code("be27ce41f9ea0d1f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cyr19/reproducibility 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.

collate_idf Ran
ran; our contract draft was wrong, not the code
cyr19/reproducibility/bert_score/scorer.py
pointer only (licence: NONE) · get_code("80aa6d93e1e6196f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cyr19/reproducibility 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.

collate_idf Ran
ran; our contract draft was wrong, not the code
yuhui-zh15/nlg_metrics/nlg_metrics/bertscore/bert_util.py
pointer only (licence: NONE) · get_code("a674ab62cada9f02")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, yuhui-zh15/nlg_metrics 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.

collate_idf Ran
ran; our contract draft was wrong, not the code
danieldeutsch/bert_score_content_analysis/bert_score/utils.py
code served (permissive licence) · get_code("1d15c841be27109a")
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. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from transformers import GPT2Tokenizer

torch.manual_seed(0)

# Create a minimal tokenizer stand-in
class MinimalTokenizer:
    def __init__(self):
        self.pad_token_id = 0
        self.max_len = 512
    
    def encode(self, text, add_special_tokens=True, add_prefix_space=False, max_length=None):
        # Return a simple token id sequence
        return [101, 2054, 2003, 102]  # Fixed sequence for testing
    
    def convert_ids_to_tokens(self, ids):
        # Map token ids to token strings
        token_map = {0: '[PAD]', 101: '[CLS]', 102: '[SEP]', 2054: 'what', 2003: 'is'}
        return [token_map.get(i, '[UNK]') for i in ids]

# Create tokenizer
tokenizer = MinimalTokenizer()

# Create a small idf_dict mapping token ids to idf scores
idf_dict = {
    0: 0.0,      # pad token
    101: 1.5,    # [CLS]
    102: 1.3,    # [SEP]
    2054: 2.1,   # what
    2003: 1.9    # is
}

# Create test sentences
arr = [
    "what is this",
    "hello world"
]

# Define ARGS dict with all parameters for collate_idf
ARGS = {
    "arr": arr,
    "tokenizer": tokenizer,
    "idf_dict": idf_dict,
    "device": "cpu"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
collate_idf Ran
ran; our contract draft was wrong, not the code
neulab/code-bert-score/code_bert_score/scorer.py
code served (permissive licence) · get_code("84a478e9730d32cf")
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. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from transformers import GPT2Tokenizer

torch.manual_seed(0)

# Create a minimal tokenizer stand-in that mimics GPT2Tokenizer behavior
class MockTokenizer:
    def __init__(self):
        self.pad_token_id = 0
        self.model_max_length = 512
        self.max_len = 512
    
    def encode(self, sent, add_special_tokens=True, add_prefix_space=False, max_length=None, truncation=None):
        # Return a simple list of token ids
        if sent.strip() == '':
            return []
        # Simulate encoding by returning token ids based on sentence length
        tokens = sent.split()
        return [1] + [i + 2 for i in range(len(tokens))] + [2]
    
    def build_inputs_with_special_tokens(self, tokens):
        return [1] + tokens + [2]

# Create mock tokenizer
tokenizer = MockTokenizer()

# Create a batch of 2 sentences
arr = [
    "Hello world",
    "This is a test"
]

# Create idf_dict mapping token ids to idf scores
# Need to cover all possible token ids that could appear
idf_dict = {i: 0.5 + (i * 0.1) for i in range(20)}

# Set device to CPU
device = 'cpu'

ARGS = {
    'arr': arr,
    'tokenizer': tokenizer,
    'idf_dict': idf_dict,
    'device': device
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
distutils, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
collate_idf Ran
ran; our contract draft was wrong, not the code
Tiiiger/bert_score/bert_score/scorer.py
code served (permissive licence) · get_code("e1297e386354025c")
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. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from transformers import AutoTokenizer
import torch.nn as nn

torch.manual_seed(0)

# Create a mock tokenizer with required attributes and methods
class MockTokenizer:
    def __init__(self):
        self.pad_token_id = 0
        self.model_max_length = 512
    
    def encode(self, sent, add_special_tokens=True, add_prefix_space=False, max_length=None, truncation=False):
        # Return a simple list of token ids for the sentence
        tokens = [101] + [2054, 2003] + [102]  # [CLS] what is [SEP]
        if max_length and len(tokens) > max_length:
            tokens = tokens[:max_length]
        return tokens
    
    def build_inputs_with_special_tokens(self, tokens):
        return [101] + tokens + [102]

# Create sample data
tokenizer = MockTokenizer()

# Create an IDF dictionary mapping token ids to their IDF scores
idf_dict = {
    0: 0.0,    # pad token
    101: 0.5,  # [CLS]
    102: 0.5,  # [SEP]
    2054: 1.2, # example token
    2003: 1.5, # example token
}

# Create sample sentences
arr = [
    "what is this",
    "hello world"
]

# Device set to CPU only
device = 'cpu'

ARGS = {
    'arr': arr,
    'tokenizer': tokenizer,
    'idf_dict': idf_dict,
    'device': device
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
packaging, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
compute_RPF Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lovit/ko-BERTScore/KoBERTScore/score.py
pointer only (licence: NONE) · get_code("9cc9523dfc879e70")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lovit/ko-BERTScore 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.

compute_pairwise_cosine Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lovit/ko-BERTScore/KoBERTScore/score.py
pointer only (licence: NONE) · get_code("a6fb6a679479b806")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lovit/ko-BERTScore 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_bert_embedding Ran
ran; our contract draft was wrong, not the code
cyr19/reproducibility/bert_score/scorer.py
pointer only (licence: NONE) · get_code("e8c19548068c18c0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cyr19/reproducibility 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_bert_embedding Ran
ran; our contract draft was wrong, not the code
yuhui-zh15/nlg_metrics/nlg_metrics/bertscore/bert_util.py
pointer only (licence: NONE) · get_code("466fbc555ce2478f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, yuhui-zh15/nlg_metrics 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_bert_embedding Ran
ran; our contract draft was wrong, not the code
danieldeutsch/bert_score_content_analysis/bert_score/utils.py
code served (permissive licence) · get_code("60a9029618bff133")
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. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import torch.nn as nn
from transformers import GPT2Tokenizer

torch.manual_seed(0)

# Build a minimal BERT-like model that satisfies the function's usage
class MinimalBertModel(nn.Module):
    def __init__(self, hidden_size=4, num_layers=2):
        super().__init__()
        self.hidden_size = hidden_size
        self.num_layers = num_layers
        self.embedding = nn.Embedding(100, hidden_size)
        self.layers = nn.ModuleList([nn.Linear(hidden_size, hidden_size) for _ in range(num_layers)])
    
    def forward(self, input_ids, attention_mask=None):
        # Returns tuple where [0] is last hidden state and [-1] is all hidden states
        x = self.embedding(input_ids)
        hidden_states = [x]
        for layer in self.layers:
            x = layer(x)
            hidden_states.append(x)
        # Return (last_hidden_state, pooler_output, hidden_states_list)
        return (x, None, hidden_states)
    
    def eval(self):
        super().eval()
        return self

# Build a minimal tokenizer stand-in
class MinimalTokenizer:
    def __init__(self):
        self.pad_token_id = 0
        self.max_len = 512
    
    def encode(self, sent, add_special_tokens=True, max_length=512, add_prefix_space=False):
        # Simple mock: return list of token ids (1-99 range to avoid pad token)
        tokens = [i % 99 + 1 for i in range(len(sent.split()) + 2)]
        return tokens[:max_length]
    
    def convert_ids_to_tokens(self, ids):
        return [f"token_{i}" for i in ids]

# Create model and tokenizer
model = MinimalBertModel(hidden_size=4, num_layers=2)
tokenizer = MinimalTokenizer()

# Create IDF dictionary mapping token ids to idf scores
idf_dict = {i: 0.5 + (i % 10) * 0.01 for i in range(100)}

# Create sample sentences
all_sens = ["hello world", "this is a test"]

ARGS = {
    "all_sens": all_sens,
    "model": model,
    "tokenizer": tokenizer,
    "idf_dict": idf_dict,
    "batch_size": 2,
    "device": "cpu",
    "all_layers": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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_bert_embedding Ran
ran; our contract draft was wrong, not the code
neulab/code-bert-score/code_bert_score/scorer.py
code served (permissive licence) · get_code("1eebdf77ab9a0ecd")
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. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import torch.nn as nn
from transformers import AutoModel, GPT2Tokenizer

torch.manual_seed(0)

# Create a minimal mock model
class MockBertModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(100, 8)
        
    def forward(self, input_ids, attention_mask=None):
        # Returns (last_hidden_state, hidden_states_tuple)
        embeds = self.embedding(input_ids)
        # hidden_states is a tuple of tensors for all layers
        hidden_states = (embeds, embeds, embeds)
        return (embeds, hidden_states)
    
    def eval(self):
        super().eval()
        return self

# Create a minimal mock tokenizer
class MockTokenizer:
    def __init__(self):
        self.model_max_length = 32
        self.pad_token_id = 0
        self.vocab_size = 100
    
    def encode(self, text, add_special_tokens=True, max_length=None, truncation=None):
        # Return simple token ids
        tokens = [1, 2, 3, 4, 5]
        if max_length:
            tokens = tokens[:max_length]
        return tokens
    
    def build_inputs_with_special_tokens(self, tokens):
        return [101] + tokens + [102]

# Setup model, tokenizer, and data
model = MockBertModel()
tokenizer = MockTokenizer()

# Create sample sentences
all_sens = ["hello world", "this is a test"]

# Create idf_dict - mapping token ids to idf scores
idf_dict = {i: 0.5 + i * 0.01 for i in range(100)}

# Parameters for bert_encode
batch_size = 2
device = 'cpu'

ARGS = {
    'all_sens': all_sens,
    'model': model,
    'tokenizer': tokenizer,
    'idf_dict': idf_dict,
    'batch_size': batch_size,
    'device': device,
    'all_layers': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
distutils, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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_bert_embedding Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Tiiiger/bert_score/bert_score/scorer.py
code served (permissive licence) · get_code("779e3927681cb63b")
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. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import torch.nn as nn
from transformers import BertTokenizer, BertModel

torch.manual_seed(0)

# Create a minimal BERT model stand-in
class MinimalBertModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(100, 4)
        self.output_layer = nn.Linear(4, 4)
        
    def forward(self, input_ids, attention_mask=None, output_hidden_states=False):
        # Simulate BERT output
        embeddings = self.embedding(input_ids)
        pooled = self.output_layer(embeddings.mean(dim=1))
        
        if output_hidden_states:
            # Return tuple with hidden states as last element (list of tensors)
            hidden_states = [embeddings, embeddings, embeddings]
            return (embeddings, pooled, hidden_states)
        else:
            # Return tuple with last_hidden_state first
            return (embeddings, pooled)
    
    def eval(self):
        super().eval()
        return self

# Create a minimal tokenizer stand-in
class MinimalTokenizer:
    def __init__(self):
        self.pad_token_id = 0
        self.model_max_length = 512
        self.max_len = 512
    
    def encode(self, sent, add_special_tokens=True, add_prefix_space=False, max_length=512, truncation=False):
        # Return simple token IDs
        tokens = [1] + [i % 99 + 1 for i in range(len(sent.split()))] + [2]
        if truncation and len(tokens) > max_length:
            tokens = tokens[:max_length]
        return tokens
    
    def build_inputs_with_special_tokens(self, tokens):
        return [1] + tokens + [2]

# Create IDF dictionary mapping token IDs to IDF scores
idf_dict = {i: 0.5 + (i % 10) * 0.1 for i in range(100)}

# Create sample sentences
all_sens = ["hello world", "test sentence"]

# Create model and tokenizer
model = MinimalBertModel()
tokenizer = MinimalTokenizer()

ARGS = {
    "all_sens": all_sens,
    "model": model,
    "tokenizer": tokenizer,
    "idf_dict": idf_dict,
    "batch_size": 2,
    "device": "cpu",
    "all_layers": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
packaging, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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_hash Ran
ran; our contract draft was wrong, not the code
neulab/code-bert-score/code_bert_score/scorer.py
code served (permissive licence) · get_code("f982fdf447668cbb")
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
import torch.nn as nn

torch.manual_seed(0)

# The function uses:
# - model: converted to string via .format(), so needs to be something stringifiable
# - num_layers: used in string formatting, so needs to be an int
# - idf: used in a boolean conditional
# - rescale_with_baseline: used in a boolean conditional
# - use_custom_baseline: used in a boolean conditional

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def __repr__(self):
        return "bert-base"

model = SimpleModel()
num_layers = 12
idf = True
rescale_with_baseline = True
use_custom_baseline = False

ARGS = {
    'model': model,
    'num_layers': num_layers,
    'idf': idf,
    'rescale_with_baseline': rescale_with_baseline,
    'use_custom_baseline': use_custom_baseline
}
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_hash Ran
ran; our contract draft was wrong, not the code
Tiiiger/bert_score/bert_score/scorer.py
code served (permissive licence) · get_code("7a9d43b6fa2eafef")
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
import numpy as np
from transformers import __version__ as trans_version

torch.manual_seed(0)

ARGS = {
    'model': 'bert-base-uncased',
    'num_layers': 12,
    'idf': True,
    'rescale_with_baseline': True,
    'use_custom_baseline': False,
    'use_fast_tokenizer': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, transformers — 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_precision_token_alignments Ran
ran; our contract draft was wrong, not the code
danieldeutsch/bert_score_content_analysis/bert_score/utils.py
code served (permissive licence) · get_code("e93b135d3cd1c1ec")
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. 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)

# Construct ref_subwords_list: list of lists of subword tokens
# Each inner list starts with '<s>' and ends with '</s>'
ref_subwords_list = [
    ['<s>', 'Ġhello', 'Ġworld', '</s>'],
    ['<s>', 'Ġgood', 'Ġmorning', '</s>']
]

# Construct hyp_subwords_list: list of lists of subword tokens
hyp_subwords_list = [
    ['<s>', 'Ġhello', 'Ġworld', '</s>'],
    ['<s>', 'Ġgood', 'Ġmorning', '</s>']
]

# indices: shape (batch_size=2, num_tokens=4)
# Contains indices into the reference subwords
indices = torch.tensor([
    [0, 1, 2, 3],
    [0, 1, 2, 3]
], dtype=torch.long)

# masks: shape (batch_size=2, num_tokens=4, max_ref_len=4)
# Boolean mask indicating valid alignments
masks = torch.ones((2, 4, 4), dtype=torch.float32)

# scores: shape (batch_size=2, num_tokens=4)
# Alignment scores
scores = torch.tensor([
    [0.9, 0.8, 0.7, 0.6],
    [0.95, 0.85, 0.75, 0.65]
], dtype=torch.float32)

# token_weights: shape (batch_size=2, num_tokens=4)
# Weights for each token
token_weights = torch.tensor([
    [1.0, 1.0, 1.0, 0.5],
    [1.0, 1.0, 1.0, 0.5]
], dtype=torch.float32)

ARGS = {
    'ref_subwords_list': ref_subwords_list,
    'hyp_subwords_list': hyp_subwords_list,
    'indices': indices,
    'masks': masks,
    'scores': scores,
    'token_weights': token_weights
}
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 tuple — a tuple output has no array shape of its own; none is 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_recall_token_alignments Ran
ran; our contract draft was wrong, not the code
danieldeutsch/bert_score_content_analysis/bert_score/utils.py
code served (permissive licence) · get_code("0dc67c4f397a1eba")
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. 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)

# Build reference and hypothesis subword lists
# Each must start with '<s>' and end with '</s>'
# Tokens start with 'Ġ', special tokens don't
ref_subwords_list = [
    ['<s>', 'Ġhello', 'Ġworld', '</s>'],
    ['<s>', 'Ġfoo', 'Ġbar', '</s>']
]

hyp_subwords_list = [
    ['<s>', 'Ġhe', 'llo', 'Ġworld', '</s>'],
    ['<s>', 'Ġfoo', 'Ġbar', 'Ġbaz', '</s>']
]

# indices: shape (batch_size, num_tokens) - maps hypothesis subword positions
# batch_size=2, num_tokens=4 (max length of hypothesis subwords)
indices = torch.tensor([
    [0, 1, 2, 3],
    [0, 1, 2, 3]
], dtype=torch.long)

# masks: shape (batch_size, num_hypothesis_subwords, num_tokens)
# We need masks[i, j, k] where j indexes hypothesis and k indexes reference
# batch_size=2, num_hypothesis_subwords=5 (max hyp subword length), num_tokens=4
masks = torch.tensor([
    [
        [1.0, 0.0, 0.0, 0.0],
        [1.0, 1.0, 0.0, 0.0],
        [0.0, 1.0, 0.0, 0.0],
        [0.0, 0.0, 1.0, 0.0],
        [0.0, 0.0, 0.0, 0.0]
    ],
    [
        [1.0, 0.0, 0.0, 0.0],
        [0.0, 1.0, 0.0, 0.0],
        [0.0, 0.0, 1.0, 0.0],
        [0.0, 0.0, 0.0, 1.0],
        [0.0, 0.0, 0.0, 0.0]
    ]
], dtype=torch.float)

# scores: shape (batch_size, num_tokens) - alignment scores
scores = torch.tensor([
    [0.9, 0.8, 0.7, 0.6],
    [0.95, 0.85, 0.75, 0.65]
], dtype=torch.float)

# token_weights: shape (batch_size, num_tokens) - weights per token
token_weights = torch.tensor([
    [1.0, 1.0, 1.0, 1.0],
    [1.0, 1.0, 1.0, 1.0]
], dtype=torch.float)

ARGS = {
    'ref_subwords_list': ref_subwords_list,
    'hyp_subwords_list': hyp_subwords_list,
    'indices': indices,
    'masks': masks,
    'scores': scores,
    'token_weights': token_weights
}
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 tuple — a tuple output has no array shape of its own; none is 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_tokenizer Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Tiiiger/bert_score/bert_score/scorer.py
code served (permissive licence) · get_code("0a3852d45d725a39")
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 MagicMock. 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 os
import tempfile
import json
from unittest.mock import patch, MagicMock

# Create a temporary cache folder for testing
temp_cache = tempfile.mkdtemp()

# Create a mock tokenizer that AutoTokenizer.from_pretrained would return
mock_tokenizer = MagicMock()
mock_tokenizer.encode = MagicMock(return_value=[101, 2054, 2003, 102])
mock_tokenizer.decode = MagicMock(return_value="what is")

# Patch AutoTokenizer.from_pretrained to return our mock tokenizer
def mock_from_pretrained(model_type, use_fast=False):
    return mock_tokenizer

# Setup arguments for get_tokenizer function
ARGS = {
    'model_type': 'bert-base-uncased',
    'use_fast': False
}

# Optionally patch the AutoTokenizer if running in isolation
# This ensures the function can execute without network access
try:
    from transformers import AutoTokenizer
    original_from_pretrained = AutoTokenizer.from_pretrained
    AutoTokenizer.from_pretrained = mock_from_pretrained
except ImportError:
    pass
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
packaging, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MagicMock — a MagicMock output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MagicMock output the recorded ndim 1 and dtype family None 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_window_indices Ran
ran, honoured the contract we drafted
neulab/code-bert-score/code_bert_score/scorer.py
code served (permissive licence) · get_code("ea4088dfeb479c9a")
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 2, 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

torch.manual_seed(0)

ARGS = {
    "total_seq_length": 1000,
    "encoder_max_length": 256,
    "chunk_overlap": 0.2
}
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 list, ndim 2, 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
idf_numpy_to_embed Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lovit/ko-BERTScore/KoBERTScore/score.py
pointer only (licence: NONE) · get_code("9ccab64bf97fe100")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lovit/ko-BERTScore 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.

load_idf Ran
ran; our contract draft was wrong, not the code
lovit/ko-BERTScore/KoBERTScore/score.py
pointer only (licence: NONE) · get_code("89c6cff022037bf3")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lovit/ko-BERTScore 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.

map_optional Ran
ran, honoured the contract we drafted
facebookresearch/vizseq/vizseq/scorers/bert_score.py
code served (permissive licence) · get_code("e175c125be8d278b")
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 int, ndim 0, dtype family int, 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 torch.nn as nn

torch.manual_seed(0)

def identity_map(x):
    """Simple mapping function that returns the input"""
    return x

def increment_map(x):
    """Mapping function that increments a number"""
    return x + 1

def tensor_transform(x):
    """Mapping function that transforms a tensor"""
    if isinstance(x, torch.Tensor):
        return x * 2
    return x

# Test case 1: None object with a mapping function
obj1 = None
map_fn1 = identity_map

# Test case 2: Non-None object (integer) with a mapping function
obj2 = 5
map_fn2 = increment_map

# Test case 3: Non-None object (tensor) with a mapping function
obj3 = torch.tensor([1.0, 2.0, 3.0, 4.0])
map_fn3 = tensor_transform

# Test case 4: Non-None object (list) with a mapping function
obj4 = [1, 2, 3]
map_fn4 = lambda x: [i * 2 for i in x]

ARGS = {
    "obj": obj2,
    "map_fn": map_fn2,
}
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 int, ndim 0, dtype family int, 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
map_subword_index_to_token_index Ran
ran; our contract draft was wrong, not the code
danieldeutsch/bert_score_content_analysis/bert_score/utils.py
code served (permissive licence) · get_code("47078bc5a6336435")
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 torch
import numpy as np

ARGS = {
    'subwords': ['<s>', 'Ġhello', 'Ġworld', '</s>']
}
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 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
mark_all_punc_tokens Ran
ran, violated the contract we drafted
neulab/code-bert-score/code_bert_score/scorer.py
code served (permissive licence) · get_code("aaf8f9d22087eb72")
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 Tensor, ndim 1, dtype family float, shape (10,) 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 string

torch.manual_seed(0)

# The function takes a list of tokens (strings) and marks which ones are NOT all punctuation
# (after stripping whitespace tokens). It returns a boolean tensor.

tokens = [
    'hello',
    '.',
    'Ġworld',
    '!!!',
    'Ċtest',
    ',',
    '+-*',
    'Ġ',
    'foo',
    '??'
]

ARGS = {
    'tokens': tokens
}
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 Tensor, ndim 1, dtype family float, shape (10,) — shape (10,) 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
padding Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from yuhui-zh15/nlg_metrics
pointer only; the stored copy get_code serves, from yuhui-zh15/nlg_metrics, is pointer only (licence: NONE) · get_code("13ef8eeae8570519")
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. A run is recorded.

process Ran
ran; our contract draft was wrong, not the code
cyr19/reproducibility/bert_score/scorer.py
pointer only (licence: NONE) · get_code("1d48904fd63d4a59")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cyr19/reproducibility 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.

process Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
neulab/code-bert-score/code_bert_score/scorer.py
code served (permissive licence) · get_code("5a7c2e48dc108411")
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 set. 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
from transformers import GPT2Tokenizer

torch.manual_seed(0)

# Create a minimal tokenizer mock that supports both GPT2Tokenizer and generic tokenizer paths
class MinimalTokenizer:
    def __init__(self):
        self.model_max_length = 512
    
    def encode(self, text, add_special_tokens=True, max_length=None, truncation=None, add_prefix_space=False):
        # Simple mock: return a list of token ids
        return [101, 2054, 2003, 1045, 102]  # Mock token IDs
    
    def build_inputs_with_special_tokens(self, tokens):
        # Mock implementation for empty case
        return [101, 102]  # [CLS] and [SEP] tokens

# Create a GPT2Tokenizer instance for testing the GPT2-specific path
try:
    gpt2_tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
except Exception:
    # If downloading fails, use minimal tokenizer
    gpt2_tokenizer = MinimalTokenizer()

# Test with a generic tokenizer
generic_tokenizer = MinimalTokenizer()

# Construct arguments for the process function
ARGS = {
    "a": "This is a test sentence",
    "tokenizer": generic_tokenizer
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
distutils, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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
process Ran
ran; our contract draft was wrong, not the code
Tiiiger/bert_score/bert_score/scorer.py
code served (permissive licence) · get_code("6fb229c8407fb6c8")
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 set. 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.

from transformers import GPT2Tokenizer, AutoTokenizer

# Create a minimal mock tokenizer that satisfies the function's needs
class MockTokenizer:
    def __init__(self):
        self.model_max_length = 512
        self.max_len = 512
    
    def encode(self, sent, add_special_tokens=True, add_prefix_space=False, max_length=None, truncation=False):
        # Simple mock: return a list of token ids
        tokens = [101] + [i for i in range(1, len(sent) + 1)] + [102]
        if max_length:
            tokens = tokens[:max_length]
        return tokens
    
    def build_inputs_with_special_tokens(self, tokens):
        return [101] + tokens + [102]

# Test with a regular string and a tokenizer
test_string = "Hello world"
mock_tokenizer = MockTokenizer()

ARGS = {
    "a": test_string,
    "tokenizer": mock_tokenizer
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
packaging, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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
rescaling Ran
ran, violated the contract we drafted
lovit/ko-BERTScore/KoBERTScore/score.py
pointer only (licence: NONE) · get_code("2b21ab2f6f331acc")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lovit/ko-BERTScore 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.

sent_encode Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Tiiiger/bert_score/bert_score/scorer.py
code served (permissive licence) · get_code("37d4a40315d05e5e")
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.

from transformers import GPT2Tokenizer, AutoTokenizer
from packaging import version
from transformers import __version__ as trans_version

# Create a simple tokenizer - use GPT2Tokenizer as it's available
# and the function has specific logic for it
try:
    tokenizer = GPT2Tokenizer.from_pretrained('gpt2')
except Exception:
    # Fallback: create a minimal mock tokenizer
    class MockTokenizer:
        def __init__(self):
            self.model_max_length = 512
            self.max_len = 512
            self.vocab_size = 50257
        
        def encode(self, text, add_special_tokens=False, add_prefix_space=False, 
                   max_length=None, truncation=False):
            # Simple mock: return token ids
            return [101, 2054, 2003, 102]  # Mock token IDs
        
        def build_inputs_with_special_tokens(self, token_ids):
            return [101] + token_ids + [102]
    
    tokenizer = MockTokenizer()

# Test sentences
sent_normal = "Hello, this is a test sentence."
sent_empty = ""

ARGS = {
    "tokenizer": tokenizer,
    "sent": sent_normal
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
packaging, transformers — 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
sents_to_tensor Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lovit/ko-BERTScore/KoBERTScore/score.py
pointer only (licence: NONE) · get_code("58daeffb3ffb38df")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lovit/ko-BERTScore 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.

truncate_bert_layers Ran
ran; our contract draft was wrong, not the code
lovit/ko-BERTScore/KoBERTScore/score.py
pointer only (licence: NONE) · get_code("5bf3a9aaa9676734")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lovit/ko-BERTScore 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.

BERTScore Not yet run
unverified (harvested, no recorded run)
lovit/ko-BERTScore/KoBERTScore/score.py
pointer only (licence: NONE) · get_code("573bfd9ac94c99ed")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lovit/ko-BERTScore 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.

BERTScorer Not yet run
unverified (harvested, no recorded run)
cyr19/reproducibility/bert_score/scorer.py
pointer only (licence: NONE) · get_code("0dbd601cded6f834")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cyr19/reproducibility 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.

BERTScorer Not yet run
unverified (harvested, no recorded run)
neulab/code-bert-score/code_bert_score/scorer.py
code served (permissive licence) · get_code("364dacc2df955455")
How it ran

no invocation recorded.

BERTScorer Not yet run
unverified (harvested, no recorded run)
Tiiiger/bert_score/bert_score/scorer.py
code served (permissive licence) · get_code("200a19a9f1229034")
How it ran

no invocation recorded.

_cgroup_cpu_quota Not yet run
unverified (harvested, no recorded run)
facebookresearch/vizseq/vizseq/scorers/bert_score.py
code served (permissive licence) · get_code("2d6d94d1c61edf11")
How it ran

no invocation recorded.

_get_bert_scorer Not yet run
unverified (harvested, no recorded run)
facebookresearch/vizseq/vizseq/scorers/bert_score.py
code served (permissive licence) · get_code("c2dc3fa5dcf4e828")
How it ran

no invocation recorded.

bert_cos_score_idf Not yet run
unverified (harvested, no recorded run)
cyr19/reproducibility/bert_score/scorer.py
pointer only (licence: NONE) · get_code("e2471a1206f6d191")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cyr19/reproducibility 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.

bert_cos_score_idf Not yet run
unverified (harvested, no recorded run)
yuhui-zh15/nlg_metrics/nlg_metrics/bertscore/bert_util.py
pointer only (licence: NONE) · get_code("74c9dc5efff4ab40")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, yuhui-zh15/nlg_metrics 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.

bert_cos_score_idf Not yet run
unverified (harvested, no recorded run)
danieldeutsch/bert_score_content_analysis/bert_score/utils.py
code served (permissive licence) · get_code("c3818aacfecb9596")
How it ran

no invocation recorded.

bert_cos_score_idf Not yet run
unverified (harvested, no recorded run)
neulab/code-bert-score/code_bert_score/scorer.py
code served (permissive licence) · get_code("a6d2976f556bf53f")
How it ran

no invocation recorded.

bert_cos_score_idf Not yet run
unverified (harvested, no recorded run)
Tiiiger/bert_score/bert_score/scorer.py
code served (permissive licence) · get_code("6a5eab3261e5500c")
How it ran

no invocation recorded.

bert_encode Not yet run
unverified (harvested, no recorded run)
danieldeutsch/bert_score_content_analysis/bert_score/utils.py
code served (permissive licence) · get_code("841ac1a3bf04a266")
How it ran

no invocation recorded.

bert_score Not yet run
unverified (harvested, no recorded run)
lovit/ko-BERTScore/KoBERTScore/score.py
pointer only (licence: NONE) · get_code("011256828cf4ffa5")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lovit/ko-BERTScore 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.

cache_scibert Not yet run
unverified (harvested, no recorded run)
neulab/code-bert-score/code_bert_score/scorer.py
code served (permissive licence) · get_code("ffd1e746cb94818e")
How it ran

no invocation recorded.

get_hash Not yet run
unverified (harvested, no recorded run)
cyr19/reproducibility/bert_score/scorer.py
pointer only (licence: NONE) · get_code("c14c6317a3d158ea")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cyr19/reproducibility 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.

get_idf_dict Not yet run
unverified (harvested, no recorded run)
cyr19/reproducibility/bert_score/scorer.py
pointer only (licence: NONE) · get_code("ab46123387327340")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cyr19/reproducibility 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.

Showing the first 60. An agent gets every one from get_harvested_code_for_paper("1904.09675").

Also present in other papers' code

Of 76 samples lifted from this paper's linked repositories, 76 carry a function identity and 0 do not. Of the 69 distinct functions with an identity, 14 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 14 later) and 55 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
padding
brick of this paper's assembly: helper
6 other papers
6 later · 1 only as an assembly brick
1908.05739 (2019-08)
Abductive Commonsense Reasoning
1909.02622 (2019-09)
MoverScore: Text Generation Evaluating with Contextualized Embeddings and Earth Mover Distance
2005.01196 (2020-05)
On the Limitations of Cross-lingual Encoders as Exposed by Reference-Free Machine Translation Evaluation
and 3 more not named here
sent_encode
brick of this paper's assembly: helper
3 other papers
3 later · 1 only as an assembly brick
2202.08479 (2022-02)
On the Evaluation Metrics for Paraphrase Generation
2207.05987 (2022-07)
DocPrompting: GENERATING CODE BY RETRIEVING THE DOCS
2209.13654 (2022-09)
Embarrassingly Easy Document-Level MT Metrics: How to Convert Any Pretrained Metric Into a Document-Level Metric
get_idf_dict
brick of this paper's assembly: helper
2 other papers
2 later · 1 only as an assembly brick
2111.08919 (2021-11)
EMScore: Evaluating Video Captioning via Coarse-Grained and Fine-Grained Embedding Matching
2207.05987 (2022-07)
DocPrompting: GENERATING CODE BY RETRIEVING THE DOCS
get_model
brick of this paper's assembly: helper
2 other papers
2 later
2106.02208 (2021-06)
BERTTune: Fine-Tuning Neural Machine Translation with BERTScore
2202.08479 (2022-02)
On the Evaluation Metrics for Paraphrase Generation
get_model
brick of this paper's assembly: helper
2 other papers
2 later · 1 only as an assembly brick
2207.05987 (2022-07)
DocPrompting: GENERATING CODE BY RETRIEVING THE DOCS
2209.13654 (2022-09)
Embarrassingly Easy Document-Level MT Metrics: How to Convert Any Pretrained Metric Into a Document-Level Metric
bert_cos_score_idf
brick of this paper's assembly: metric
1 other paper
1 later
2207.05987 (2022-07)
DocPrompting: GENERATING CODE BY RETRIEVING THE DOCS
bert_encode
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2207.05987 (2022-07)
DocPrompting: GENERATING CODE BY RETRIEVING THE DOCS
cache_scibert
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2207.05987 (2022-07)
DocPrompting: GENERATING CODE BY RETRIEVING THE DOCS
collate_idf
brick of this paper's assembly: helper
1 other paper
1 later
2207.05987 (2022-07)
DocPrompting: GENERATING CODE BY RETRIEVING THE DOCS
get_bert_embedding
brick of this paper's assembly: helper
1 other paper
1 later
2207.05987 (2022-07)
DocPrompting: GENERATING CODE BY RETRIEVING THE DOCS
get_hash
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2207.05987 (2022-07)
DocPrompting: GENERATING CODE BY RETRIEVING THE DOCS
get_tokenizer
brick of this paper's assembly: helper
1 other paper
1 later
2209.13654 (2022-09)
Embarrassingly Easy Document-Level MT Metrics: How to Convert Any Pretrained Metric Into a Document-Level Metric
greedy_cos_idf
brick of this paper's assembly: metric
1 other paper
1 later · 1 only as an assembly brick
2207.05987 (2022-07)
DocPrompting: GENERATING CODE BY RETRIEVING THE DOCS
process
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2207.05987 (2022-07)
DocPrompting: GENERATING CODE BY RETRIEVING THE DOCS

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

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 propose BERTSCORE, an automatic evaluation metric for text generation. Analogously to common metrics, BERTSCORE computes a similarity score for each token in the candidate sentence with each token in the reference sentence. However, instead of exact matches, we compute token similarity using contextual embeddings. We evaluate using the outputs of 363 machine translation and image captioning systems. BERTSCORE correlates better with human judgments and provides stronger model selection performance than existing metrics. Finally, we use an adversarial paraphrase detection task to show that BERTSCORE is more robust to challenging examples when compared to existing metrics. * Equal contribution. † Work done at Cornell.

For agents

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

get_harvested_code_for_paper("1904.09675")
get_code_for_paper("1904.09675")
have("1904.09675")

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

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

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

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

Connect an agent — have() is free.