SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2004.13922 · EMNLP Findings · 2020

Revisiting Pre-trained Models for Chinese Natural Language Processing

Ting Liu, Shijin Wang, Yiming Cui, Wanxiang Che, Bing Qin, Guoping Hu

arXiv · PDF · Open in the Atlas

Code that ran

21 of 35 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 11 failures of our instrument; 14 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2004.13922.json · badge: /api/ran/2004.13922.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
ymcui/Chinese-PreTrained-XLNet community (classifier label)
classifier basis not recorded on the link
12 ran · 8 no recorded run
ymcui/Chinese-ELECTRA community (classifier label)
classifier basis not recorded on the link
5 ran · 2 no recorded run
shibing624/pycorrector community
Papers with Code archive
4 ran · 4 no recorded run
FunctionStatusWhere it lives
FocalLoss Ran
ran on a synthesized input · constructed an object; no result was computed
shibing624/pycorrector/pycorrector/macbert/macbert4csc.py
code served (permissive licence) · get_code("49538ded4b211b0d")
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 an instance of its own class, FocalLoss: the run constructed the object and did not call it, so no result was computed. 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)

# For softmax case: logits of shape [batch_size, num_cls]
batch_size = 2
num_labels = 4

# Create softmax test inputs
logits_softmax = torch.randn(batch_size, num_labels)
target_softmax = torch.randint(0, num_labels, (batch_size,))

# Create sigmoid test inputs (multi-hot encoded)
logits_sigmoid = torch.randn(batch_size, num_labels)
target_sigmoid = torch.randint(0, 2, (batch_size, num_labels)).float()

# Define ARGS for softmax variant
ARGS = {
    'num_labels': num_labels,
    'activation_type': 'softmax',
    'gamma': 2.0,
    'alpha': 0.25,
    'epsilon': 1e-09,
}

# Additional test data (for reference, not part of ARGS)
TEST_DATA_SOFTMAX = {
    'input': logits_softmax,
    'target': target_softmax,
}

TEST_DATA_SIGMOID = {
    'input': logits_sigmoid,
    'target': target_sigmoid,
}
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 FocalLoss — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a FocalLoss 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
assign_to_gpu Ran
ran on a synthesized input
ymcui/Chinese-PreTrained-XLNet/src/gpu_utils.py
code served (permissive licence) · get_code("6b2a8f1c93d0b071")
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 function. 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 tensorflow as tf

# The function assign_to_gpu takes two parameters:
# - gpu: an integer specifying which GPU to use
# - ps_dev: a string specifying the parameter server device

# Looking at the function body, it returns a closure _assign that:
# 1. Takes an op (which can be a tf.NodeDef or an object with a .node_def attribute)
# 2. Checks if op.node_def.op == 'Variable'
# 3. Returns either ps_dev or a GPU device string

# Create a minimal mock NodeDef-like object for testing
class MockNodeDef:
    def __init__(self, op_type='MatMul'):
        self.op = op_type

class MockOp:
    def __init__(self, op_type='MatMul'):
        self.node_def = MockNodeDef(op_type)

# Define the arguments
ARGS = {
    'gpu': 0,
    'ps_dev': '/device:CPU:0'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
batchify Ran
ran on a synthesized input
ymcui/Chinese-PreTrained-XLNet/src/data_utils.py
code served (permissive licence) · get_code("8fa4efe75d3345a4")
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 int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# The function expects:
# - data: something with len() and reshapeable (numpy array or torch tensor)
# - bsz_per_host: int (batch size per host)
# - sent_ids: optional, same structure as data

# Create small numpy arrays that satisfy the function's operations
data = np.arange(24, dtype=np.int32).reshape(24)  # 24 elements
bsz_per_host = 4  # batch size
sent_ids = np.arange(24, 48, dtype=np.int32).reshape(24)  # 24 elements, different values

ARGS = {
    "data": data,
    "bsz_per_host": bsz_per_host,
    "sent_ids": sent_ids,
}
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 3, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_corrector_prf Ran
ran, honoured the contract we drafted
shibing624/pycorrector/pycorrector/macbert/macbert4csc.py
code served (permissive licence) · get_code("bc8cd524a10a5326")
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.

from loguru import logger

# Create a simple logger instance
test_logger = logger

# Create sample data for results
# Each item is (src, tgt, predict) where src is original, tgt is target, predict is model's prediction
results = [
    ("你好世界", "你好世界", "你好世界"),  # Perfect prediction
    ("这是一个测试", "这是一个测试", "这是一个测试"),  # Perfect prediction
    ("我爱吃饭", "我爱吃面", "我爱吃面"),  # Correct prediction with error detection
    ("中国人民", "中国人名", "中国人民"),  # False positive - predicted wrong
    ("测试文本", "测试文字", "测试文本"),  # Missed error - didn't detect change from 本 to 字
]

ARGS = {
    "results": results,
    "logger": test_logger,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
loguru — 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
compute_sentence_level_prf Ran
ran, honoured the contract we drafted
shibing624/pycorrector/pycorrector/macbert/macbert4csc.py
code served (permissive licence) · get_code("731b5640fb2a2a52")
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.

from loguru import logger

# Create sample results for compute_sentence_level_prf
# Each item is a tuple of (src, tgt, predict)
# where src is source, tgt is target, predict is prediction
results = [
    ("hello world", "hello world", "hello world"),  # TN: src==tgt and tgt==predict
    ("hello world", "hello world", "goodbye world"),  # FP: src==tgt but tgt!=predict
    ("hello wrld", "hello world", "hello world"),  # TP: src!=tgt and tgt==predict
    ("hello wrld", "hello world", "goodbye world"),  # FN: src!=tgt and tgt!=predict
    ("test case", "test case", "test case"),  # TN
    ("test cse", "test case", "test case"),  # TP
]

ARGS = {
    "results": results,
    "logger": logger,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
loguru — 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
create_int_feature Ran
ran; our contract draft was wrong, not the code
ymcui/Chinese-ELECTRA/build_pretraining_dataset.py
code served (permissive licence) · get_code("b03d45af664a39e3")
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 Feature. 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 tensorflow.compat.v1 as tf

# The function takes 'values' parameter and converts it to a list
# which is then passed to tf.train.Int64List(value=list(values))
# So values needs to be something iterable that can be converted to a list of integers

values = [1, 2, 3, 4, 5]

ARGS = {
    "values": values
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Feature — a Feature output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Feature 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
create_run_config Ran
ran on a synthesized input
ymcui/Chinese-PreTrained-XLNet/src/xlnet.py
code served (permissive licence) · get_code("b9e225229ba459c3")
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 RunConfig. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class FLAGSConfig:
    def __init__(self):
        self.use_tpu = False
        self.use_bfloat16 = False
        self.dropout = 0.1
        self.dropatt = 0.1
        self.init = "normal"
        self.init_range = 0.1
        self.init_std = 0.02
        self.clamp_len = -1
        self.mem_len = 128
        self.reuse_len = 64
        self.bi_data = True
        self.same_length = False

FLAGS = FLAGSConfig()

ARGS = {
    "is_training": True,
    "is_finetune": False,
    "FLAGS": FLAGS
}
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 RunConfig — a RunConfig output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a RunConfig 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
encode_pieces Ran
ran; our contract draft was wrong, not the code
ymcui/Chinese-PreTrained-XLNet/src/prepro_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from cliang1453/super-structured-lottery-tickets, is pointer only (licence: MIT) · get_code("0de7059b7a331eb0")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from cliang1453/super-structured-lottery-tickets, and MIT, as GitHub detects it on that repository, is in the permissive set, but a licence decision keeps the body a pointer: its licence file names an outside party, so it may cover vendored code rather than the repository owner's files (recorded as pointer:licence_names_third_party_corporation). 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.

find_lcs Ran
ran on a synthesized input
ymcui/Chinese-ELECTRA/cmrc2018_drcd_evaluate.py
code served (permissive licence) · get_code("b71224516be1ddfa")
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

# Analyze the function: find_lcs takes two sequences s1 and s2
# It finds the longest common substring by comparing elements
# Both parameters are sequences that support len(), indexing with [], and element comparison

# Create simple string sequences as arguments
s1 = "abcdef"
s2 = "xbcdyz"

ARGS = {
    "s1": s1,
    "s2": s2
}
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
format_filename Ran
ran on a synthesized input
ymcui/Chinese-PreTrained-XLNet/src/data_utils.py
code served (permissive licence) · get_code("b86bea980cfb5cbf")
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

ARGS = {
    'prefix': 'pretrain',
    'bsz_per_host': 32,
    'seq_len': 512,
    'bi_data': True,
    'suffix': 'tfrecord',
    'mask_alpha': 5,
    'mask_beta': 1,
    'reuse_len': 100,
    'uncased': False,
    'fixed_num_predict': 76
}
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
gelu Ran
ran, honoured the contract we drafted
ymcui/Chinese-PreTrained-XLNet/src/modeling.py
code served (permissive licence) · get_code("d08f324f950148de")
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 EagerTensor, 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 numpy as np
import tensorflow as tf

# Create a small TensorFlow tensor for testing
x = tf.constant([[-0.5, 0.0, 0.5, 1.0], [0.2, -0.3, 0.8, -0.1]], dtype=tf.float32)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, 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; our contract draft was wrong, not the code
ymcui/Chinese-ELECTRA/model/modeling.py
code served (permissive licence) · get_code("9c6c6f379ebe0c8e")
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 SymbolicTensor. 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 tensorflow.compat.v1 as tf
import numpy as np

tf.disable_v2_behavior()

# Create a small float tensor for input
input_tensor = tf.constant(
    [[-1.5, -0.5, 0.5, 1.5],
     [0.0, 1.0, 2.0, 3.0]], 
    dtype=tf.float32
)

ARGS = {
    "input_tensor": input_tensor
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_activation Ran
ran; our contract draft was wrong, not the code
ymcui/Chinese-ELECTRA/model/modeling.py
code served (permissive licence) · get_code("b2dfae5f1625da67")
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 function. 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 tensorflow.compat.v1 as tf
import six

# Disable eager execution for TensorFlow v1 compatibility
tf.disable_eager_execution()

# Setup TensorFlow session
session = tf.compat.v1.Session()

# Define test arguments for get_activation function
ARGS = {
    "activation_string": "relu"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
six, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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_assignment_map_from_checkpoint Ran
ran on a synthesized input
ymcui/Chinese-ELECTRA/model/modeling.py
code served (permissive licence) · get_code("cb34c9c201e23b66")
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 collections
import re
import tempfile
import os
import tensorflow.compat.v1 as tf

# Disable eager execution for TensorFlow v1
tf.disable_eager_execution()

# Create a temporary checkpoint file for testing
temp_dir = tempfile.mkdtemp()
checkpoint_path = os.path.join(temp_dir, "test_checkpoint")

# Create a simple TensorFlow checkpoint
with tf.Graph().as_default():
    var1 = tf.Variable(tf.constant([[1.0, 2.0], [3.0, 4.0]]), name="layer1/weights")
    var2 = tf.Variable(tf.constant([0.1, 0.2]), name="layer1/bias")
    var3 = tf.Variable(tf.constant([[5.0, 6.0]]), name="layer2/weights")
    
    saver = tf.train.Saver()
    with tf.Session() as sess:
        sess.run(tf.global_variables_initializer())
        saver.save(sess, checkpoint_path)

# Create mock TensorFlow variables for the current graph
with tf.Graph().as_default():
    current_var1 = tf.Variable(tf.zeros([2, 2]), name="layer1/weights")
    current_var2 = tf.Variable(tf.zeros([2]), name="layer1/bias")
    current_var3 = tf.Variable(tf.zeros([1, 2]), name="layer2/weights")
    current_var4 = tf.Variable(tf.zeros([3]), name="layer3/bias")
    
    tvars = [current_var1, current_var2, current_var3, current_var4]

ARGS = {
    'tvars': tvars,
    'init_checkpoint': checkpoint_path,
    'prefix': ''
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — 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_tokens Ran
ran; our contract draft was wrong, not the code
ymcui/Chinese-PreTrained-XLNet/src/squad_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from saptarshi059/cdqa-project, is pointer only (licence: NONE) · get_code("aa6bc32d9c17a2f1")
How it ran

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

make_optimizer Ran
ran; our contract draft was wrong, not the code
shibing624/pycorrector/pycorrector/macbert/macbert4csc.py
code served (permissive licence) · get_code("3c707eafb83ce730")
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 SGD. 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)

# Create a simple model with parameters (including bias)
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

# Create a config object with required SOLVER attributes
class Config:
    class SOLVER:
        BASE_LR = 0.001
        WEIGHT_DECAY = 0.0005
        BIAS_LR_FACTOR = 2.0
        WEIGHT_DECAY_BIAS = 0.0
        OPTIMIZER_NAME = 'SGD'
        MOMENTUM = 0.9

cfg = Config()

ARGS = {
    'cfg': cfg,
    'model': model
}
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 SGD — a SGD output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SGD 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
make_qid_to_has_ans Ran
ran; our contract draft was wrong, not the code
ymcui/Chinese-PreTrained-XLNet/src/squad_utils.py
code served (permissive licence) · get_code("e91c44f5680827e2")
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 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 numpy as np

# Construct a minimal dataset matching the expected structure
dataset = [
    {
        'paragraphs': [
            {
                'qas': [
                    {
                        'id': 'q1',
                        'answers': [{'text': 'answer1', 'answer_start': 0}]
                    },
                    {
                        'id': 'q2',
                        'answers': []
                    }
                ]
            },
            {
                'qas': [
                    {
                        'id': 'q3',
                        'answers': [{'text': 'answer3', 'answer_start': 5}]
                    }
                ]
            }
        ]
    },
    {
        'paragraphs': [
            {
                'qas': [
                    {
                        'id': 'q4',
                        'answers': []
                    }
                ]
            }
        ]
    }
]

ARGS = {
    'dataset': dataset
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, 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
normalize_answer Ran
ran; our contract draft was wrong, not the code
ymcui/Chinese-PreTrained-XLNet/src/squad_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from saptarshi059/cdqa-project, is pointer only (licence: NONE) · get_code("6a96435eba311b08")
How it ran

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

positional_embedding Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ymcui/Chinese-PreTrained-XLNet/src/modeling.py
code served (permissive licence) · get_code("9bf0f6e6298f3fbe")
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 EagerTensor, ndim 3, dtype family float, shape (5, 2, 8) 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 tensorflow as tf
import numpy as np

# Set random seed for reproducibility
tf.random.set_seed(0)

# Create pos_seq: a 1D tensor of positions
# Using shape [5] for sequence length
pos_seq = tf.constant([0, 1, 2, 3, 4], dtype=tf.float32)

# Create inv_freq: inverse frequencies for positional encoding
# Using shape [4] for embedding dimension / 2
inv_freq = tf.constant([1.0, 0.1, 0.01, 0.001], dtype=tf.float32)

# bsz: batch size (optional parameter)
bsz = 2

ARGS = {
    'pos_seq': pos_seq,
    'inv_freq': inv_freq,
    'bsz': bsz,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 3, dtype family float, shape (5, 2, 8) — shape (5, 2, 8) 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
preprocess_text Ran
ran; our contract draft was wrong, not the code
ymcui/Chinese-PreTrained-XLNet/src/prepro_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from cliang1453/super-structured-lottery-tickets, is pointer only (licence: MIT) · get_code("b19697c998adb1ea")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from cliang1453/super-structured-lottery-tickets, and MIT, as GitHub detects it on that repository, is in the permissive set, but a licence decision keeps the body a pointer: its licence file names an outside party, so it may cover vendored code rather than the repository owner's files (recorded as pointer:licence_names_third_party_corporation). 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.

printable_text Ran
ran; our contract draft was wrong, not the code
ymcui/Chinese-PreTrained-XLNet/src/prepro_utils.py
code served (permissive licence) · get_code("0e5615f8994003cf")
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 six

# The function takes a single parameter 'text' which can be:
# - str (works in both Python 2 and 3)
# - bytes (in Python 3, decoded to utf-8)
# - unicode (in Python 2, encoded to utf-8)

# Since we're running on Python 3, we'll test with a string
text_input = "Hello, World!"

ARGS = {
    "text": text_input
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
six — 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
BaseTrainingEngine Not yet run
unverified (harvested, no recorded run)
shibing624/pycorrector/pycorrector/macbert/macbert4csc.py
code served (permissive licence) · get_code("cfac541eefda5168")
How it ran

no invocation recorded.

CscTrainingModel Not yet run
unverified (harvested, no recorded run)
shibing624/pycorrector/pycorrector/macbert/macbert4csc.py
code served (permissive licence) · get_code("af8425a9c3022046")
How it ran

no invocation recorded.

MacBert4Csc Not yet run
unverified (harvested, no recorded run)
shibing624/pycorrector/pycorrector/macbert/macbert4csc.py
code served (permissive licence) · get_code("f5ffeb1faccdd442")
How it ran

no invocation recorded.

average_grads_and_vars Not yet run
unverified (harvested, no recorded run)
ymcui/Chinese-PreTrained-XLNet/src/gpu_utils.py
code served (permissive licence) · get_code("0e3f1e158da4c3b8")
How it ran

no invocation recorded.

build_lr_scheduler Not yet run
unverified (harvested, no recorded run)
shibing624/pycorrector/pycorrector/macbert/macbert4csc.py
code served (permissive licence) · get_code("699577a393a1a36e")
How it ran

no invocation recorded.

configure_tpu Not yet run
unverified (harvested, no recorded run)
ymcui/Chinese-PreTrained-XLNet/src/model_utils.py
code served (permissive licence) · get_code("09d1e0e9c15a4503")
How it ran

no invocation recorded.

construct_scalar_host_call Not yet run
unverified (harvested, no recorded run)
ymcui/Chinese-PreTrained-XLNet/src/function_builder.py
code served (permissive licence) · get_code("c09b2ad22d30dc58")
How it ran

no invocation recorded.

create_tfrecords Not yet run
unverified (harvested, no recorded run)
ymcui/Chinese-PreTrained-XLNet/src/data_utils.py
code served (permissive licence) · get_code("8e58d7fe314fa0a1")
How it ran

no invocation recorded.

embedding_lookup Not yet run
unverified (harvested, no recorded run)
ymcui/Chinese-PreTrained-XLNet/src/modeling.py
code served (permissive licence) · get_code("5abf0267f0fc7514")
How it ran

no invocation recorded.

file_based_input_fn_builder Not yet run
unverified (harvested, no recorded run)
ymcui/Chinese-PreTrained-XLNet/src/run_classifier.py
code served (permissive licence) · get_code("aab5156ced02aa8a")
How it ran

no invocation recorded.

init_from_checkpoint Not yet run
unverified (harvested, no recorded run)
ymcui/Chinese-PreTrained-XLNet/src/model_utils.py
code served (permissive licence) · get_code("7b1d9794b90b3ae2")
How it ran

no invocation recorded.

load_from_checkpoint Not yet run
unverified (harvested, no recorded run)
ymcui/Chinese-PreTrained-XLNet/src/gpu_utils.py
code served (permissive licence) · get_code("3d6b054785523852")
How it ran

no invocation recorded.

mixed_segmentation Not yet run
unverified (harvested, no recorded run)
ymcui/Chinese-ELECTRA/cmrc2018_drcd_evaluate.py
code served (permissive licence) · get_code("2ac9d5179c0b5c85")
How it ran

no invocation recorded.

remove_punctuation Not yet run
unverified (harvested, no recorded run)
ymcui/Chinese-ELECTRA/cmrc2018_drcd_evaluate.py
code served (permissive licence) · get_code("5a2e0cd001c9f26b")
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, 18 are also present in other papers whose code we hold (13 with at least one paper dated earlier, 5 the same month, 12 later) and 17 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
normalize_answer 37 other papers
6 dated earlier, 1 the same month, 30 later · 1 only as an assembly brick
1808.07042 (2018-08)
CoQA: A Conversational Question Answering Challenge
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1902.01718 (2019-02)
End-to-End Open-Domain Question Answering with BERTserini
and 34 more not named here
printable_text 33 other papers
13 dated earlier, 20 later
1609.08144 (2016-09)
Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1901.04085 (2019-01)
Passage Re-ranking with BERT
and 30 more not named here
get_activation 32 other papers
17 dated earlier, 1 the same month, 14 later · 1 only as an assembly brick
1804.05392 (2018-04)
Higher-order Coreference Resolution with Coarse-to-fine Inference
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1901.04085 (2019-01)
Passage Re-ranking with BERT
and 29 more not named here
gelu 26 other papers
14 dated earlier, 1 the same month, 11 later · 4 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 23 more not named here
get_tokens 25 other papers
4 dated earlier, 1 the same month, 20 later
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1902.01718 (2019-02)
End-to-End Open-Domain Question Answering with BERTserini
1908.08962 (2019-08)
Well-Read Students Learn Better: On the Importance of Pre-training Compact Models
and 22 more not named here
create_int_feature 13 other papers
7 dated earlier, 1 the same month, 5 later
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1906.05474 (2019-06)
Transfer Learning in Biomedical Natural Language Processing: An Evaluation of BERT and ELMo on Ten Benchmarking Datasets
1908.08962 (2019-08)
Well-Read Students Learn Better: On the Importance of Pre-training Compact Models
and 10 more not named here
make_qid_to_has_ans 9 other papers
3 dated earlier, 6 later
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1908.08962 (2019-08)
Well-Read Students Learn Better: On the Importance of Pre-training Compact Models
1910.01244 (2019-10)
Linking artificial and human neural representations of language
and 6 more not named here
assign_to_gpu 3 other papers
3 dated earlier
1602.02410 (2016-02)
Exploring the Limits of Language Modeling
1606.04934 (2016-06)
Improving Variational Inference with Inverse Autoregressive Flow
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
gelu 3 other papers
3 dated earlier · 1 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
1906.05394 (2019-06)
Neural Arabic Question Answering
embedding_lookup 2 other papers
2 dated earlier · 1 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
load_from_checkpoint 2 other papers
2 dated earlier
1602.02410 (2016-02)
Exploring the Limits of Language Modeling
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
make_optimizer
brick of this paper's assembly: helper
2 other papers
2 later
2005.07421 (2020-05)
Spelling Error Correction with Soft-Masked BERT
2104.06770 (2021-04)
Graph-based Person Signature for Person Re-Identifications
positional_embedding 2 other papers
2 dated earlier · 1 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
average_grads_and_vars 1 other paper
1 dated earlier
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
compute_corrector_prf
brick of this paper's assembly: helper
1 other paper
1 later
2005.07421 (2020-05)
Spelling Error Correction with Soft-Masked BERT
compute_sentence_level_prf
brick of this paper's assembly: helper
1 other paper
1 later
2005.07421 (2020-05)
Spelling Error Correction with Soft-Masked BERT
encode_pieces 1 other paper
1 later
2105.12002 (2021-05)
Super Tickets in Pre-Trained Language Models: From Model Compression to Improving Generalization
preprocess_text 1 other paper
1 later
2105.12002 (2021-05)
Super Tickets in Pre-Trained Language Models: From Model Compression to Improving Generalization

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

Bidirectional Encoder Representations from Transformers (BERT) has shown marvelous improvements across various NLP tasks, and consecutive variants have been proposed to further improve the performance of the pretrained language models. In this paper, we target on revisiting Chinese pre-trained language models to examine their effectiveness in a non-English language and release the Chinese pre-trained language model series to the community. We also propose a simple but effective model called MacBERT, which improves upon RoBERTa in several ways, especially the masking strategy that adopts MLM as correction (Mac). We carried out extensive experiments on eight Chinese NLP tasks to revisit the existing pre-trained language models as well as the proposed MacBERT. Experimental results show that MacBERT could achieve state-of-the-art performances on many NLP tasks, and we also ablate details with several findings that may help future research. 1

For agents

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

get_harvested_code_for_paper("2004.13922")
get_code_for_paper("2004.13922")
have("2004.13922")

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

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

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

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

Connect an agent — have() is free.