SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2024.findings-acl.148 · ACL Findings · 2024

Alirector: Alignment-Enhanced Chinese Grammatical Error Corrector

Xiaojun Quan, Haihui Yang

Open in the Atlas

Code that ran

9 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 3 failures of our instrument; 2 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/2024.findings-acl.148.json · badge: /api/ran/2024.findings-acl.148.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
HillZhang1999/MuCGEC canonical (classifier label)
classifier basis: census
9 ran · 2 no recorded run
FunctionStatusWhere it lives
convert_to_unicode Ran
ran; our contract draft was wrong, not the code
HillZhang1999/MuCGEC/models/seq2edit-based-CGEC/tokenization.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from huawei-noah/Pretrained-Language-Model, is pointer only (licence: NONE) · get_code("1923fc05163d207d")
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 huawei-noah/Pretrained-Language-Model, 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.

evaluate_edits Ran
ran on a synthesized input
HillZhang1999/MuCGEC/scorers/ChERRANT/compare_m2_for_evaluation.py
code served (permissive licence) · get_code("c12aa1cd7d994a2f")
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

class Args:
    def __init__(self):
        self.beta = 1.0
        self.verbose = False

# Build sample hyp_dict and ref_dict
# These map hypothesis/reference IDs to edit dictionaries
# Edit dictionaries map edit positions (tuples) to lists of categories

hyp_dict = {
    0: {
        (0, 1): ['grammar'],
        (2, 3): ['spelling'],
    },
    1: {
        (0, 1): ['grammar'],
    }
}

ref_dict = {
    0: {
        (0, 1): ['grammar'],
        (1, 2): ['punctuation'],
    },
    1: {
        (0, 1): ['noop'],
    }
}

# Build best dict with initial values
best = {
    'tp': 0,
    'fp': 0,
    'fn': 0
}

# Source sentence
src = " The quick brown fox"

# Sentence ID
sent_id = 1

# Args object with required attributes
args = Args()

ARGS = {
    'src': src,
    'hyp_dict': hyp_dict,
    'ref_dict': ref_dict,
    'best': best,
    'sent_id': sent_id,
    'args': args
}
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
load_json Ran
ran on a synthesized input
HillZhang1999/MuCGEC/models/seq2seq-based-CGEC/utils.py
code served (permissive licence) · get_code("8a8d4f4b964a92a9")
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 Dataset. 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
from datasets import Dataset

# Create a temporary JSON file with the expected structure
temp_dir = tempfile.mkdtemp()
file_path = os.path.join(temp_dir, "test_data.json")

test_data = [
    {
        "summarization": "This is a summary of the first article.",
        "article": "This is the full text of the first article with more details."
    },
    {
        "summarization": "This is a summary of the second article.",
        "article": "This is the full text of the second article with additional information."
    }
]

with open(file_path, 'w', encoding='utf-8') as f:
    json.dump(test_data, f)

ARGS = {
    'file_path': file_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Dataset — a Dataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Dataset output the recorded ndim 1 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_vocab Ran
ran; our contract draft was wrong, not the code
HillZhang1999/MuCGEC/models/seq2edit-based-CGEC/tokenization.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from blcuicall/CCL2022-CLTC, is pointer only (licence: NONE) · get_code("deb4d1793cf3ba73")
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 blcuicall/CCL2022-CLTC, 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.

parse_m2 Ran
ran on a synthesized input
HillZhang1999/MuCGEC/scorers/ChERRANT/rule_ensemble.py
code served (permissive licence) · get_code("1d98725878fe7990")
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 m2 format file for testing
temp_m2_content = """This is a test source sentence.
S This is a test source sentence.
A 0 1|||det|||a|||REQUIRED|||-NONE-|||0
A 2 3|||nn|||test|||REQUIRED|||-NONE-|||1

Another source sentence here.
S Another source sentence here.
A 1 2|||VBZ|||is|||REQUIRED|||-NONE-|||0

"""

# Create a temporary file with the m2 format content
temp_file = tempfile.NamedTemporaryFile(mode='w', suffix='.m2', delete=False)
temp_file.write(temp_m2_content)
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 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
printable_text Ran
ran; our contract draft was wrong, not the code
HillZhang1999/MuCGEC/models/seq2edit-based-CGEC/tokenization.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
process_edits Ran
ran on a synthesized input
HillZhang1999/MuCGEC/scorers/ChERRANT/compare_m2_for_evaluation.py
code served (permissive licence) · get_code("41f74cee8844bc4e")
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 numpy as np
from argparse import Namespace

# Create a minimal args object with all required attributes
args = Namespace(
    dt=True,  # detection task flag
    ds=False,  # detection span flag
    cse=False,  # case-sensitive error flag
    single=False,  # single token edits only
    multi=False,  # multi-token edits only
    filt=None  # filter categories (None means no filtering)
)

# Create sample edits data structure
# Each edit: [start, end, category, correction, coder_id]
edits = [
    [0, 1, 'SPELL', 'speling', 0],
    [2, 4, 'GRAM', 'grammar', 1],
    [5, 5, 'VERB', 'verbed', 0],
    [-1, -1, 'noop', '-NONE-', 2],
]

ARGS = {
    'edits': edits,
    'args': args
}
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 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
read_lines Ran
ran on a synthesized input
HillZhang1999/MuCGEC/models/seq2seq-based-CGEC/utils.py
code served (permissive licence) · get_code("5431270e7aba8ae2")
How it ran

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

import io

# Create a file-like object with sample content
file_content = "hello world\nfoo   bar\nbaz  qux\n"
file = io.StringIO(file_content)

ARGS = {
    "file": 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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
simplify_edits Ran
ran on a synthesized input
HillZhang1999/MuCGEC/scorers/ChERRANT/compare_m2_for_evaluation.py
code served (permissive licence) · get_code("1bceddf96ad83624")
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 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.

# Analyze the function to understand what it needs
# - sent: a string that can be split by '\n', containing edit annotations
# - max_answer_num: an integer or None that filters edits by coder index

# The function parses lines starting with 'A ' in the format:
# "A <start> <end>|||<category>|||<correction>|||<coder_id>"

# Construct valid arguments
sent = """A 0 2|||SPELL|||teh|||0
A 5 7|||GRAM|||correct|||1
A 10 12|||PUNCT|||.|||2"""

max_answer_num = None

ARGS = {
    "sent": sent,
    "max_answer_num": max_answer_num,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, 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
split_sentence Not yet run
unverified (harvested, no recorded run)
HillZhang1999/MuCGEC/models/seq2edit-based-CGEC/predict.py
code served (permissive licence) · get_code("005057ea89462d58")
How it ran

no invocation recorded.

validate Not yet run
unverified (harvested, no recorded run)
HillZhang1999/MuCGEC/scorers/ChERRANT/rule_ensemble.py
code served (permissive licence) · get_code("b0aa76205d55b598")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 2 later) and 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
convert_to_unicode 36 other papers
31 dated earlier, 2 later, 3 same year, order not determinable
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 33 more not named here
printable_text 33 other papers
28 dated earlier, 2 later, 3 same year, order not determinable
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
load_vocab 4 other papers
4 dated earlier
1902.10909 (2019-02)
BERT for Joint Intent Classification and Slot Filling
1903.09588 (2019-03)
Utilizing BERT for Aspect-Based Sentiment Analysis via Constructing Auxiliary Sentence
2203.09313 (2022-03)
EVA2.0: Investigating Open-Domain Chinese Dialogue Systems with Large-Scale Pre-Training
and 1 more not named here
process_edits 1 other paper
1 dated earlier
2010.03260 (2020-10)
Improving the Efficiency of Grammatical Error Correction with Erroneous Span Detection and Correction

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

Chinese grammatical error correction (CGEC) faces serious overcorrection challenges when employing autoregressive generative models such as sequence-to-sequence (Seq2Seq) models and decoder-only large language models (LLMs). While previous methods aim to address overcorrection in Seq2Seq models, they are difficult to adapt to decoder-only LLMs. In this paper, we propose an alignment-enhanced corrector for the overcorrection problem that applies to both Seq2Seq models and decoderonly LLMs. Our method first trains a correction model to generate an initial correction of the source sentence. Then, we combine the source sentence with the initial correction and feed it through an alignment model for another round of correction, aiming to enforce the alignment model to focus on potential overcorrection. Moreover, to enhance the model's ability to identify nuances, we further explore the reverse alignment of the source sentence and the initial correction. Finally, we transfer the alignment knowledge from two alignment models to the correction model, instructing it on how to avoid overcorrection. Experimental results on three CGEC datasets demonstrate the effectiveness of our approach in alleviating overcorrection and improving overall performance. Our code has been made publicly available 1 .

For agents

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

get_harvested_code_for_paper("2024.findings-acl.148")
get_code_for_paper("2024.findings-acl.148")
have("2024.findings-acl.148")

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

curl https://syntology.ai/api/ran/2024.findings-acl.148.json

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

[![Syntology run record](https://syntology.ai/api/ran/2024.findings-acl.148.svg)](https://syntology.ai/paper/2024.findings-acl.148)

Connect an agent — have() is free.