urdu-business-nlu
v0.1.0
Published
Deterministic TypeScript library: informal Urdu / Roman-Urdu business messages to validated structured records. Rules-only v0 (M3 GO); no production accuracy claim outside eval reports.
Readme
urdu-business-nlu
M3 GO — rules-only v0. TypeScript library: normalisers, rules-only
propose/extract, deterministic validator and router. Silent-error focus (prefer confirm over a wrong quantity/amount). Optional LLM is BYOK and later. Contact: [email protected]

Abstract diagram only — not a product screenshot. No WhatsApp/Meta branding.
Hosting (what this is)
This is an npm/TypeScript library + eval set, not a hosted SaaS. Source lives on GitHub; when the package is published, consumers install it with npm. There is no Railway/app hosting for the core product, and no always-on API in v0. An optional hosted API remains a possible later add-on and is out of scope for this release.
CI (pending): GitHub Actions is not on main yet — the token lacked the workflow OAuth scope, so the workflow is parked at .github/ci.yml.pending. Branch/tag rulesets are already applied. After gh auth refresh -h github.com -s workflow, restore the file to .github/workflows/ci.yml and push.
What this is
An open-source (MIT) TypeScript library plus an in-repo synthetic eval set (public dataset licence CC-BY-4.0 when/if published separately — not legal advice; gold is in eval/gold/** today, not a separate data release) that turns informal Urdu, Roman-Urdu and mixed-English business messages (orders, payments, credit/udhaar, delivery) into validated structured records. A deterministic validator checks every number, unit and date; anything uncertain goes to human confirmation.
Not in scope for v0: WhatsApp bot, Meta Business API, ledger storage, payments, ASR, or a hosted API.
Source of truth: PROJECT_CONTEXT.md · docs/SPEC.md · docs/DATA_AND_PRIVACY.md · docs/BUILD_PLAN.md
Status (honest)
| Item | State |
|---|---|
| Hypothesis | Unvalidated — builders may lack an open, tested Urdu/Roman-Urdu business-message parser + eval |
| Library | M3 GO rules-only v0 — src/ normalisers + propose/extract + validateRecord + route |
| npm publish | [email protected] on npm |
| Eval decision | M3 go/no-go · gold baseline — cite reports; no marketing accuracy % |
| Spikes | N1 · N3 · N4; N2 LLM/hybrid arms deferred (no key) |
| Gold | 101 owner_confirmed in eval/gold/; synthetic placeholders only |
| LLM | Optional BYOK adapter — later (M4 deferred) |
| CI | Live — .github/workflows/ci.yml on pull_request |
Install
npm i urdu-business-nluRequires Node >= 18. From source (develop / contribute):
# From GitHub
npm install github:arsalan-arshad/urdu-business-nlu
# Local clone
git clone https://github.com/arsalan-arshad/urdu-business-nlu.git
cd urdu-business-nlu
npm install
npm test
npm run buildMore detail: docs/USAGE.md.
Usage (rules-only, offline)
Public exports match src/index.ts: propose, extract, validateRecord, route, plus normalisers. Rules-only path needs no network and no API keys.
import { propose, extract, validateRecord, route } from "urdu-business-nlu";
// Rules-only: text → candidate (already validated + routed)
const record = propose("PARTY_A ko 5 carton oil bhej do");
// record.route === "auto" | "confirm" | "reject"
// extract is the same function until an optional LLM adapter (later)
const same = extract("PARTY_A ko 5 carton oil bhej do");
// Or validate a candidate yourself:
const { issues } = validateRecord(record, "PARTY_A ko 5 carton oil bhej do");
route(issues);Every number in a candidate must be traceable (after normalisation / number-word parse) to the input. Ungrounded qty/amount → reject. Ambiguous kal, missing currency/direction, etc. → confirm.
Contract and eval evidence (cite reports; no marketing accuracy %): docs/SPEC.md · M3 go/no-go · gold baseline.
Architecture
Message → propose (rules-only now; optional LLM later, BYOK) → deterministic validator → auto | confirm | reject.
flowchart LR
M["Message text"] --> P["Propose candidate"]
P --> V["Deterministic validator"]
V -->|ok| A["auto"]
V -->|uncertain| C["confirm"]
V -->|invalid| R["reject"]Data & privacy
Synthetic or explicitly consented, anonymised samples only. No scraping, no real chats in the repo. Draft contributor consent lives in the N4 spike (not legal advice). Code is MIT. Eval data intended CC-BY-4.0 when/if published as a separate dataset — not published separately yet; gold remains in this repo. See docs/DATA_AND_PRIVACY.md.
Contributing / security / licence
See CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md, LICENSE (MIT).
