SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2020.findings-emnlp.234 · EMNLP Findings · 2020

Grid Tagging Scheme for Aspect-oriented Fine-grained Opinion Extraction

Zhen Wu, Xinyu Dai, Rui Xia, Fei Zhao, Chengcan Ying, Zhifang Fan

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 6 have no contract verdict; 2 failures of our instrument; 1 no recorded run), measured 2026-11-24; 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/2020.findings-emnlp.234.json · badge: /api/ran/2020.findings-emnlp.234.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
NJUNLP/GTS canonical (classifier label)
classifier basis: census
8 ran · 1 no recorded run
FunctionStatusWhere it lives
attention Ran
ran; our contract draft was wrong, not the code
NJUNLP/GTS/code/NNModel/attention_module.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from smiles724/molformer, is pointer only (licence: NONE) · get_code("916dd244b4ead0ac")
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 smiles724/molformer, 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.

clones Ran
ran; our contract draft was wrong, not the code
NJUNLP/GTS/code/NNModel/attention_module.py
code served (permissive licence) · get_code("7542d49a55b02185")
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 ModuleList. 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 copy
import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a simple nn.Module to clone
class SimpleLayer(nn.Module):
    def __init__(self, in_features=4, out_features=3):
        super().__init__()
        self.linear = nn.Linear(in_features, out_features)
    
    def forward(self, x):
        return self.linear(x)

# Instantiate a module to be cloned
module = SimpleLayer(in_features=4, out_features=3)

# Define the number of clones to produce
N = 5

# Construct ARGS dict with all parameters
ARGS = {
    "module": module,
    "N": N
}
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 ModuleList — a ModuleList output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModuleList output the recorded ndim 1 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_aspects Ran
ran on a synthesized input
NJUNLP/GTS/code/BertModel/utils.py
code served (permissive licence) · get_code("4a38b291f483a461")
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 2, 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:
# - tags is indexed as tags[i][i], suggesting a 2D structure (likely tensor or list of lists)
# - length is an integer used for range iteration
# - ignore_index is an integer used for comparison (default -1)
# - tags[i][i] is compared to ignore_index, 1, and other values
# - The function treats tags[i][i] as containing integer values

# Create a small 2D tensor where we can access tags[i][i]
# Using shape (4, 4) so we have enough indices to work with
tags = torch.tensor([
    [1, 0, 0, 0],
    [0, 1, 0, 0],
    [0, 0, -1, 0],
    [0, 0, 0, 0]
], dtype=torch.long)

length = 4
ignore_index = -1

ARGS = {
    "tags": tags,
    "length": length,
    "ignore_index": ignore_index
}
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 2, 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_evaluate_spans Ran
ran on a synthesized input
NJUNLP/GTS/code/BertModel/data.py
code served (permissive licence) · get_code("5e38345883833faf")
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 2, 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:
# - tags: indexed by l (from token_range), compared to -1, 1, 0. Needs to be indexable.
# - length: used in range(length) and as final index. Integer.
# - token_range: indexed by i (0 to length-1), returns (l, r) tuples. List of tuples.

# Example: 5 tokens, so length=5
# token_range maps token indices to character ranges
# tags needs to have indices covering the 'l' values from token_range

length = 5
token_range = [(0, 2), (3, 5), (6, 8), (9, 11), (12, 14)]

# tags is indexed by 'l' values from token_range
# l values are: 0, 3, 6, 9, 12 (max is 12)
# Create tags array with enough size; use BIO encoding: -1 (no tag), 0 (Inside/O), 1 (Begin/B)
tags = np.array([-1, 1, 0, 1, -1, 0, 1, 0, -1, 1, 0, -1, 1, 0, -1], dtype=int)

ARGS = {
    "tags": tags,
    "length": length,
    "token_range": token_range,
}
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 2, 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_opinions Ran
ran on a synthesized input
NJUNLP/GTS/code/BertModel/utils.py
code served (permissive licence) · get_code("8f7b0cf6db46f88b")
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 2, 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:
# - tags: indexed with tags[i][i], so it's a 2D indexable structure
# - length: integer used in range() and comparisons
# - ignore_index: integer used in comparison (default -1)
# The function accesses tags[i][i] for i in range(length), checking values against ignore_index and 2

# Create a 2D tensor where diagonal elements contain tag values
# We'll make it 4x4 to have enough positions for testing
tags = torch.tensor([
    [2, 0, 0, 0],
    [0, 2, 0, 0],
    [0, 0, 1, 0],
    [0, 0, 0, 1]
], dtype=torch.long)

length = 4
ignore_index = -1

ARGS = {
    "tags": tags,
    "length": length,
    "ignore_index": ignore_index
}
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 2, 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_spans Ran
ran on a synthesized input
NJUNLP/GTS/code/BertModel/data.py
code served (permissive licence) · get_code("ebe0c30ab76e8926")
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

torch.manual_seed(0)

# The function get_spans takes a single parameter 'tags' which is a string
# It processes BIO (Begin-Inside-Outside) format tags
# The string is stripped and split by whitespace

# Example BIO tags string
tags_string = "B-PER I-PER O B-LOC O I-ORG B-ORG"

ARGS = {
    "tags": tags_string
}
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 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
load_data_instances Ran
ran on a synthesized input
NJUNLP/GTS/code/BertModel/data.py
code served (permissive licence) · get_code("04bf5dae1dbb3451")
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
import tempfile
import os

torch.manual_seed(0)

# Create a minimal mock tokenizer
class MockBertTokenizer:
    def __init__(self):
        pass
    
    def encode(self, text, add_special_tokens=True):
        # Simple mock: return list of token IDs based on text length
        # [CLS] + tokens + [SEP]
        if add_special_tokens:
            words = text.strip().split()
            return [101] + list(range(1000, 1000 + len(words))) + [102]
        else:
            words = text.strip().split()
            return list(range(1000, 1000 + len(words)))

# Create minimal args object
class Args:
    def __init__(self):
        self.max_sequence_len = 64
        self.bert_tokenizer_path = "bert-base-uncased"
        self.task = "triplet"

# Mock sentence packs with proper structure
sentence_packs = [
    {
        'id': '1',
        'sentence': 'The food is great',
        'triples': [
            {
                'target_tags': 'B O O O',
                'opinion_tags': 'O O O B',
                'sentiment': 'positive'
            }
        ]
    },
    {
        'id': '2',
        'sentence': 'The service was bad',
        'triples': [
            {
                'target_tags': 'B O O O',
                'opinion_tags': 'O O O B',
                'sentiment': 'negative'
            }
        ]
    }
]

args = Args()

# Monkey patch the BertTokenizer to use our mock
original_from_pretrained = BertTokenizer.from_pretrained

def mock_from_pretrained(path):
    return MockBertTokenizer()

BertTokenizer.from_pretrained = staticmethod(mock_from_pretrained)

ARGS = {
    'sentence_packs': sentence_packs,
    'args': args
}
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
load_data_instances Ran
ran on a synthesized input
NJUNLP/GTS/code/NNModel/data.py
code served (permissive licence) · get_code("507037e5d857df3f")
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 types

torch.manual_seed(0)

# Create a small word2index vocabulary
word2index = {
    '<unk>': 0,
    'great': 1,
    'movie': 2,
    'bad': 3,
    'acting': 4,
    'loved': 5,
    'it': 6,
}

# Create args object with required attributes
args = types.SimpleNamespace(
    max_sequence_len=8,
    task='triplet'
)

# Create sample sentence packs
sentence_packs = [
    {
        'id': '1',
        'sentence': 'great movie bad acting',
        'triples': [
            {
                'target_tags': 'B O O O',
                'opinion_tags': 'O B O O',
                'sentiment': 'positive'
            },
            {
                'target_tags': 'O O B B',
                'opinion_tags': 'O O O B',
                'sentiment': 'negative'
            }
        ]
    },
    {
        'id': '2',
        'sentence': 'loved it',
        'triples': [
            {
                'target_tags': 'B O',
                'opinion_tags': 'B O',
                'sentiment': 'positive'
            }
        ]
    }
]

ARGS = {
    'sentence_packs': sentence_packs,
    'word2index': word2index,
    'args': args
}
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 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
score_aspect Not yet run
unverified (harvested, no recorded run)
NJUNLP/GTS/code/NNModel/utils.py
code served (permissive licence) · get_code("f306f2be0052d14e")
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, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 2 later) and 7 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
attention 27 other papers
9 dated earlier, 15 later, 3 same year, order not determinable
1411.4555 (2014-11)
Show and Tell: A Neural Image Caption Generator
1609.08144 (2016-09)
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
1612.00563 (2016-12)
Self-critical Sequence Training for Image Captioning
and 24 more not named here
clones 1 other paper
1 later
2403.16371 (2024-03)
Uncovering Selective State Space Model's Capabilities in Lifelong Sequential Recommendation

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-24.

Repositories linked to this paper

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

Abstract

Aspect-oriented Fine-grained Opinion Extraction (AFOE) aims at extracting aspect terms and opinion terms from review in the form of opinion pairs or additionally extracting sentiment polarity of aspect term to form opinion triplet. Because of containing several opinion factors, the complete AFOE task is usually divided into multiple subtasks and achieved in the pipeline. However, pipeline approaches easily suffer from error propagation and inconvenience in real-world scenarios. To this end, we propose a novel tagging scheme, Grid Tagging Scheme (GTS), to address the AFOE task in an end-to-end fashion only with one unified grid tagging task. Additionally, we design an effective inference strategy on GTS to exploit mutual indication between different opinion factors for more accurate extractions. To validate the feasibility and compatibility of GTS, we implement three different GTS models respectively based on CNN, BiL-STM, and BERT, and conduct experiments on the aspect-oriented opinion pair extraction and opinion triplet extraction datasets. Extensive experimental results indicate that GTS models outperform strong baselines significantly and achieve state-of-the-art performance.

For agents

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

get_harvested_code_for_paper("2020.findings-emnlp.234")
get_code_for_paper("2020.findings-emnlp.234")
have("2020.findings-emnlp.234")

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

curl https://syntology.ai/api/ran/2020.findings-emnlp.234.json

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

[![Syntology run record](https://syntology.ai/api/ran/2020.findings-emnlp.234.svg)](https://syntology.ai/paper/2020.findings-emnlp.234)

Connect an agent — have() is free.