vpelloin commited on
Commit
f9dd19d
1 Parent(s): 61fc149

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +39 -1
README.md CHANGED
@@ -17,4 +17,42 @@ tags:
17
  - MEDIA
18
  ---
19
 
20
- # MEDIA NLU model trained on FlauBERT Finetuned on ASR
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  - MEDIA
18
  ---
19
 
20
+ # vpelloin/MEDIA_NLU_flaubert_finetuned
21
+
22
+ This is a Natural Language Understanding (NLU) model for the French [MEDIA benchmark](https://catalogue.elra.info/en-us/repository/browse/ELRA-S0272/).
23
+ It maps each input words into outputs concepts tags (76 available).
24
+
25
+ This model is a fine-tuning of `flaubert_base_uncased_oral_ft` (FlauBERT finetuned on ASR data).
26
+
27
+
28
+ ## Usage with Pipeline
29
+ ```python
30
+ from transformers import pipeline
31
+
32
+ generator = pipeline(model="vpelloin/MEDIA_NLU_flaubert_finetuned", task="token-classification")
33
+
34
+ print(generator)
35
+ ```
36
+
37
+ ## Usage with AutoTokenizer/AutoModel
38
+ ```python
39
+ from transformers import (
40
+ AutoTokenizer,
41
+ AutoModelForTokenClassification
42
+ )
43
+
44
+ tokenizer = AutoTokenizer.from_pretrained("vpelloin/MEDIA_NLU_flaubert_finetuned")
45
+ model = AutoModelForTokenClassification.from_pretrained("vpelloin/MEDIA_NLU_flaubert_finetuned")
46
+
47
+ sentences = [
48
+ "je voudrais réserver une chambre à paris pour demain et lundi",
49
+ "d'accord pour l'hôtel à quatre vingt dix euros la nuit",
50
+ "deux nuits s'il vous plait",
51
+ "dans un hôtel avec piscine à marseille"
52
+ ]
53
+ inputs = tokenizer(sentences, padding=True, return_tensors='pt')
54
+
55
+ outptus = model(**inputs).logits
56
+
57
+ print([[model.config.id2label[i] for i in b] for b in outptus.argmax(dim=-1).tolist()])
58
+ ```