CoolFace
Modelpublic

Chapsi/hinglish-smart-home-nlu-onnx

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes
Model Card

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 heads
  • —crf.npz — CRF transition/start/end params (slot decoding, NumPy Viterbi)
  • —tokenizer/ — WordPiece tokenizer (pruned task vocab; load with tokenizers, not transformers)
  • —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

modelsizeIA en/hi/hingSlot F1SEMOOD FAR
INT8 ONNX (deployed)48MB0.990/0.988/0.9970.8930.9110.009

Gate scorecard — INT8 ONNX (deployed)

GateTargetActualStatus
IA English>=0.980.9900✅
IA Hindi>=0.940.9883✅
IA Hinglish>=0.940.9966✅
SEM_full>=0.800.9112✅
Slot F1>=0.850.8935✅
OOD FAR<0.050.0095✅
Bundle size≤50 MB48.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:

python
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.