Views
No views yet
bart4csc-base-chinese evaluate SIGHAN2015 test data:| input_text | pred |
|---|---|
| 辰导中引述她的话说:核子间题的解决之道系于克什米尔纷争。 | 报导中引述她的话说:核子问题的解决之道系于克什米尔纷争。 |
| 报导并末说明事故发生的原因。 | 报导并未说明事故发生的原因。 |
pip install -U textgen1from transformers import BertTokenizerFast
2from textgen import BartSeq2SeqModel
3
4tokenizer = BertTokenizerFast.from_pretrained('shibing624/bart4csc-base-chinese')
5model = BartSeq2SeqModel(
6 encoder_type='bart',
7 encoder_decoder_type='bart',
8 encoder_decoder_name='shibing624/bart4csc-base-chinese',
9 tokenizer=tokenizer,
10 args={"max_length": 128, "eval_batch_size": 128})
11sentences = ["少先队员因该为老人让坐"]
12print(model.predict(sentences))
13# ['少先队员应该为老人让座']bart4csc-base-chinese
├── config.json
├── model_args.json
├── pytorch_model.bin
├── special_tokens_map.json
├── tokenizer_config.json
├── spiece.model
└── vocab.txt| 数据集 | 语料 | 下载链接 | 压缩包大小 |
|---|---|---|---|
SIGHAN+Wang271K中文纠错数据集 | SIGHAN+Wang271K(27万条) | 百度网盘(密码01b9) | 106M |
原始SIGHAN数据集 | SIGHAN13 14 15 | 官方csc.html | 339K |
原始Wang271K数据集 | Wang271K | Automatic-Corpus-Generation dimmywang提供 | 93M |
1[
2 {
3 "id": "B2-4029-3",
4 "original_text": "晚间会听到嗓音,白天的时候大家都不会太在意,但是在睡觉的时候这嗓音成为大家的恶梦。",
5 "wrong_ids": [
6 5,
7 31
8 ],
9 "correct_text": "晚间会听到噪音,白天的时候大家都不会太在意,但是在睡觉的时候这噪音成为大家的恶梦。"
10 },
11]1@software{textgen,
2 author = {Xu Ming},
3 title = {textgen: Implementation of Text Generation models},
4 year = {2022},
5 url = {https://github.com/shibing624/textgen},
6}