模型:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from transformers import pipeline
loaded_tokenizer = AutoTokenizer.from_pretrained('flaubert/flaubert_large_cased')
loaded_model = AutoModelForSequenceClassification.from_pretrained("DemangeJeremy/4-sentiments-with-flaubert")
nlp = pipeline('sentiment-analysis', model=loaded_model, tokenizer=loaded_tokenizer)
print(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,使用FlauBERT进行四种情感分析(2021),Hugging Face 代码库, https://huggingface.co/DemangeJeremy/4-sentiments-with-flaubert