Hinglish Smart-Home NLU β deployed INT8 ONNX bundle
On-device joint intent + sub-action + slot NLU for bilingual (English / Hindi /
code-switched Hinglish) smart-home voice commands. Distilled from a 12-layer MuRIL teacher to a
6-layer student, task-vocab pruned, and dynamic-INT8 quantised to ONNX. Runs torch-free on
onnxruntime + a NumPy CRF Viterbi decoder β built to fit a Raspberry Pi 4 (β€50 MB flash,
β€512 MB RAM for the whole voice pipeline).
Dataset: Chapsi/hinglish-smart-home-nlu.
Bundle contents
model_int8.onnxβ quantised encoder + intent/sub-action/slot headscrf.npzβ CRF transition/start/end params (slot decoding, NumPy Viterbi)tokenizer/β WordPiece tokenizer (pruned task vocab; load withtokenizers, nottransformers)label_maps.json,intents_v1.yaml,normalisation.yaml,thresholds.json
Offline evaluation (test split)
Offline evaluation (test)
Device: cpu (torch 2.13.0+cpu)
Model comparison
| model | size | IA en/hi/hing | Slot F1 | SEM | OOD FAR |
|---|---|---|---|---|---|
| INT8 ONNX (deployed) | 48MB | 0.990/0.988/0.997 | 0.893 | 0.911 | 0.009 |
Gate scorecard β INT8 ONNX (deployed)
| Gate | Target | Actual | Status |
|---|---|---|---|
| IA English | >=0.98 | 0.9900 | β |
| IA Hindi | >=0.94 | 0.9883 | β |
| IA Hinglish | >=0.94 | 0.9966 | β |
| SEM_full | >=0.80 | 0.9112 | β |
| Slot F1 | >=0.85 | 0.8935 | β |
| OOD FAR | <0.05 | 0.0095 | β |
| Bundle size | β€50 MB | 48.3 MB | β |
Overall: ALL GATES PASS β
These are honest numbers: the deployed INT8 model currently passes all gates. Improvement plan tracked in the source repo's nlu-improvement-plan.md. Use
accordingly β this is a dissertation research artifact, not a production model.
Usage
The runtime lives in the source repo (pipeline/nlu/infer.py), torch-free:
from tokenizers import Tokenizer
import onnxruntime as ort, numpy as np, json
# load model_int8.onnx + tokenizer/tokenizer.json + crf.npz + label_maps.json,
# run the encoder, argmax the intent/sub-action heads, Viterbi-decode slots with the CRF params.
# See pipeline/nlu/infer.py for the reference implementation.
Attribution
Trained on our own hand-authored/synthesised utterances plus filtered public corpora used at training time only (MASSIVE-Hindi, MTOP-Hindi, CoMTIC, Hinglish-TOP) β those are not redistributed here. Base encoder: google/muril-base-cased. M.Tech dissertation artifact.