SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2205.15485 · 2022

FinBERT-MRC: financial named entity recognition using BERT under the machine reading comprehension paradigm

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 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 6 have no contract verdict; 1 failure of our instrument; 3 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/2205.15485.json · badge: /api/ran/2205.15485.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
zyz0000/finbert-mrc canonical (classifier label)
classifier basis not recorded on the link
7 ran · 3 no recorded run
FunctionStatusWhere it lives
calculate_metric Ran
ran on a synthesized input
zyz0000/finbert-mrc/utils/evaluator.py
code served (permissive licence) · get_code("6f736eb737268aa4")
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 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 numpy as np

# Analyze the function:
# - gt: iterable of entities, each entity has indexable elements [0] and [1]
# - predict: iterable of entities, each entity has indexable elements [0] and [1]
# The function compares entities by their first two elements

# Create ground truth entities as tuples or lists
# Each entity is represented as [label, position]
gt = [
    [1, 10],
    [2, 20],
    [3, 30],
]

# Create predicted entities
# Mix of correct and incorrect predictions
predict = [
    [1, 10],    # matches gt[0] - will increment tp
    [2, 20],    # matches gt[1] - will increment tp
    [4, 40],    # doesn't match any gt - will increment fp
    [5, 50],    # doesn't match any gt - will increment fp
]

ARGS = {
    "gt": gt,
    "predict": predict,
}
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 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
fine_grade_tokenize Ran
ran on a synthesized input
zyz0000/finbert-mrc/preprocess/processor.py
code served (permissive licence) · get_code("4025a3277a3b1d8b")
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 torch
from transformers import BertTokenizer

# Create a minimal stand-in tokenizer that mimics BertTokenizer behavior
class MinimalTokenizer:
    def tokenize(self, text):
        """
        Mimics BertTokenizer.tokenize() behavior.
        Returns a list of tokens. Empty for invalid characters.
        """
        if text in [' ', '\t', '\n']:
            return []
        elif text in ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 
                      'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
                      'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
                      'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
                      '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
                      '.', ',', '!', '?', '-', '(', ')']:
            return [text]
        else:
            # Invalid characters return empty list
            return []

# Test inputs
raw_text = "Hello world!"
tokenizer = MinimalTokenizer()

ARGS = {
    "raw_text": raw_text,
    "tokenizer": tokenizer
}
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 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_model_path_list Ran
ran on a synthesized input
zyz0000/finbert-mrc/utils/functions_utils.py
code served (permissive licence) · get_code("3c3ae0b8b37e17c7")
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 tempfile
import shutil

# Create a temporary directory structure with model.pt files
temp_dir = tempfile.mkdtemp()

# Create nested directory structure that matches the expected format:
# base_dir/category/epoch-N/model.pt
os.makedirs(os.path.join(temp_dir, 'category_a', 'epoch-1'), exist_ok=True)
os.makedirs(os.path.join(temp_dir, 'category_a', 'epoch-2'), exist_ok=True)
os.makedirs(os.path.join(temp_dir, 'category_b', 'epoch-1'), exist_ok=True)

# Create model.pt files
with open(os.path.join(temp_dir, 'category_a', 'epoch-1', 'model.pt'), 'w') as f:
    f.write('dummy')
with open(os.path.join(temp_dir, 'category_a', 'epoch-2', 'model.pt'), 'w') as f:
    f.write('dummy')
with open(os.path.join(temp_dir, 'category_b', 'epoch-1', 'model.pt'), 'w') as f:
    f.write('dummy')

ARGS = {
    'base_dir': temp_dir
}
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_p_r_f Ran
ran on a synthesized input
zyz0000/finbert-mrc/utils/evaluator.py
code served (permissive licence) · get_code("08830f799e4586d7")
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 (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 numpy as np

# Analyze the function: get_p_r_f takes three numeric parameters (tp, fp, fn)
# and performs arithmetic operations on them, returning a numpy array.
# The parameters represent true positives, false positives, and false negatives.

# Create simple numeric values for testing
tp = 10  # true positives
fp = 2   # false positives
fn = 3   # false negatives

ARGS = {
    'tp': tp,
    'fp': fp,
    'fn': fn
}
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 (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
get_time_dif Ran
ran; our contract draft was wrong, not the code
zyz0000/finbert-mrc/utils/functions_utils.py
code served (permissive licence) · get_code("70c3fe86405eead9")
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 timedelta. 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 time

ARGS = {
    'start_time': time.time() - 5.5
}
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 timedelta — a timedelta output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a timedelta 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
load_model_and_parallel Ran
ran on a synthesized input
zyz0000/finbert-mrc/utils/functions_utils.py
code served (permissive licence) · get_code("2296a33d62672e9d")
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. 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 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 torch.nn as nn
import logging

torch.manual_seed(0)
logging.basicConfig(level=logging.INFO)

# Create a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create a stand-in options class
class Options:
    def __init__(self):
        self.gpu_ids = '-1'  # CPU mode
        self.local_rank = 0

# Instantiate the components
opt = Options()
model = SimpleModel()
ckpt_path = None

ARGS = {
    'opt': opt,
    'model': model,
    'ckpt_path': ckpt_path,
    'strict': 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 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
mrc_decode Ran
ran on a synthesized input
zyz0000/finbert-mrc/utils/evaluator.py
code served (permissive licence) · get_code("8e454f802e6e7724")
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. 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

# Create sample logits with shape (batch_size, seq_length)
# batch_size=2, seq_length=5
start_logits = np.array([
    [0.1, 0.9, 0.2, 0.3, 0.4],
    [0.2, 0.3, 0.8, 0.1, 0.5]
], dtype=np.float32)

end_logits = np.array([
    [0.1, 0.2, 0.9, 0.3, 0.4],
    [0.2, 0.8, 0.3, 0.1, 0.5]
], dtype=np.float32)

# Create raw_text as a list where indices map to tokens
raw_text = ['[CLS]', 'hello', 'world', 'test', '[SEP]']

ARGS = {
    'start_logits': start_logits,
    'end_logits': end_logits,
    'raw_text': raw_text
}
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 list — a list 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
build_model Not yet run
unverified (harvested, no recorded run)
zyz0000/finbert-mrc/utils/model_utils.py
code served (permissive licence) · get_code("a259cb4122adab4b")
How it ran

no invocation recorded.

cut_sentences_v1 Not yet run
unverified (harvested, no recorded run)
zyz0000/finbert-mrc/preprocess/processor.py
code served (permissive licence) · get_code("3b7516851200edac")
How it ran

no invocation recorded.

cut_sentences_v2 Not yet run
unverified (harvested, no recorded run)
zyz0000/finbert-mrc/preprocess/processor.py
code served (permissive licence) · get_code("a707dabccba1c68b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 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.

FunctionAlso present inEarliest-datedOthers named
get_time_dif 3 other papers
3 dated earlier
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1509.01626 (2015-09)
Character-level Convolutional Networks for Text Classification *
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding

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

Financial named entity recognition (FinNER) from literature is a challenging task in the field of financial text information extraction, which aims to extract a large amount of financial knowledge from unstructured texts. It is widely accepted to use sequence tagging frameworks to implement FinNER tasks. However, such sequence tagging models cannot fully take advantage of the semantic information in the texts. Instead, we formulate the FinNER task as a machine reading comprehension (MRC) problem and propose a new model termed FinBERT-MRC. This formulation introduces significant prior information by utilizing well-designed queries, and extracts start index and end index of target entities without decoding modules such as conditional random fields (CRF). We conduct experiments on a publicly available Chinese financial dataset ChFinAnn and a real-word bussiness dataset AdminPunish. FinBERT-MRC model achieves average F1 scores of 92.78% and 96.80% on the two datasets, respectively, with average F1 gains +3.94% and +0.89% over some sequence tagging models including BiLSTM-CRF, BERT-Tagger, and BERT-CRF. The source code is available at https://github.com/zyz0000/FinBERT-MRC.

For agents

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

get_harvested_code_for_paper("2205.15485")
get_code_for_paper("2205.15485")
have("2205.15485")

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

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

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

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

Connect an agent — have() is free.