IntentIQ is a fully modular, extensible intent recognition engine built for voice and text inputs.
It combines classical ML classifiers, sentence-transformer embeddings, dynamic skill routing,
and optional offline speech-to-text using Vosk.
This repository includes:
- A CLI engine for real-time intent recognition
- A Streamlit web UI for demo and deployment
- Trainable, versioned ML models
- Auto-discovery and auto-generation of skill modules
- Transformer model caching for offline inference
- Text mode: Fully functional in CLI + Streamlit UI
- Voice mode: Powered by Vosk (offline STT), available only in CLI
- Online demos disable voice mode due to 2GB Vosk model size
Supports multiple ML families with versioning:
- LR (Logistic Regression)
- SVC (Support Vector Classifier)
- NeuralNet (Reserved for future expansion)
Every trained model is saved in:
models/intent_models/<MODEL_TYPE>/classifier_vX.pkl
models/intent_models/<MODEL_TYPE>/label_encoder_vX.pkl
models/intent_models/<MODEL_TYPE>/metadata_vX.json
The engine supports:
- Loading any model type
- Loading any version
- Always backward compatible
Each predicted intent maps to a Python skill file:
skills/<intent>.py
If a skill does not exist, the router auto-creates a placeholder module:
def run(text):
print('Placeholder skill executed for intent: <intent>')
The embedding model all-MiniLM-L6-v2 is downloaded once, saved inside:
models/transformer_model/
Subsequent runs load it instantly without re-downloading.
The UI provides:
- Model selection (family(model_type) + version)
- Load Model button
- Text prediction
- Probability visualization
- Fully client-friendly layout for deployment on Render
IntentIQ_Lappy/
β
βββ core/
β βββ config.py # Paths, constants, model directories
β βββ engine.py # Main CLI engine
β βββ router.py # Dynamic skill routing
β βββ logger.py # Logging utilities
β
βββ intent_system/
β βββ preprocess.py # Text cleanup, wake word, fillers, lemmatization
β βββ intent_recognizer.py # Loads embeddings + classifier
β βββ trainer.py # Dataset preprocessing, embedding, training
β βββ evaluation.py # Full evaluation pipeline
β βββ model_handlers.py # LR, SVC handlers
β βββ ...
β
βββ io_layer/
β βββ stt_vosk.py # Offline speech recognition
β βββ audio_utils.py
β
β
βββ models/
β βββ intent_models/
β β βββ LR/
β β βββ SVC/
β β βββ NeuralNet/ # Coming in Future
β βββ transformer_model/ # Cached transformer
β βββ voice_models/
β
βββ ui/
β βββ local_app.py # streamlit user interface for local machine (includes STT) # Coming in future
β βββ app.py # Streamlit user interface for deployment
β
βββ skills/
β βββ greeting.py
β βββ get_time.py
β βββ weather_query.py
β βββ open_app.py
β βββ general_conversation.py
β βββ exit.py
β
βββ utils/
β βββ ensure_transformer.py
β βββ file_utils.py
β
βββ logs/
β βββ intent_iq.log
β
βββ dataset/
β βββ dataset_downloader.py # Can download dataset from hugging face and save as csv file
β βββ EDA.py # For Exploratory Data Analysis
β βββ intents2.csv
β βββ intents.csv
β
βββ main.py # CLI entrypoint
βββ README.md
Direct string input (CLI or UI)
Pipeline:
Microphone β RawAudio β VoskSTT β Recognized text β Preprocess β IntentRecognizer
Functions performed:
- Lowercasing
- Punctuation cleanup
- Wake-word detection (βlappyβ)
- Filler-word removal (uh, umm, pleaseβ¦)
- Lemmatization (spaCy optional)
Returns:
(has_wake_word, cleaned_text)
Embedding model:
all-MiniLM-L6-v2
Workflow:
Raw text β preprocess β transformer.encode() β 384-dim embedding vector
Caching ensures fast inference offline.
- Loads classifier + label encoder for chosen model + version
- Produces:
intent_label, probability_distribution
Maps recognized intent to:
skills/<intent>.py
If missing β auto-created placeholder.
Executes:
run(text)
Simple Python scripts performing actions:
- greet
- tell time
- fetch weather
- exit system
- general conversation
- open apps
Fully extensible.
3 sections:
Explains system functionality.
User picks:
- model family (LR/SVC)
- version (v1/vX)
- clicks Load Model
User enters text β system outputs:
- intent
- probability table
- real-time data visualition as the model predicts the intents # Coming in Future.
dataset/intents.csv
Uses same cleaning pipeline as inference.
Creates an embedding for each sample.
- LR β logistic regression
- SVC β radial-basis SVM
Classifier, label encoder, metadata.
evaluation.py provides:
- Accuracy
- Classification report
- Confusion matrix
python3 main.py
- Select input mode (voice/text)
- Select model family
- Select version
- System enters real-time inference loop
streamlit run ui/app.py
Available online demo features:
- Text-only predictions
- Model selection
- Intent + probability display + Real-Time Data visualition (coming in future)
Voice mode is disabled for deployment.
Include:
streamlit
sentence-transformers
scikit-learn
pandas
joblib
numpy
Render will:
- Start the app using
streamlit run ui/app.py - Provide a public URL
- You can link this URL in your portfolio
- NeuralNet classifier support
- Real skill implementations
- Live probability charts in UI
- Task automation integrations
- Full web-based STT through WebRTC (future)
Built by Sagar Joon.
IntentIQ is designed as a modular showcase of ML engineering, inference systems, and UI integration.