cet_advisement_bot / README.md
bmendoza40's picture
Update README.md
1bf507f verified
|
raw
history blame
4.75 kB
metadata
title: Cet Advisement Bot
emoji: πŸš€
colorFrom: red
colorTo: red
sdk: docker
app_port: 8501
tags:
  - streamlit
pinned: false
short_description: A chatbot designed to aid course advisement at City Tech
license: apache-2.0

Project Title: Academic Advisement Bot

Description

The Academic Advisement Bot is an application designed to assist students with course advisement, leveraging a Retrieval-Augmented Generation (RAG) system. It provides detailed and accurate answers to student queries regarding course prerequisites, corequisites, semester plans, and general education requirements based on the Computer Engineering Technology (CET) curriculum. The bot also includes user authentication, API key management, and an automated evaluation system for its performance.

Features

  • Conversational AI: Utilizes a RAG chain to provide context-aware answers to academic queries.
  • Course Information: Provides detailed information on CET courses, including prerequisites, corequisites, and semester-wise plans.
  • User Authentication: Secure login and registration system with password hashing and strength validation.
  • API Key Management: Allows users to set and manage their OpenAI API keys for model interaction.
  • Automated Evaluation: Includes a feature to run automated evaluations against predefined Q&A pairs to assess the bot's accuracy using cosine similarity.
  • Session Management: Handles user sessions and timeouts.
  • Interactive UI: Built with Streamlit for an intuitive and user-friendly experience.

Technologies Used

  • Python 3.x
  • Streamlit: Web application framework.
  • LangChain: For building the RAG conversational chain.
  • FAISS: For efficient similarity search on course embeddings.
  • Sentence Transformers: For generating embeddings.
  • OpenAI API: For language model interactions (requires user-provided API key).
  • SQLite3: For user authentication and API key storage.
  • Pandas: For data manipulation and evaluation results.
  • Scikit-learn: For cosine similarity calculation in evaluation.
  • Docker: For containerization.
  • Dotenv: For environment variable management.

Project Structure

cet_advisement_bot/
β”œβ”€β”€ .gitattributes
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ README.md             <-- This file
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ original_cat.pdf  <-- Original course catalog document
β”‚   └── original_vector/  <-- FAISS index for course embeddings
β”‚       β”œβ”€β”€ index.faiss
β”‚       └── index.pkl
β”œβ”€β”€ queries/
β”‚   └── QueriesDataSet_Final.xlsx <-- Dataset (queries) for evaluation.
└── src/
    β”œβ”€β”€ app.py            <-- Main Streamlit application, handles UI, auth, and chat
    β”œβ”€β”€ chains.py         <-- Defines the RAG chain and retriever
    β”œβ”€β”€ embeddings.py     <-- Handles embedding model loading
    β”œβ”€β”€ history.py        <-- Manages chat history for conversational context
    └── streamlit_app.py  <-- (Potentially deprecated or merged into app.py, needs clarification)

Setup and Installation

Prerequisites

  • Python 3.x
  • Docker (optional, for containerized deployment)
  • An OpenAI API Key (to be provided within the application)

Local Setup

  1. Clone the repository:
    git clone https://github.com/your-repo/cet_advisement_bot.git
    cd cet_advisement_bot
    
  2. Create a virtual environment and activate it:
    python -m venv venv
    .\venv\Scripts\activate  # On Windows
    source venv/bin/activate # On macOS/Linux
    
  3. Install dependencies:
    pip install -r requirements.txt
    
  4. Prepare data files: The application expects original_cat.pdf and the original_vector directory (containing index.faiss and index.pkl) to be present in the docs/ directory. These files are crucial for the RAG system. Ensure these are downloaded and placed correctly. (Note: If these files are large and hosted externally, instructions for downloading them using gdown or similar tools should be added here.)
  5. Run the Streamlit application:
    streamlit run src/app.py
    
    The application will open in your web browser.

Docker Deployment

  1. Build the Docker image:
    docker build -t cet-advisement-bot .
    
  2. Run the Docker container:
    docker run -p 8501:8501 cet-advisement-bot
    
    Access the application at http://localhost:8501 in your browser.

Usage

  1. Login/Register: Upon launching the application, you will be prompted to log in or register a new account.