Model description

This model is a fine-tuned version of distilbert-base-uncased on the dataset dair-ai/emotion dataset. The model is fine tuned to label text into six different emotional categories. These categories being:

  • (0) joy, (1) love, (2) anger, (3) fear, (4), surprise (5).

The model achieved the following results below:

  • Validation Accuracy: 93.7%
  • Test Accuracy: 92%

Intended use

  • Analyse text data
  • Classify text data as one of the six emotions
  • Tested on its ability to classify text into six previously mentioned emotional categories

Training and evaluation data

  • The model was trained and evaluated with dair-ai/emotion dataset
  • Training set: 16,000 examples
  • Validation set: 2,000 examples
  • Test set: 2,000 examples

Limitations and Biases

  • Model may struggle to understand emotions that require more context.
  • Does not capture more nuanced emotions given that are only six emotional categories

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 2e-05
  • train_batch_size: 16
  • eval_batch_size: 8
  • seed: 42
  • optimizer: Use OptimizerNames.ADAMW_TORCH with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
  • lr_scheduler_type: linear
  • num_epochs: 2
  • mixed_precision_training: Native AMP

Training results

Training Loss Epoch Step Validation Loss Accuracy
0.2517 1.0 1000 0.1897 0.922
0.1476 2.0 2000 0.1656 0.9335

Code Usage Example

  classifier = pipeline("text-classification", model = "Marty-17/emotion-classification-model",tokenizer="Marty-17/emotion-classification-model") # Create Pipeline
    test_text = ["I am so Happy Today !",
                 "I am not Happy Today !",
                 "I do not fear being happy"
                 ] # Test cases

    result = classifier(test_text)
     #Loop and display results for the test case.
    for i,text in enumerate(test_text):
        label= result[i]['label']
        score = result[i]['score']
        print(f"Text Example:{text}")
        print(f"Predicted Label: {label}")
Downloads last month
35
Safetensors
Model size
67M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for Marty-17/emotion-classification-model

Finetuned
(12816)
this model