File size: 1,137 Bytes
9ec8347
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e5fa3b8
9ec8347
 
 
 
 
 
 
 
 
e5fa3b8
 
9ec8347
 
 
 
 
 
 
 
 
e5fa3b8
 
9ec8347
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
language: 
- multilingual
- ny
- kg
- kmb
- rw
- ln
- lua
- lg
- nso
- rn
- st
- sw
- ss
- ts
- tn
- tum
- umb
- xh
- zu
- fr
- en
license: apache-2.0
---


### How to use

You can use this model directly with a pipeline for masked language modeling:

```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='nairaxo/toumbert')
>>> unmasker("rais wa [MASK] ya tanzania.")


```

Here is how to use this model to get the features of a given text in PyTorch:

```python
from transformers import BertTokenizer, BertModel
tokenizer = BertTokenizer.from_pretrained('nairaxo/toumbert')
model = BertModel.from_pretrained("nairaxo/toumbert")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
```

and in TensorFlow:

```python
from transformers import BertTokenizer, TFBertModel
tokenizer = BertTokenizer.from_pretrained('nairaxo/toumbert')
model = TFBertModel.from_pretrained("nairaxo/toumbert")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)
```