Instructions to use nbouali/flaubert-base-uncased-finetuned-cooking with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nbouali/flaubert-base-uncased-finetuned-cooking with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="nbouali/flaubert-base-uncased-finetuned-cooking")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("nbouali/flaubert-base-uncased-finetuned-cooking") model = AutoModelForSequenceClassification.from_pretrained("nbouali/flaubert-base-uncased-finetuned-cooking", device_map="auto") - Notebooks
- Google Colab
- Kaggle
FlauBERT finetuned on French cooking recipes
This model is finetuned on a sequence classification task that associates each sequence with the appropriate recipe category.
How to use it?
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from transformers import TextClassificationPipeline
loaded_tokenizer = AutoTokenizer.from_pretrained("nbouali/flaubert-base-uncased-finetuned-cooking")
loaded_model = AutoModelForSequenceClassification.from_pretrained("nbouali/flaubert-base-uncased-finetuned-cooking")
nlp = TextClassificationPipeline(model=loaded_model,tokenizer=loaded_tokenizer,task="Recipe classification")
print(nlp("Lasagnes à la bolognaise"))
[{'label': 'LABEL_6', 'score': 0.9921900033950806}]
Label encoding:
| label | Recipe Category |
|---|---|
| 0 | 'Accompagnement' |
| 1 | 'Amuse-gueule' |
| 2 | 'Boisson' |
| 3 | 'Confiserie' |
| 4 | 'Dessert' |
| 5 | 'Entrée' |
| 6 | 'Plat principal' |
| 7 | 'Sauce' |
If you would like to know more about this model you can refer to our blog post
- Downloads last month
- 39