Project Analysis
Personal Assistant Chatbot – Rule-Based + NLP Hybrid
About Project
Users often need a centralized virtual assistant that can handle small tasks like reminders, greetings, simple queries (date/time/weather), or custom commands. Existing solutions (like Alexa or Siri) are either voice-only or not customizable for personal needs, and most bots cannot be extended easily by developers.
Problem Statement
Users often need a centralized virtual assistant that can handle small tasks like reminders, greetings, simple queries (date/time/weather), or custom commands. Existing solutions (like Alexa or Siri) are either voice-only or not customizable for personal needs, and most bots cannot be extended easily by developers.
Objective
- Build a customizable personal assistant chatbot
- Capable of handling basic day-to-day queries and actions
Core Functionalities
- Responds to date/time queries
- Manages to-do reminders
- Handles casual greetings and small talk
Modular Design
- Intent-based architecture for easy extensibility
- New features and tasks can be added with minimal changes
NLP Capabilities
- Grammar correction for user inputs
- Includes NLP preprocessing (e.g., lemmatization, stopword filtering)
Deployment Options
- Runs on a local server
- Can be integrated into a Django interface
Proposed Solution
Chatbot Implementation
Intent Matching
- Used rule-based matching with keyword sets and regular expressions
Grammar Correction
- Integrated TextBlob for grammar and spelling correction
Custom Command Parsing
- Designed a custom parser to interpret commands like:
- “Remind me to call mom at 6pm”
- “Add buy milk to my to-do list”
Context-Aware Responses
- Responds based on user profile, previous greetings, and ongoing conversation context
Optional Session Logging
- Supports optional storage and retrieval of past user queries
- Useful for session-based personalization
Technologies Used
Tech Stack & Libraries
Python Libraries
- TextBlob – for grammar correction and text cleaning
- datetime – for handling date and time queries
- os, platform – for fetching system-level information
- re (regex) – for command parsing and parameter extraction
Frontend Interface
- Django – integrated as the primary web app interface
Challenges Faced
Challenges in Natural Command Understanding
Command Parsing
- Parsing human language like “remind me at 5pm” was ambiguous
- Used regex combined with rule-based templates for robust extraction
Extensibility
- Needed modular functions for easy, plugin-like task addition
- Designed system with intent-handler mapping for scalability
Grammar Issues
- Users typed shorthand or incorrect English
- Solved using grammar correction with TextBlob and fuzzy keyword matching
Time & Context Interpretation
- Handled semantic understanding for phrases like “tomorrow evening” vs “at 7pm”
- Used datetime parsing with fallback defaults for incomplete input
Methodology
🧪 Methodology
🔧 Preprocessing
- Converted text to lowercase
- Punctuation removal for clean input
- Applied TextBlob for grammar correction
🧠 Intent Classification
- Used rule-based matching with priority order
- Example priority: “weather” > “time” > “greeting”
⚙️ Task Execution
- Executed mapped functions like:
get_time()set_reminder()tell_joke()
💬 Response Generation
- Generated human-like replies using response templates
- Used dynamic content injection for personalization
🖥️ Frontend
- Interactive chatbot built with Streamlit
- Django or CLI used as fallback for testing
Result / Outcome
Features
- Personalized Greetings – Greets the user by name (configurable)
- Time & Date Reporting – Tells the current time and date on request
- Simple Reminder System – Sets reminders that are either locally stored or printed
- Custom Small Talk – Responds to casual inputs like “Who made you?” or “How are you?”
- Self-Learning Ability – Can learn new responses via an admin interface or hardcoded functions
- Local Memory Support – Optionally integrates with SQLite for storing logs or session data