SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1911.02257 · 2019

Hierarchical Contextualized Representation for Named Entity Recognition

arXiv · PDF · Open in the Atlas

Code that ran

9 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; 1 failure of our instrument; 0 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/1911.02257.json · badge: /api/ran/1911.02257.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
cslydia/Hire-NER canonical (classifier label)
classifier basis: census
9 ran · 0 no recorded run
FunctionStatusWhere it lives
build_pretrain_embedding Ran
ran on a synthesized input
cslydia/Hire-NER/utils/functions.py
code served (permissive licence) · get_code("73cae25332218360")
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 numpy as np
import sys

class WordAlphabet:
    """Stand-in class for word_alphabet that provides the required methods."""
    def __init__(self, words):
        self.word2idx = {word: idx for idx, word in enumerate(words)}
    
    def size(self):
        return len(self.word2idx)
    
    def iteritems(self):
        return self.word2idx.items()

# Create a small word alphabet with a few words
words = ["hello", "world", "test", "foo"]
word_alphabet = WordAlphabet(words)

# Since embedding_path is checked with "!= None", we pass None to skip file loading
embedding_path = None

# Standard embedding dimension
embedd_dim = 100

# Whether to normalize embeddings
norm = True

ARGS = {
    "embedding_path": embedding_path,
    "word_alphabet": word_alphabet,
    "embedd_dim": embedd_dim,
    "norm": norm
}
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 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
config_file_to_dict Ran
ran on a synthesized input
cslydia/Hire-NER/utils/data.py
code served (permissive licence) · get_code("fa74990a86a30699")
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 config file
temp_dir = tempfile.mkdtemp()
config_file_path = os.path.join(temp_dir, 'test_config.txt')

# Write a valid config file
config_content = """# This is a comment
learning_rate = 0.001
batch_size = 32
feature user_id emb_size=20 emb_norm=True emb_dir=/path/to/emb
feature item_id emb_size=15 emb_norm=False
max_epochs = 100
# Another comment
feature category emb_size=10
dropout = 0.5 # inline comment
"""

with open(config_file_path, 'w') as f:
    f.write(config_content)

ARGS = {
    'input_file': config_file_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_ner_BMES Ran
ran on a synthesized input
cslydia/Hire-NER/utils/metric.py
code served (permissive licence) · get_code("2a699dbbb422f387")
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.

# Analyze the function to understand what it needs
# get_ner_BMES takes label_list as parameter
# label_list is used with: len(), indexing with [i], .upper(), string operations
# It should be a list of strings representing NER labels with B-, E-, S- prefixes

ARGS = {
    "label_list": [
        "B-PER",
        "I-PER", 
        "E-PER",
        "S-LOC",
        "B-ORG",
        "E-ORG"
    ]
}
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_ner_fmeasure Ran
ran on a synthesized input
cslydia/Hire-NER/utils/metric.py
code served (permissive licence) · get_code("83425339a1202f68")
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

# Set seed for reproducibility
torch.manual_seed(0)

# Construct arguments for get_ner_fmeasure
# The function takes:
# - golden_lists: list of lists of golden labels
# - predict_lists: list of lists of predicted labels
# - label_type: string indicating the labeling scheme ('BMES', 'BIOES', or 'BIO')

# Create sample NER label sequences
# Using BMES format: B- (Begin), M- (Middle), E- (End), S- (Single)
golden_lists = [
    ['B-PER', 'E-PER', 'O', 'B-LOC', 'E-LOC'],
    ['S-ORG', 'O', 'B-PER', 'M-PER', 'E-PER', 'O']
]

predict_lists = [
    ['B-PER', 'E-PER', 'O', 'B-LOC', 'E-LOC'],
    ['S-ORG', 'O', 'B-PER', 'E-PER', 'O', 'O']
]

label_type = 'BMES'

ARGS = {
    'golden_lists': golden_lists,
    'predict_lists': predict_lists,
    'label_type': label_type
}
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
log_sum_exp Ran
ran; our contract draft was wrong, not the code
cslydia/Hire-NER/model/crf.py
code served (permissive licence) · get_code("8e960fbb64668568")
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 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 torch

torch.manual_seed(0)

# Construct arguments for log_sum_exp
# Parameters: vec (batch_size, vanishing_dim, hidden_dim), m_size (hidden_dim)

batch_size = 2
vanishing_dim = 3
hidden_dim = 4

# Create a random tensor of shape (batch_size, vanishing_dim, hidden_dim)
vec = torch.randn(batch_size, vanishing_dim, hidden_dim)

# m_size should be the hidden_dim
m_size = hidden_dim

ARGS = {
    "vec": vec,
    "m_size": m_size
}
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 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
normalize_word Ran
ran on a synthesized input
cslydia/Hire-NER/utils/functions.py
code served (permissive licence) · get_code("1b6406aa4e398f9e")
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

torch.manual_seed(0)

# The function normalize_word takes a single parameter 'word' which is a string.
# It iterates through each character in the word, replacing digits with '0' and
# keeping other characters unchanged.

word = "hello123world456"

ARGS = {
    "word": word
}
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 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
read_instance Ran
ran on a synthesized input
cslydia/Hire-NER/utils/functions.py
code served (permissive licence) · get_code("1e7945702a0d75fd")
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 sys
import tempfile
import os

class Alphabet:
    def __init__(self, items=None):
        self.index2word = {}
        self.word2index = {}
        if items is None:
            items = []
        for i, item in enumerate(items):
            self.index2word[i] = item
            self.word2index[item] = i
    
    def get_index(self, word):
        if word in self.word2index:
            return self.word2index[word]
        else:
            idx = len(self.word2index)
            self.word2index[word] = idx
            self.index2word[idx] = word
            return idx

# Create temporary input file for sentence classification
with tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt', encoding='utf8') as f:
    input_file = f.name
    f.write("hello world\tfeature1\tlabel1\n")
    f.write("test sentence\tfeature2\tlabel2\n")

# Create alphabets
word_alphabet = Alphabet(['hello', 'world', 'test', 'sentence', '</unk>'])
char_alphabet = Alphabet(['h', 'e', 'l', 'o', 'w', 'r', 'd', 't', 's', 'n', 'c', '</pad>'])
feature_alphabet_1 = Alphabet(['feature1', 'feature2', '</unk>'])
feature_alphabets = [feature_alphabet_1]
label_alphabet = Alphabet(['label1', 'label2', '</unk>'])

# For non-sentence classification mode
word_mat = {}
for i in range(len(word_alphabet.word2index)):
    word_mat[i] = []
mem_mat = []

ARGS = {
    'input_file': input_file,
    'word_alphabet': word_alphabet,
    'char_alphabet': char_alphabet,
    'feature_alphabets': feature_alphabets,
    'label_alphabet': label_alphabet,
    'number_normalized': True,
    'max_sent_length': 100,
    'sentence_classification': True,
    'split_token': '\t',
    'word_idx': 1,
    'word_mat': word_mat,
    'mem_mat': mem_mat,
    'char_padding_size': 10,
    'char_padding_symbol': '</pad>'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — 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
reverse_style Ran
ran on a synthesized input
cslydia/Hire-NER/utils/metric.py
code served (permissive licence) · get_code("cae186b62c77331c")
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

torch.manual_seed(0)

def reverse_style(input_string):
    target_position = input_string.index('[')
    input_len = len(input_string)
    output_string = input_string[target_position:input_len] + input_string[0:target_position]
    return output_string

ARGS = {
    'input_string': 'hello[world]test'
}
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
str2bool Ran
ran on a synthesized input
cslydia/Hire-NER/utils/data.py
code served (permissive licence) · get_code("89bc3ed968d941b8")
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

ARGS = {
    'string': 'True'
}
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

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, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 1 later) and 4 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
log_sum_exp 10 other papers
4 dated earlier, 6 later
1505.08075 (2015-05)
Transition-Based Dependency Parsing with Stack Long Short-Term Memory
1806.05626 (2018-06)
NCRF++: An Open-source Neural Sequence Labeling Toolkit
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
and 7 more not named here
build_pretrain_embedding 1 other paper
1 dated earlier
1806.05626 (2018-06)
NCRF++: An Open-source Neural Sequence Labeling Toolkit
config_file_to_dict 1 other paper
1 dated earlier
1806.05626 (2018-06)
NCRF++: An Open-source Neural Sequence Labeling Toolkit
normalize_word 1 other paper
1 dated earlier
1806.05626 (2018-06)
NCRF++: An Open-source Neural Sequence Labeling Toolkit
str2bool 1 other paper
1 dated earlier
1806.05626 (2018-06)
NCRF++: An Open-source Neural Sequence Labeling Toolkit

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

Named entity recognition (NER) models are typically based on the architecture of Bi-directional LSTM (BiLSTM). The constraints of sequential nature and the modeling of single input prevent the full utilization of global information from larger scope, not only in the entire sentence, but also in the entire document (dataset). In this paper, we address these two deficiencies and propose a model augmented with hierarchical contextualized representation: sentence-level representation and document-level representation. In sentence-level, we take different contributions of words in a single sentence into consideration to enhance the sentence representation learned from an independent BiLSTM via label embedding attention mechanism. In document-level, the key-value memory network is adopted to record the document-aware information for each unique word which is sensitive to similarity of context information. Our two-level hierarchical contextualized representations are fused with each input token embedding and corresponding hidden state of BiLSTM, respectively. The experimental results on three benchmark NER datasets (CoNLL-2003 and Ontonotes 5.0 English datasets, CoNLL-2002 Spanish dataset) show that we establish new state-of-the-art results.

For agents

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

get_harvested_code_for_paper("1911.02257")
get_code_for_paper("1911.02257")
have("1911.02257")

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

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

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

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

Connect an agent — have() is free.