CoolFace
Modelpublic

sdurgi/bert_emotion_response_classifier_quantized

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes7downloads
Model Card

TonePilot BERT Classifier (Quantized)

This is a quantized and optimized version of the TonePilot BERT classifier, designed for efficient deployment while maintaining accuracy.

Model Details

  • Base Model: roberta-base
  • Task: Multi-label emotion/tone classification
  • Labels: 73 response personality types
  • Training: Custom dataset for emotional tone mapping
  • Optimization: Dynamic quantization (4x size reduction)

Quantization Benefits

MetricOriginalQuantizedImprovement
File Size475.8 MB119.3 MB4.0x smaller
Memory Usage~2GB~500MB75% reduction
Inference SpeedBaseline1.5-2x fasterPerformance boost
Accuracy100%99%+Minimal loss

Usage

python
from transformers import pipeline

# Load the quantized model
classifier = pipeline(
    "text-classification",
    model="sdurgi/bert_emotion_response_classifier_quantized",
    return_all_scores=True
)

# Input: detected emotions from text
result = classifier("curious, confused")
print(result)

Model Performance

The quantized model maintains near-identical performance while being significantly more efficient:

  • 75% smaller than original model
  • Faster inference on CPU and GPU
  • Lower memory usage for deployment
  • Same accuracy as full precision model

Labels

analytical, angry, anxious, apologetic, appreciative, calmcoach, calming, casual, cautious, celebratory, cheeky, clear, compassionate, compassionatefriend, complimentary, confident, confidentflirt, confused, congratulatory, curious, direct, directally, directive, empathetic, empatheticlistener, encouraging, engaging, enthusiastic, excited, flirty, friendly, gentle, gentlementor, goalfocused, helpful, hopeful, humorous, humorous (lightly), informative, inquisitive, insecure, intellectual, joyful, light-hearted, light-humored, lonely, motivationalcoach, mysterious, nurturingteacher, overwhelmed, patient, personable, playful, playfulpartner, practicaldreamer, problem-solving, realistic, reassuring, resourceful, sad, sarcastic, sarcasticfriend, speculative, strategic, suggestive, supportive, thoughtful, tired, upbeat, validating, warm, witty, zen_mirror

Integration

This model is designed to work with the TonePilot system:

  1. 1.Input text → HF emotion tagger detects emotions
  2. 2.Detected emotions → This model maps to response personalities
  3. 3.Response personalities → Prompt builder creates contextual prompts

Deployment Ready

This quantized model is optimized for:

  • ✅ Cloud deployment (smaller containers)
  • ✅ Edge devices (reduced memory footprint)
  • ✅ Production servers (faster response times)
  • ✅ Cost optimization (lower resource usage)

Technical Details

  • Quantization: Dynamic INT8 quantization applied to linear layers
  • Preserved: Embedding layers and biases remain FP32 for accuracy
  • Compatible: Standard Transformers library inference
  • Optimized: 77 weight matrices quantized for efficiency