SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2103.11811 · 2021

MasakhaNER: Named Entity Recognition for African Languages

arXiv · PDF · Open in the Atlas

Code that ran

11 of 16 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; 5 failures of our instrument; 5 no recorded run), measured 2026-11-22; 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/2103.11811.json · badge: /api/ran/2103.11811.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
masakhane-io/masakhane-ner canonical (classifier label)
classifier basis: classifier_2025
5 ran · 1 no recorded run
michael-beukman/nertransfer community (classifier label)
classifier basis not recorded on the link
6 ran · 4 no recorded run
FunctionStatusWhere it lives
convert_examples_to_features Ran
ran; our contract draft was wrong, not the code
masakhane-io/masakhane-ner/code/predict_ner.py
pointer only (licence: NOASSERTION) · get_code("366bf9d9c1ffe01e")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, masakhane-io/masakhane-ner (NOASSERTION). 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.

get_common_things_between_two_langs Ran
ran on a synthesized input
michael-beukman/nertransfer/src/analysis/v50/statistical_overlap.py
code served (permissive licence) · get_code("f3323c9c3c5c92a4")
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 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 tempfile
import os
from collections import defaultdict

# Create a temporary directory structure to mock the masakhane-ner data
temp_dir = tempfile.mkdtemp()
data_dir = os.path.join(temp_dir, 'data', 'masakhane-ner', 'data')
os.makedirs(data_dir, exist_ok=True)

# Create 10 language directories with train/test/dev files
langs = ['eng', 'fra', 'deu', 'spa', 'ita', 'por', 'rus', 'ara', 'zho', 'jpn']

for lang in langs:
    lang_dir = os.path.join(data_dir, lang)
    os.makedirs(lang_dir, exist_ok=True)
    
    # Create train.txt, test.txt, dev.txt files
    for split in ['train', 'test', 'dev']:
        file_path = os.path.join(lang_dir, f'{split}.txt')
        with open(file_path, 'w') as f:
            # Write some mock NER data
            if lang == 'eng':
                f.write("John B-PER\n")
                f.write("Smith I-PER\n")
                f.write("lives O\n")
                f.write("in O\n")
                f.write("New B-LOC\n")
                f.write("York I-LOC\n")
                f.write("2023-01-15 B-DATE\n")
                f.write("Google B-ORG\n")
            elif lang == 'fra':
                f.write("Jean B-PER\n")
                f.write("Dupont I-PER\n")
                f.write("habite O\n")
                f.write("à O\n")
                f.write("Paris B-LOC\n")
                f.write("2023-01-15 B-DATE\n")
                f.write("Microsoft B-ORG\n")
            else:
                f.write("Alice B-PER\n")
                f.write("lives O\n")
                f.write("London B-LOC\n")
                f.write("2023-01-15 B-DATE\n")
                f.write("IBM B-ORG\n")

# Monkey-patch glob to return our test files
import glob as glob_module
original_glob = glob_module.glob

def mock_glob(pattern):
    if 'masakhane-ner/data/*' in pattern and 'train.txt' in pattern:
        result = []
        for lang in langs:
            result.append(os.path.join(data_dir, lang, 'train.txt'))
        return result
    return original_glob(pattern)

glob_module.glob = mock_glob

# Also patch the relative path reference in the function
import sys
sys.path.insert(0, temp_dir)

ARGS = {
    'lang1': 'eng',
    'lang2': 'fra',
    'entities_to_use': ['DATE', 'PER', 'LOC', 'ORG'],
    'joint_all_sets': False
}
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 tuple, ndim 2, dtype family int — 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
get_word_idx Ran
ran on a synthesized input
michael-beukman/nertransfer/src/analysis/v40/embeddings.py
code served (permissive licence) · get_code("14f54b791055c4c7")
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 int, ndim 0, dtype family int, 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

ARGS = {
    'sent': 'the quick brown fox',
    'word': 'quick'
}
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 int, ndim 0, dtype family int, 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
map_task_to_data Ran
ran; our contract draft was wrong, not the code
masakhane-io/masakhane-ner/MasakhaNER2.0/ranking_languages/langrank.py
pointer only (licence: NOASSERTION) · get_code("59f7e84a8e40deed")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, masakhane-io/masakhane-ner (NOASSERTION). 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.

map_task_to_models Ran
ran; our contract draft was wrong, not the code
masakhane-io/masakhane-ner/MasakhaNER2.0/ranking_languages/langrank.py
pointer only (licence: NOASSERTION) · get_code("cd55b256a5726cf4")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, masakhane-io/masakhane-ner (NOASSERTION). 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.

order_columns_of_df Ran
ran on a synthesized input
michael-beukman/nertransfer/src/analysis/utils.py
code served (permissive licence) · get_code("d2afa5d042c7a876")
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 DataFrame. 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 pandas as pd
import numpy as np

# Create a sample DataFrame with columns that match the ORDER function
# The function will reorder these columns based on the predefined ORDER
df_data = {
    'wol': [1, 2, 3],
    'pcm': [4, 5, 6],
    'yor': [7, 8, 9],
    'hau': [10, 11, 12],
    'ibo': [13, 14, 15],
    'luo': [16, 17, 18],
    'lug': [19, 20, 21],
    'kin': [22, 23, 24],
    'swa': [25, 26, 27],
    'amh': [28, 29, 30]
}

df = pd.DataFrame(df_data)

ARGS = {
    'df': df,
    'rows': False,
    'both': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 and dtype family int 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
pretty Ran
ran on a synthesized input
michael-beukman/nertransfer/src/analysis/v10/basic_analyse_pretrained_model.py
code served (permissive licence) · get_code("b655ab126afacd7a")
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 str. 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

# The function takes a list `li` and a `decimal` parameter
# It asserts len(li) == 5, so we need a list of exactly 5 elements
# It computes mean and std on the list, multiplies by 100, and rounds

# Create a list of 5 numeric values
li = [0.1, 0.15, 0.12, 0.14, 0.13]

# decimal parameter with default value of 2
decimal = 2

ARGS = {
    'li': li,
    'decimal': decimal
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
read_examples Ran
ran; our contract draft was wrong, not the code
masakhane-io/masakhane-ner/code/predict_ner.py
pointer only (licence: NOASSERTION) · get_code("d6f999d45b668128")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, masakhane-io/masakhane-ner (NOASSERTION). 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.

read_examples_from_file Ran
ran on a synthesized input
michael-beukman/nertransfer/src/utils/utils_ner.py
code served (permissive licence) · get_code("c80e5c9a8ef905bf")
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

class InputExample(object):
    """A single training/test example for token classification."""

    def __init__(self, guid, words, labels):
        """Constructs a InputExample.

        Args:
            guid: Unique id for the example.
            words: list. The words of the sequence.
            labels: (Optional) list. The labels for each word of the sequence. This should be
            specified for train and dev examples, but not for test examples.
        """
        self.guid = guid
        self.words = words
        self.labels = labels

def read_examples_from_file(data_dir, mode):
    file_path = os.path.join(data_dir, '{}.txt'.format(mode))
    guid_index = 1
    examples = []
    with open(file_path, encoding='utf-8') as f:
        words = []
        labels = []
        for line in f:
            line = line.strip()
            if len(line) < 2 or line == '\n':
                if words:
                    examples.append(InputExample(guid='{}-{}'.format(mode, guid_index), words=words, labels=labels))
                    guid_index += 1
                    words = []
                    labels = []
            else:
                splits = line.split(' ')
                words.append(splits[0])
                if len(splits) > 1:
                    labels.append(splits[-1].replace('\n', ''))
                else:
                    labels.append('O')
        if words:
            examples.append(InputExample(guid='{}-{}'.format(mode, guid_index), words=words, labels=labels))
    return examples

# Create a temporary directory with test data
temp_dir = tempfile.mkdtemp()

# Create a sample train.txt file with token classification data
train_file_path = os.path.join(temp_dir, 'train.txt')
with open(train_file_path, 'w', encoding='utf-8') as f:
    f.write('The O\n')
    f.write('cat B-ANIMAL\n')
    f.write('sat O\n')
    f.write('\n')
    f.write('John B-PERSON\n')
    f.write('runs O\n')

ARGS = {
    'data_dir': temp_dir,
    'mode': 'train',
}
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
read_examples_from_file_flexible Ran
ran on a synthesized input
michael-beukman/nertransfer/src/utils/utils_ner.py
code served (permissive licence) · get_code("cad5b48757653160")
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 tempfile
import os

# Create a temporary file with sample data in CoNLL format
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt', encoding='utf-8')
temp_file.write("-DOCSTART- O\n\n")
temp_file.write("John B-PER\n")
temp_file.write("Smith I-PER\n")
temp_file.write("lives O\n")
temp_file.write("in O\n")
temp_file.write("New B-LOC\n")
temp_file.write("York I-LOC\n")
temp_file.write("\n")
temp_file.write("He O\n")
temp_file.write("works O\n")
temp_file.write("at O\n")
temp_file.write("Google B-ORG\n")
temp_file.write("\n")
temp_file.close()

ARGS = {
    'file_path': temp_file.name,
    'mode': 'train'
}
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
read_vocab_file Ran
ran; our contract draft was wrong, not the code
masakhane-io/masakhane-ner/MasakhaNER2.0/ranking_languages/langrank.py
pointer only (licence: NOASSERTION) · get_code("7f352620f4bfd7b0")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, masakhane-io/masakhane-ner (NOASSERTION). 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.

get_f1 Not yet run
unverified (harvested, no recorded run)
michael-beukman/nertransfer/src/analysis/v20/base.py
code served (permissive licence) · get_code("c60cb5d43bb0779f")
How it ran

no invocation recorded.

get_hidden_states Not yet run
unverified (harvested, no recorded run)
michael-beukman/nertransfer/src/analysis/v40/embeddings.py
code served (permissive licence) · get_code("47472e158df3a8ba")
How it ran

no invocation recorded.

get_word_vector Not yet run
unverified (harvested, no recorded run)
michael-beukman/nertransfer/src/analysis/v40/embeddings.py
code served (permissive licence) · get_code("54cecc912e67b334")
How it ran

no invocation recorded.

load_and_cache_examples Not yet run
unverified (harvested, no recorded run)
masakhane-io/masakhane-ner/code/predict_ner.py
pointer only (licence: NOASSERTION) · get_code("a962fe586a31e797")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, masakhane-io/masakhane-ner (NOASSERTION). 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. No invocation recorded.

load_compressed_pickle Not yet run
unverified (harvested, no recorded run)
michael-beukman/nertransfer/src/analysis/utils.py
code served (permissive licence) · get_code("842eea7c099f7105")
How it ran

no invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 6 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 6 later) and 10 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
convert_examples_to_features 2 other papers
2 later
2204.06487 (2022-04)
Adapting Pre-trained Language Models to African Languages via Multilingual Adaptive Fine-Tuning
2304.03952 (2023-04)
AfricaNLP workshop at ICLR2023 MPHAYANER: NAMED ENTITY RECOGNITION FOR TSHIVEND ˆA
read_examples_from_file 2 other papers
2 later
2211.15613 (2022-11)
Frustratingly Easy Label Projection for Cross-lingual Transfer
2304.03952 (2023-04)
AfricaNLP workshop at ICLR2023 MPHAYANER: NAMED ENTITY RECOGNITION FOR TSHIVEND ˆA
read_examples_from_file_flexible 2 other papers
2 later
2211.15613 (2022-11)
Frustratingly Easy Label Projection for Cross-lingual Transfer
2304.03952 (2023-04)
AfricaNLP workshop at ICLR2023 MPHAYANER: NAMED ENTITY RECOGNITION FOR TSHIVEND ˆA
read_vocab_file 2 other papers
1 dated earlier, 1 later
1905.12688 (2019-05)
Choosing Transfer Languages for Cross-Lingual Learning
2210.12391 (2022-10)
MasakhaNER 2.0: Africa-centric Transfer Learning for Named Entity Recognition
map_task_to_data 1 other paper
1 later
2210.12391 (2022-10)
MasakhaNER 2.0: Africa-centric Transfer Learning for Named Entity Recognition
map_task_to_models 1 other paper
1 later
2210.12391 (2022-10)
MasakhaNER 2.0: Africa-centric Transfer Learning for Named Entity Recognition

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

Repositories linked to this paper

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

Abstract

We take a step towards addressing the under-representation of the African continent in NLP research by creating the first large publicly available high-quality dataset for named entity recognition (NER) in ten African languages, bringing together a variety of stakeholders. We detail characteristics of the languages to help researchers understand the challenges that these languages pose for NER. We analyze our datasets and conduct an extensive empirical evaluation of state-of-the-art methods across both supervised and transfer learning settings. We release the data, code, and models in order to inspire future research on African NLP.

For agents

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

get_harvested_code_for_paper("2103.11811")
get_code_for_paper("2103.11811")
have("2103.11811")

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

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

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

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

Connect an agent — have() is free.