SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1904.02232 · 2019

BERT Post-Training for Review Reading Comprehension and Aspect-based Sentiment Analysis

arXiv · PDF · Open in the Atlas

Code that ran

4 of 7 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; 1 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 1 failure of our instrument; 3 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/1904.02232.json · badge: /api/ran/1904.02232.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
howardhsu/BERT-for-RRC-ABSA community (classifier label)
classifier basis: plan_row
4 ran · 3 no recorded run
FunctionStatusWhere it lives
convert_examples_to_features Ran
ran on a synthesized input
howardhsu/BERT-for-RRC-ABSA/pytorch-pretrained-bert/src/absa_data_utils.py
code served (permissive licence) · get_code("2b7167d132905cdd")
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
import numpy as np

class MockExample:
    def __init__(self, text_a, text_b=None, label=None, idx_map=None):
        self.text_a = text_a
        self.text_b = text_b
        self.label = label
        self.idx_map = idx_map

class MockTokenizer:
    def __init__(self):
        self.vocab = {
            '[CLS]': 0,
            '[SEP]': 1,
            '[PAD]': 2,
            'hello': 3,
            'world': 4,
            'test': 5,
            'sample': 6,
        }
    
    def tokenize(self, text):
        return text.lower().split()
    
    def subword_tokenize(self, tokens, labels):
        idx_map = list(range(len(tokens)))
        return tokens, labels, idx_map
    
    def convert_tokens_to_ids(self, tokens):
        ids = []
        for token in tokens:
            ids.append(self.vocab.get(token, 2))
        return ids

# Create mock examples
examples = [
    MockExample(text_a="hello world", text_b=None, label="positive"),
    MockExample(text_a="test sample", text_b="more text", label="negative")
]

# Create label list
label_list = ["positive", "negative"]

# Create tokenizer
tokenizer = MockTokenizer()

# Set parameters
max_seq_length = 16
mode = 'classification'

# Build ARGS dictionary
ARGS = {
    'examples': examples,
    'label_list': label_list,
    'max_seq_length': max_seq_length,
    'tokenizer': tokenizer,
    'mode': mode
}
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 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
create_instances_from_document Ran
ran on a synthesized input
howardhsu/BERT-for-RRC-ABSA/pytorch-pretrained-bert/src/gen_pt_review.py
code served (permissive licence) · get_code("ff2e475360e82c7f")
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 random
import collections

# Create a simple RNG
rng = random.Random(42)

# Create sample vocabulary words
vocab_words = ['hello', 'world', 'python', 'code', 'test', 'sample', 'data', 'machine']

# Create sample documents - each document is a list of segments
# Each segment is a list of tokens
all_documents = [
    [
        ['[CLS]', 'the', 'quick', 'brown', 'fox'],
        ['jumps', 'over', 'the', 'lazy', 'dog'],
        ['[SEP]']
    ],
    [
        ['[CLS]', 'hello', 'world', 'this', 'is'],
        ['a', 'test', 'document', 'for', 'training'],
        ['[SEP]']
    ],
    [
        ['[CLS]', 'another', 'example', 'with', 'tokens'],
        ['and', 'more', 'text', 'here'],
        ['[SEP]']
    ],
    [
        ['[CLS]', 'final', 'document', 'in', 'our'],
        ['collection', 'of', 'test', 'data'],
        ['[SEP]']
    ]
]

# Set parameters
document_index = 0
max_seq_length = 20
short_seq_prob = 0.1
masked_lm_prob = 0.15
max_predictions_per_seq = 3

ARGS = {
    'all_documents': all_documents,
    'document_index': document_index,
    'max_seq_length': max_seq_length,
    'short_seq_prob': short_seq_prob,
    'masked_lm_prob': masked_lm_prob,
    'max_predictions_per_seq': max_predictions_per_seq,
    'vocab_words': vocab_words,
    'rng': rng
}
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
create_masked_lm_predictions Ran
ran; our contract draft was wrong, not the code
howardhsu/BERT-for-RRC-ABSA/pytorch-pretrained-bert/src/gen_pt_review.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from tugstugi/mongolian-bert, is pointer only (licence: NONE) · get_code("b40fc12ef51e9ccc")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from tugstugi/mongolian-bert, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

warmup_linear Ran
ran, honoured the contract we drafted
howardhsu/BERT-for-RRC-ABSA/pytorch-pretrained-bert/src/run_rrc.py
code served (permissive licence) · get_code("c58d57224530d17e")
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) 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 warmup_linear takes two parameters:
# - x: a numeric value (float) representing a position/step in training
# - warmup: a float representing the warmup threshold (default 0.002)
# 
# The function uses x and warmup in simple arithmetic comparisons and operations,
# so we just need numeric values.

ARGS = {
    "x": 0.001,
    "warmup": 0.002
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
convert_examples_to_features Not yet run
unverified (harvested, no recorded run)
howardhsu/BERT-for-RRC-ABSA/pytorch-pretrained-bert/src/squad_data_utils.py
code served (permissive licence) · get_code("88d0c4f20672bdb6")
How it ran

no invocation recorded.

create_training_instances Not yet run
unverified (harvested, no recorded run)
howardhsu/BERT-for-RRC-ABSA/pytorch-pretrained-bert/src/gen_pt_review.py
code served (permissive licence) · get_code("82a2777ee7a78bd8")
How it ran

no invocation recorded.

evaluate Not yet run
unverified (harvested, no recorded run)
howardhsu/BERT-for-RRC-ABSA/pytorch-pretrained-bert/eval/evaluate_ae.py
code served (permissive licence) · get_code("aeb20ed962ccdd7f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 4 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 3 later) and 3 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
warmup_linear 19 other papers
4 dated earlier, 15 later
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1803.03376 (2018-03)
Learning Approximate Inference Networks for Structured Prediction
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
and 16 more not named here
convert_examples_to_features 1 other paper
1 later
2010.11731 (2020-10)
Improving BERT Performance for Aspect-Based Sentiment Analysis
create_masked_lm_predictions 1 other paper
1 dated earlier
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
evaluate 1 other paper
1 later
2010.11731 (2020-10)
Improving BERT Performance for Aspect-Based Sentiment Analysis

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

Question-answering plays an important role in e-commerce as it allows potential customers to actively seek crucial information about products or services to help their purchase decision making. Inspired by the recent success of machine reading comprehension (MRC) on formal documents, this paper explores the potential of turning customer reviews into a large source of knowledge that can be exploited to answer user questions.~We call this problem Review Reading Comprehension (RRC). To the best of our knowledge, no existing work has been done on RRC. In this work, we first build an RRC dataset called ReviewRC based on a popular benchmark for aspect-based sentiment analysis. Since ReviewRC has limited training examples for RRC (and also for aspect-based sentiment analysis), we then explore a novel post-training approach on the popular language model BERT to enhance the performance of fine-tuning of BERT for RRC. To show the generality of the approach, the proposed post-training is also applied to some other review-based tasks such as aspect extraction and aspect sentiment classification in aspect-based sentiment analysis. Experimental results demonstrate that the proposed post-training is highly effective. The datasets and code are available at https://www.cs.uic.edu/~hxu/.

For agents

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

get_harvested_code_for_paper("1904.02232")
get_code_for_paper("1904.02232")
have("1904.02232")

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

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

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

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

Connect an agent — have() is free.