Migrate model card from transformers-repo
Browse filesRead announcement at https://huggingface.co/proxy/discuss.huggingface.co/t/announcement-all-model-cards-will-be-migrated-to-hf-co-model-repos/2755
Original file history: https://github.com/huggingface/transformers/commits/master/model_cards/tblard/tf-allocine/README.md
README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: fr
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
# tf-allociné
|
| 6 |
+
|
| 7 |
+
A french sentiment analysis model, based on [CamemBERT](https://camembert-model.fr/), and finetuned on a large-scale dataset scraped from [Allociné.fr](http://www.allocine.fr/) user reviews.
|
| 8 |
+
|
| 9 |
+
## Results
|
| 10 |
+
|
| 11 |
+
| Validation Accuracy | Validation F1-Score | Test Accuracy | Test F1-Score |
|
| 12 |
+
|--------------------:| -------------------:| -------------:|--------------:|
|
| 13 |
+
| 97.39 | 97.36 | 97.44 | 97.34 |
|
| 14 |
+
|
| 15 |
+
The dataset and the evaluation code are available on [this repo](https://github.com/TheophileBlard/french-sentiment-analysis-with-bert).
|
| 16 |
+
|
| 17 |
+
## Usage
|
| 18 |
+
|
| 19 |
+
```python
|
| 20 |
+
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification
|
| 21 |
+
from transformers import pipeline
|
| 22 |
+
|
| 23 |
+
tokenizer = AutoTokenizer.from_pretrained("tblard/tf-allocine")
|
| 24 |
+
model = TFAutoModelForSequenceClassification.from_pretrained("tblard/tf-allocine")
|
| 25 |
+
|
| 26 |
+
nlp = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)
|
| 27 |
+
|
| 28 |
+
print(nlp("Alad'2 est clairement le meilleur film de l'année 2018.")) # POSITIVE
|
| 29 |
+
print(nlp("Juste whoaaahouuu !")) # POSITIVE
|
| 30 |
+
print(nlp("NUL...A...CHIER ! FIN DE TRANSMISSION.")) # NEGATIVE
|
| 31 |
+
print(nlp("Je m'attendais à mieux de la part de Franck Dubosc !")) # NEGATIVE
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
## Author
|
| 35 |
+
|
| 36 |
+
Théophile Blard – :email: [email protected]
|
| 37 |
+
|
| 38 |
+
If you use this work (code, model or dataset), please cite as:
|
| 39 |
+
|
| 40 |
+
> Théophile Blard, French sentiment analysis with BERT, (2020), GitHub repository, <https://github.com/TheophileBlard/french-sentiment-analysis-with-bert>
|