模型:

tblard/tf-allocine

英文

tf-allocine

一种基于 CamemBERT 的法语情感分析模型,并在从 Allociné.fr 用户评论中抓取的大规模数据集上进行了微调。

结果

Validation Accuracy Validation F1-Score Test Accuracy Test F1-Score
97.39 97.36 97.44 97.34

数据集和评估代码可在 this repo 上获得。

用法

from transformers import AutoTokenizer, TFAutoModelForSequenceClassification
from transformers import pipeline

tokenizer = AutoTokenizer.from_pretrained("tblard/tf-allocine")
model = TFAutoModelForSequenceClassification.from_pretrained("tblard/tf-allocine")

nlp = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)

print(nlp("Alad'2 est clairement le meilleur film de l'année 2018.")) # POSITIVE
print(nlp("Juste whoaaahouuu !")) # POSITIVE
print(nlp("NUL...A...CHIER ! FIN DE TRANSMISSION.")) # NEGATIVE
print(nlp("Je m'attendais à mieux de la part de Franck Dubosc !")) # NEGATIVE

作者

Théophile Blard-:email:theophile.blard@gmail.com

如果您使用了这个工作(代码、模型或数据集),请引用:

Théophile Blard,French sentiment analysis with BERT,(2020),GitHub存储库, https://github.com/TheophileBlard/french-sentiment-analysis-with-bert