| # π― 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 |