Downloads · 30 days
230
1% of all-time downloads
SchuylerH/bert-multilingual-go-emtions
bert-multilingual-go-emtions is a text classification model from SchuylerH. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This repository hosts a fine-tuned BERT model for cross-language emotion classification on the GoEmotions dataset. This model is unique as it has been trained on a multilingual dataset comprising of English and Chines…
Downloads · 30 days
230
1% of all-time downloads
All-time downloads
32.1K
Public
Repo size
1.4 GB
Likes
32
Public
Click a slice to open those files.
.bin712 MB · 100%
From the Hugging Face model README
This repository hosts a fine-tuned BERT model for cross-language emotion classification on the GoEmotions dataset. This model is unique as it has been trained on a multilingual dataset comprising of English and Chinese texts. It is capable of classifying text into one of 28 different emotion categories.
The 28 emotion categories, according to the GoEmotions taxonomy, are: 'admiration', 'amusement', 'anger', 'annoyance', 'approval', 'caring', 'confusion', 'curiosity', 'desire', 'disappointment', 'disapproval', 'disgust', 'embarrassment', 'excitement', 'fear', 'gratitude', 'grief', 'joy', 'love', 'nervousness', 'optimism', 'pride', 'realization', 'relief', 'remorse', 'sadness', 'surprise', and 'neutral'.
The model demonstrates high performance on the validation set, with the following scores:
Accuracy: 85.95% Precision: 91.99% Recall: 89.56% F1 Score: 90.17% These results indicate the model's high accuracy and precision in predicting the correct emotion category for a given input text, regardless of the language (English or Chinese).
The dataset used for training the model is a combined dataset of the original English GoEmotions dataset and a machine translated Chinese version of the GoEmotions dataset.
The dataset is split into two parts:
The model is trained in two stages:
The model is trained for a total of 20 epochs (10 epochs for each stage). Precision, recall, and F1 score are logged during training.
Here is a code snippet showing how to use this model:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from transformers import pipeline
# Load the model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("SchuylerH/bert-multilingual-go-emtions")
model = AutoModelForSequenceClassification.from_pretrained("SchuylerH/bert-multilingual-go-emtions")
text = "I love you."
nlp = pipeline("sentiment-analysis", model = model, tokenizer = tokenizer)
result = nlp(text)
print(result)