Skip to content

rxnujan/Testbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ITER Bhubaneswar Intelligent Chatbot

An intelligent chatbot for ITER Bhubaneswar that provides precise, contextual answers about the college using semantic search and natural language understanding.

πŸš€ Features

  • Smart Query Understanding: Classifies user intent and extracts relevant context
  • Precise Answers: Provides exact information without overwhelming details
  • Course-Specific Responses: Automatically detects which course/branch you're asking about
  • Semantic Search: Falls back to intelligent search when exact matches aren't found
  • Multiple Interfaces: Both command-line and web interface available
  • Self-Training: Learns from the JSON knowledge base to answer new questions

πŸ“ Project Structure

/home/gaurav/Projects/Warp-1/
β”œβ”€β”€ data_processor.py      # JSON data processing and search indexing
β”œβ”€β”€ iter_chatbot.py       # Main chatbot logic with contextual understanding
β”œβ”€β”€ app.py               # Flask web interface
β”œβ”€β”€ templates/
β”‚   └── index.html       # Web UI template
β”œβ”€β”€ venv/                # Python virtual environment
└── README.md           # This file

πŸ› οΈ Installation

  1. Clone/Navigate to project directory:

    cd /home/gaurav/Projects/Warp-1
  2. Activate virtual environment:

    source venv/bin/activate
  3. Dependencies are already installed:

    • scikit-learn (for TF-IDF and cosine similarity)
    • numpy (for numerical computations)
    • flask (for web interface)
    • Other standard libraries

πŸ’» Usage

Command Line Interface

# Activate environment
source venv/bin/activate

# Run chatbot
python iter_chatbot.py

Web Interface

# Activate environment
source venv/bin/activate

# Start web server
python app.py

Then open http://localhost:5000 in your browser.

Testing Data Processor

# Test the data processing module
python data_processor.py

πŸ€– How It Works

1. Data Processing (data_processor.py)

  • Loads JSON knowledge base
  • Recursively extracts all searchable text
  • Creates TF-IDF vectors for semantic search
  • Provides specific info retrieval methods

2. Intelligent Understanding (iter_chatbot.py)

  • Query Classification: Identifies intent (fees, placements, admissions, etc.)
  • Course Extraction: Detects which course/branch is being asked about
  • Context-Aware Responses: Provides precise answers based on detected intent
  • Fallback Search: Uses semantic search when specific rules don't match

3. Smart Response Generation

  • Exact Matches: "What is attendance requirement?" β†’ "75% attendance is required"
  • Course-Specific: "CSE fees" β†’ "CSE fees: β‚Ή137,500 per semester"
  • Complex Queries: Handles multiple intents in one question
  • Fallback: Semantic search for unmatched queries

🎯 Example Interactions

Query Response
"What is the attendance requirement?" "75% attendance is required"
"CSE fees per semester" "CSE fees: β‚Ή137,500 per semester"
"Average placement package" "Average CTC: β‚Ή5-9 LPA for engineering overall"
"AI and ML course details" "B.Tech AI & ML: 4-year program. Cutting-edge AI, machine learning, data science curriculum."
"Which companies visit for placements?" "Top recruiters include Amazon, Microsoft, TCS, Wipro, Infosys..."

🧠 Intelligence Features

Query Classification

The chatbot automatically understands:

  • Fees queries: fee, cost, tuition, price
  • Placement queries: placement, job, package, salary, ctc
  • Admission queries: admission, entrance, eligibility, apply
  • Course queries: course, program, degree, branch
  • Facility queries: hostel, campus, lab, library, sports

Course Detection

Recognizes course mentions:

  • CSE, Computer Science β†’ CSE details
  • AI, ML, Data Science β†’ AI/ML program info
  • ECE, Electronics β†’ ECE program info
  • And many more...

Context Awareness

  • Maintains conversation history
  • Provides concise, relevant answers
  • Avoids information overload

πŸ”§ Customization

Adding New Data

  1. Update the JSON knowledge base at /home/gaurav/Downloads/iter_bhubaneswar_knowledge.json
  2. The chatbot will automatically index new information
  3. Add specific response patterns in get_specific_info() method if needed

Adding New Intent Categories

  1. Update context_keywords dictionary in iter_chatbot.py
  2. Add handling logic in _handle_single_intent() method
  3. Test with relevant queries

Improving Search

  • Adjust TF-IDF parameters in data_processor.py
  • Modify similarity thresholds
  • Add preprocessing rules for better text matching

🌐 Web Interface Features

  • Responsive Design: Works on desktop and mobile
  • Real-time Chat: Instant responses
  • Example Queries: Click-to-try common questions
  • Modern UI: Clean, professional interface
  • Error Handling: Graceful error messages

πŸ“Š Technical Details

  • Search Engine: TF-IDF with cosine similarity
  • Text Processing: Recursive JSON traversal
  • Query Understanding: Pattern matching + semantic search
  • Response Generation: Rule-based + retrieval hybrid
  • Web Framework: Flask
  • Frontend: Pure HTML/CSS/JavaScript

🎯 Key Benefits

  1. Precise Answers: No information overload - just what you asked for
  2. Context Aware: Understands what course/topic you're interested in
  3. Natural Language: Ask questions naturally, no specific format required
  4. Fast Response: Instant answers with efficient search
  5. Always Learning: Automatically incorporates new information from JSON updates

πŸš€ Future Enhancements

  • Add more sophisticated NLP models
  • Implement conversation memory
  • Add voice interface
  • Create admin panel for knowledge base management
  • Add analytics and usage tracking
  • Multi-language support

πŸ“ License

This project is created for ITER Bhubaneswar and is intended for educational and informational purposes.


Contact: For questions about this chatbot, you can ask it directly! 😊

The chatbot knows about:

  • Course fees and details
  • Placement statistics
  • Admission procedures
  • Campus facilities
  • Contact information
  • And much more about ITER Bhubaneswar!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors