Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: id
|
3 |
+
tags:
|
4 |
+
- roberta-base-indonesia
|
5 |
+
license: mit
|
6 |
+
datasets:
|
7 |
+
- oscar
|
8 |
+
widget:
|
9 |
+
- text: "Budi adalah anak yang pintar karena ia suka <mask>."
|
10 |
+
---
|
11 |
+
|
12 |
+
## Indonesian RoBERTa Base
|
13 |
+
## How to Use
|
14 |
+
|
15 |
+
### As Masked Language Model
|
16 |
+
```python
|
17 |
+
from transformers import pipeline
|
18 |
+
pretrained_name = "akahana/roberta-base-indonesia"
|
19 |
+
fill_mask = pipeline(
|
20 |
+
"fill-mask",
|
21 |
+
model=pretrained_name,
|
22 |
+
tokenizer=pretrained_name
|
23 |
+
)
|
24 |
+
fill_mask("Budi adalah anak yang pintar karena ia suka <mask>.")
|
25 |
+
```
|
26 |
+
|
27 |
+
### Feature Extraction in PyTorch
|
28 |
+
```python
|
29 |
+
from transformers import RobertaModel, RobertaTokenizerFast
|
30 |
+
pretrained_name = "akahana/roberta-base-indonesia"
|
31 |
+
model = RobertaModel.from_pretrained(pretrained_name)
|
32 |
+
tokenizer = RobertaTokenizerFast.from_pretrained(pretrained_name)
|
33 |
+
prompt = "Budi adalah anak yang pintar karena ia suka belajar."
|
34 |
+
encoded_input = tokenizer(prompt, return_tensors='pt')
|
35 |
+
output = model(**encoded_input)
|
36 |
+
```
|