Chapsi/hinglish-smart-home-nlu-onnx
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
Gate scorecard — INT8 ONNX (deployed)
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.
