Spaces:
Sleeping
Sleeping
updated README.md
Browse files
README.md
CHANGED
@@ -1,23 +1,106 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## Project Title: Academic Advisement Bot
|
2 |
+
|
3 |
+
### Description
|
4 |
+
The Academic Advisement Bot is a Streamlit 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.
|
5 |
+
|
6 |
+
### Features
|
7 |
+
* **Conversational AI:** Utilizes a RAG chain to provide context-aware answers to academic queries.
|
8 |
+
* **Course Information:** Provides detailed information on CET courses, including prerequisites, corequisites, and semester-wise plans.
|
9 |
+
* **User Authentication:** Secure login and registration system with password hashing and strength validation.
|
10 |
+
* **API Key Management:** Allows users to set and manage their OpenAI API keys for model interaction.
|
11 |
+
* **Automated Evaluation:** Includes a feature to run automated evaluations against predefined Q&A pairs to assess the bot's accuracy using cosine similarity.
|
12 |
+
* **Session Management:** Handles user sessions and timeouts.
|
13 |
+
* **Interactive UI:** Built with Streamlit for an intuitive and user-friendly experience.
|
14 |
+
|
15 |
+
### Technologies Used
|
16 |
+
* **Python 3.x**
|
17 |
+
* **Streamlit:** Web application framework.
|
18 |
+
* **LangChain:** For building the RAG conversational chain.
|
19 |
+
* **FAISS:** For efficient similarity search on course embeddings.
|
20 |
+
* **Sentence Transformers:** For generating embeddings.
|
21 |
+
* **OpenAI API:** For language model interactions (requires user-provided API key).
|
22 |
+
* **SQLite3:** For user authentication and API key storage.
|
23 |
+
* **Pandas:** For data manipulation and evaluation results.
|
24 |
+
* **Scikit-learn:** For cosine similarity calculation in evaluation.
|
25 |
+
* **Docker:** For containerization.
|
26 |
+
* **Dotenv:** For environment variable management.
|
27 |
+
|
28 |
+
### Project Structure
|
29 |
+
```
|
30 |
+
cet_advisement_bot/
|
31 |
+
βββ .gitattributes
|
32 |
+
βββ Dockerfile
|
33 |
+
βββ README.md <-- This file
|
34 |
+
βββ requirements.txt
|
35 |
+
βββ docs/
|
36 |
+
β βββ original_cat.pdf <-- Original course catalog document
|
37 |
+
β βββ original_vector/ <-- FAISS index for course embeddings
|
38 |
+
β βββ index.faiss
|
39 |
+
β βββ index.pkl
|
40 |
+
βββ queries/
|
41 |
+
β βββ QueriesDataSet_Final.xlsx <-- Dataset for automated evaluation
|
42 |
+
βββ src/
|
43 |
+
βββ app.py <-- Main Streamlit application, handles UI, auth, and chat
|
44 |
+
βββ chains.py <-- Defines the RAG chain and retriever
|
45 |
+
βββ embeddings.py <-- Handles embedding model loading
|
46 |
+
βββ history.py <-- Manages chat history for conversational context
|
47 |
+
βββ streamlit_app.py <-- (Potentially deprecated or merged into app.py, needs clarification)
|
48 |
+
```
|
49 |
+
|
50 |
+
### Setup and Installation
|
51 |
+
|
52 |
+
#### Prerequisites
|
53 |
+
* Python 3.x
|
54 |
+
* Docker (optional, for containerized deployment)
|
55 |
+
* An OpenAI API Key (to be provided within the application)
|
56 |
+
|
57 |
+
#### Local Setup
|
58 |
+
1. **Clone the repository:**
|
59 |
+
```bash
|
60 |
+
git clone https://github.com/your-repo/cet_advisement_bot.git
|
61 |
+
cd cet_advisement_bot
|
62 |
+
```
|
63 |
+
2. **Create a virtual environment and activate it:**
|
64 |
+
```bash
|
65 |
+
python -m venv venv
|
66 |
+
.\venv\Scripts\activate # On Windows
|
67 |
+
source venv/bin/activate # On macOS/Linux
|
68 |
+
```
|
69 |
+
3. **Install dependencies:**
|
70 |
+
```bash
|
71 |
+
pip install -r requirements.txt
|
72 |
+
```
|
73 |
+
4. **Prepare data files:**
|
74 |
+
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.
|
75 |
+
*(Note: If these files are large and hosted externally, instructions for downloading them using `gdown` or similar tools should be added here.)*
|
76 |
+
5. **Run the Streamlit application:**
|
77 |
+
```bash
|
78 |
+
streamlit run src/app.py
|
79 |
+
```
|
80 |
+
The application will open in your web browser.
|
81 |
+
|
82 |
+
#### Docker Deployment
|
83 |
+
1. **Build the Docker image:**
|
84 |
+
```bash
|
85 |
+
docker build -t cet-advisement-bot .
|
86 |
+
```
|
87 |
+
2. **Run the Docker container:**
|
88 |
+
```bash
|
89 |
+
docker run -p 8501:8501 cet-advisement-bot
|
90 |
+
```
|
91 |
+
Access the application at `http://localhost:8501` in your browser.
|
92 |
+
|
93 |
+
### Usage
|
94 |
+
1. **Login/Register:** Upon launching the application, you will be prompted to log in or register a new account.
|
95 |
+
2. **Set OpenAI API Key:** Navigate to the "User Panel" in the sidebar and provide your OpenAI API key. This is required for the chatbot functionality.
|
96 |
+
3. **Ask Questions:** Once authenticated and with a valid API key, you can start asking questions about the CET curriculum.
|
97 |
+
4. **Automated Evaluation:** The "Admin Panel" (or "User Panel" if admin features are integrated) allows you to run an automated evaluation of the bot's performance against a predefined set of questions.
|
98 |
+
|
99 |
+
### Contributing
|
100 |
+
(Placeholder for contribution guidelines)
|
101 |
+
|
102 |
+
### License
|
103 |
+
(Placeholder for license information)
|
104 |
+
|
105 |
+
### Contact
|
106 |
+
(Placeholder for contact information)
|