language
| language |
|---|
| malay |
Bahasa XLNet Model
Pretrained XLNet base language model for Malay and Indonesian.
Pretraining Corpus
XLNET-base-bahasa-cased model was pretrained on ~1.8 Billion words. We trained on both standard and social media language structures, and below is list of data we trained on,
- dumping wikipedia.
- local instagram.
- local twitter.
- local news.
- local parliament text.
- local singlish/manglish text.
- IIUM Confession.
- Wattpad.
- Academia PDF.
Preprocessing steps can reproduce from here, Malaya/pretrained-model/preprocess.
Pretraining details
- This model was trained using zihangdai XLNet's github repository on 3 Titan V100 32GB VRAM.
- All steps can reproduce from here, Malaya/pretrained-model/xlnet.
Load Pretrained Model
You can use this model by installing torch or tensorflow and Huggingface library transformers. And you can use it directly by initializing it like this:
from transformers import XLNetTokenizer, XLNetModel
model = XLNetModel.from_pretrained('huseinzol05/xlnet-base-bahasa-cased')
tokenizer = XLNetTokenizer.from_pretrained(
'huseinzol05/xlnet-base-bahasa-cased', do_lower_case = False
)
Example using AutoModelWithLMHead
from transformers import AlbertTokenizer, AutoModelWithLMHead, pipeline
model = AutoModelWithLMHead.from_pretrained('huseinzol05/xlnet-base-bahasa-cased')
tokenizer = XLNetTokenizer.from_pretrained(
'huseinzol05/xlnet-base-bahasa-cased', do_lower_case = False
)
fill_mask = pipeline('fill-mask', model = model, tokenizer = tokenizer)
print(fill_mask('makan ayam dengan [MASK]'))
Results
For further details on the model performance, simply checkout accuracy page from Malaya, https://malaya.readthedocs.io/en/latest/Accuracy.html, we compared with traditional models.
Acknowledgement
Thanks to Im Big, LigBlou, Mesolitica and KeyReply for sponsoring AWS, Google and GPU clouds to train XLNet for Bahasa.