Views
No views yet
| Name | Quant method | Size |
|---|---|---|
| chinese-text-correction-7b.Q2_K.gguf | Q2_K | 2.81GB |
| chinese-text-correction-7b.Q3_K_S.gguf | Q3_K_S | 3.25GB |
| chinese-text-correction-7b.Q3_K.gguf | Q3_K | 3.55GB |
| chinese-text-correction-7b.Q3_K_M.gguf | Q3_K_M | 3.55GB |
| chinese-text-correction-7b.Q3_K_L.gguf | Q3_K_L | 3.81GB |
| chinese-text-correction-7b.IQ4_XS.gguf | IQ4_XS | 3.96GB |
| chinese-text-correction-7b.Q4_0.gguf | Q4_0 | 4.13GB |
| chinese-text-correction-7b.IQ4_NL.gguf | IQ4_NL | 4.16GB |
| chinese-text-correction-7b.Q4_K_S.gguf | Q4_K_S | 4.15GB |
| chinese-text-correction-7b.Q4_K.gguf | Q4_K | 4.36GB |
| chinese-text-correction-7b.Q4_K_M.gguf | Q4_K_M | 4.36GB |
| chinese-text-correction-7b.Q4_1.gguf | Q4_1 | 4.54GB |
| chinese-text-correction-7b.Q5_0.gguf | Q5_0 | 4.95GB |
| chinese-text-correction-7b.Q5_K_S.gguf | Q5_K_S | 4.95GB |
| chinese-text-correction-7b.Q5_K.gguf | Q5_K | 5.07GB |
| chinese-text-correction-7b.Q5_K_M.gguf | Q5_K_M | 5.07GB |
| chinese-text-correction-7b.Q5_1.gguf | Q5_1 | 5.36GB |
| chinese-text-correction-7b.Q6_K.gguf | Q6_K | 5.82GB |
| chinese-text-correction-7b.Q8_0.gguf | Q8_0 | 7.54GB |
shibing624/chinese-text-correction-7b evaluate test data:| input_text | predict_text |
|---|---|
| 文本纠错:\n少先队员因该为老人让坐。 | 少先队员应该为老人让座。 |
| Name | Base Model | Download |
|---|---|---|
| chinese-text-correction-1.5b | Qwen/Qwen2.5-1.5B-Instruct | 🤗 Hugging Face |
| chinese-text-correction-1.5b-lora | Qwen/Qwen2.5-1.5B-Instruct | 🤗 Hugging Face |
| chinese-text-correction-7b | Qwen/Qwen2.5-7B-Instruct | 🤗 Hugging Face |
| chinese-text-correction-7b-lora | Qwen/Qwen2.5-7B-Instruct | 🤗 Hugging Face |
| Model Name | Model Link | Base Model | Avg | SIGHAN-2015 | EC-LAW | MCSC | GPU/CPU | QPS |
|---|---|---|---|---|---|---|---|---|
| Kenlm-CSC | shibing624/chinese-kenlm-klm | kenlm | 0.3409 | 0.3147 | 0.3763 | 0.3317 | CPU | 9 |
| Mengzi-T5-CSC | shibing624/mengzi-t5-base-chinese-correction | mengzi-t5-base | 0.3984 | 0.7758 | 0.3156 | 0.1039 | GPU | 214 |
| ERNIE-CSC | PaddleNLP/ernie-csc | PaddlePaddle/ernie-1.0-base-zh | 0.4353 | 0.8383 | 0.3357 | 0.1318 | GPU | 114 |
| MacBERT-CSC | shibing624/macbert4csc-base-chinese | hfl/chinese-macbert-base | 0.3993 | 0.8314 | 0.1610 | 0.2055 | GPU | 224 |
| ChatGLM3-6B-CSC | shibing624/chatglm3-6b-csc-chinese-lora | THUDM/chatglm3-6b | 0.4538 | 0.6572 | 0.4369 | 0.2672 | GPU | 3 |
| Qwen2.5-1.5B-CTC | shibing624/chinese-text-correction-1.5b | Qwen/Qwen2.5-1.5B-Instruct | 0.6802 | 0.3032 | 0.7846 | 0.9529 | GPU | 6 |
| Qwen2.5-7B-CTC | shibing624/chinese-text-correction-7b | Qwen/Qwen2.5-7B-Instruct | 0.8225 | 0.4917 | 0.9798 | 0.9959 | GPU | 3 |
pycorrector项目:pycorrector,可支持大模型微调后用于文本纠错,通过如下命令调用:pip install -U pycorrector1from pycorrector.gpt.gpt_corrector import GptCorrector
2
3if __name__ == '__main__':
4 error_sentences = [
5 '真麻烦你了。希望你们好好的跳无',
6 '少先队员因该为老人让坐',
7 '机七学习是人工智能领遇最能体现智能的一个分知',
8 '一只小鱼船浮在平净的河面上',
9 '我的家乡是有明的渔米之乡',
10 ]
11 m = GptCorrector("shibing624/chinese-text-correction-7b")
12
13 batch_res = m.correct_batch(error_sentences)
14 for i in batch_res:
15 print(i)
16 print()pip install transformers 1# pip install transformers
2from transformers import AutoModelForCausalLM, AutoTokenizer
3checkpoint = "shibing624/chinese-text-correction-7b"
4
5device = "cuda" # for GPU usage or "cpu" for CPU usage
6tokenizer = AutoTokenizer.from_pretrained(checkpoint)
7model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
8
9input_content = "文本纠错:\n少先队员因该为老人让坐。"
10
11messages = [{"role": "user", "content": input_content}]
12input_text=tokenizer.apply_chat_template(messages, tokenize=False)
13
14print(input_text)
15
16inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
17outputs = model.generate(inputs, max_new_tokens=1024, temperature=0, do_sample=False, repetition_penalty=1.08)
18
19print(tokenizer.decode(outputs[0]))少先队员应该为老人让座。shibing624/chinese-text-correction-7b
|-- added_tokens.json
|-- config.json
|-- generation_config.json
|-- merges.txt
|-- model.safetensors
|-- model.safetensors.index.json
|-- README.md
|-- special_tokens_map.json
|-- tokenizer_config.json
|-- tokenizer.json
`-- vocab.json

1@software{pycorrector,
2 author = {Xu Ming},
3 title = {pycorrector: Implementation of language model finetune},
4 year = {2024},
5 url = {https://github.com/shibing624/pycorrector},
6}