indonlp/NusaX-MT
Updated β’ 152 β’ 12
How to use smapproyek/fasttext-id-region-lang-detection with fastText:
from huggingface_hub import hf_hub_download
import fasttext
model = fasttext.load_model(hf_hub_download("smapproyek/fasttext-id-region-lang-detection", "model.bin"))A fastText classifier that identifies Indonesian, English and 10 Indonesian regional languages, trained on NusaX-MT.
Labels use the __label__<iso639-3>_<script> format of facebook/fasttext-language-identification.
| Label | Language | Precision | Recall | F1 |
|---|---|---|---|---|
ind_Latn |
Indonesian | 0.9679 | 0.9800 | 0.9739 |
eng_Latn |
English | 0.9780 | 1.0000 | 0.9889 |
ace_Latn |
Acehnese | 0.9975 | 0.9925 | 0.9950 |
ban_Latn |
Balinese | 0.9875 | 0.9900 | 0.9888 |
bjn_Latn |
Banjarese | 0.9847 | 0.9650 | 0.9747 |
bug_Latn |
Buginese | 0.9900 | 0.9950 | 0.9925 |
jav_Latn |
Javanese | 0.9924 | 0.9850 | 0.9887 |
mad_Latn |
Madurese | 0.9925 | 0.9925 | 0.9925 |
min_Latn |
Minangkabau | 0.9801 | 0.9850 | 0.9825 |
nij_Latn |
Ngaju | 0.9875 | 0.9850 | 0.9862 |
sun_Latn |
Sundanese | 0.9975 | 0.9875 | 0.9925 |
bbc_Latn |
Toba Batak | 0.9925 | 0.9900 | 0.9912 |
Test accuracy: 0.9873 (4800 sentences, official NusaX test split)
| 3 words | 5 words | 10 words | full sentence |
|---|---|---|---|
| 0.8148 | 0.9058 | 0.9788 | 0.9873 |
import fasttext
from huggingface_hub import hf_hub_download
model = fasttext.load_model(hf_hub_download("smapproyek/fasttext-id-region-lang-detection", "model.bin"))
model.predict("abdi bade angkat ka bandung enjing", k=3)
# (('__label__sun_Latn', ...), array([...]))
A quantized, smaller model.ftz is also provided.
The model was trained on text that was lowercased, had emojis converted to text aliases, @mentions replaced with user, URLs removed, and every character other than [a-z0-9] and whitespace replaced with a space. Apply the same cleaning at inference for best results.
fasttext.train_supervised with lr=0.5, epoch=30, dim=64, wordNgrams=2, minn=2, maxn=5, minCount=1, loss=softmax.@misc{winata2022nusax,
title={NusaX: Multilingual Parallel Sentiment Dataset for 10 Indonesian Local Languages},
author={Winata, Genta Indra and Aji, Alham Fikri and Cahyawijaya, Samuel and Mahendra, Rahmad and Koto, Fajri and Romadhony, Ade and Kurniawan, Kemal and Moeljadi, David and Prasojo, Radityo Eko and Fung, Pascale and Baldwin, Timothy and Lau, Jey Han and Sennrich, Rico and Ruder, Sebastian},
year={2022},
eprint={2205.15960},
archivePrefix={arXiv},
primaryClass={cs.CL}
}