Back to all models
fill-mask mask_token: [MASK]
Query this model
πŸ”₯ This model is currently loaded and running on the Inference API. ⚠️ This model could not be loaded by the inference API. ⚠️ This model can be loaded on the Inference API on-demand.
JSON Output
API endpoint  

⚑️ Upgrade your account to access the Inference API

Share Copied link to clipboard

Monthly model downloads

huseinzol05/electra-base-generator-bahasa-cased huseinzol05/electra-base-generator-bahasa-cased
23 downloads
last 30 days

pytorch

tf

Contributed by

huseinzol05 husein zolkepli
23 models

How to use this model directly from the πŸ€—/transformers library:

			
Copy to clipboard
from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("huseinzol05/electra-base-generator-bahasa-cased") model = AutoModelForMaskedLM.from_pretrained("huseinzol05/electra-base-generator-bahasa-cased")

Bahasa ELECTRA Model

Pretrained ELECTRA base language model for Malay and Indonesian.

Pretraining Corpus

electra-base-generator-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,

  1. dumping wikipedia.
  2. local instagram.
  3. local twitter.
  4. local news.
  5. local parliament text.
  6. local singlish/manglish text.
  7. IIUM Confession.
  8. Wattpad.
  9. Academia PDF.

Preprocessing steps can reproduce from here, Malaya/pretrained-model/preprocess.

Pretraining details

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 ElectraTokenizer, ElectraModel

model = ElectraModel.from_pretrained('huseinzol05/electra-base-generator-bahasa-cased')
tokenizer = ElectraTokenizer.from_pretrained(
    'huseinzol05/electra-base-generator-bahasa-cased',
    do_lower_case = False,
)

Example using AutoModelWithLMHead

from transformers import ElectraTokenizer, AutoModelWithLMHead, pipeline

model = AutoModelWithLMHead.from_pretrained('huseinzol05/electra-base-generator-bahasa-cased')
tokenizer = ElectraTokenizer.from_pretrained(
    'huseinzol05/electra-base-generator-bahasa-cased',
    do_lower_case = False,
)
fill_mask = pipeline('fill-mask', model = model, tokenizer = tokenizer)
print(fill_mask('makan ayam dengan [MASK]'))

Output is,

[{'sequence': '[CLS] makan ayam dengan ayam [SEP]',
  'score': 0.08424834907054901,
  'token': 3255},
 {'sequence': '[CLS] makan ayam dengan rendang [SEP]',
  'score': 0.064150370657444,
  'token': 6288},
 {'sequence': '[CLS] makan ayam dengan nasi [SEP]',
  'score': 0.033446669578552246,
  'token': 2533},
 {'sequence': '[CLS] makan ayam dengan kucing [SEP]',
  'score': 0.02803465723991394,
  'token': 3577},
 {'sequence': '[CLS] makan ayam dengan telur [SEP]',
  'score': 0.026627106592059135,
  'token': 6350}]

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 ELECTRA for Bahasa.