Update README.md
Browse files
README.md
CHANGED
@@ -49,17 +49,19 @@ Load CamemBERT and its sub-word tokenizer :
|
|
49 |
```python
|
50 |
from transformers import CamembertModel, CamembertTokenizer
|
51 |
|
52 |
-
tokeinzer = CamembertTokenizer.from_pretrained(
|
53 |
-
model = CamembertModel.from_pretrained(
|
54 |
model.eval()
|
|
|
|
|
55 |
```
|
56 |
|
57 |
Filling masks using pipeline :
|
58 |
```python
|
59 |
from transformers import pipeline
|
60 |
|
61 |
-
model_fill_mask = pipeline(
|
62 |
-
results = model_fill_mask(
|
63 |
#results
|
64 |
#[{'sequence': '<s> Le camembert est délicieux :)</s>', 'score': 0.3878222405910492, 'token': 7200},
|
65 |
# {'sequence': '<s> Le camembert est excellent :)</s>', 'score': 0.06469205021858215, 'token': 2183},
|
|
|
49 |
```python
|
50 |
from transformers import CamembertModel, CamembertTokenizer
|
51 |
|
52 |
+
tokeinzer = CamembertTokenizer.from_pretrained("cmarkea/distilcamembert-base")
|
53 |
+
model = CamembertModel.from_pretrained("cmarkea/distilcamembert-base")
|
54 |
model.eval()
|
55 |
+
|
56 |
+
...
|
57 |
```
|
58 |
|
59 |
Filling masks using pipeline :
|
60 |
```python
|
61 |
from transformers import pipeline
|
62 |
|
63 |
+
model_fill_mask = pipeline("fill-mask", model="cmarkea/distilcamembert-base", tokenizer="cmarkea/distilcamembert-base")
|
64 |
+
results = model_fill_mask("Le camembert est <mask> :)")
|
65 |
#results
|
66 |
#[{'sequence': '<s> Le camembert est délicieux :)</s>', 'score': 0.3878222405910492, 'token': 7200},
|
67 |
# {'sequence': '<s> Le camembert est excellent :)</s>', 'score': 0.06469205021858215, 'token': 2183},
|