KshitijKrishna's picture
persona classifier
2695622
|
Raw
History Blame Contribute Delete
1.36 kB
# 🎯 Pivot Engine - Persona / Product Classifier
This repository contains the **fine-tuned classification model** used in Pivot Engine to identify product intent or category.
---
## 🧠 Model Purpose
The classifier helps to:
- Detect product category (electronics, accessories, etc.)
- Improve routing in retrieval pipeline
- Filter irrelevant queries
- Enhance personalization layer
---
## πŸ“¦ Files Included
- `product_classifier.pt` β†’ Trained PyTorch classification model
- `label_map.json` β†’ Mapping of class IDs β†’ readable labels
---
## βš™οΈ Workflow
User Query β†’ Classifier β†’ Category Label β†’ Routed Retrieval Pipeline
---
## πŸš€ Usage Example
```python
import torch
import json
model = torch.load("product_classifier.pt")
model.eval()
with open("label_map.json") as f:
label_map = json.load(f)
query = "I need a good gaming laptop under 80k"
pred = model(query) # simplified inference
label_id = torch.argmax(pred).item()
print("Predicted Category:", label_map[str(label_id)])
πŸ“Œ Role in System
This model ensures:
Correct routing of queries
Filtering irrelevant inputs
Better downstream retrieval accuracy
⚑ Key Benefit
Reduces noise in retrieval pipeline and improves precision before embedding search.
πŸ‘¨β€πŸ’» Part of Pivot Engine System