File size: 946 Bytes
9b52ab2 3f9c271 1a6d2b0 90d22f9 1a6d2b0 9b52ab2 640b207 5a09423 640b207 90d22f9 640b207 90d22f9 640b207 528d958 90d22f9 640b207 90d22f9 5a8ca16 640b207 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
---
license: apache-2.0
language:
- zh
metrics:
- bleu
pipeline_tag: translation
widget:
- text: "竖子不足与谋。"
example_title: "translation"
---
# Model Description
Erya4FT is based on [Erya](https://huggingface.co/RUCAIBox/Erya) and further fine-tuned on our [Dataset](https://huggingface.co/datasets/RUCAIBox/Erya-dataset), enhancing the ability to translate ancient Chinese into Modern Chinese.
# Example
```python
>>> from transformers import BertTokenizer, CPTForConditionalGeneration
>>> tokenizer = BertTokenizer.from_pretrained("RUCAIBox/Erya4FT")
>>> model = CPTForConditionalGeneration.from_pretrained("RUCAIBox/Erya4FT")
>>> input_ids = tokenizer("竖子不足与谋。", return_tensors='pt')
>>> input_ids.pop("token_type_ids")
>>> pred_ids = model.generate(max_new_tokens=256, **input_ids)
>>> print(tokenizer.batch_decode(pred_ids, skip_special_tokens=True))
['这 小 子 不 值 得 与 他 商 量 。']
``` |