Downloads · 30 days
10
14% of all-time downloads
orozcohsu/translation_zh_en
translation_zh_en is a translation model from orozcohsu. Use it when you need text moved from one language to another. It is set up for transformers.
本模型基於 Helsinki-NLP/opus-mt-zh-en 預訓練權重,針對 繁體中文 ➔ 英文翻譯任務進行微調。 使用 Hugging Face transformers 庫完成訓練,並以 BLEU 分數作為主要評估指標。
Downloads · 30 days
10
14% of all-time downloads
All-time downloads
71
Public
Parameters
77.5M
312 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors310 MB · 99%
From the Hugging Face model README
本模型基於 Helsinki-NLP/opus-mt-zh-en 預訓練權重,針對 繁體中文 ➔ 英文翻譯任務進行微調。
使用 Hugging Face transformers 庫完成訓練,並以 BLEU 分數作為主要評估指標。
Seq2SeqTrainer 完成微調predict_with_generate=True(生成翻譯以供評分)training_log.csv./results/transformer_v1from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
model = AutoModelForSeq2SeqLM.from_pretrained("./results/transformer_v1")
tokenizer = AutoTokenizer.from_pretrained("./results/transformer_v1")
inputs = tokenizer("外出要小心注意安全", return_tensors="pt")
outputs = model.generate(**inputs)
translated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(translated_text)