sw2th / usage.py
datasetsANDmodels's picture
Upload usage.py
25bede7 verified
raw
history blame
777 Bytes
from transformers import pipeline
#pipe= pipeline("translation", model="th2en")
#pipe= pipeline("translation", model="ur2en")
pipe= pipeline("translation", model="sv2th")
#text ="ผมโทรมาจากสำนักงานสรรพากรครับ" #Thai
#text="میں ٹیکس آفس سے کال کر رہا ہوں۔" #Urdu
text="I am calling from tax office"
#text= "मैं कर कार्यालय से फोन कर रहा हूँ"# HINDI
#text="Jeg ringer fra skattekontoret"
text="Jag ringer från skattekontoret."#SWIDISH
#text="ผมโทรมาจากสํานักงานสรรพากร"#THAI
#text="저는 세무서에서 전화하고 있습니다."
result =pipe(text)
print( result[0]["translation_text"])