CoolFace
Modelpublic

CodeTed/Chinese_Spelling_Correction_T5

sourceHugging Faceapache-2.0updated 3y agoView on Hugging Face
2likes90downloads
Model Card

CSC T5 - T5 for Traditional and Simplified Chinese Spelling Correction

This model was obtained by instruction-tuning the corresponding ClueAI/PromptCLUE-base-v1-5 model on the spelling error corpus.

Model Details

Model Description

  • Language(s) (NLP): Chinese
  • Pretrained from model: ClueAI/PromptCLUE-base-v1-5
  • Pretrained by dataset: 1M UDN news corpus
  • Finetuned by dataset: shibing624/CSC spelling error corpus (CN + TC)

Model Sources

Evaluation

  • Chinese spelling error correction task(SIGHAN2015):
  • FPR: False Positive Rate
ModelBase ModelaccuracyrecallprecisionF1FPR
GECToRhfl/chinese-macbert-base71.771.671.871.728.2
GECToR_largehfl/chinese-macbert-large73.776.572.574.429.1
T5 w/ pretrainClueAI/PromptCLUE-base-v1-579.269.285.876.611.1
T5 w/o pretrainClueAI/PromptCLUE-base-v1-575.163.182.271.413.3
PTCSpellN/A79.089.483.8N/A
MDCSpellN/A77.281.579.3N/A

Usage

python
from transformers import AutoTokenizer, T5ForConditionalGeneration
tokenizer = AutoTokenizer.from_pretrained("CodeTed/Chinese_Spelling_Correction_T5")
model = T5ForConditionalGeneration.from_pretrained("CodeTed/Chinese_Spelling_Correction_T5")
input_text = '糾正句子裡的錯字: 為了降低少子化,政府可以堆動獎勵生育的政策。'
input_ids = tokenizer(input_text, return_tensors="pt").input_ids
outputs = model.generate(input_ids, max_length=256)
edited_text = tokenizer.decode(outputs[0], skip_special_tokens=True)

Related Project

CodeTed/CGEDit - Chinese Grammatical Error Diagnosis by Task-Specific Instruction Tuning