SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.14774 · EMNLP · 2022

TweetNLP: Cutting-Edge Natural Language Processing for Social Media

Fangyu Liu, Dimosthenis Antypas, Jose Camacho-Collados, Francesco Barbieri, Leonardo Neves, Luis Espinosa-Anke, Kiamehr Rezaee, Asahi Ushio, Daniel Loureiro, Talayeh Riahi, Joanne Boisson, Eugenio Martínez-Cámara, and 2 more

arXiv · PDF · Open in the Atlas

Code that ran

5 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; 1 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 2 failures of our instrument; 4 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/2206.14774.json · badge: /api/ran/2206.14774.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
cardiffnlp/tweetnlp canonical (classifier label)
classifier basis not recorded on the link
5 ran · 4 no recorded run
FunctionStatusWhere it lives
allowed_transitions Ran
ran, honoured the contract we drafted
cardiffnlp/tweetnlp/tweetnlp/ner/allennlp_crf.py
code served (permissive licence) · get_code("8c4fb7eac3196bd9")
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

# For allowed_transitions function, we need:
# - constraint_type: str (one of "BIO", "IOB1", "BIOUL", "BMES")
# - labels: Dict[int, str] mapping label_id to label string

# Create a small labels dictionary
# Labels follow the tagging scheme format like "B-PER", "I-ORG", "O", etc.
labels = {
    0: "O",           # Outside
    1: "B-PER",       # Begin Person
    2: "I-PER",       # Inside Person
    3: "B-ORG",       # Begin Organization
    4: "I-ORG",       # Inside Organization
    5: "B-LOC",       # Begin Location
    6: "I-LOC",       # Inside Location
}

ARGS = {
    "constraint_type": "BIO",
    "labels": labels,
}
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
cosine_similarity Ran
ran on a synthesized input
cardiffnlp/tweetnlp/tweetnlp/sentence_embedding/model.py
code served (permissive licence) · get_code("c29d45c4d93b5194")
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 float32, 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 numpy as np

# Create small distinct vectors for cosine similarity computation
v_a = np.array([1.0, 2.0, 3.0, 4.0], dtype=np.float32)
v_b = np.array([2.0, 1.0, 4.0, 3.0], dtype=np.float32)

ARGS = {
    "v_a": v_a,
    "v_b": v_b,
    "eps": 1e-05
}
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 float32, 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
load_dataset_question_answering Ran
ran on a synthesized input
cardiffnlp/tweetnlp/tweetnlp/question_answering/dataset.py
code served (permissive licence) · get_code("5890208b0f87054d")
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 MagicMock. 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
from unittest.mock import Mock, MagicMock
from datasets import Dataset, DatasetDict

# Create mock datasets to avoid actual network calls
mock_dataset = DatasetDict({
    'train': Dataset.from_dict({
        'question': ['What is this?', 'Who are you?'],
        'context': ['This is a test.', 'I am an AI.'],
        'answers': [{'text': ['test'], 'answer_start': [10]}, {'text': ['AI'], 'answer_start': [5]}]
    }),
    'validation': Dataset.from_dict({
        'question': ['Where?'],
        'context': ['Here is the place.'],
        'answers': [{'text': ['here'], 'answer_start': [0]}]
    })
})

# Patch load_dataset to return our mock
import datasets
original_load_dataset = datasets.load_dataset

def mock_load_dataset(dataset_type, dataset_name=None, use_auth_token=False):
    return mock_dataset

datasets.load_dataset = mock_load_dataset

ARGS = {
    'task_type': 'question_answering',
    'dataset_type': None,
    'dataset_name': None,
    'use_auth_token': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MagicMock — a MagicMock output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MagicMock output the recorded ndim 1 and dtype family None 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
logsumexp Ran
ran; our contract draft was wrong, not the code
cardiffnlp/tweetnlp/tweetnlp/ner/allennlp_crf.py
code served (permissive licence) · get_code("35b6de3a6dc2aecf")
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

torch.manual_seed(0)

# Create a small tensor with shape (2, 4)
# This is a reasonable size for testing logsumexp
tensor = torch.randn(2, 4, dtype=torch.float32)

# dim parameter - reduce over the last dimension
dim = -1

# keepdim parameter - don't keep the reduced dimension
keepdim = False

ARGS = {
    "tensor": tensor,
    "dim": dim,
    "keepdim": keepdim,
}
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
viterbi_decode Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
cardiffnlp/tweetnlp/tweetnlp/ner/allennlp_crf.py
code served (permissive licence) · get_code("d09499c8bf92252b")
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 torch
import math

torch.manual_seed(0)

# Small sequence length and number of tags for testing
sequence_length = 3
num_tags = 4

# Create tag_sequence: (sequence_length, num_tags)
tag_sequence = torch.randn(sequence_length, num_tags)

# Create transition_matrix: (num_tags, num_tags)
transition_matrix = torch.randn(num_tags, num_tags)

# Create tag_observations: optional list of observed tag indices
tag_observations = [0, -1, 2]  # -1 means unobserved

# Create allowed_start_transitions: (num_tags,)
allowed_start_transitions = torch.randn(num_tags)

# Create allowed_end_transitions: (num_tags,)
allowed_end_transitions = torch.randn(num_tags)

# top_k for returning multiple paths
top_k = 1

ARGS = {
    "tag_sequence": tag_sequence,
    "transition_matrix": transition_matrix,
    "tag_observations": tag_observations,
    "allowed_start_transitions": allowed_start_transitions,
    "allowed_end_transitions": allowed_end_transitions,
    "top_k": top_k,
}
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 — 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
get_label2id Not yet run
unverified (harvested, no recorded run)
cardiffnlp/tweetnlp/tweetnlp/util.py
code served (permissive licence) · get_code("546235fdf34e08cf")
How it ran

no invocation recorded.

load_dataset_ner Not yet run
unverified (harvested, no recorded run)
cardiffnlp/tweetnlp/tweetnlp/ner/dataset.py
code served (permissive licence) · get_code("d37ccb7a12784148")
How it ran

no invocation recorded.

load_dataset_question_answer_generation Not yet run
unverified (harvested, no recorded run)
cardiffnlp/tweetnlp/tweetnlp/question_answer_generation/dataset.py
code served (permissive licence) · get_code("06526559439b08ae")
How it ran

no invocation recorded.

load_model Not yet run
unverified (harvested, no recorded run)
cardiffnlp/tweetnlp/tweetnlp/util.py
code served (permissive licence) · get_code("12e9be32bca300f5")
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, 3 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 6 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
logsumexp 3 other papers
2 dated earlier, 1 later
1603.01354 (2016-03)
End-to-end Sequence Labeling via Bi-directional LSTM-CNNs-CRF
2021.emnlp-main.291 (2021 (year only))
A Fine-Grained Domain Adaption Model for Joint Word Segmentation and POS Tagging
2604.19335 (2026-04)
When Active Learning Falls Short: An Empirical Study on Chemical Reaction Extraction
allowed_transitions 2 other papers
1 dated earlier, 1 later
2021.emnlp-main.291 (2021 (year only))
A Fine-Grained Domain Adaption Model for Joint Word Segmentation and POS Tagging
2604.19335 (2026-04)
When Active Learning Falls Short: An Empirical Study on Chemical Reaction Extraction
viterbi_decode 1 other paper
1 later
2604.19335 (2026-04)
When Active Learning Falls Short: An Empirical Study on Chemical Reaction Extraction

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

In this paper we present TweetNLP, an integrated platform for Natural Language Processing (NLP) in social media. TweetNLP supports a diverse set of NLP tasks, including generic focus areas such as sentiment analysis and named entity recognition, as well as social media-specific tasks such as emoji prediction and offensive language identification. Taskspecific systems are powered by reasonablysized Transformer-based language models specialized on social media text (in particular, Twitter) which can be run without the need for dedicated hardware or cloud services. The main contributions of TweetNLP are: (1) an integrated Python library for a modern toolkit supporting social media analysis using our various task-specific models adapted to the social domain; (2) an interactive online demo for codeless experimentation using our models; and (3) a tutorial covering a wide variety of typical social media applications.

For agents

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

get_harvested_code_for_paper("2206.14774")
get_code_for_paper("2206.14774")
have("2206.14774")

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

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

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

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

Connect an agent — have() is free.