SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1909.02177 · 2019

NERO: A Neural Rule Grounding Framework for Label-Efficient Relation Extraction

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 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 8 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-21; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1909.02177.json · badge: /api/ran/1909.02177.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
INK-USC/NERO canonical (classifier label)
classifier basis: census
8 ran · 1 no recorded run
FunctionStatusWhere it lives
dropout Ran
ran on a synthesized input
INK-USC/NERO/func.py
code served (permissive licence) · get_code("c52cf85f1e861534")
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 EagerTensor, ndim 3, 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 tensorflow as tf
import numpy as np

# Create a 3D tensor for testing (batch_size=2, sequence_length=5, embedding_dim=4)
args_tensor = tf.constant(np.random.randn(2, 5, 4).astype(np.float32))

# Create a boolean tensor for is_train
is_train_tensor = tf.constant(True)

# Define ARGS dict with all parameters
ARGS = {
    'args': args_tensor,
    'keep_prob': 0.8,
    'is_train': is_train_tensor,
    'mode': 'embedding'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 3, dtype family float — no output shape is stated: observe_signature.py recorded SymbolicTensor ndim 3, which disagrees with the fixture run
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_counter Ran
ran on a synthesized input
INK-USC/NERO/semeval_loader.py
code served (permissive licence) · get_code("e0fda705693704b0")
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 Counter. 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 collections import Counter

# Construct valid arguments for get_counter
# The function expects:
# - data: an iterable of dicts, each containing a 'tokens' key with an iterable of tokens

data = [
    {'tokens': ['hello', 'world', 'hello']},
    {'tokens': ['foo', 'bar', 'hello']},
    {'tokens': ['world', 'foo']}
]

ARGS = {
    'data': data
}
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 Counter — a Counter output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Counter 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_counter Ran
ran on a synthesized input
INK-USC/NERO/tacred_loader.py
code served (permissive licence) · get_code("6e3512dcf6e0a4a2")
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 Counter. 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 collections import Counter

torch.manual_seed(0)

# The function iterates over `data`, where each element d has a 'token' key
# containing an iterable of tokens. Each token is counted.

# Create sample data with the required structure
data = [
    {'token': ['hello', 'world', 'hello']},
    {'token': ['foo', 'bar', 'world']},
    {'token': ['hello', 'baz']},
]

ARGS = {
    'data': data
}
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 Counter — a Counter output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Counter 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_mask Ran
ran on a synthesized input
INK-USC/NERO/util.py
code served (permissive licence) · get_code("c29b35b48ef286c2")
How it ran

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

import torch
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - start: int, used in list slicing
# - end: int, used in list slicing and arithmetic
# - length: int, used in list slicing and arithmetic
# - pad: optional int or None, used in conditional and range

# The function creates a mask list with:
# - 'start' zeros
# - (end - start + 1) ones
# - (length - end - 1) zeros
# - optionally pads with zeros to reach 'pad' length

# Valid example: start=2, end=5, length=10
# This creates: [0,0,1,1,1,1,0,0,0] (9 elements)
# With pad=12: [0,0,1,1,1,1,0,0,0,0,0,0]

ARGS = {
    "start": 2,
    "end": 5,
    "length": 10,
    "pad": 12
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_pos Ran
ran on a synthesized input
INK-USC/NERO/util.py
code served (permissive licence) · get_code("0a1db6c62bc1e9d8")
How it ran

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

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function get_pos(start, end, length, pad=None):
# - start: int, used in range(-start, 0)
# - end: int, used in range operations and comparisons
# - length: int, used in range(length - end - 1)
# - pad: optional int, used to pad the result list

# Create simple integer arguments
start = 3
end = 5
length = 12
pad = 20

ARGS = {
    "start": start,
    "end": end,
    "length": length,
    "pad": pad
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_word Ran
ran on a synthesized input
INK-USC/NERO/util.py
code served (permissive licence) · get_code("fe6da28d025d5e3b")
How it ran

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

import torch

torch.manual_seed(0)

# Construct arguments for get_word function
tokens = ["Hello", "WORLD", "python", "Test"]
word2idx_dict = {
    "hello": 1,
    "world": 2,
    "python": 3,
    "test": 4,
    "Hello": 5,
    "WORLD": 6,
    "Python": 7,
    "Test": 8,
}
pad = 6

ARGS = {
    "tokens": tokens,
    "word2idx_dict": word2idx_dict,
    "pad": pad,
}
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 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
read_glove Ran
ran on a synthesized input
INK-USC/NERO/semeval_loader.py
code served (permissive licence) · get_code("3b2bddb9be1e2548")
How it ran

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

import tempfile
import os

# Create a temporary GloVe-format file for testing
temp_dir = tempfile.mkdtemp()
glove_path = os.path.join(temp_dir, "glove.txt")

# Write sample GloVe data with dimension 3
with open(glove_path, 'w', encoding='utf-8') as f:
    f.write("apple 0.1 0.2 0.3\n")
    f.write("banana 0.4 0.5 0.6\n")
    f.write("cherry 0.7 0.8 0.9\n")
    f.write("date 0.11 0.12 0.13\n")
    f.write("elderberry 0.14 0.15 0.16\n")

# Create a counter dict with some of the words
counter = {
    "apple": 10,
    "banana": 5,
    "cherry": 3,
}

# Parameters for the function
path = glove_path
size = 5  # number of lines in the file
dim = 3   # embedding dimension

ARGS = {
    "path": path,
    "counter": counter,
    "size": size,
    "dim": dim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tqdm — 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
softmax_mask Ran
ran on a synthesized input
INK-USC/NERO/func.py
code served (permissive licence) · get_code("64e4e52164703171")
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 EagerTensor, ndim 2, dtype family float, shape (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 tensorflow as tf
import numpy as np

INF = 1e+30

# Create sample tensors for testing softmax_mask
# val: a float tensor that will have softmax applied
# mask: a boolean/binary tensor indicating which positions are valid

# Create val tensor with shape (2, 4) - batch_size=2, features=4
val = tf.constant([
    [1.0, 2.0, 3.0, 4.0],
    [5.0, 6.0, 7.0, 8.0]
], dtype=tf.float32)

# Create mask tensor with shape (2, 4) - same spatial dims as val
mask = tf.constant([
    [1, 1, 0, 1],
    [1, 0, 1, 1]
], dtype=tf.int32)

ARGS = {
    "val": val,
    "mask": mask
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (2, 4) — shape (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
dense Not yet run
unverified (harvested, no recorded run)
INK-USC/NERO/func.py
code served (permissive licence) · get_code("aecd65a13632edca")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 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.

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

Repositories linked to this paper

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

Abstract

Deep neural models for relation extraction tend to be less reliable when perfectly labeled data is limited, despite their success in label-sufficient scenarios. Instead of seeking more instance-level labels from human annotators, here we propose to annotate frequent surface patterns to form labeling rules. These rules can be automatically mined from large text corpora and generalized via a soft rule matching mechanism. Prior works use labeling rules in an exact matching fashion, which inherently limits the coverage of sentence matching and results in the low-recall issue. In this paper, we present a neural approach to ground rules for RE, named NERO, which jointly learns a relation extraction module and a soft matching module. One can employ any neural relation extraction models as the instantiation for the RE module. The soft matching module learns to match rules with semantically similar sentences such that raw corpora can be automatically labeled and leveraged by the RE module (in a much better coverage) as augmented supervision, in addition to the exactly matched sentences. Extensive experiments and analysis on two public and widely-used datasets demonstrate the effectiveness of the proposed NERO framework, comparing with both rule-based and semi-supervised methods. Through user studies, we find that the time efficiency for a human to annotate rules and sentences are similar (0.30 vs. 0.35 min per label). In particular, NERO's performance using 270 rules is comparable to the models trained using 3,000 labeled sentences, yielding a 9.5x speedup. Moreover, NERO can predict for unseen relations at test time and provide interpretable predictions. We release our code to the community for future research.

For agents

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

get_harvested_code_for_paper("1909.02177")
get_code_for_paper("1909.02177")
have("1909.02177")

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

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

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

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

Connect an agent — have() is free.