update README
Browse files
README.md
CHANGED
@@ -1,11 +1,12 @@
|
|
1 |
---
|
2 |
language: "mn"
|
3 |
tags:
|
|
|
4 |
- mongolian
|
5 |
- cased
|
6 |
---
|
7 |
|
8 |
-
# BERT-
|
9 |
[Link to Official Mongolian-BERT repo](https://github.com/tugstugi/mongolian-bert)
|
10 |
|
11 |
## Model description
|
@@ -18,21 +19,27 @@ This repository is based on the following open source projects: [google-research
|
|
18 |
#### How to use
|
19 |
|
20 |
```python
|
21 |
-
from transformers import pipeline, AutoTokenizer,
|
22 |
|
23 |
-
tokenizer = AutoTokenizer.from_pretrained('tugstugi/bert-large-mongolian-cased')
|
24 |
-
model =
|
25 |
|
26 |
## declare task ##
|
27 |
pipe = pipeline(task="fill-mask", model=model, tokenizer=tokenizer)
|
28 |
|
29 |
## example ##
|
30 |
-
input_ = '
|
31 |
|
32 |
output_ = pipe(input_)
|
33 |
for i in range(len(output_)):
|
34 |
print(output_[i])
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
```
|
37 |
|
38 |
|
|
|
1 |
---
|
2 |
language: "mn"
|
3 |
tags:
|
4 |
+
- bert
|
5 |
- mongolian
|
6 |
- cased
|
7 |
---
|
8 |
|
9 |
+
# BERT-LARGE-MONGOLIAN-CASED
|
10 |
[Link to Official Mongolian-BERT repo](https://github.com/tugstugi/mongolian-bert)
|
11 |
|
12 |
## Model description
|
|
|
19 |
#### How to use
|
20 |
|
21 |
```python
|
22 |
+
from transformers import pipeline, AutoTokenizer, AutoModelForMaskedLM
|
23 |
|
24 |
+
tokenizer = AutoTokenizer.from_pretrained('tugstugi/bert-large-mongolian-cased', use_fast=False)
|
25 |
+
model = AutoModelForMaskedLM.from_pretrained('tugstugi/bert-large-mongolian-cased')
|
26 |
|
27 |
## declare task ##
|
28 |
pipe = pipeline(task="fill-mask", model=model, tokenizer=tokenizer)
|
29 |
|
30 |
## example ##
|
31 |
+
input_ = 'Монгол улсын [MASK] Улаанбаатар хотоос ярьж байна.'
|
32 |
|
33 |
output_ = pipe(input_)
|
34 |
for i in range(len(output_)):
|
35 |
print(output_[i])
|
36 |
|
37 |
+
## output ##
|
38 |
+
# {'sequence': 'Монгол улсын нийслэл Улаанбаатар хотоос ярьж байна.', 'score': 0.9779232740402222, 'token': 1176, 'token_str': 'нийслэл'}
|
39 |
+
# {'sequence': 'Монгол улсын Нийслэл Улаанбаатар хотоос ярьж байна.', 'score': 0.015034765936434269, 'token': 4059, 'token_str': 'Нийслэл'}
|
40 |
+
# {'sequence': 'Монгол улсын Ерөнхийлөгч Улаанбаатар хотоос ярьж байна.', 'score': 0.0021413620561361313, 'token': 325, 'token_str': 'Ерөнхийлөгч'}
|
41 |
+
# {'sequence': 'Монгол улсын ерөнхийлөгч Улаанбаатар хотоос ярьж байна.', 'score': 0.0008035294013097882, 'token': 1215, 'token_str': 'ерөнхийлөгч'}
|
42 |
+
# {'sequence': 'Монгол улсын нийслэлийн Улаанбаатар хотоос ярьж байна.', 'score': 0.0006434018723666668, 'token': 356, 'token_str': 'нийслэлийн'}
|
43 |
```
|
44 |
|
45 |
|