Views
No views yet
diagnostic_engineknowledge_generalmaintenance_scheduleparts_searchdiagnostic_enginemaintenance_scheduleknowledge_generalparts_search1from transformers import AutoTokenizer, AutoModel
2import torch
3import json
4
5# Load model and tokenizer
6tokenizer = AutoTokenizer.from_pretrained("IntentRouter/informant-67M-automotive")
7
8# Load custom classifier (you'll need the IntentClassifier class)
9# See: https://github.com/your-org/intent-router
10
11# Load model configuration
12with open("model_config.json", "r") as f:
13 config = json.load(f)
14
15label_to_id = config["labels"]["label_to_id"]
16id_to_label = config["labels"]["id_to_label"]
17
18# Predict intent
19def predict_intent(text):
20 inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
21 with torch.no_grad():
22 outputs = model(**inputs)
23 predictions = torch.softmax(outputs.logits, dim=-1)
24 predicted_id = torch.argmax(predictions, dim=-1).item()
25 confidence = predictions[0][predicted_id].item()
26
27 intent = id_to_label[str(predicted_id)]
28 return intent, confidence
29
30# Example usage
31intent, confidence = predict_intent("My engine is making strange noises")
32print(f"Intent: {intent} (confidence: {confidence:.3f})")1# Install the intent router system
2git clone https://github.com/your-org/intent-router
3cd intent-router
4
5# Use the model
6python intent_inference.py \
7 --model-id IntentRouter/informant-67M-automotive \
8 --text "Your query here" \
9 --confidence
10
11# Start API server
12python intent_inference.py \
13 --model-id IntentRouter/informant-67M-automotive \
14 --serve --port 80001# Single prediction
2curl -X POST "http://localhost:8000/predict" \
3 -H "Content-Type: application/json" \
4 -d '{"text": "Your query here", "return_confidence": true}'
5
6# Batch prediction
7curl -X POST "http://localhost:8000/predict/batch" \
8 -H "Content-Type: application/json" \
9 -d '{"texts": ["Query 1", "Query 2"], "return_confidence": true}'| Metric | Value |
|---|---|
| Validation Accuracy | 93.3% |
| Parameters | 0.0M |
| Inference Time | ~10-20ms |
| Memory Usage | ~200MB |
1@misc{IntentRouter_informant_67M_automotive,
2 title={IntentRouter/informant-67M-automotive: Intent Classification for Automotive MCP Routing},
3 author={Intent Router System},
4 year={2025},
5 howpublished={\url{https://huggingface.co/IntentRouter/informant-67M-automotive}},
6 note={Fine-tuned distilbert-base-uncased for intent classification}
7}