CoolFace
Modelpublic

nikhiltogadiya/AI-jewelry-showroom-models

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes
Model Card

Gemma Jewelry Assistant - Intent & Emotion Classifier

This is an ONNX-optimized multi-task classification model used in the AI Jewelry Showroom project. It analyzes user queries during a jewelry shopping conversation and predicts both the user's intent and emotion simultaneously to enhance Agentic Retrieval-Augmented Generation (RAG) routing.

Model Details

  • —Architecture: Transformer-based text classifier (multi-task head for Intent and Emotion)
  • —Format: ONNX (.onnx and .onnx.data format for >2GB weight externalization)
  • —Language: English
  • —Use Case: Conversational e-commerce assistant ("Gemma")

Intended Use

This model is designed to be used in real-time chat environments to route queries and adapt the assistant's tone.

Predicted Intents (10 classes): browse, search, compare, ask_detail, objection_price, objection_trust, ready_to_buy, ask_education, greeting, farewell

Predicted Emotions (6 classes): excited, hesitant, confused, confident, frustrated, neutral

Performance & Metrics

The model was fine-tuned and evaluated on a custom dataset of jewelry shopping conversations:

  • —Intent Classification Accuracy: 89.46% (Macro F1: 84.49%)
  • —Emotion Classification Accuracy: 82.77% (Macro F1: 60.76%)
  • —Best parameters during training: Learning Rate: 3e-5, Epochs: 5, Batch Size: 32

Usage (ONNX Runtime)

Since the model uses external data (intent_emotion_classifier.onnx.data), ensure both the .onnx and .onnx.data files are downloaded into the same directory before loading.

python
import onnxruntime as ort
import numpy as np

# 1. Initialize session
session_options = ort.SessionOptions()

# 2. Load the model. Ensure the .onnx.data file is in the same folder!
session = ort.InferenceSession("intent_emotion_classifier.onnx", session_options)

# 3. Prepare inputs (e.g., from a tokenizer)
# inputs = {
#     "input_ids": np.array([[...]], dtype=np.int64),
#     "attention_mask": np.array([[...]], dtype=np.int64)
# }

# 4. Run inference
# intent_logits, emotion_logits = session.run(["intent_logits", "emotion_logits"], inputs)

Training Data

The model was trained on synthetic high-end retail conversations regarding jewelry. It covers scenarios like negotiating price (objection_price), comparing gems (compare), and asking about gemological properties (ask_education).