HillZhang1999 / MuCGEC

MuCGEC中文纠错数据集及文本纠错SOTA模型开源;Code & Data for our NAACL 2022 Paper "MuCGEC: a Multi-Reference Multi-Source Evaluation Dataset for Chinese Grammatical Error Correction"
https://aclanthology.org/2022.naacl-main.227/
Apache License 2.0
509 stars 64 forks source link

请问有多个候选答案的gold.m2的生成脚本是啥?我自测生成的一直有问题,有大面积空白行 #35

Closed jack-wxm closed 1 year ago

jack-wxm commented 1 year ago

INPUT_FILE=./data/input_grammar.txt REF_FILE=./data/ref_grammar.txt REF_PARA_FILE=./data/gram.ref.para REF_M2_FILE=./data/gram.ref.m2.char

Step1. extract edits from hypothesis file.

paste $INPUT_FILE $REF_FILE | awk '{print NR"\t"$p}' > $REF_PARA_FILE # only for single hypothesis situation

python parallel_to_m2.py -f $REF_PARA_FILE -o $REF_M2_FILE -g char # char-level evaluation

HillZhang1999 commented 1 year ago

$REF_PARA_FILE的格式应该是 id src_sent ref_sent1 ref_sent2 ref_sent3 ... 然后使用python parallel_to_m2.py即可。

jack-wxm commented 1 year ago

好的,检查了一下是原句后面多了个换行符,感谢