SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.15509 · 2020

BOND: BERT-Assisted Open-Domain Named Entity Recognition with Distant Supervision

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 failures of our instrument; 1 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/2006.15509.json · badge: /api/ran/2006.15509.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
cliang1453/BOND canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
FunctionStatusWhere it lives
convert_examples_to_features Ran
ran on a synthesized input
cliang1453/BOND/data_utils.py
code served (permissive licence) · get_code("dd9c936ca51e4d8e")
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 float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import logging

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

class SimpleTokenizer:
    """Minimal tokenizer stand-in"""
    def tokenize(self, word):
        # Split into character-level tokens, but keep it simple
        if word.lower() in ['[cls]', '[sep]', '[pad]']:
            return [word]
        # Simple: return word as-is or split into subword tokens
        return [word] if word else []
    
    def convert_tokens_to_ids(self, tokens):
        # Simple mapping: each token gets a unique ID
        token_to_id = {
            '[cls]': 101,
            '[sep]': 102,
            '[pad]': 0,
            'word': 1000,
            'hello': 1001,
            'world': 1002,
            'test': 1003,
        }
        return [token_to_id.get(t, hash(t) % 10000 + 103) for t in tokens]

class Example:
    """Minimal example class"""
    def __init__(self, words, labels, hp_labels):
        self.words = words
        self.labels = labels
        self.hp_labels = hp_labels

# Create minimal examples
examples = [
    Example(
        words=['hello', 'world'],
        labels=[0, 1],
        hp_labels=[0, None]
    ),
    Example(
        words=['test', 'word'],
        labels=[1, 0],
        hp_labels=[None, 1]
    ),
]

# Label list
label_list = [0, 1]

# Tokenizer
tokenizer = SimpleTokenizer()

# Arguments dictionary
ARGS = {
    'examples': examples,
    'label_list': label_list,
    'max_seq_length': 16,
    'tokenizer': tokenizer,
    'cls_token_at_end': False,
    'cls_token': '[CLS]',
    'cls_token_segment_id': 0,
    'sep_token': '[SEP]',
    'sep_token_extra': False,
    'pad_on_left': False,
    'pad_token': 0,
    'pad_token_segment_id': 0,
    'pad_token_label_id': -100,
    'sequence_a_segment_id': 0,
    'mask_padding_with_zero': True,
    'show_exnum': -1,
}
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 list, ndim 1, dtype family float — 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
get_mt_loss Ran
ran on a synthesized input
cliang1453/BOND/model_utils.py
code served (permissive licence) · get_code("19284e3c5602b606")
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 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensor arguments
# s_logits and t_logits should be tensors with shape (batch, num_classes)
# Using batch=2, num_classes=4
s_logits = torch.randn(2, 4)
t_logits = torch.randn(2, 4)

# class_name can be None, 'prob', 'logit', 'smart', 'kl', or 'distill'
class_name = 'kl'

# _lambda is a scaling factor
_lambda = 0.5

ARGS = {
    's_logits': s_logits,
    't_logits': t_logits,
    'class_name': class_name,
    '_lambda': _lambda,
}
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 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
multi_source_label_refine Ran
ran on a synthesized input
cliang1453/BOND/model_utils.py
code served (permissive licence) · get_code("ab995422bbf03b78")
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
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal args object with all required attributes
class Args:
    def __init__(self):
        self.self_training_label_mode = 'hard'  # or 'soft'
        self.self_training_hp_label = 0

args = Args()

# Batch size: 2, sequence length: 3, num_labels: 4
batch_size = 2
seq_length = 3
num_labels = 4

pad_token_label_id = 0

# Create tensors with distinct sizes to probe dimensions
# hp_labels: shape (batch=2, seq=3)
hp_labels = torch.randint(0, num_labels, (batch_size, seq_length))

# combined_labels: shape (batch=2, seq=3)
combined_labels = torch.randint(0, num_labels, (batch_size, seq_length))

# pred_labels: shape (batch=2, seq=3) for hard mode or (batch=2, seq=3, num_labels=4) for soft mode
pred_labels = torch.randint(0, num_labels, (batch_size, seq_length))

# pred_logits: shape (batch=2, seq=3, num_labels=4) - logits over labels
pred_logits = torch.randn(batch_size, seq_length, num_labels)

ARGS = {
    'args': args,
    'hp_labels': hp_labels,
    'combined_labels': combined_labels,
    'pred_labels': pred_labels,
    'pad_token_label_id': pad_token_label_id,
    'pred_logits': pred_logits
}
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
read_examples_from_file Ran
ran on a synthesized input
cliang1453/BOND/data_utils.py
code served (permissive licence) · get_code("60c21b1d7e85c1a3")
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 float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import json
import tempfile

class InputExample(object):
    """A single training/test example for token classification."""

    def __init__(self, guid, words, labels, hp_labels):
        """Constructs a InputExample.

        Args:
            guid: Unique id for the example.
            words: list. The words of the sequence.
            labels: (Optional) list. The labels for each word of the sequence. This should be
            specified for train and dev examples, but not for test examples.
        """
        self.guid = guid
        self.words = words
        self.labels = labels
        self.hp_labels = hp_labels

def read_examples_from_file(data_dir, mode):
    file_path = os.path.join(data_dir, '{}.json'.format(mode))
    guid_index = 1
    examples = []
    with open(file_path, 'r') as f:
        data = json.load(f)
        for item in data:
            words = item['str_words']
            labels = item['tags']
            if 'tags_hp' in item:
                hp_labels = item['tags_hp']
            else:
                hp_labels = [None] * len(labels)
            examples.append(InputExample(guid='%s-%d' % (mode, guid_index), words=words, labels=labels, hp_labels=hp_labels))
            guid_index += 1
    return examples

# Create temporary directory and JSON file
temp_dir = tempfile.mkdtemp()
mode = "train"

# Create sample data
sample_data = [
    {
        "str_words": ["The", "cat", "sat"],
        "tags": ["DET", "NOUN", "VERB"],
        "tags_hp": ["O", "B-ANIMAL", "O"]
    },
    {
        "str_words": ["on", "the", "mat"],
        "tags": ["PREP", "DET", "NOUN"]
    }
]

# Write JSON file
json_path = os.path.join(temp_dir, f"{mode}.json")
with open(json_path, 'w') as f:
    json.dump(sample_data, f)

ARGS = {
    "data_dir": temp_dir,
    "mode": mode
}
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 list, ndim 1, dtype family float — 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
soft_frequency Ran
ran on a synthesized input
cliang1453/BOND/model_utils.py
code served (permissive licence) · get_code("e2b46b23a02fcc83")
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, 2, 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

torch.manual_seed(0)

# Create a small logits tensor with shape (batch=2, sequence=2, classes=4)
# The function expects logits with shape where last dimension is number of classes
# It reshapes to (-1, logits.shape[-1]) and then back, so we need 3D input
logits = torch.randn(2, 2, 4)

ARGS = {
    "logits": logits,
    "power": 2,
    "probs": False,
}
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 3, dtype family float, shape (2, 2, 4) — shape (2, 2, 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
load_and_cache_examples Not yet run
unverified (harvested, no recorded run)
cliang1453/BOND/data_utils.py
code served (permissive licence) · get_code("d44194ff2ec0a210")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 5 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 5 later) and 1 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
get_mt_loss 2 other papers
2 later
2022.emnlp-main.417 (2022 (year only))
Simple Questions Generate Named Entity Recognition Datasets
2301.03726 (2023-01)
Neighborhood-Regularized Self-Training for Learning with Few Labels
convert_examples_to_features 1 other paper
1 later
2022.emnlp-main.417 (2022 (year only))
Simple Questions Generate Named Entity Recognition Datasets
multi_source_label_refine 1 other paper
1 later
2022.emnlp-main.417 (2022 (year only))
Simple Questions Generate Named Entity Recognition Datasets
read_examples_from_file 1 other paper
1 later
2022.emnlp-main.417 (2022 (year only))
Simple Questions Generate Named Entity Recognition Datasets
soft_frequency 1 other paper
1 later
2022.emnlp-main.417 (2022 (year only))
Simple Questions Generate Named Entity Recognition Datasets

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 study the open-domain named entity recognition (NER) problem under distant supervision. The distant supervision, though does not require large amounts of manual annotations, yields highly incomplete and noisy distant labels via external knowledge bases. To address this challenge, we propose a new computational framework -- BOND, which leverages the power of pre-trained language models (e.g., BERT and RoBERTa) to improve the prediction performance of NER models. Specifically, we propose a two-stage training algorithm: In the first stage, we adapt the pre-trained language model to the NER tasks using the distant labels, which can significantly improve the recall and precision; In the second stage, we drop the distant labels, and propose a self-training approach to further improve the model performance. Thorough experiments on 5 benchmark datasets demonstrate the superiority of BOND over existing distantly supervised NER methods. The code and distantly labeled data have been released in https://github.com/cliang1453/BOND.

For agents

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

get_harvested_code_for_paper("2006.15509")
get_code_for_paper("2006.15509")
have("2006.15509")

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

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

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

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

Connect an agent — have() is free.