SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2005.01634 · ACL · 2020

Code and Named Entity Recognition in StackOverflow

Wei Xu, Alan Ritter, Mounica Maddela, Jeniya Tabassum

arXiv · PDF · Open in the Atlas

Code that ran

9 of 13 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; 3 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 2 failures of our instrument; 4 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/2005.01634.json · badge: /api/ran/2005.01634.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
jeniyat/StackOverflowNER canonical (classifier label)
classifier basis: census
7 ran · 2 no recorded run
taidnguyen/software_entity_recognition community
Papers with Code archive
2 ran · 2 no recorded run
FunctionStatusWhere it lives
argmax Ran
ran, honoured the contract we drafted
jeniyat/StackOverflowNER/code/Attentive_BiLSTM/model.py
code served (permissive licence) · get_code("d38f06bbd9f9c98c")
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

torch.manual_seed(0)

# The argmax function takes a vec parameter and calls torch.max(vec, 1)
# torch.max along dimension 1 requires a 2D tensor with at least 2 columns
# Let's create a small batch of vectors (batch_size=2, features=4)
vec = torch.randn(2, 4)

ARGS = {
    "vec": vec
}
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
calcMetrics Ran
ran on a synthesized input
jeniyat/StackOverflowNER/code/Attentive_BiLSTM/conlleval_py.py
code served (permissive licence) · get_code("82ddeedc1532be36")
How it ran

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

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - TP: used in division (TP / P) and (TP / T), so numeric
# - P: used in division (TP / P) and checked for truthiness, so numeric
# - T: used in division (TP / T) and checked for truthiness, so numeric
# - percent: boolean flag for conditional return

# Create valid numeric arguments
TP = 85  # True Positives
P = 100  # Predicted positives
T = 95   # True positives in ground truth

ARGS = {
    "TP": TP,
    "P": P,
    "T": T,
    "percent": True
}
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 tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
endOfChunk Ran
ran on a synthesized input
jeniyat/StackOverflowNER/code/Attentive_BiLSTM/conlleval_py.py
code served (permissive licence) · get_code("5d56e08fc935df9b")
How it ran

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

import torch
import torch.nn as nn

# The function endOfChunk takes 4 string parameters that represent
# chunk tags and types in sequence labeling (e.g., NER tagging)
# It checks if a chunk boundary occurs between previous and current words

# Valid chunk tags include: 'B', 'I', 'O', 'E', '[', ']', '.'
# Types would be entity types like 'PER', 'ORG', 'LOC', etc.

ARGS = {
    'prevTag': 'B',
    'tag': 'O',
    'prevType': 'PER',
    'type_': 'PER'
}
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 bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
gaussian Ran
ran on a synthesized input
jeniyat/StackOverflowNER/code/Attentive_BiLSTM/gaussian_binner.py
code served (permissive licence) · get_code("43cd754556c221e1")
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 ndarray, ndim 1, dtype family float, shape (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 numpy as np

# The gaussian function takes two parameters:
# diff: a difference value (likely a scalar or array)
# sig: a sigma/standard deviation value (likely a scalar)

# Looking at the function body:
# - diff is used in np.power(diff, 2.0), so it should be numeric
# - sig is used in arithmetic (2 * sig * sig), so it should be numeric
# - np.exp is called on the result

# Create simple numeric arguments
diff = np.array([0.5, 1.0, 1.5, 2.0])
sig = 0.8

ARGS = {
    "diff": diff,
    "sig": sig,
}
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 ndarray, ndim 1, dtype family float, shape (4,) — shape (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
get_labels Ran
ran; our contract draft was wrong, not the code
taidnguyen/software_entity_recognition/src/model_nll.py
code served (permissive licence) · get_code("8d492584c2bb879a")
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 tempfile
import os

# Create a temporary labels file
temp_dir = tempfile.mkdtemp()
labels_file = os.path.join(temp_dir, 'labels.txt')

with open(labels_file, 'w') as f:
    f.write('PER\n')
    f.write('ORG\n')
    f.write('LOC\n')

ARGS = {
    'path': labels_file
}
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
kl_div Ran
ran; our contract draft was wrong, not the code
taidnguyen/software_entity_recognition/src/model_nll.py
code served (permissive licence) · get_code("978e6ebd9602e13a")
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 (2,) 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)

# The function kl_div takes two probability distributions p and q
# It computes KL divergence: sum of p * (log(p) - log(q)) along the last dimension
# Both p and q should be tensors with probability distributions

# Create two small probability distribution tensors
# Shape: (2, 4) - batch size 2, dimension 4
p = torch.tensor([
    [0.4, 0.3, 0.2, 0.1],
    [0.25, 0.25, 0.25, 0.25]
], dtype=torch.float32)

q = torch.tensor([
    [0.3, 0.3, 0.2, 0.2],
    [0.2, 0.3, 0.3, 0.2]
], dtype=torch.float32)

ARGS = {
    "p": p,
    "q": q
}
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 (2,) — shape (2,) 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
prepare_sequence Ran
ran, honoured the contract we drafted
jeniyat/StackOverflowNER/code/Attentive_BiLSTM/model.py
code served (permissive licence) · get_code("66f180f39c43eeb5")
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 int, shape (3,) 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
from torch.autograd import Variable

torch.manual_seed(0)

# Define a small sequence of words
seq = ["hello", "world", "foo"]

# Define a word-to-index mapping dictionary
to_ix = {
    "hello": 0,
    "world": 1,
    "foo": 2,
    "bar": 3
}

ARGS = {
    "seq": seq,
    "to_ix": to_ix
}
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 int, shape (3,) — shape (3,) 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
startOfChunk Ran
ran on a synthesized input
jeniyat/StackOverflowNER/code/Attentive_BiLSTM/conlleval_py.py
code served (permissive licence) · get_code("dacaea8c1a2f5f82")
How it ran

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

import torch

torch.manual_seed(0)

# The function takes 4 string parameters: prevTag, tag, prevType, type_
# It compares them for chunk boundary detection in sequence labeling
# All parameters are used as string comparisons

ARGS = {
    'prevTag': 'B',
    'tag': 'I',
    'prevType': 'PER',
    'type_': 'ORG'
}
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 bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
to_scalar Ran
ran, honoured the contract we drafted
jeniyat/StackOverflowNER/code/Attentive_BiLSTM/model.py
code served (permissive licence) · get_code("ac476e734740149f")
How it ran

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

import torch

torch.manual_seed(0)

# The function to_scalar takes a tensor 'var', reshapes it to 1D,
# accesses its data, and converts to a list, returning the first element.
# We need to provide a tensor that supports .view(), .data, and .tolist()

var = torch.tensor([[1.5, 2.3, 3.1, 4.2], [5.6, 6.7, 7.8, 8.9]])

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

no invocation recorded.

NLLModel Not yet run
unverified (harvested, no recorded run)
taidnguyen/software_entity_recognition/src/model_nll.py
code served (permissive licence) · get_code("95421f07c3753c59")
How it ran

no invocation recorded.

save_char_embed Not yet run
unverified (harvested, no recorded run)
jeniyat/StackOverflowNER/code/Attentive_BiLSTM/train_so.py
code served (permissive licence) · get_code("c9fe7ba81ee0b5b0")
How it ran

no invocation recorded.

unicodeToAscii Not yet run
unverified (harvested, no recorded run)
jeniyat/StackOverflowNER/code/Attentive_BiLSTM/loader_so.py
code served (permissive licence) · get_code("13c5cea0c71aab3f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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
argmax 1 other paper
1 dated earlier
1808.09075 (2018-08)
Evaluating the Utility of Hand-crafted Features in Sequence Labelling
prepare_sequence 1 other paper
1 dated earlier
1808.09075 (2018-08)
Evaluating the Utility of Hand-crafted Features in Sequence Labelling
to_scalar 1 other paper
1 dated earlier
1808.09075 (2018-08)
Evaluating the Utility of Hand-crafted Features in Sequence Labelling

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

There is an increasing interest in studying natural language and computer code together, as large corpora of programming texts become readily available on the Internet. For example, StackOverflow currently has over 15 million programming related questions written by 8.5 million users. Meanwhile, there is still a lack of fundamental NLP techniques for identifying code tokens or software-related named entities that appear within natural language sentences. In this paper, we introduce a new named entity recognition (NER) corpus for the computer programming domain, consisting of 15,372 sentences annotated with 20 fine-grained entity types. We trained indomain BERT representations (BERTOverflow) on 152 million sentences from Stack-Overflow, which lead to an absolute increase of +10 F 1 score over off-the-shelf BERT. We also present the SoftNER model which achieves an overall 79.10 F 1 score for code and named entity recognition on StackOverflow data. Our SoftNER model incorporates a context-independent code token classifier with corpus-level features to improve the BERTbased tagging model. 1

For agents

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

get_harvested_code_for_paper("2005.01634")
get_code_for_paper("2005.01634")
have("2005.01634")

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

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

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

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

Connect an agent — have() is free.