This is one of several other language models that have been pre-trained with indonesian datasets. More detail about
its usage on downstream tasks (text classification, text generation, etc) is available at
Transformer based Indonesian Language Models
Intended uses & limitations
How to use
You can use this model directly with a pipeline for masked language modeling:
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='cahya/distilbert-base-indonesian')
>>> unmasker("Ayahku sedang bekerja di sawah untuk [MASK] padi")
[
{
"sequence": "[CLS] ayahku sedang bekerja di sawah untuk menanam padi [SEP]",
"score": 0.6853187084197998,
"token": 12712,
"token_str": "menanam"
},
{
"sequence": "[CLS] ayahku sedang bekerja di sawah untuk bertani padi [SEP]",
"score": 0.03739545866847038,
"token": 15484,
"token_str": "bertani"
},
{
"sequence": "[CLS] ayahku sedang bekerja di sawah untuk memetik padi [SEP]",
"score": 0.02742469497025013,
"token": 30338,
"token_str": "memetik"
},
{
"sequence": "[CLS] ayahku sedang bekerja di sawah untuk penggilingan padi [SEP]",
"score": 0.02214187942445278,
"token": 28252,
"token_str": "penggilingan"
},
{
"sequence": "[CLS] ayahku sedang bekerja di sawah untuk tanam padi [SEP]",
"score": 0.0185895636677742,
"token": 11308,
"token_str": "tanam"
}
]
Here is how to use this model to get the features of a given text in PyTorch:
from transformers import DistilBertTokenizer, DistilBertModel
model_name='cahya/distilbert-base-indonesian'
tokenizer = DistilBertTokenizer.from_pretrained(model_name)
model = DistilBertModel.from_pretrained(model_name)
text = "Silakan diganti dengan text apa saja."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
and in Tensorflow:
from transformers import DistilBertTokenizer, TFDistilBertModel
model_name='cahya/distilbert-base-indonesian'
tokenizer = DistilBertTokenizer.from_pretrained(model_name)
model = TFDistilBertModel.from_pretrained(model_name)
text = "Silakan diganti dengan text apa saja."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)
Training data
This model was distiled with 522MB of indonesian Wikipedia and 1GB of
indonesian newspapers
.
The texts are lowercased and tokenized using WordPiece and a vocabulary size of 32,000. The inputs of the model are
then of the form:
[CLS] Sentence A [SEP] Sentence B [SEP]
Runs of cahya distilbert-base-indonesian on huggingface.co
1.7K
Total runs
-30
24-hour runs
-8
3-day runs
-85
7-day runs
556
30-day runs
More Information About distilbert-base-indonesian huggingface.co Model
More distilbert-base-indonesian license Visit here:
distilbert-base-indonesian huggingface.co is an AI model on huggingface.co that provides distilbert-base-indonesian's model effect (), which can be used instantly with this cahya distilbert-base-indonesian model. huggingface.co supports a free trial of the distilbert-base-indonesian model, and also provides paid use of the distilbert-base-indonesian. Support call distilbert-base-indonesian model through api, including Node.js, Python, http.
distilbert-base-indonesian huggingface.co is an online trial and call api platform, which integrates distilbert-base-indonesian's modeling effects, including api services, and provides a free online trial of distilbert-base-indonesian, you can try distilbert-base-indonesian online for free by clicking the link below.
cahya distilbert-base-indonesian online free url in huggingface.co:
distilbert-base-indonesian is an open source model from GitHub that offers a free installation service, and any user can find distilbert-base-indonesian on GitHub to install. At the same time, huggingface.co provides the effect of distilbert-base-indonesian install, users can directly use distilbert-base-indonesian installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
distilbert-base-indonesian install url in huggingface.co: