GoEmotions: A Dataset of Fine-Grained Emotions
Paper
•
2005.00547
•
Published
•
1
A logistic regression model for classifying text into 6 emotion categories.
This model was trained on a merged dataset from two sources:
GoEmotions (Google): A corpus of 58k Reddit comments with 27 emotion categories
Emotion Dataset: Text samples labeled with basic emotions
Labels were mapped to 6 core emotion categories for this model.
The model uses a combination of:
class_weight='balanced'import skops.io as sio
# Load model (review untrusted types before loading)
trusted_types = [
"sklearn.pipeline.Pipeline",
"sklearn.linear_model._logistic.LogisticRegression",
"sklearn.feature_extraction.text.TfidfVectorizer",
"numpy.ndarray",
"numpy.dtype"
]
model = sio.load("6emotions_model.skops", trusted=trusted_types)
# Predict
text = "I'm so happy today!"
prediction = model.predict([text])
print(prediction) # ['joy']