Bilingual NLU Intent Engine (Retrieval-Based)

A retrieval-based NLU framework using a six-layer pipeline to normalize and classify noisy Tagalog-English (Taglish) user intents.

Stack

Highlights

The engineering philosophy behind this engine centers on a Canonical Skeleton Mapping layer, a heuristic-driven solution designed to intercept and fix "hallucinating" spellcheckers. In traditional NLP workflows, a user typing a stretched word like "whhhooooo" is often incorrectly autocorrected to an unrelated term like "wahoo," causing the subsequent semantic model to lose the original intent entirely. To resolve this, the engine reduces both user input and pre-defined "Guard" phrases into single-character skeletons, allowing the system to recognize the underlying intent through a fast hash-map lookup before any destructive normalization occurs. This layer acts as a protective shield for the bot’s identity and core navigation functions, ensuring that critical user interactions remain robust regardless of typographical variance or emotional emphasis.⁣ ⁣ Beyond simple string manipulation, the engine manages bilingual complexity through a switching logic that coordinates between English and Tagalog processing paths. Using a combination of langid and custom linguistic markers, the system determines when to trigger MarianMT (Helsinki-NLP) neural translation models to unify Tagalog segments into a clean English token set for final analysis. Once normalized, the input is passed to a Sentence-Transformer (all-MiniLM-L6-v2) to calculate cosine similarity against a structured knowledge base of intent patterns. This hybrid approach—combining classical rule-based heuristics with modern transformer-based embeddings—results in a high-performance, privacy-focused NLU suite optimized for local execution on resource-constrained environments.