Fill-Mask
Transformers
PyTorch
Bulgarian
bert
torch
rmihaylov commited on
Commit
a942e66
1 Parent(s): bc6adbe

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +35 -4
README.md CHANGED
@@ -20,9 +20,40 @@ between bulgarian and Bulgarian. The training data is Bulgarian text from [OSCAR
20
 
21
  The model was compressed via [progressive module replacing](https://arxiv.org/abs/2002.02925).
22
 
23
- ## Intended uses & limitations
24
 
25
- You can use the raw model for:
26
- - fill-mask task
27
 
28
- Or fine-tune it to a downstream task.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  The model was compressed via [progressive module replacing](https://arxiv.org/abs/2002.02925).
22
 
23
+ ### How to use
24
 
25
+ Here is how to use this model in PyTorch:
 
26
 
27
+ ```python
28
+ >>> from transformers import pipeline
29
+ >>>
30
+ >>> model = pipeline(
31
+ >>> 'fill-mask',
32
+ >>> model='rmihaylov/bert-base-theseus-bg',
33
+ >>> tokenizer='rmihaylov/bert-base-theseus-bg',
34
+ >>> device=0,
35
+ >>> revision=None)
36
+ >>> output = model("София е [MASK] на България.")
37
+ >>> print(output)
38
+
39
+ [{'score': 0.1586454212665558,
40
+ 'sequence': 'София е столица на България.',
41
+ 'token': 76074,
42
+ 'token_str': 'столица'},
43
+ {'score': 0.12992817163467407,
44
+ 'sequence': 'София е столица на България.',
45
+ 'token': 2659,
46
+ 'token_str': 'столица'},
47
+ {'score': 0.06064048036932945,
48
+ 'sequence': 'София е Перлата на България.',
49
+ 'token': 102146,
50
+ 'token_str': 'Перлата'},
51
+ {'score': 0.034687548875808716,
52
+ 'sequence': 'София е представителката на България.',
53
+ 'token': 105456,
54
+ 'token_str': 'представителката'},
55
+ {'score': 0.03053216263651848,
56
+ 'sequence': 'София е присъединяването на България.',
57
+ 'token': 18749,
58
+ 'token_str': 'присъединяването'}]
59
+ ```