中文语法纠错任务介绍

Task:中文语法纠错任务(Chinese Grammatical Error Correction,CGEC) CGEC任务输入一句中文文本,文本纠错技术对句子中存在拼写、语法、语义等错误进行自动纠正,输出纠正后的文本。

中文语法纠错方法

主流的方法为seq2seq和seq2edits,常用的中文纠错数据集包括Lang8、NLPCC18和CGED等。

模型描述

我们采用基于transformer的seq2seq方法建模文本纠错任务。模型选择上,我们使用中文BART作为预训练模型,然后在Lang8和CGED训练数据上进行finetune。 在不引入额外资源的情况下,本模型在LANG8测试集上达到了SOTA。

模型训练

模型训练是基于fairseq库进行训练的。

如何使用

step1: 下载fairseq库,并进行安装 step2: 使用interactive.py方法进行推理 python -u ${FAIRSEQ_DIR}/interactive.py $PROCESSED_DIR
--task syntax-enhanced-translation
--path ${MODEL_PATH}
--beam ${BEAM}
--nbest ${N_BEST}
-s src
-t tgt
--buffer-size 1000
--batch-size 32
--num-workers 12
--log-format tqdm
--remove-bpe
--fp16
--output_file $OUTPUT_DIR/output.nbest
<$OUTPUT_DIR/lang8_test.char

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API: The HF Inference API does not support translation models for fairseq library.