/Course-Info-Bot-LLM

The Course-Recommendation-System repository features a project aimed at developing a system that predicts and recommends courses to students based on their preferences and past behavior. It involves data preprocessing, feature engineering, model selection, and evaluation to provide personalized course recommendations.

Primary LanguagePythonMIT LicenseMIT

Course Info Bot LLM

GitHub contributors GitHub forks GitHub issues GitHub license GitHub last commit Flask scikit-learn Pandas NumPy Ollama LLM

Project Overview

The Course-Info-Bot-LLM project aims to develop an intelligent chatbot powered by a Large Language Model (LLM) to interface with a Student Information System (SIS). The chatbot retrieves detailed course information and provides personalized advice to students, enhancing their academic planning and course selection experience.

Business Problem

Educational institutions often struggle with providing timely and accurate course information to students. Traditional methods of retrieving information from SIS can be time-consuming and inefficient. This project seeks to develop an AI-driven chatbot that offers quick and precise course information and recommendations.

Objectives

  • Develop a chatbot that integrates with the SIS to retrieve and provide course information.
  • Enhance the student experience by offering personalized course recommendations.
  • Improve decision-making in academic planning through AI-driven insights.

Data Collection

Data Source

The primary data source is the 'University Student Enrollment Data' dataset available on Kaggle. This dataset includes comprehensive details on university student enrollment, course registrations, and other related academic activities.

University Student Enrollment Data on Kaggle

Features Included

  • Course ID: Unique identifier for each course.
  • Course Name: Name of the course.
  • Credit Hours: Number of credit hours assigned to the course.
  • Department: Department offering the course.
  • Prerequisites: Prerequisites required to enroll in the course.
  • Core Area: Core area classification of the course.
  • Inquiry Area: Inquiry area classification of the course.
  • Recommendation: Course recommendation status.

Model

Model Overview

The chatbot leverages Natural Language Processing (NLP) techniques and integrates with a Large Language Model (LLM) to interact with students and provide course information. The chatbot is designed to handle various types of queries, including course descriptions, prerequisites, and personalized course recommendations.

Architecture of the Chatbot

image

Data Layer

  • Course Data Storage: Stores detailed course information, such as course IDs, names, credit hours, departments, prerequisites, core areas, inquiry areas, and recommendations.
  • Vector Database: Uses Chroma for efficient retrieval of course information based on text embeddings.

Preprocessing Layer

  • Data Cleaning and Transformation: Scripts to clean and preprocess the course data before loading it into the vector database.
  • Text Splitter: A module (e.g., RecursiveCharacterTextSplitter) to split course descriptions and other text data into manageable chunks for embedding.

Embedding Layer

  • Embedding Model: A pre-trained model (e.g., HuggingFaceEmbeddings) that converts course text data into embeddings (numerical representations).
  • Embedding Storage: Storage of these embeddings in the vector database for fast retrieval.

API Layer

  • Flask API: A RESTful API built with Flask to handle incoming requests from users. It processes user queries, retrieves relevant data, and returns responses.
  • Session Management: Flask sessions to manage ongoing conversations and context.

Retrieval Layer

  • Retriever: A component to query the vector database and retrieve the most relevant course information based on user input.
  • Document Formatter: A module to format the retrieved documents and their metadata into a user-friendly response.

Conversational Layer

  • Ollama Model: A conversational AI model (e.g., llama3) that handles small talk and enhances the user interaction experience. It can generate human-like responses for non-course-related queries.
  • Small Talk Handler: A module to handle predefined small talk scenarios and provide appropriate responses.

Integration Layer

  • Query Handler: A core module that integrates the retriever and conversational model. It processes the user input, decides whether the query is course-related or general small talk, and generates the appropriate response.
  • Response Cleaner: A component to clean and format the final response before sending it back to the user.

Web Application

Model Deployment

  • Web Interface: Design an easy-to-use web interface for users to input data and receive predictions. The interface includes a chat window where users can type their queries and receive responses in real-time.
  • Backend Integration: Integrate the chatbot with the SIS backend to securely access and retrieve data.
  • Deployment Platform: Deploy the chatbot on a cloud platform (e.g., AWS, Azure, Google Cloud) to ensure scalability and accessibility.

Usage

Prerequisites

  • Python 3.7 or higher
  • Virtual environment (optional but recommended)

Installation

  1. Clone the repository:

    git clone https://github.com/saboye/Course-Info-Bot-LLM.git
    cd Course-Info-Bot-LLM
  2. Create a virtual environment (optional but recommended):

    python -m venv venv
  3. Activate the virtual environment:

    • On Windows:

      .\venv\Scripts\activate
    • On macOS/Linux:

      source venv/bin/activate
  4. Install the dependencies:

    pip install -r requirements.txt
  5. Run the Flask application:

    python app.py
  6. Access the application:

    Open your web browser and navigate to http://127.0.0.1:5000.

License

This project is licensed under the MIT License - see the LICENSE file for details.