File size: 1,729 Bytes
d677166
 
528b70e
d677166
0b2c0aa
d677166
 
 
528b70e
 
 
 
 
 
 
 
 
d677166
 
384e3fb
cc370a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
language: fr
pipeline_tag: "token-classification"
widget:
 - text: "je voudrais réserver une chambre à paris pour demain et lundi"
 - text: "d'accord pour l'hôtel à quatre vingt dix euros la nuit"
 - text: "deux nuits s'il vous plait"
 - text: "dans un hôtel avec piscine à marseille"
tags:
- bert
- flaubert 
- natural language understanding
- NLU
- spoken language understanding
- SLU
- understanding
- MEDIA
---

# vpelloin/MEDIA_NLU_flaubert_uncased (FBU)

This is a Natural Language Understanding (NLU) model for the French [MEDIA benchmark](https://catalogue.elra.info/en-us/repository/browse/ELRA-S0272/).
It maps each input words into outputs concepts tags (76 available).

This model is a fine-tuning of [`flaubert_base_uncased`](https://huggingface.co/flaubert/flaubert_base_uncased).

## Usage with Pipeline
```python
from transformers import pipeline

generator = pipeline(model="vpelloin/MEDIA_NLU_flaubert_finetuned", task="token-classification")

print(generator)
```

## Usage with AutoTokenizer/AutoModel
```python
from transformers import (
    AutoTokenizer,
    AutoModelForTokenClassification
)

tokenizer = AutoTokenizer.from_pretrained("vpelloin/MEDIA_NLU_flaubert_uncased")
model = AutoModelForTokenClassification.from_pretrained("vpelloin/MEDIA_NLU_flaubert_uncased")

sentences = [
    "je voudrais réserver une chambre à paris pour demain et lundi",
    "d'accord pour l'hôtel à quatre vingt dix euros la nuit",
    "deux nuits s'il vous plait",
    "dans un hôtel avec piscine à marseille"
 ]
inputs = tokenizer(sentences, padding=True, return_tensors='pt')

outptus = model(**inputs).logits

print([[model.config.id2label[i] for i in b] for b in outptus.argmax(dim=-1).tolist()])
```