Update usage
Browse files
README.md
CHANGED
|
@@ -58,7 +58,7 @@ You can use this model directly with a pipeline for masked language modeling:
|
|
| 58 |
|
| 59 |
```python
|
| 60 |
>>> from transformers import pipeline
|
| 61 |
-
>>> unmasker = pipeline('fill-mask', model='fralbert-base')
|
| 62 |
>>> unmasker("Bonjour Je suis un model [MASK] .")
|
| 63 |
```
|
| 64 |
|
|
@@ -66,8 +66,8 @@ Here is how to use this model to get the features of a given text in PyTorch:
|
|
| 66 |
|
| 67 |
```python
|
| 68 |
from transformers import AlbertTokenizer, AlbertModel
|
| 69 |
-
tokenizer = AlbertTokenizer.from_pretrained('fralbert-base')
|
| 70 |
-
model = AlbertModel.from_pretrained("fralbert-base")
|
| 71 |
text = "Remplacez-moi par le texte en français que vous souhaitez."
|
| 72 |
encoded_input = tokenizer(text, return_tensors='pt')
|
| 73 |
output = model(**encoded_input)
|
|
@@ -77,8 +77,8 @@ and in TensorFlow:
|
|
| 77 |
|
| 78 |
```python
|
| 79 |
from transformers import AlbertTokenizer, TFAlbertModel
|
| 80 |
-
tokenizer = AlbertTokenizer.from_pretrained('fralbert-base')
|
| 81 |
-
model = TFAlbertModel.from_pretrained("fralbert-base")
|
| 82 |
text = "Remplacez-moi par le texte en français que vous souhaitez."
|
| 83 |
encoded_input = tokenizer(text, return_tensors='tf')
|
| 84 |
output = model(encoded_input)
|
|
@@ -133,4 +133,6 @@ When fine-tuned on downstream tasks, the ALBERT models achieve the following res
|
|
| 133 |
address = {Online},
|
| 134 |
month = sep,
|
| 135 |
}
|
| 136 |
-
```
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
```python
|
| 60 |
>>> from transformers import pipeline
|
| 61 |
+
>>> unmasker = pipeline('fill-mask', model='qwant/fralbert-base')
|
| 62 |
>>> unmasker("Bonjour Je suis un model [MASK] .")
|
| 63 |
```
|
| 64 |
|
|
|
|
| 66 |
|
| 67 |
```python
|
| 68 |
from transformers import AlbertTokenizer, AlbertModel
|
| 69 |
+
tokenizer = AlbertTokenizer.from_pretrained('qwant/fralbert-base')
|
| 70 |
+
model = AlbertModel.from_pretrained("qwant/fralbert-base")
|
| 71 |
text = "Remplacez-moi par le texte en français que vous souhaitez."
|
| 72 |
encoded_input = tokenizer(text, return_tensors='pt')
|
| 73 |
output = model(**encoded_input)
|
|
|
|
| 77 |
|
| 78 |
```python
|
| 79 |
from transformers import AlbertTokenizer, TFAlbertModel
|
| 80 |
+
tokenizer = AlbertTokenizer.from_pretrained('qwant/fralbert-base')
|
| 81 |
+
model = TFAlbertModel.from_pretrained("qwant/fralbert-base")
|
| 82 |
text = "Remplacez-moi par le texte en français que vous souhaitez."
|
| 83 |
encoded_input = tokenizer(text, return_tensors='tf')
|
| 84 |
output = model(encoded_input)
|
|
|
|
| 133 |
address = {Online},
|
| 134 |
month = sep,
|
| 135 |
}
|
| 136 |
+
```
|
| 137 |
+
|
| 138 |
+
Link to the paper: [PDF](https://hal.archives-ouvertes.fr/hal-03336060)
|