Skip to content

SCB 1M en→th, th→en Pre-trained Transformer Model - v1.0

Latest
Compare
Choose a tag to compare
@lalital lalital released this 22 Jun 11:58
78df1a6

Pretrained machine translation model based on Transformer [Vaswani et al. 2017] for translating from Thai to English and English to Thai. The pre-trained models are trained from the English-Thai dataset namely (scb-mt-en-th-2020) which comprise over one million segment pairs.

The model weights are separated by translation direction (Thai→English and English→Thai) and by the type of source/target token used when training as follows.

  1. Word-level -- we use Thai dictionary-based word tokenizer, namely newmm, from PyThaiNLP) to tokenize Thai sentences. For English sentences, we use Moses Tokenizer (moses).

  2. Subword-level -- we use SentencePiece to trained the BPE model with unigram language model algorithm for both Thai and English. In this configuration, we join the BPE vocabulary built from the Thai and English training set.

Besides, we provide a notebook for testing the machine translation model inference via Google Colaboratory


โมเดลแปลภาษา (Machine Translation) บน Architecture Transformer [Vaswani et al. 2017] สำหรับการแปลภาษาระหว่าง ไทย→อังกฤษ และ อังกฤษ→ไทย โดยโมเดลได้เทรนจากชุดข้อมูลคู่ประโยคในภาษาอังกฤษ-ไทย (scb-mt-en-th-2020) ซึ่งมีจำนวนกว่า 1 ล้านคู่ประโยค

สำหรับโมเดลจะแบ่งเป็น 2 ทิศทาง คือ ระหว่าง ภาษาไทย→อังกฤษ และ ภาษาอังกฤษ→ไทย โดยในแต่ละทิศทาง จะมีรูปแบบของ Token ที่ต่างกัน ดังนี้

  1. Word-level โดยใช้ ตัวตัดคำจาก PyThaiNLP (newmm) สำหรับการตัดคำในประโยคภาษาไทย และ Moses Tokenizer (moses) สำหรับการตัดคำในประโยคภาษาอังกฤษ

  2. Subword-level โดยใช้ SentencePiece ในการสร้าง subword ทั้งในประโยคภาษาไทยและอังกฤษ (spm)

นอกจากนี้ทางศูนย์วิจัย ได้เตรียม Jupyter Notebook สำหรับการทดสอบการรันโมเดล Machine Translation ได้โดยทันทีผ่าน Google Colaboratory