SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.10661 · 2023

NusaWrites: Constructing High-Quality Corpora for Underrepresented and Extremely Low-Resource Languages

arXiv · PDF · Open in the Atlas

Code that ran

9 of 14 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 0 have no contract verdict; 8 failures of our instrument; 5 no recorded run), measured 2026-11-24; 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/2309.10661.json · badge: /api/ran/2309.10661.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
indonlp/nusa-writes canonical (classifier label)
classifier basis: census
9 ran · 5 no recorded run
FunctionStatusWhere it lives
create_output_directory Ran
ran; our contract draft was wrong, not the code
indonlp/nusa-writes/main_generation_classic.py
code served (permissive licence) · get_code("19a1892a06e4be89")
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 os
import tempfile

# Create a temporary directory to use as the base model_dir
temp_dir = tempfile.mkdtemp()

ARGS = {
    'model_dir': temp_dir,
    'dataset_name': 'test_dataset',
    'task': 'classification',
    'dataset_lang': 'en',
    'model_checkpoint': 'bert-base-uncased',
    'seed': 42,
    'num_sample': 100,
    'force': 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 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
evaluate_classical Ran
ran; our contract draft was wrong, not the code
indonlp/nusa-writes/main_generation_classic.py
code served (permissive licence) · get_code("38ca8eb2c0964a43")
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 numpy as np

torch.manual_seed(0)

# list_hyp: list of hypotheses (predictions)
list_hyp = [
    torch.tensor([0.9, 0.1, 0.0, 0.0]),
    torch.tensor([0.1, 0.8, 0.1, 0.0])
]

# list_label: list of ground truth labels
list_label = [
    torch.tensor([1, 0, 0, 0]),
    torch.tensor([0, 1, 0, 0])
]

# metrics_fn: a function that computes metrics from hypotheses and labels
def metrics_fn(list_hyp, list_label):
    """Compute simple accuracy-like metric"""
    correct = 0
    total = len(list_hyp)
    for hyp, label in zip(list_hyp, list_label):
        if torch.argmax(hyp) == torch.argmax(label):
            correct += 1
    return {"accuracy": correct / total}

ARGS = {
    "list_hyp": list_hyp,
    "list_label": list_label,
    "metrics_fn": metrics_fn
}
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 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
evaluate_language_model Ran
ran; our contract draft was wrong, not the code
indonlp/nusa-writes/main_generation.py
code served (permissive licence) · get_code("daa8d47d0f9da670")
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 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 torch.nn as nn
from typing import List, Tuple, Dict, Any

torch.manual_seed(0)

# Minimal model that satisfies model.eval() and is callable
class DummyLanguageModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 8)
    
    def forward(self, x):
        return self.linear(x)

# Minimal tokenizer stand-in with required methods/attributes
class DummyTokenizer:
    def decode(self, tokens, skip_special_tokens=False):
        return f"decoded_text_{tokens}"
    
    def encode(self, text):
        return [1, 2, 3]

# forward_fn that matches expected signature and return format
def dummy_forward_fn(model, batch_data, model_type=None, tokenizer=None, 
                     device=None, is_inference=False, is_test=False, 
                     skip_special_tokens=False, beam_size=1, max_seq_len=512):
    batch_seq = batch_data[-1]
    # Return (loss, batch_hyp, batch_label)
    loss = torch.tensor(0.5)
    batch_hyp = ["hypothesis_1", "hypothesis_2"]
    batch_label = ["label_1", "label_2"]
    return loss, batch_hyp, batch_label

# metrics_fn that takes predictions and labels
def dummy_metrics_fn(predictions: List[str], labels: List[str]) -> Dict[str, float]:
    return {
        "accuracy": 0.85,
        "f1": 0.82,
        "bleu": 0.75
    }

# Create tiny data loader with 2 batches
# Each batch is a tuple where last element is batch_seq
data_loader = [
    (torch.randn(2, 4), torch.tensor([0, 1]), "seq_batch_1"),
    (torch.randn(2, 4), torch.tensor([1, 0]), "seq_batch_2"),
]

# Build the ARGS dictionary
ARGS = {
    "model": DummyLanguageModel(),
    "data_loader": data_loader,
    "forward_fn": dummy_forward_fn,
    "metrics_fn": dummy_metrics_fn,
    "model_type": "transformer",
    "tokenizer": DummyTokenizer(),
    "beam_size": 1,
    "max_seq_len": 512,
    "is_test": False,
    "device": "cpu"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — 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_lr Ran
ran, honoured the contract we drafted
indonlp/nusa-writes/main_generation.py
code served (permissive licence) · get_code("e9c7d263fd12f86d")
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 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
import torch.nn as nn
from torch.optim import SGD

torch.manual_seed(0)

# Create a minimal model with parameters
model = nn.Linear(4, 3)

# Create an optimizer with a specific learning rate
learning_rate = 0.001
optimizer = SGD(model.parameters(), lr=learning_rate)

# Create minimal args object (the function only iterates over optimizer.param_groups)
# args is not actually used in the function body, so we can use a simple dict or object
class MinimalArgs:
    pass

args = MinimalArgs()

ARGS = {
    'args': args,
    'optimizer': optimizer
}
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 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
hyperparam_tuning Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
indonlp/nusa-writes/boomer/main_boomer.py
code served (permissive licence) · get_code("80e1967386ea09db")
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 GridSearchCV. 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.

from sklearn.svm import SVC
from scipy.sparse import csr_matrix
import numpy as np

# Create small sparse matrices for training and validation data
xtrain = csr_matrix(np.random.rand(4, 8))  # 4 samples, 8 features
ytrain = [0, 1, 0, 1]

xvalid = csr_matrix(np.random.rand(2, 8))  # 2 samples, 8 features
yvalid = [1, 0]

# Create a simple classifier
classifier = SVC()

# Define parameter grid for hyperparameter tuning
param_grid = {
    'C': [0.1, 1.0],
    'kernel': ['linear', 'rbf']
}

ARGS = {
    'xtrain': xtrain,
    'ytrain': ytrain,
    'xvalid': xvalid,
    'yvalid': yvalid,
    'classifier': classifier,
    'param_grid': param_grid
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type GridSearchCV — a GridSearchCV output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GridSearchCV 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
metrics_to_string Ran
ran; our contract draft was wrong, not the code
indonlp/nusa-writes/main_generation.py
code served (permissive licence) · get_code("2c8f98e551054b67")
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 torch
import numpy as np

torch.manual_seed(0)

# The function metrics_to_string takes a metric_dict and iterates over its items,
# formatting each key-value pair where value is a float.
# It requires a dictionary with string keys and numeric values (floats).

metric_dict = {
    'loss': 2.5432,
    'accuracy': 0.9187,
    'f1_score': 0.8734,
    'precision': 0.9045
}

ARGS = {
    'metric_dict': metric_dict
}
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 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
to_prompt Ran
ran; our contract draft was wrong, not the code
indonlp/nusa-writes/main_nlg_prompt.py
code served (permissive licence) · get_code("d9aa425b275a90da")
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 torch

torch.manual_seed(0)

lang_map = {'abs': 'Ambonese', 'btk': 'Batak', 'bew': 'Betawi', 'bhp': 'Bima', 'jav': 'Javanese', 'mad': 'Madurese', 'mak': 'Makassarese', 'min': 'Minangkabau', 'mui': 'Musi', 'rej': 'Rejang', 'sun': 'Sundanese', 'ind': 'Indonesian'}

input_dict = {
    'ind_text': 'This is Indonesian text',
    'tgt_text': 'Ini adalah teks target'
}

prompt_template = 'Translate from [SOURCE] to [TARGET]: [INPUT]'

lang = 'sun'

ARGS = {
    'input': input_dict,
    'prompt': prompt_template,
    'lang': lang,
    'to_ind': False,
    'with_label': False
}
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 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
to_prompt Ran
ran; our contract draft was wrong, not the code
indonlp/nusa-writes/main_nlu_prompt.py
code served (permissive licence) · get_code("d84b67034badaff8")
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 torch

torch.manual_seed(0)

# Construct arguments for to_prompt function
# The function expects:
# - input: dict with either 'text' key or 'text_1'/'text_2' keys, and optionally 'label' key
# - prompt: string with placeholders like [INPUT], [INPUT_A], [INPUT_B], [OPTIONS], [LABELS_CHOICE]
# - labels: list of label strings
# - with_label: boolean

# Test case 1: single text input with options
input_1 = {
    'text': 'This is a sample input',
    'label': 1
}

prompt_1 = 'Classify the following: [INPUT]. Options: [OPTIONS]'

labels_1 = ['positive', 'negative', 'neutral']

# Test case 2: dual text input
input_2 = {
    'text_1': 'First text',
    'text_2': 'Second text',
    'label': 0
}

prompt_2 = 'Compare [INPUT_A] and [INPUT_B]. Choose from [OPTIONS]'

labels_2 = ['similar', 'different']

# Using the first test case as primary
ARGS = {
    'input': input_1,
    'prompt': prompt_1,
    'labels': labels_1,
    'with_label': True
}
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 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
translate_one_sentence_panlex Ran
ran; our contract draft was wrong, not the code
indonlp/nusa-writes/main_generation_classic.py
code served (permissive licence) · get_code("eab6642a577f3db1")
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 torch

# Create a simple translator dictionary
# The function calls translator.get(word) to look up translations
translator = {
    'hello': 'hola',
    'world': 'mundo',
    'python': 'python',
    'code': 'codigo'
}

# Create a test sentence with some words that exist in the translator
# and some that don't (to test the fallback behavior)
sentence = 'hello world python rocks'

ARGS = {
    'sentence': sentence,
    'translator': translator
}
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 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
get_logprobs Not yet run
unverified (harvested, no recorded run)
indonlp/nusa-writes/main_nlu_prompt.py
code served (permissive licence) · get_code("dc1ba6a2eff33540")
How it ran

no invocation recorded.

load_data Not yet run
unverified (harvested, no recorded run)
indonlp/nusa-writes/boomer/main_boomer.py
code served (permissive licence) · get_code("97cce8a19961338b")
How it ran

no invocation recorded.

predict_classification Not yet run
unverified (harvested, no recorded run)
indonlp/nusa-writes/main_nlu_prompt.py
code served (permissive licence) · get_code("c9ff0f13e10f8152")
How it ran

no invocation recorded.

predict_generation Not yet run
unverified (harvested, no recorded run)
indonlp/nusa-writes/main_nlg_prompt.py
code served (permissive licence) · get_code("4554d73b7e0f9471")
How it ran

no invocation recorded.

train_and_test Not yet run
unverified (harvested, no recorded run)
indonlp/nusa-writes/boomer/main_boomer.py
code served (permissive licence) · get_code("1ee1d7db8057684b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 0 later) and 11 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
get_lr 2 other papers
2 dated earlier
2009.05387 (2020-09)
IndoNLU: Benchmark and Resources for Evaluating Indonesian Natural Language Understanding
2109.07684 (2021-09)
Language Models are Few-shot Multilingual Learners
metrics_to_string 2 other papers
2 dated earlier
2009.05387 (2020-09)
IndoNLU: Benchmark and Resources for Evaluating Indonesian Natural Language Understanding
2109.07684 (2021-09)
Language Models are Few-shot Multilingual Learners
predict_classification 1 other paper
1 dated earlier
2305.13627 (2023-05)
InstructAlign: High-and-Low Resource Language Alignment via Continual Crosslingual Instruction Tuning

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

Democratizing access to natural language processing (NLP) technology is crucial, especially for underrepresented and extremely low-resource languages. Previous research has focused on developing labeled and unlabeled corpora for these languages through online scraping and document translation. While these methods have proven effective and cost-efficient, we have identified limitations in the resulting corpora, including a lack of lexical diversity and cultural relevance to local communities. To address this gap, we conduct a case study on Indonesian local languages. We compare the effectiveness of online scraping, human translation, and paragraph writing by native speakers in constructing datasets. Our findings demonstrate that datasets generated through paragraph writing by native speakers exhibit superior quality in terms of lexical diversity and cultural content. In addition, we present the \datasetname{} benchmark, encompassing 12 underrepresented and extremely low-resource languages spoken by millions of individuals in Indonesia. Our empirical experiment results using existing multilingual large language models conclude the need to extend these models to more underrepresented languages. We release the NusaWrites dataset at https://github.com/IndoNLP/nusa-writes.

For agents

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

get_harvested_code_for_paper("2309.10661")
get_code_for_paper("2309.10661")
have("2309.10661")

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

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

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

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

Connect an agent — have() is free.