Downloads · 30 days
394
19% of all-time downloads
shun89/opus-mt-ko-zh
opus-mt-ko-zh is a translation model from shun89. Use it when you need text moved from one language to another. The card lists the license as apache-2.0.
from transformers import MarianMTModel, MarianTokenizer
Downloads · 30 days
394
19% of all-time downloads
All-time downloads
2.1K
Public
Repo size
623 MB
Likes
0
Public
Click a slice to open those files.
.bin310 MB · 99%
From the Hugging Face model README
from transformers import MarianMTModel, MarianTokenizer
model = MarianMTModel.from_pretrained(“shun89/opus-mt-ko-zh”)
tokenizer = MarianTokenizer.from_pretrained(“shun89/opus-mt-ko-zh”)
text = '오피스 빌딩이 너무 현대적이라 사무 환경이 편안하네요!'
inputs = tokenizer(texts, return_tensors="pt",padding=True, truncation=True, max_length=256)
outputs = model.generate(**inputs)
result= " ".join(tokenizer.batch_decode(outputs, skip_special_tokens=True))
print("待翻译语句:",text)
print("翻译结果:",result)