Views
No views yet
product_classifier.pt → Trained PyTorch classification modellabel_map.json → Mapping of class IDs → readable labels1import torch
2import json
3
4model = torch.load("product_classifier.pt")
5model.eval()
6
7with open("label_map.json") as f:
8 label_map = json.load(f)
9
10query = "I need a good gaming laptop under 80k"
11
12pred = model(query) # simplified inference
13label_id = torch.argmax(pred).item()
14
15print("Predicted Category:", label_map[str(label_id)])
16📌 Role in System
17
18This model ensures:
19
20Correct routing of queries
21Filtering irrelevant inputs
22Better downstream retrieval accuracy
23⚡ Key Benefit
24
25Reduces noise in retrieval pipeline and improves precision before embedding search.
26
27👨💻 Part of Pivot Engine System