pythainlp.translate
The pythainlp.translate
for machine translation.
Modules
- class pythainlp.translate.Translate(src_lang: str, target_lang: str)[source]
Machine Translation
- Options for source & target language
th - en - Thai to English
en - th - English to Thai
th - zh - Thai to Chinese
zh - th - Chinese to Thai
th - fr - Thai to French
- Example
Translate text from Thai to English:
from pythainlp.translate import Translate th2en = Translate('th', 'en') th2en.translate("ฉันรักแมว") # output: I love cat.
- pythainlp.translate.en_th.download_model_all() None [source]
Download all translation models in advanced
- class pythainlp.translate.en_th.EnThTranslator[source]
English-Thai Machine Translation
from VISTEC-depa Thailand Artificial Intelligence Research Institute
Website: https://airesearch.in.th/releases/machine-translation-models/
- class pythainlp.translate.en_th.ThEnTranslator[source]
Thai-English Machine Translation
from VISTEC-depa Thailand Artificial Intelligence Research Institute
Website: https://airesearch.in.th/releases/machine-translation-models/
- class pythainlp.translate.zh_th.ThZhTranslator(pretrained: str = 'Lalita/marianmt-th-zh_cn')[source]
Thai-Chinese Machine Translation
from Lalita @ AI builder
- class pythainlp.translate.zh_th.ZhThTranslator(pretrained: str = 'Lalita/marianmt-zh_cn-th')[source]
Chinese-Thai Machine Translation
from Lalita @ AI builder