← all repositories
shibing624/pycorrector

A Swiss Army knife for Chinese typos, from n-grams to Qwen3

It bundles nine Chinese text correction algorithms under one roof so you can trade off MacBERT’s 224 QPS against Qwen3’s 0.85 F1.

pycorrector
Not currently ranked — collecting fresh signals.
star history

What it does

pycorrector is a Python toolkit that attacks Chinese text errors—phonetic slips, visual typos, grammar mistakes, and even extra or missing characters—using a small army of models. It wraps statistical language models, BERT variants, T5, and instruction-tuned LLMs like ChatGLM3 and Qwen behind a common interface, and ships pretrained weights for most of them. The whole affair is geared toward letting you swap one corrector for another without rewriting your pipeline.

The interesting bit

Rather than pretending one architecture rules them all, the README lays out an honest scoreboard. You can see that the lightweight MacBERT model screams at 224 QPS on a Tesla V100 while the heavier Qwen3-4B model pushes the highest average F1 of 0.8521—useful data when you’re deciding whether to burn GPU cycles. That transparency is rare in glue-code repos; here it is the point.

Key highlights

  • Covers the full hardware spectrum: Kenlm runs on CPU at 9 QPS, while MacBERT and T5 variants target GPU for hundreds of QPS.
  • Distinguishes spelling correction (CSC, length-aligned errors) from general text correction (CTC, which handles missing or extra characters).
  • Ships trained weights and a HuggingFace Gradio demo for immediate triage.
  • Evaluation table cites concrete F1 scores across SIGHAN-2015, EC-LAW, and MCSC benchmarks.

Caveats

  • The README itself admits that Kenlm, DeepContext, and ConvSeq2Seq deliver only “效果一般” (mediocre results), so don’t expect magic from the older statistical models.
  • Top-tier LLM correctors run at a glacial 3–6 QPS on a Tesla V100, making them expensive for high-throughput pipelines.
  • Most documentation and context assume Chinese fluency; English support is present but clearly secondary.

Verdict

Worth a look if you need to correct Chinese text and want to benchmark multiple architectures before committing to one. Skip it if you’re only dealing with English or if you already have a fine-tuned in-house model you’re happy with.

Frequently asked

What is shibing624/pycorrector?
It bundles nine Chinese text correction algorithms under one roof so you can trade off MacBERT’s 224 QPS against Qwen3’s 0.85 F1.
Is pycorrector open source?
Yes — shibing624/pycorrector is open source, released under the Apache-2.0 license.
What language is pycorrector written in?
shibing624/pycorrector is primarily written in Python.
How popular is pycorrector?
shibing624/pycorrector has 6.5k stars on GitHub.
Where can I find pycorrector?
shibing624/pycorrector is on GitHub at https://github.com/shibing624/pycorrector.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.