BERTc-165M-CSC
BERTc-165M-CSC is a Chinese spelling correction model fine-tuned from
Ismantic/BERTc-165M. It uses a Modern BERTc encoder with two heads:
- correction head: tied to the input embedding matrix
- detection head: binary error detection
Metrics
SIGHAN-15 sentence-level evaluation using the pycorrector-style 707-sample protocol:
- Sentence F1: 0.8308
- Accuracy: 0.8416
- Precision: 0.9516
- Recall: 0.7373
- TP/FP/FN/TN: 275 / 14 / 98 / 320
Training recipe:
- backbone:
Ismantic/BERTc-165M - epochs: 5
- batch size: 64
- learning rate: 5e-5
- warmup ratio: 0.1
- detection loss weight: 0.3
- inference threshold: 0.7
- max length: 128
Files
model.safetensors: CSC state dict.cor_head.weightis intentionally omitted and tied tobert.embed.weightbycsc_model.py.config.json: BERTc backbone architecture.csc_config.json: task and metric metadata.model.py: Modern BERTc implementation.csc_model.py: CSC wrapper and batch correction helper.piece.model: tokenizer model; load withpiece_tokenizerusingcn_dict="no".
Usage
from csc_model import BERTcForCSC, PieceCharTokenizer
tok = PieceCharTokenizer(".")
model = BERTcForCSC.from_pretrained(".")
texts = ["少先队员因该为老人让坐。"]
print(model.correct(texts, tok, threshold=0.7))
This is not a generative model. It performs same-length character replacement for Chinese spelling correction.
- Downloads last month
- 32
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support