SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2010.05324 · EMNLP · 2020

Multilingual Offensive Language Identification with Cross-lingual Embeddings

Marcos Zampieri, Tharindu Ranasinghe

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 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 4 have no contract verdict; 0 failures of our instrument; 2 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/2010.05324.json · badge: /api/ran/2010.05324.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
tharindudr/DeepOffense canonical (classifier label)
classifier basis: census
4 ran · 2 no recorded run
FunctionStatusWhere it lives
encode Ran
ran on a synthesized input
tharindudr/DeepOffense/deepoffense/language_modeling/language_modeling_utils.py
code served (permissive licence) · get_code("d34c8ab039bdf946")
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 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

class SimpleTokenizer:
    def encode(self, text):
        return [1, 2, 3]

tokenizer = SimpleTokenizer()
line = "hello world"

ARGS = {
    "data": (tokenizer, line)
}
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 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
encode_sliding_window Ran
ran on a synthesized input
tharindudr/DeepOffense/deepoffense/language_modeling/language_modeling_utils.py
code served (permissive licence) · get_code("1369dca3f5bbc52a")
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

class MockTokenizer:
    def __init__(self):
        self.sep_token_id = 102
        self.cls_token_id = 101
        self.pad_token_id = 0
    
    def tokenize(self, text):
        # Simple tokenization: split by spaces and add some dummy tokens
        tokens = text.split()
        return tokens
    
    def convert_tokens_to_ids(self, tokens):
        # Simple conversion: map each token to a dummy ID
        return [hash(token) % 1000 for token in tokens]

tokenizer = MockTokenizer()
line = "hello world this is a test sentence for sliding window"
max_seq_length = 16
special_tokens_count = 2
stride = 0.5
no_padding = False

ARGS = {
    "data": (tokenizer, line, max_seq_length, special_tokens_count, stride, no_padding)
}
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
preprocess_batch_for_hf_dataset Ran
ran on a synthesized input
tharindudr/DeepOffense/deepoffense/classification/classification_utils.py
code served (permissive licence) · get_code("845d1017a8c6aacc")
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 torch
from transformers import AutoTokenizer

torch.manual_seed(0)

# Create a minimal tokenizer stand-in that implements the __call__ interface
class MinimalTokenizer:
    def __call__(self, text=None, text_pair=None, truncation=None, padding=None, max_length=None):
        # Simulate tokenizer output with input_ids and attention_mask
        batch_size = len(text) if isinstance(text, list) else 1
        return {
            'input_ids': [[101, 2054, 2003, 102] for _ in range(batch_size)],
            'attention_mask': [[1, 1, 1, 1] for _ in range(batch_size)],
            'token_type_ids': [[0, 0, 1, 1] for _ in range(batch_size)]
        }

# Test case 1: dataset with text_a and text_b
dataset_with_pairs = {
    'text_a': ['Hello world', 'How are you'],
    'text_b': ['Goodbye world', 'I am fine']
}

tokenizer = MinimalTokenizer()
max_seq_length = 128

ARGS = {
    'dataset': dataset_with_pairs,
    'tokenizer': tokenizer,
    'max_seq_length': max_seq_length
}
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 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
sweep_config_to_sweep_values Ran
ran on a synthesized input
tharindudr/DeepOffense/deepoffense/classification/classification_utils.py
code served (permissive licence) · get_code("ed7096c541cce33f")
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 torch
import torch.nn as nn

class MockWandbConfig:
    """Stand-in for wandb.Config that supports dict-like access and keys()"""
    def __init__(self, data):
        self._data = data
    
    def __getitem__(self, key):
        return self._data[key]
    
    def keys(self):
        return self._data.keys()

sweep_config = MockWandbConfig({
    'learning_rate': 0.001,
    'batch_size': 32,
    'epochs': 10,
    'optimizer': 'adam',
    'hidden_dim': 128,
    'dropout': 0.5
})

ARGS = {
    'sweep_config': sweep_config
}
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 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
mask_tokens Not yet run
unverified (harvested, no recorded run)
tharindudr/DeepOffense/deepoffense/language_modeling/language_modeling_utils.py
code served (permissive licence) · get_code("37e86e14623d0254")
How it ran

no invocation recorded.

preprocess_data_multiprocessing Not yet run
unverified (harvested, no recorded run)
tharindudr/DeepOffense/deepoffense/classification/classification_utils.py
code served (permissive licence) · get_code("c38f7ab41a3dd3f0")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 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
encode 1 other paper
1 later
2106.01561 (2021-06)
Can Generative Pre-trained Language Models Serve as Knowledge Bases for Closed-book QA?
encode_sliding_window 1 other paper
1 later
2106.01561 (2021-06)
Can Generative Pre-trained Language Models Serve as Knowledge Bases for Closed-book QA?

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

Offensive content is pervasive in social media and a reason for concern to companies and government organizations. Several studies have been recently published investigating methods to detect the various forms of such content (e.g. hate speech, cyberbulling, and cyberaggression). The clear majority of these studies deal with English partially because most annotated datasets available contain English data. In this paper, we take advantage of English data available by applying cross-lingual contextual word embeddings and transfer learning to make predictions in languages with less resources. We project predictions on comparable data in Bengali, Hindi, and Spanish and we report results of 0.8415 F1 macro for Bengali, 0.8568 F1 macro for Hindi, and 0.7513 F1 macro for Spanish. Finally, we show that our approach compares favorably to the best systems submitted to recent shared tasks on these three languages, confirming the robustness of cross-lingual contextual embeddings and transfer learning for this task.

For agents

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

get_harvested_code_for_paper("2010.05324")
get_code_for_paper("2010.05324")
have("2010.05324")

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

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

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

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

Connect an agent — have() is free.