Team Ai
Modelpublic

context4ai/intent-router-onnx

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

Intent Router (ONNX int8)

A 7-class intent classifier for code query routing. Classifies natural language queries (English and Chinese) into structured intents for code intelligence tools.

Intents

LabelDescription
locate_symbolFind symbol definitions
find_referencesTrace reverse references / impact
trace_dependenciesTrace forward dependencies / call chains
semantic_searchSemantic search over code and docs
browse_structureBrowse package / module structure
cross_layer_traceMap between code and business docs
ambiguousQuery cannot be classified

Files

FileRequiredDescription
onnx/model.onnxYesONNX model graph
onnx/model.onnx_dataYesModel weights (int8 quantized)
model_head.jsonYesClassification head (weights + bias)
tokenizer.jsonYesTokenizer
tokenizer_config.jsonYesTokenizer configuration
labels.jsonYesIntent label list
config.jsonYesModel configuration

Inference

Requires ONNX Runtime. The model takes tokenized text input and outputs sentence embeddings. The classification head (model_head.json) maps embeddings to intent logits.

input text → tokenizer → ONNX model → embedding → classification head → intent + confidence

Benchmark

Evaluated on a held-out test set of 221 bilingual (Chinese + English) code queries.

MetricValue
Overall accuracy96.8% (214/221)
Inference latency (CPU, ONNX Runtime)~3ms p50

Per-intent performance:

IntentPrecisionRecallF1
locate_symbol98.4%96.8%0.976
find_references95.1%97.5%0.963
trace_dependencies90.2%95.1%0.926
semantic_search100.0%91.5%0.956
browse_structure91.7%100.0%0.957
crosslayertrace100.0%100.0%1.000
ambiguous100.0%100.0%1.000

Training set: 284 samples. Test set: 221 samples.

Quantization

int8 (dynamic quantization). Total size ~559MB.

Related Project

This model is fine-tuned for C4A (Context For AI), a knowledge modeling service that indexes code repositories and business documents for developer teams and AI agents.

License

MIT