Skip to content

t4runjangra/college_chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

College Enquiry Chatbot

A college enquiry chatbot built using Python, Machine Learning, and Flask. Students can ask questions about the college and get instant answers without visiting the campus personally.


Project Structure

college_chatbot/
│
├── intents.json          ← Training data (questions + responses)
├── train_model.py        ← ML model training script (run once)
├── chatbot.py            ← Core prediction engine
├── app.py                ← Flask web application
├── requirements.txt      ← Python dependencies
│
├── model/                ← Auto-created after training
│   ├── chatbot_model.pkl
│   └── responses.pkl
│
├── templates/
│   └── index.html        ← Chat UI
│
└── static/
    ├── css/style.css     ← Styling
    └── js/chat.js        ← Frontend logic

How to Run

Step 1 — Install the required libraries

pip install -r requirements.txt

Step 2 — Train the model

python train_model.py

Step 3 — Start the server

python app.py

Step 4 — Open in browser

http://127.0.0.1:5000

How It Works

The user types a question in the chat. The message is converted into numbers using TF-IDF vectorization and then passed to a Logistic Regression classifier which predicts the intent. Based on the predicted intent, a response is picked and shown to the user. If the confidence is below 25%, a fallback message is shown instead.


How to Add New Topics

Open intents.json and add a new block like this:

{
  "tag": "topic_name",
  "patterns": [
    "Question 1",
    "Question 2"
  ],
  "responses": [
    "Answer here"
  ]
}

After adding, run python train_model.py again to retrain the model.


Tech Stack

  • Language — Python 3.10+
  • ML Model — Logistic Regression (Scikit-learn)
  • Text Processing — TF-IDF Vectorization
  • Web Framework — Flask
  • Frontend — HTML, CSS, JavaScript

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors