SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2021.emnlp-main.291 · EMNLP · 2021

A Fine-Grained Domain Adaption Model for Joint Word Segmentation and POS Tagging

Guangwei Xu, Pengjun Xie, Peijie Jiang, Meishan Zhang, Yueheng Sun, Dingkun Long

Open in the Atlas

Code that ran

5 of 5 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 3 have no contract verdict; 1 failure of our instrument; 0 no recorded run), measured 2026-11-24; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2021.emnlp-main.291.json · badge: /api/ran/2021.emnlp-main.291.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
JZX555/FGDA canonical (classifier label)
classifier basis: census
5 ran · 0 no recorded run
FunctionStatusWhere it lives
allowed_transitions Ran
ran, honoured the contract we drafted
JZX555/FGDA/model/bertCRF.py
code served (permissive licence) · get_code("16a88dc904671c0b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Based on the function signature and body, we need:
# constraint_type: str - one of "BIO", "IOB1", "BIOUL", "BMES"
# labels: Dict[int, str] - mapping of label_id to label string

# The labels dict should contain BIO/IOB1/BIOUL/BMES formatted tags
# Format is like: {0: "O", 1: "B-PER", 2: "I-PER", 3: "B-LOC", 4: "I-LOC"}

labels = {
    0: "O",
    1: "B-PER",
    2: "I-PER",
    3: "B-LOC",
    4: "I-LOC",
    5: "B-ORG",
    6: "I-ORG"
}

constraint_type = "BIO"

ARGS = {
    "constraint_type": constraint_type,
    "labels": labels
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
kl_anneal_function Ran
ran on a synthesized input
JZX555/FGDA/driver/model_helper.py
code served (permissive licence) · get_code("c2ff6c2a42505ec4")
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 numpy as np

def kl_anneal_function(step, k=0.0025, x0=1000, min_lambda=0):
    return max(float(1 / (1 + np.exp(-k * (step - x0)))), min_lambda)

# Set up valid arguments for kl_anneal_function
ARGS = {
    "step": 500,
    "k": 0.0025,
    "x0": 1000,
    "min_lambda": 0
}
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 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
logsumexp Ran
ran; our contract draft was wrong, not the code
JZX555/FGDA/model/bertCRF.py
code served (permissive licence) · get_code("ddffb47a00250425")
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 1, dtype family float, shape (2,) 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)

# Create a small tensor for testing logsumexp
# Shape: (2, 4) - batch size 2, dimension 4
tensor = torch.randn(2, 4, dtype=torch.float32)

ARGS = {
    "tensor": tensor,
    "dim": -1,
    "keepdim": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) 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
safe_exp Ran
ran on a synthesized input
JZX555/FGDA/driver/model_helper.py
code served (permissive licence) · get_code("1b612e44f1cea2f3")
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 math

def safe_exp(value):
    """Exponentiation with catching of overflow error."""
    try:
        ans = math.exp(value)
    except OverflowError:
        ans = float('inf')
    return ans

# The function takes a single parameter 'value' which is used with math.exp()
# math.exp() accepts a numeric type (int, float)
# We'll test with a normal float value that doesn't overflow

ARGS = {
    "value": 0.5
}
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 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
viterbi_decode Ran
ran on a synthesized input
JZX555/FGDA/model/bertCRF.py
code served (permissive licence) · get_code("4546d7f3624e8c45")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import math

torch.manual_seed(0)

# Construct tiny but valid arguments for viterbi_decode

sequence_length = 3
num_tags = 4

# tag_sequence: shape (sequence_length, num_tags)
tag_sequence = torch.randn(sequence_length, num_tags)

# transition_matrix: shape (num_tags, num_tags)
transition_matrix = torch.randn(num_tags, num_tags)

# tag_observations: optional list of observed tag indices (or -1 for unobserved)
tag_observations = [-1, 1, -1]

# allowed_start_transitions: optional tensor of shape (num_tags,)
allowed_start_transitions = torch.randn(num_tags)

# allowed_end_transitions: optional tensor of shape (num_tags,)
allowed_end_transitions = torch.randn(num_tags)

# top_k: optional integer for returning multiple paths
top_k = None

ARGS = {
    "tag_sequence": tag_sequence,
    "transition_matrix": transition_matrix,
    "tag_observations": tag_observations,
    "allowed_start_transitions": allowed_start_transitions,
    "allowed_end_transitions": allowed_end_transitions,
    "top_k": top_k,
}
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 — 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

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 2 later) and 3 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
logsumexp 3 other papers
1 dated earlier, 2 later
1603.01354 (2016-03)
End-to-end Sequence Labeling via Bi-directional LSTM-CNNs-CRF
2206.14774 (2022-06)
TweetNLP: Cutting-Edge Natural Language Processing for Social Media
2604.19335 (2026-04)
When Active Learning Falls Short: An Empirical Study on Chemical Reaction Extraction
allowed_transitions 2 other papers
2 later
2206.14774 (2022-06)
TweetNLP: Cutting-Edge Natural Language Processing for Social Media
2604.19335 (2026-04)
When Active Learning Falls Short: An Empirical Study on Chemical Reaction Extraction

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

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

Abstract

Domain adaption for word segmentation and POS tagging is a challenging problem for Chinese lexical processing. Self-training is one promising solution for it, which struggles to construct a set of high-quality pseudo training instances for the target domain. Previous work usually assumes a universal sourceto-target adaption to collect such pseudo corpus, ignoring the different gaps from the target sentences to the source domain. In this work, we start from joint word segmentation and POS tagging, presenting a fine-grained domain adaption method to model the gaps accurately. We measure the gaps by one simple and intuitive metric, and adopt it to develop a pseudo target domain corpus based on finegrained subdomains incrementally. A novel domain-mixed representation learning model is proposed accordingly to encode the multiple subdomains effectively. The whole process is performed progressively for both corpus construction and model training. Experimental results on a benchmark dataset show that our method can gain significant improvements over a vary of baselines. Extensive analyses are performed to show the advantages of our final domain adaption model as well.

For agents

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

get_harvested_code_for_paper("2021.emnlp-main.291")
get_code_for_paper("2021.emnlp-main.291")
have("2021.emnlp-main.291")

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

curl https://syntology.ai/api/ran/2021.emnlp-main.291.json

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

[![Syntology run record](https://syntology.ai/api/ran/2021.emnlp-main.291.svg)](https://syntology.ai/paper/2021.emnlp-main.291)

Connect an agent — have() is free.