Downloads · 30 days
30
36% of all-time downloads
cstorm125/marianmt-th-zh_cn
marianmt-th-zh_cn is a translation model from cstorm125. Use it when you need text moved from one language to another. It is set up for transformers.
source languages: th target languages: zhcn dataset: model: transformer-align pre-processing: normalization + SentencePiece test set translations: test set scores:
Downloads · 30 days
30
36% of all-time downloads
All-time downloads
84
Public
Repo size
485 MB
Likes
0
Public
Click a slice to open those files.
.bin242 MB · 99%
From the Hugging Face model README
Training scripts from LalitaDeelert/NLP-ZH_TH-Project. Experiments tracked at cstorm125/marianmt-th-zh_cn.
export WANDB_PROJECT=marianmt-th-zh_cn
python train_model.py --input_fname ../data/v1/Train.csv \
--output_dir ../models/marianmt-th-zh_cn \
--source_lang th --target_lang zh \
--metric_tokenize zh --fp16
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("cstorm125/marianmt-zh_cn-th")
model = AutoModelForSeq2SeqLM.from_pretrained("cstorm125/marianmt-zh_cn-th").cpu()
src_text = [
'ฉันรักคุณ',
'ฉันอยากกินข้าว',
]
translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
print([tokenizer.decode(t, skip_special_tokens=True) for t in translated])
> ['我爱你', '我想吃饭。']
transformers==4.6.0
torch==1.8.0