Views
No views yet
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2from transformers import pipeline
3
4loaded_tokenizer = AutoTokenizer.from_pretrained('flaubert/flaubert_large_cased')
5loaded_model = AutoModelForSequenceClassification.from_pretrained("DemangeJeremy/4-sentiments-with-flaubert")
6
7nlp = pipeline('sentiment-analysis', model=loaded_model, tokenizer=loaded_tokenizer)
8
9print(nlp("Je suis plutôt confiant."))[{'label': 'OBJECTIVE', 'score': 0.3320835530757904}]| Epoch | Validation Loss | Samples Per Second |
|---|---|---|
| 1 | 2.219246 | 49.476000 |
| 2 | 1.883753 | 47.259000 |
| 3 | 1.747969 | 44.957000 |
| 4 | 1.695606 | 43.872000 |
| 5 | 1.641470 | 45.726000 |
Jérémy Demange, Four sentiments with FlauBERT, (2021), Hugging Face repository, https://huggingface.co/DemangeJeremy/4-sentiments-with-flaubert