KalParso-MuRIL

Turns an informal Hindi-English (Hinglish) planner entry into its type and an exact date and time, on a CPU, in milliseconds. "parso shaam saade 5 baje dentist" written on Saturday 31 October 2026 at 14:00 gives reminder, 2026-11-02, 17:30.

The model is a fine-tuned muril-base-cased (237M parameters) with three small heads: it marks the time words (parso, shaam, saade 5 baje), the entry type and the tense. A 200-line deterministic grounder (ground.py, included) does the calendar arithmetic. Kal means tomorrow or yesterday depending only on the tense, which is where general LLMs fail and this model does not.

Most accurate KalParso model. Use fp32 only (see the warning below).

Do not quantize this model to int8. Dynamic int8 quantization with ONNX Runtime defaults collapses MuRIL to 11% (XLM-R and mDistilBERT survive it). No int8 file is provided.

Accuracy

Date and time both correct, on the 706 scored held-out human entries of KalParso (human/test), and on the 262-entry calibration split this checkpoint was chosen on:

File Size Held-out test Calibration CPU latency, 1 core
fp32 ONNX (onnx/model.onnx) 948 MB 86.4% 93.8% 29 ms

Across five training seeds the mean is 86.1 ± 0.3% (the paper's number). This checkpoint is seed 7, picked by calibration score, never by test score. Latency is the median on an Intel Core i7-9700 (2019) capped at 35 W, one thread, end to end including tokenization and grounding.

For comparison on the same test entries: untrained gemma4:26b prompted with the same conventions reaches 89.0% at 10.8 s per entry on all 8 cores of the same CPU; gemma3:27b 82.3%, qwen3:32b 69.8%, llama3.1:8b 52.3%; dateparser 20.8%.

Use (CPU, no PyTorch)

pip install onnxruntime tokenizers numpy huggingface_hub
import sys
from datetime import datetime
from huggingface_hub import snapshot_download

d = snapshot_download("imsg8/kalparso-muril", allow_patterns=["*.py", "onnx/*.json", "onnx/model.onnx"])
sys.path.insert(0, d)
from kalparso import KalParso

kp = KalParso(f"{d}/onnx", onnx_file="model.onnx")
kp("parso shaam saade 5 baje dentist", datetime(2026, 10, 31, 14, 0))
# {'type': 'reminder', 'date': '2026-11-02', 'time': '17:30', 'direction': 'future', 'spans': [...]}
kp("kal Rahul se mila tha")   # anchor defaults to now; 'kal' + past tense -> yesterday

Output: type (reminder, note or goal), date (YYYY-MM-DD or null), time (HH:MM or null), direction (tense) and the spans the model found.

Files

File What
onnx/model.onnx The model for ONNX Runtime; outputs tags, type, dir
onnx/tokenizer.json, onnx/meta.json Tokenizer and label lists
kalparso.py, ground.py, lexicon.py Runtime and grounder
model.safetensors, config.json PyTorch weights (fp16) for fine-tuning: an AutoModel encoder under enc. plus linear heads tag (13 BIO labels), typ (3) and dir (2) on the first token. The module is Tagger in training/train_encoder.py of the code repository

Training

Fine-tuned on 29,911 synthetic entries (KalParso v3, template-generated, with character-level spans) plus 3,300 PHINC tweets with weak tense labels from their English translations: AdamW, learning rate 5e-5, batch 32, 3 epochs, linear decay with 6% warm-up, max length 64, one NVIDIA T4. No human test entry is in the training data.

Limits

  • Grounding follows the written conventions of the dataset (for example, agle Friday means the coming Friday). Read spec.md in the dataset before relying on edge cases.
  • Trained mostly on Roman-script Hinglish. On formal Devanagari Hindi news text the MuRIL model finds time expressions zero-shot (F1 85.8 on NTX) but the grounder's lexicon does not cover them.
  • One speaker wrote the human test set, so accuracy for other speakers' habits may differ.

Links

Shivang Gulati and Archana Praveen Kumar, Manipal Institute of Technology, MAHE. Paper under review.

Downloads last month
-
Safetensors
Model size
0.2B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for imsg8/kalparso-muril

Quantized
(1)
this model

Dataset used to train imsg8/kalparso-muril