SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1911.00720 · 2019

ZEN: Pre-training Chinese Text Encoder Enhanced by N-gram Representations

arXiv · PDF · Open in the Atlas

Code that ran

28 of 35 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 20 have no contract verdict; 7 failures of our instrument; 7 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, 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/1911.00720.json · badge: /api/ran/1911.00720.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
SVAIGBA/TwASP canonical (classifier label)
classifier basis: census
13 ran · 4 no recorded run
SVAIGBA/WMSeg canonical (classifier label)
classifier basis: census
7 ran · 1 no recorded run
sinovation/ZEN canonical (classifier label)
classifier basis: classifier_2025
1 ran · 1 no recorded run
cuhksz-nlp/mcasp community (classifier label)
classifier basis not recorded on the link
4 ran · 0 no recorded run
cuhksz-nlp/het-mc community (classifier label)
classifier basis: plan_row
3 ran · 1 no recorded run
FunctionStatusWhere it lives
swish Ran
ran; our contract draft was wrong, not the code
SVAIGBA/TwASP/pytorch_pretrained_bert/modeling_openai.py
code served (permissive licence) · get_code("0f786c407fb1ee4c")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-04T22:33:52Z). 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)

# The function swish takes a single parameter 'x' which is used with:
# - torch.sigmoid(x) - requires a tensor
# - x * ... - requires a tensor that supports multiplication
# So x should be a tensor

x = torch.randn(2, 4)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 2, dtype family float, shape (2, 4) — shape (2, 4) 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
build_tf_to_pytorch_map Ran
ran; our contract draft was wrong, not the code
SVAIGBA/TwASP/pytorch_pretrained_bert/modeling_transfo_xl.py
code served (permissive licence) · get_code("35ef111fc00c21b4")
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

torch.manual_seed(0)

class Config:
    def __init__(self):
        self.tie_projs = [False]
        self.tie_weight = True
        self.untie_r = False

class LayerNorm(nn.Module):
    def __init__(self, dim):
        super().__init__()
        self.weight = nn.Parameter(torch.randn(dim))
        self.bias = nn.Parameter(torch.randn(dim))

class DecAttn(nn.Module):
    def __init__(self, d_model=4, d_head=2):
        super().__init__()
        self.layer_norm = LayerNorm(d_model)
        self.o_net = nn.Linear(d_model, d_model)
        self.qkv_net = nn.Linear(d_model, 3 * d_model)
        self.r_net = nn.Linear(d_model, d_model)
        self.r_r_bias = nn.Parameter(torch.randn(d_model))
        self.r_w_bias = nn.Parameter(torch.randn(d_model))

class PosFeedForward(nn.Module):
    def __init__(self, d_model=4, d_ff=8):
        super().__init__()
        self.layer_norm = LayerNorm(d_model)
        self.CoreNet = nn.Sequential(
            nn.Linear(d_model, d_ff),
            nn.ReLU(),
            nn.Linear(d_ff, d_ff),
            nn.Linear(d_ff, d_model)
        )

class TransformerLayer(nn.Module):
    def __init__(self, d_model=4):
        super().__init__()
        self.dec_attn = DecAttn(d_model)
        self.pos_ff = PosFeedForward(d_model)

class WordEmb(nn.Module):
    def __init__(self, vocab_size=100, d_model=4, n_cutoffs=1):
        super().__init__()
        self.emb_layers = nn.ModuleList([nn.Embedding(vocab_size, d_model) for _ in range(n_cutoffs)])
        self.emb_projs = nn.ModuleList([nn.Linear(d_model, d_model) for _ in range(n_cutoffs)])

class AdaptiveSoftmax(nn.Module):
    def __init__(self, vocab_size=100, d_model=4, n_cutoffs=1):
        super().__init__()
        self.cluster_weight = nn.Parameter(torch.randn(n_cutoffs, d_model))
        self.cluster_bias = nn.Parameter(torch.randn(n_cutoffs))
        self.out_layers = nn.ModuleList([nn.Linear(d_model, vocab_size) for _ in range(n_cutoffs)])
        self.out_projs = nn.ModuleList([nn.Linear(d_model, d_model) for _ in range(n_cutoffs)])

class Transformer(nn.Module):
    def __init__(self, d_model=4, n_layers=2, n_cutoffs=1):
        super().__init__()
        self.word_emb = WordEmb(vocab_size=100, d_model=d_model, n_cutoffs=n_cutoffs)
        self.layers = nn.ModuleList([TransformerLayer(d_model) for _ in range(n_layers)])
        self.r_r_bias = nn.Parameter(torch.randn(d_model))
        self.r_w_bias = nn.Parameter(torch.randn(d_model))

class Model(nn.Module):
    def __init__(self, d_model=4, n_layers=2, n_cutoffs=1):
        super().__init__()
        self.transformer = Transformer(d_model=d_model, n_layers=n_layers, n_cutoffs=n_cutoffs)
        self.crit = AdaptiveSoftmax(vocab_size=100, d_model=d_model, n_cutoffs=n_cutoffs)

config = Config()
model = Model(d_model=4, n_layers=2, n_cutoffs=1)

ARGS = {
    'model': model,
    'config': 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
count_n_gram Ran
ran on a synthesized input
SVAIGBA/WMSeg/wmseg_helper.py
code served (permissive licence) · get_code("4892acce036705d1")
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 tempfile
import os
import re

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

# Create train.tsv file
train_tsv_path = os.path.join(temp_dir, 'train.tsv')
with open(train_tsv_path, 'w', encoding='utf8') as f:
    f.write("我\tB-PER\n")
    f.write("是\tO\n")
    f.write("学\tB-ORG\n")
    f.write("生\tI-ORG\n")
    f.write("\n")
    f.write("这\tO\n")
    f.write("是\tO\n")
    f.write("句\tO\n")
    f.write("子\tO\n")
    f.write("\n")

# Create test.tsv file
test_tsv_path = os.path.join(temp_dir, 'test.tsv')
with open(test_tsv_path, 'w', encoding='utf8') as f:
    f.write("你\tB-PER\n")
    f.write("好\tO\n")
    f.write("吗\tO\n")
    f.write("\n")
    f.write("测\tO\n")
    f.write("试\tO\n")
    f.write("数\tO\n")
    f.write("据\tO\n")
    f.write("\n")

ARGS = {
    'data_dir': temp_dir
}
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 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
cws_evaluate_OOV Ran
ran on a synthesized input
SVAIGBA/WMSeg/wmseg_eval.py
code served (permissive licence) · get_code("1a310e8f6b36323b")
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

torch.manual_seed(0)

# Analyze the function:
# - y_pred_list: list of sequences of tags ('E', 'S', etc.)
# - y_list: list of sequences of tags ('E', 'S', etc.)
# - sentence_list: list of sequences of characters
# - word2id: dict mapping words (strings) to IDs

# The function iterates through predictions and ground truth tags,
# checking if words at boundaries match. It calculates OOV (out-of-vocabulary) accuracy.

# Create sample data
y_pred_list = [
    ['S', 'E', 'S', 'E'],
    ['E', 'S', 'E', 'S']
]

y_list = [
    ['S', 'E', 'S', 'E'],
    ['E', 'S', 'E', 'S']
]

sentence_list = [
    ['你', '好', '世', '界'],
    ['我', '爱', '你', '们']
]

word2id = {
    '你好': 1,
    '世界': 2,
    '我': 3,
    '爱': 4,
    '你': 5,
    '们': 6
}

ARGS = {
    'y_pred_list': y_pred_list,
    'y_list': y_list,
    'sentence_list': sentence_list,
    'word2id': word2id
}
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
cws_evaluate_word_PRF Ran
ran; our contract draft was wrong, not the code
sinovation/ZEN/examples/run_token_level_classification.py
code served (permissive licence) · get_code("ba2b25faa32a1249")
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

torch.manual_seed(0)

# The function cws_evaluate_word_PRF takes two string parameters:
# y_pred: a predicted sequence string with tags like 'E', 'S', 'B', 'M'
# y: a ground truth sequence string with the same tags

# Both strings represent word segmentation tags where:
# 'S' = single character word
# 'B' = beginning of word
# 'M' = middle of word
# 'E' = end of word

# The function counts 'E' and 'S' to get word counts and evaluates precision, recall, F1

# Construct valid example sequences
# Let's create sequences that represent segmented text
y_pred_example = "SSBMESBE"  # predicted: word1(S), word2(BME), word3(S), word4(BE)
y_example = "SSBMESBE"       # ground truth: same structure for this example

ARGS = {
    'y_pred': y_pred_example,
    'y': y_example
}
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
cws_evaluate_word_PRF Ran
ran on a synthesized input
SVAIGBA/WMSeg/wmseg_eval.py
code served (permissive licence) · get_code("0421eab98cc3b9a9")
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

# Analyzing the function:
# - y_pred: a string with characters 'E', 'S', and other characters
# - y: a string with characters 'E', 'S', and other characters
# - The function compares them character by character and counts matching word boundaries
# - Word boundaries are marked by 'E' (End) or 'S' (Single character word)

# Create valid test arguments
# y_pred and y should be strings of same length containing tags like 'B', 'M', 'E', 'S'

y_pred = "BMEBMESS"  # Predicted tags: word1(BME), word2(B), word3(M), word4(E), word5(SS)
y = "BMEBMESS"      # True tags: same as predicted for this test case

ARGS = {
    "y_pred": y_pred,
    "y": y
}
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, 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
dlg Ran
ran on a synthesized input
cuhksz-nlp/mcasp/mcasp_helper.py
code served (permissive licence) · get_code("34ec071d80ec7278")
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 re
import numpy as np
from unittest.mock import Mock, patch
import tempfile
import os

# Create temporary TSV files for testing
temp_dir = tempfile.mkdtemp()

# Create a simple TSV file with character-label pairs
tsv_content_1 = """中 B
国 I
人 I

自 B
然 I
"""

tsv_content_2 = """我 B
爱 I
北 I
京 I

天 B
安 I
门 I
"""

file_path_1 = os.path.join(temp_dir, "test1.tsv")
file_path_2 = os.path.join(temp_dir, "test2.tsv")

with open(file_path_1, 'w', encoding='utf8') as f:
    f.write(tsv_content_1)

with open(file_path_2, 'w', encoding='utf8') as f:
    f.write(tsv_content_2)

# Define the arguments
ARGS = {
    'data_path_list': [file_path_1, file_path_2],
    'ngram_length': 5,
    'renew_freq': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tqdm — 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
eval_sentence Ran
ran on a synthesized input
SVAIGBA/TwASP/twasp_eval.py
code served (permissive licence) · get_code("87867d95beeee94a")
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 numpy as np

torch.manual_seed(0)

# Analyze the function:
# - y_pred: list of labels, each label is indexable (label[0], label[2:])
# - y: list of labels (can be None), each label is indexable (label[0], label[2:])
# - sentence: string with space-separated words
# - word2id: dict-like object with __contains__ method

# Build test data
sentence = "hello world foo bar"
words = sentence.split(' ')  # 4 words

# y_pred: list of labels where each label is a sequence
# label[0] gives tag (S/E/B/I), label[2:] gives POS tag
y_pred = [
    "BS_NN",      # B tag, POS = S_NN (label[2:] = "S_NN")
    "IS_VB",      # I tag, POS = S_VB
    "ES_JJ",      # E tag, POS = S_JJ
    "SS_RB",      # S tag, POS = S_RB
]

# y: ground truth labels with same structure
y = [
    "BS_NN",
    "IS_VB", 
    "ES_JJ",
    "SS_RB",
]

# word2id: dict that maps words to ids
# The function checks if word_true is in word2id
word2id = {
    "hello": 0,
    "helloworld": 1,
    "helloworldfoo": 2,
    "helloworld": 3,
    "world": 4,
    "worldfoo": 5,
    "foo": 6,
    "foobar": 7,
    "bar": 8,
}

ARGS = {
    "y_pred": y_pred,
    "y": y,
    "sentence": sentence,
    "word2id": word2id,
}
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, 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
eval_sentence Ran
ran on a synthesized input
SVAIGBA/WMSeg/wmseg_eval.py
code served (permissive licence) · get_code("fad09e6582176e41")
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 numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - y_pred: list/array of predictions (chars 'S', 'E', or others)
# - y: list/array of true labels (chars 'S', 'E', or others), can be None
# - sentence: string with space-separated words
# - word2id: dict mapping words to ids

# The function splits a sentence by spaces, groups words based on y_pred and y
# labels, and returns tuples of segmented strings.

# Create simple test data
sentence = "hello world foo bar"
words = sentence.split(' ')  # ['hello', 'world', 'foo', 'bar']

# y_pred: predictions for each word
y_pred = ['S', 'E', 'S', 'E']

# y: true labels for each word (same length as y_pred)
y = ['S', 'E', 'S', 'E']

# word2id: dictionary mapping words to IDs
# Include some of the words from the sentence
word2id = {
    'hello': 0,
    'world': 1,
    'foo': 2,
    'bar': 3
}

ARGS = {
    'y_pred': y_pred,
    'y': y,
    'sentence': sentence,
    'word2id': word2id
}
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, 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
eval_sentence Ran
ran on a synthesized input
cuhksz-nlp/mcasp/mcasp_eval.py
code served (permissive licence) · get_code("116ccd8fe121ef8f")
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 numpy as np

torch.manual_seed(0)

# Analyze the function to understand what it needs:
# - y_pred: list of labels, each label is a string where [0] is accessed (first char)
#           and [2:] is accessed (substring from index 2)
# - y: list of labels, same structure as y_pred
# - sentence: a string that will be split by spaces into words
# - word2id: a dict where we check membership with 'in' operator

# Construct a valid sentence with 5 words
sentence = "我 爱 自 然 语"

# Create y (true labels) - each label needs at least 3 characters
# Format: first char is word boundary tag (S/E/B/M), positions 1+ are POS tags
# We need the same number of labels as words in the sentence
y = [
    "Ba",      # word boundary tag 'B', POS tag 'a'
    "Ma",      # word boundary tag 'M', POS tag 'a'
    "Sb",      # word boundary tag 'S', POS tag 'b'
    "Ec",      # word boundary tag 'E', POS tag 'c'
    "Sd",      # word boundary tag 'S', POS tag 'd'
]

# Create y_pred (predicted labels) - same structure
y_pred = [
    "Ba",      # word boundary tag 'B', POS tag 'a'
    "Ma",      # word boundary tag 'M', POS tag 'a'
    "Sb",      # word boundary tag 'S', POS tag 'b'
    "Ed",      # word boundary tag 'E', POS tag 'd' (different from true)
    "Se",      # word boundary tag 'S', POS tag 'e' (different from true)
]

# Create word2id dictionary - a simple dict mapping some words
word2id = {
    "我爱_a": 1,
    "自然_bc": 2,
    "语_d": 3,
}

ARGS = {
    "y_pred": y_pred,
    "y": y,
    "sentence": sentence,
    "word2id": word2id,
}
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, 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
gelu Ran
ran; our contract draft was wrong, not the code
SVAIGBA/TwASP/pytorch_pretrained_bert/modeling_gpt2.py
code served (permissive licence) · get_code("8d23fbe2b99b840b")
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) and returned Tensor, ndim 2, dtype family float, shape (2, 4) 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 math

torch.manual_seed(0)

# Create a small tensor for testing
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 2, dtype family float, shape (2, 4) — shape (2, 4) 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
gelu Ran
ran, honoured the contract we drafted
SVAIGBA/TwASP/pytorch_pretrained_bert/modeling.py
pointer only (licence: MIT); the stored copy get_code serves, from tanmay1618/text_to_sql_bert, is pointer only (licence: NONE) · get_code("fdc64f4c72036ae4")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from tanmay1618/text_to_sql_bert, 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.

get_vocab Ran
ran on a synthesized input
cuhksz-nlp/het-mc/hetmc_helper.py
code served (permissive licence) · get_code("99b87b401d1fae1e")
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

# Construct training_dialog: list of dialogs
# Each dialog is a tuple/list where:
# - dialog[0] is utterance (iterable of words)
# - dialog[1] is label (iterable of labels)
# - dialog[6] is department (string)
# - dialog[7] is disease (string)

training_dialog = [
    (
        ['hello', 'i', 'have', 'fever'],  # utterance (dialog[0])
        ['greeting', 'symptom'],           # label (dialog[1])
        None,                              # dialog[2]
        None,                              # dialog[3]
        None,                              # dialog[4]
        None,                              # dialog[5]
        'cardiology',                      # department (dialog[6])
        'hypertension'                     # disease (dialog[7])
    ),
    (
        ['my', 'head', 'hurts'],           # utterance (dialog[0])
        ['symptom', 'complaint'],          # label (dialog[1])
        None,                              # dialog[2]
        None,                              # dialog[3]
        None,                              # dialog[4]
        None,                              # dialog[5]
        'neurology',                       # department (dialog[6])
        'migraine'                         # disease (dialog[7])
    ),
]

ARGS = {
    'training_dialog': training_dialog
}
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, 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_word2id Ran
ran on a synthesized input
SVAIGBA/TwASP/twasp_helper.py
code served (permissive licence) · get_code("98046cec1e6090e5")
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 tempfile
import os

# Create a temporary training file with NER-style data
temp_dir = tempfile.mkdtemp()
train_path = os.path.join(temp_dir, 'train.txt')

# Write sample NER data in CoNLL format (character\ttag format)
with open(train_path, 'w') as f:
    # Sample word 1: "hello" with tags
    f.write("h\tB\n")
    f.write("e\tI\n")
    f.write("l\tI\n")
    f.write("l\tI\n")
    f.write("o\tE\n")
    f.write("\n")
    # Sample word 2: "world" with tags
    f.write("w\tB\n")
    f.write("o\tI\n")
    f.write("r\tI\n")
    f.write("l\tI\n")
    f.write("d\tE\n")
    f.write("\n")
    # Sample word 3: "test" as a single token
    f.write("t\tS\n")
    f.write("e\tS\n")
    f.write("s\tS\n")
    f.write("t\tS\n")
    f.write("\n")

ARGS = {
    'train_path': train_path
}
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 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
get_word2id Ran
ran on a synthesized input
cuhksz-nlp/mcasp/mcasp_helper.py
code served (permissive licence) · get_code("ecd45f0d33c0aff5")
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 tempfile
import os

# Create a temporary file with sample training data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt', encoding='utf8')
temp_file_path = temp_file.name

# Write sample data in the expected format (character\tlabel)
# The function expects lines with tabs, where last column contains labels
# Labels 'S' (single) and 'E' (end) trigger word addition
sample_data = """我\tB
爱\tE
自\tB
然\tE
风\tS
景\tB
优\tM
美\tE
"""

temp_file.write(sample_data)
temp_file.close()

ARGS = {
    'train_path': temp_file_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tqdm — 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
load_json Ran
ran on a synthesized input
cuhksz-nlp/het-mc/hetmc_helper.py
code served (permissive licence) · get_code("3872690ce9ded1c4")
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 json
import tempfile
import os

# Create a temporary JSON file with a single line of JSON data
temp_dir = tempfile.gettempdir()
temp_file = os.path.join(temp_dir, "test_load_json.json")

# Write a valid JSON object as the first line
with open(temp_file, 'w', encoding='utf8') as f:
    f.write('{"key": "value", "number": 42}\n')
    f.write('{"extra": "line"}\n')  # This will be ignored

ARGS = {
    "file_path": temp_file
}
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 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
pos_evaluate_OOV Ran
ran on a synthesized input
SVAIGBA/TwASP/twasp_eval.py
code served (permissive licence) · get_code("342218755bdf47ed")
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

# Analyzing the function:
# - y_pred_list: list of lists of predictions, each prediction has elements where [0] is word label, [2:] is pos label
# - y_list: list of lists of true labels, same structure as y_pred_list
# - sentence_list: list of sentences (sequences of characters/tokens)
# - word2id: dictionary mapping words to ids

# The function processes sequences where each element has:
# - Index 0: word tag ('E', 'S', 'B', 'M', etc.)
# - Index 2+: POS tags (tuple/list)

# Create sample data
# Each label is a tuple/list where [0] is word tag and [2:] is POS tag(s)

# Sample y_list: list of 2 sequences
y_list = [
    [
        ('B', 'X', 'NN'),  # word tag 'B', pos tags ('NN',)
        ('E', 'X', 'VB'),
        ('S', 'X', 'JJ'),
    ],
    [
        ('S', 'X', 'NN'),
        ('B', 'X', 'VB'),
        ('E', 'X', 'NN'),
    ]
]

# Sample y_pred_list: predicted labels with same structure
y_pred_list = [
    [
        ('B', 'X', 'NN'),
        ('E', 'X', 'VB'),
        ('S', 'X', 'JJ'),
    ],
    [
        ('S', 'X', 'NN'),
        ('B', 'X', 'VB'),
        ('E', 'X', 'NN'),
    ]
]

# Sample sentence_list: list of character sequences
sentence_list = [
    ['中', '国', '人', '工', '智', '能'],  # 6 characters
    ['自', '然', '语', '言', '处', '理'],  # 6 characters
]

# word2id: dictionary with some in-vocabulary words
word2id = {
    '中国': 1,
    '人工': 2,
    '智能': 3,
    '自然': 4,
    '语言': 5,
}

ARGS = {
    'y_pred_list': y_pred_list,
    'y_list': y_list,
    'sentence_list': sentence_list,
    'word2id': word2id,
}
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, 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
pos_evaluate_OOV Ran
ran on a synthesized input
cuhksz-nlp/mcasp/mcasp_eval.py
code served (permissive licence) · get_code("3f4a9392fcb8695c")
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 numpy as np

# Build test data for pos_evaluate_OOV function
# The function expects:
# - y_pred_list: list of predicted label lists
# - y_list: list of true label lists
# - sentence_list: list of character sequences
# - word2id: dict mapping words to ids

# Each label is a sequence where:
# - index 0 is the word tag ('B', 'I', 'E', 'S')
# - index 1 is unused (based on y_l[2:] for POS)
# - index 2+ is the POS tag

# Create sample data with 2 sequences
# Sequence 1: 4 characters
sentence_1 = ['a', 'b', 'c', 'd']
# Labels: word_tag at [0], unused at [1], POS tag at [2:]
y_label_1 = [
    ('B', 'X', 'NN'),
    ('I', 'X', 'NN'),
    ('E', 'X', 'NN'),
    ('S', 'X', 'VB'),
]
y_pred_label_1 = [
    ('B', 'X', 'NN'),
    ('I', 'X', 'NN'),
    ('E', 'X', 'NN'),
    ('S', 'X', 'VB'),
]

# Sequence 2: 3 characters
sentence_2 = ['x', 'y', 'z']
y_label_2 = [
    ('B', 'X', 'JJ'),
    ('I', 'X', 'JJ'),
    ('S', 'X', 'RB'),
]
y_pred_label_2 = [
    ('B', 'X', 'JJ'),
    ('E', 'X', 'JJ'),
    ('S', 'X', 'RB'),
]

# Build the arguments
y_pred_list = [y_pred_label_1, y_pred_label_2]
y_list = [y_label_1, y_label_2]
sentence_list = [sentence_1, sentence_2]

# word2id: maps known words to ids
# "abc" is in-vocabulary, "xy" is out-of-vocabulary
word2id = {
    'abc': 1,
    'a': 2,
    'b': 3,
    'd': 4,
}

ARGS = {
    'y_pred_list': y_pred_list,
    'y_list': y_list,
    'sentence_list': sentence_list,
    'word2id': word2id,
}
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, 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
prune_conv1d_layer Ran
ran; our contract draft was wrong, not the code
SVAIGBA/TwASP/pytorch_pretrained_bert/modeling_gpt2.py
code served (permissive licence) · get_code("f255dd42f46c11c1")
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 Conv1D. 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
from torch.nn.parameter import Parameter

torch.manual_seed(0)

class Conv1D(nn.Module):
    def __init__(self, nf, nx):
        super(Conv1D, self).__init__()
        self.nf = nf
        w = torch.empty(nx, nf)
        nn.init.normal_(w, std=0.02)
        self.weight = Parameter(w)
        self.bias = Parameter(torch.zeros(nf))

    def forward(self, x):
        size_out = x.size()[:-1] + (self.nf,)
        x = torch.addmm(self.bias, x.view(-1, x.size(-1)), self.weight)
        x = x.view(*size_out)
        return x

# Create a Conv1D layer with dimensions: nx=4 (input features), nf=3 (output features)
layer = Conv1D(nf=3, nx=4)

# Create an index tensor to select which dimensions to keep
# Using dim=1, so we select from output dimension (nf=3)
# Let's keep indices 0 and 2 (out of 0, 1, 2)
index = torch.tensor([0, 2], dtype=torch.long)

ARGS = {
    "layer": layer,
    "index": index,
    "dim": 1
}
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 Conv1D — a Conv1D output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv1D 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
prune_linear_layer Ran
ran; our contract draft was wrong, not the code
SVAIGBA/TwASP/pytorch_pretrained_bert/modeling.py
code served (permissive licence) · get_code("d30d6c3098df2c42")
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) and returned Linear. 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 torch import nn

torch.manual_seed(0)

# Create a linear layer to prune
# Using distinct sizes: input_features=3, output_features=4
layer = nn.Linear(in_features=3, out_features=4, bias=True)

# Create an index tensor to select which output features to keep
# Selecting 2 out of 4 output features
index = torch.tensor([0, 2], dtype=torch.long)

# dim=0 means we're pruning along the output dimension (rows of weight matrix)
dim = 0

ARGS = {
    "layer": layer,
    "index": index,
    "dim": dim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Linear — a Linear output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Linear 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_dialog Ran
ran on a synthesized input
cuhksz-nlp/het-mc/hetmc_helper.py
code served (permissive licence) · get_code("c9622c7a1d0912d6")
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. 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 tempfile
import os

# Create a temporary file with dialog data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, encoding='utf8', suffix='.txt')

# Write sample dialog data in the expected format
dialog_content = """id\t12345\tpatient_name\tcardiology\tdoctor_name\thypertension
P	Hello doctor, I have been feeling dizzy	symptom
D	How long has this been happening?	inquiry
SUM1	Patient reports dizziness
SUM2	Doctor inquires about duration
SUM2.0	Patient symptom assessment
SUM2.1	Doctor follow-up questions

P	For about a week now	response
D	Let me check your blood pressure	action

"""

temp_file.write(dialog_content)
temp_file.close()

# Define ARGS dict with the filename parameter
ARGS = {
    'filename': temp_file.name
}
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 — a list 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
read_sentence Ran
ran on a synthesized input
SVAIGBA/TwASP/twasp_model.py
code served (permissive licence) · get_code("5b7c711347a2c214")
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. 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 tempfile
import os

# Create a temporary file with sample sentence data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, encoding='utf8', suffix='.txt')
temp_file.write("Hello world\n")
temp_file.write("This is a test\n")
temp_file.write("\n")  # Empty line to test the skip condition
temp_file.write("Another sentence\n")
temp_file.close()

ARGS = {
    'filename': temp_file.name
}
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 — a list 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
read_tsv Ran
ran on a synthesized input
SVAIGBA/TwASP/twasp_helper.py
code served (permissive licence) · get_code("352e22ef30c1f7b7")
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 3, 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 TSV file with sample data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "sample.tsv")

# Write sample TSV content
with open(temp_file, 'w', encoding='utf8') as f:
    f.write("The\tDET\n")
    f.write("cat\tNOUN\n")
    f.write("sat\tVERB\n")
    f.write("\n")
    f.write("It\tPRON\n")
    f.write("is\tVERB\n")
    f.write("here\tADV\n")

ARGS = {
    'file_path': temp_file
}
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 3, 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
read_tsv Ran
ran on a synthesized input
SVAIGBA/WMSeg/wmseg_helper.py
code served (permissive licence) · get_code("efebd15616e8be5b")
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 tempfile
import os

# Create a temporary TSV file with test data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.tsv")

# Write sample TSV data: character \t label format
with open(temp_file, 'w', encoding='utf8') as f:
    f.write("我\tB-PER\n")
    f.write("是\tO\n")
    f.write("张\tB-PER\n")
    f.write("三\tI-PER\n")
    f.write("\n")
    f.write("这\tO\n")
    f.write("是\tO\n")
    f.write("测\tB-LOC\n")
    f.write("试\tI-LOC\n")
    f.write("。\tO\n")
    f.write("\n")

ARGS = {
    "file_path": temp_file
}
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 — 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
readfile Ran
ran on a synthesized input
SVAIGBA/TwASP/twasp_model.py
code served (permissive licence) · get_code("013a1a80d4e2be45")
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. 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 tempfile
import os

# Create a temporary file with sample NER/tagging data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("John\tB-PER\n")
temp_file.write("Smith\tI-PER\n")
temp_file.write("went\tO\n")
temp_file.write("to\tO\n")
temp_file.write("New\tB-LOC\n")
temp_file.write("York\tI-LOC\n")
temp_file.write("\n")
temp_file.write("He\tB-PER\n")
temp_file.write("visited\tO\n")
temp_file.write("Paris\tB-LOC\n")
temp_file.write("\n")
temp_file.flush()
temp_filename = temp_file.name
temp_file.close()

ARGS = {
    'filename': temp_filename
}
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 — a list 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
readfile Ran
ran on a synthesized input
SVAIGBA/WMSeg/wmseg_model.py
code served (permissive licence) · get_code("3e642a8045e6ba92")
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 3, 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 the format expected by readfile
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_filename = temp_file.name

# Write sample data: character, tab, label format
sample_data = """中	O
国	O
是	O
一	O
个	O
大	O
国	O
家	O
。	O

美	B-LOC
国	I-LOC
人	O
。	O

"""

temp_file.write(sample_data)
temp_file.close()

ARGS = {
    'filename': temp_filename,
    'flag': 'train'
}
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 list, ndim 3, 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
readsentence Ran
ran on a synthesized input
SVAIGBA/WMSeg/wmseg_model.py
code served (permissive licence) · get_code("9b29b0de8fad09f9")
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. 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 tempfile
import os

# Create a temporary file with sample text data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, encoding='utf8', suffix='.txt')
temp_file.write("hello world\n")
temp_file.write("this is a test\n")
temp_file.write("\n")
temp_file.write("another line\n")
temp_file.close()

filename = temp_file.name

ARGS = {
    'filename': filename
}
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 — a list 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
sample_logits Ran
ran; our contract draft was wrong, not the code
SVAIGBA/TwASP/pytorch_pretrained_bert/modeling_transfo_xl_utilities.py
code served (permissive licence) · get_code("93228a3eb5c4d179")
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 3, dtype family float, shape (2, 3, 6) 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

torch.manual_seed(0)

# Small embedding layer
n_vocab = 20
n_emb = 4
embedding = nn.Embedding(n_vocab, n_emb)

# Bias vector
bias = torch.randn(n_vocab)

# Labels: [b1, b2] with valid vocab indices
b1, b2 = 2, 3
labels = torch.randint(0, n_vocab, (b1, b2))

# Inputs: [b1, b2, n_emb]
inputs = torch.randn(b1, b2, n_emb)

# Sampler that implements the sample() method
class LogUniformSampler:
    def __init__(self, n_vocab, n_sample=5):
        self.n_vocab = n_vocab
        self.n_sample = n_sample
    
    def sample(self, labels):
        # Sample negative samples
        neg_samples = torch.randint(0, self.n_vocab, (self.n_sample,))
        
        # Log probabilities
        true_log_probs = torch.randn(labels.size(0), labels.size(1))
        samp_log_probs = torch.randn(self.n_sample)
        
        return true_log_probs, samp_log_probs, neg_samples

sampler = LogUniformSampler(n_vocab=n_vocab, n_sample=5)

ARGS = {
    "embedding": embedding,
    "bias": bias,
    "labels": labels,
    "inputs": inputs,
    "sampler": sampler
}
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 3, dtype family float, shape (2, 3, 6) — shape (2, 3, 6) 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
convert_example_to_features Not yet run
unverified (harvested, no recorded run)
sinovation/ZEN/examples/run_pre_train.py
code served (permissive licence) · get_code("000595907a687ec4")
How it ran

no invocation recorded.

dlg Not yet run
unverified (harvested, no recorded run)
SVAIGBA/WMSeg/wmseg_helper.py
code served (permissive licence) · get_code("301c6b5f8def3f58")
How it ran

no invocation recorded.

load_tf_weights_in_bert Not yet run
unverified (harvested, no recorded run)
SVAIGBA/TwASP/pytorch_pretrained_bert/modeling.py
pointer only (licence: MIT); the stored copy get_code serves, from sreyan88/toxicity-detection-in-spoken-utterances, is pointer only (licence: NONE) · get_code("b1a7180868dd8d6a")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from sreyan88/toxicity-detection-in-spoken-utterances, 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. No invocation recorded.

load_tf_weights_in_gpt2 Not yet run
unverified (harvested, no recorded run)
SVAIGBA/TwASP/pytorch_pretrained_bert/modeling_gpt2.py
code served (permissive licence) · get_code("a62604f618a8cc82")
How it ran

no invocation recorded.

load_tf_weights_in_openai_gpt Not yet run
unverified (harvested, no recorded run)
SVAIGBA/TwASP/pytorch_pretrained_bert/modeling_openai.py
code served (permissive licence) · get_code("46f305675277e757")
How it ran

no invocation recorded.

load_tf_weights_in_transfo_xl Not yet run
unverified (harvested, no recorded run)
cuhksz-nlp/het-mc/pytorch_pretrained_bert/modeling_transfo_xl.py
code served (permissive licence) · get_code("1ebc2bf2c3cddc4d")
How it ran

no invocation recorded.

read_sentence Not yet run
unverified (harvested, no recorded run)
SVAIGBA/TwASP/twasp_helper.py
code served (permissive licence) · get_code("4d322567015518e5")
How it ran

no invocation recorded.

Also present in other papers' code

Of 35 samples lifted from this paper's linked repositories, 35 carry a function identity and 0 do not. Of the 35 distinct functions with an identity, 11 are also present in other papers whose code we hold (11 with at least one paper dated earlier, 2 the same month, 11 later) and 24 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
swish 206 other papers
24 dated earlier, 182 later · 44 only as an assembly brick
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1805.12114 (2018-05)
Deep Reinforcement Learning in a Handful of Trials using Probabilistic Dynamics Models
1809.01357 (2018-09)
Zero Shot Learning for Code Education: Rubric Sampling with Deep Learning Inference
and 203 more not named here
gelu 198 other papers
28 dated earlier, 3 the same month, 167 later · 32 only as an assembly brick
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1901.10125 (2019-01)
Glyce: Glyph-vectors for Chinese Character Representations
and 195 more not named here
gelu 51 other papers
10 dated earlier, 41 later · 8 only as an assembly brick
1706.03762 (2017-06)
Attention Is All You Need
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
and 48 more not named here
prune_linear_layer 29 other papers
6 dated earlier, 23 later
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1906.08230 (2019-06)
Evaluating Protein Transfer Learning with TAPE
1906.08237 (2019-06)
XLNet: Generalized Autoregressive Pretraining for Language Understanding
and 26 more not named here
prune_conv1d_layer 16 other papers
3 dated earlier, 13 later
1906.08237 (2019-06)
XLNet: Generalized Autoregressive Pretraining for Language Understanding
1909.05311 (2019-09)
Graph-Based Reasoning over Heterogeneous External Knowledge for Commonsense Question Answering
1909.11942 (2019-09)
ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
and 13 more not named here
load_tf_weights_in_bert 15 other papers
2 dated earlier, 1 the same month, 12 later
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1908.09355 (2019-08)
Patient Knowledge Distillation for BERT Model Compression
1911.03584 (2019-11)
On the Relationship between Self-Attention and Convolutional Layers
and 12 more not named here
sample_logits 14 other papers
4 dated earlier, 10 later · 2 only as an assembly brick
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
1906.08237 (2019-06)
XLNet: Generalized Autoregressive Pretraining for Language Understanding
1908.09355 (2019-08)
Patient Knowledge Distillation for BERT Model Compression
and 11 more not named here
build_tf_to_pytorch_map 10 other papers
4 dated earlier, 6 later
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
1906.08237 (2019-06)
XLNet: Generalized Autoregressive Pretraining for Language Understanding
1908.09355 (2019-08)
Patient Knowledge Distillation for BERT Model Compression
and 7 more not named here
load_tf_weights_in_gpt2 4 other papers
2 dated earlier, 2 later
1906.01698 (2019-06)
Open Sesame: Getting Inside BERT's Linguistic Knowledge
1908.09355 (2019-08)
Patient Knowledge Distillation for BERT Model Compression
2004.05707 (2020-04)
VGCN-BERT: Augmenting BERT with Graph Embedding for Text Classification
and 1 more not named here
load_tf_weights_in_openai_gpt 3 other papers
2 dated earlier, 1 later
1906.01698 (2019-06)
Open Sesame: Getting Inside BERT's Linguistic Knowledge
1908.09355 (2019-08)
Patient Knowledge Distillation for BERT Model Compression
2005.02439 (2020-05)
Contextualizing Hate Speech Classifiers with Post-hoc Explanation
load_tf_weights_in_transfo_xl 3 other papers
2 dated earlier, 1 later
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
1908.09355 (2019-08)
Patient Knowledge Distillation for BERT Model Compression
2005.02439 (2020-05)
Contextualizing Hate Speech Classifiers with Post-hoc Explanation

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

The pre-training of text encoders normally processes text as a sequence of tokens corresponding to small text units, such as word pieces in English and characters in Chinese. It omits information carried by larger text granularity, and thus the encoders cannot easily adapt to certain combinations of characters. This leads to a loss of important semantic information, which is especially problematic for Chinese because the language does not have explicit word boundaries. In this paper, we propose ZEN, a BERT-based Chinese (Z) text encoder Enhanced by N-gram representations, where different combinations of characters are considered during training. As a result, potential word or phase boundaries are explicitly pre-trained and fine-tuned with the character encoder (BERT). Therefore ZEN incorporates the comprehensive information of both the character sequence and words or phrases it contains. Experimental results illustrated the effectiveness of ZEN on a series of Chinese NLP tasks. We show that ZEN, using less resource than other published encoders, can achieve state-of-the-art performance on most tasks. Moreover, it is shown that reasonable performance can be obtained when ZEN is trained on a small corpus, which is important for applying pre-training techniques to scenarios with limited data. The code and pre-trained models of ZEN are available at https://github.com/sinovation/zen.

For agents

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

get_harvested_code_for_paper("1911.00720")
get_code_for_paper("1911.00720")
have("1911.00720")

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

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

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

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

Connect an agent — have() is free.