Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- multilingual
|
4 |
+
- ny
|
5 |
+
- kg
|
6 |
+
- kmb
|
7 |
+
- rw
|
8 |
+
- ln
|
9 |
+
- lua
|
10 |
+
- lg
|
11 |
+
- nso
|
12 |
+
- rn
|
13 |
+
- st
|
14 |
+
- sw
|
15 |
+
- ss
|
16 |
+
- ts
|
17 |
+
- tn
|
18 |
+
- tum
|
19 |
+
- umb
|
20 |
+
- xh
|
21 |
+
- zu
|
22 |
+
- fr
|
23 |
+
- en
|
24 |
+
license: apache-2.0
|
25 |
+
---
|
26 |
+
|
27 |
+
|
28 |
+
### How to use
|
29 |
+
|
30 |
+
You can use this model directly with a pipeline for masked language modeling:
|
31 |
+
|
32 |
+
```python
|
33 |
+
>>> from transformers import pipeline
|
34 |
+
>>> unmasker = pipeline('fill-mask', model='aioxlabs/toumbert')
|
35 |
+
>>> unmasker("rais wa [MASK] ya tanzania.")
|
36 |
+
|
37 |
+
|
38 |
+
```
|
39 |
+
|
40 |
+
Here is how to use this model to get the features of a given text in PyTorch:
|
41 |
+
|
42 |
+
```python
|
43 |
+
from transformers import BertTokenizer, BertModel
|
44 |
+
tokenizer = BertTokenizer.from_pretrained('aioxlabs/toumbert')
|
45 |
+
model = BertModel.from_pretrained("aioxlabs/toumbert")
|
46 |
+
text = "Replace me by any text you'd like."
|
47 |
+
encoded_input = tokenizer(text, return_tensors='pt')
|
48 |
+
output = model(**encoded_input)
|
49 |
+
```
|
50 |
+
|
51 |
+
and in TensorFlow:
|
52 |
+
|
53 |
+
```python
|
54 |
+
from transformers import BertTokenizer, TFBertModel
|
55 |
+
tokenizer = BertTokenizer.from_pretrained('aioxlabs/toumbert')
|
56 |
+
model = TFBertModel.from_pretrained("aioxlabs/toumbert")
|
57 |
+
text = "Replace me by any text you'd like."
|
58 |
+
encoded_input = tokenizer(text, return_tensors='tf')
|
59 |
+
output = model(encoded_input)
|
60 |
+
```
|