antoinelouis commited on
Commit
04c3b5e
·
1 Parent(s): a8c8df1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -1
README.md CHANGED
@@ -13,14 +13,31 @@ This model is a pruned version of the pre-trained [CamemBERT](https://huggingfac
13
 
14
  ## Usage
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  ```python
17
  from transformers import AutoTokenizer, AutoModel
18
 
19
  tokenizer = AutoTokenizer.from_pretrained('antoinelouis/camembert-L2')
20
  model = AutoModel.from_pretrained('antoinelouis/camembert-L2')
 
 
 
 
21
  ```
22
 
23
- ## Comparison
24
 
25
  | Model | #Params | Size | Pruning |
26
  |--------------------------------------------------------------------|:-------:|:-----:|:-------:|
 
13
 
14
  ## Usage
15
 
16
+ You can use the raw model for masked language modeling, but it's mostly intended to be fine-tuned on a downstream task, especially one that uses the whole sentence to make decisions such as text classification, extractive question answering, or semantic search. For tasks such as text generation, you should look at autoregressive models like [BelGPT-2](https://huggingface.co/antoinelouis/belgpt2).
17
+
18
+ You can use this model directly with a pipeline for masked language modeling:
19
+
20
+ ```python
21
+ from transformers import pipeline
22
+
23
+ unmasker = pipeline('fill-mask', model='antoinelouis/camembert-L2')
24
+ unmasker("Bonjour, je suis un [MASK] modèle.")
25
+ ```
26
+
27
+ You can also use this model to get the features of a given text:
28
+
29
  ```python
30
  from transformers import AutoTokenizer, AutoModel
31
 
32
  tokenizer = AutoTokenizer.from_pretrained('antoinelouis/camembert-L2')
33
  model = AutoModel.from_pretrained('antoinelouis/camembert-L2')
34
+
35
+ text = "Remplacez-moi par le texte de votre choix."
36
+ encoded_input = tokenizer(text, return_tensors='pt')
37
+ output = model(**encoded_input)
38
  ```
39
 
40
+ ## Variations
41
 
42
  | Model | #Params | Size | Pruning |
43
  |--------------------------------------------------------------------|:-------:|:-----:|:-------:|