sahsan commited on
Commit
8594f6a
Β·
1 Parent(s): 9848c52

updated README.md

Browse files
Files changed (1) hide show
  1. README.md +106 -23
README.md CHANGED
@@ -1,23 +1,106 @@
1
- ---
2
- title: Cet Advisement Bot
3
- emoji: πŸš€
4
- colorFrom: red
5
- colorTo: red
6
- sdk: docker
7
- app_port: 8501
8
- tags:
9
- - streamlit
10
- pinned: false
11
- short_description: A chatbot designed to aid course advisement at City Tech
12
- license: apache-2.0
13
- ---
14
-
15
- # Welcome to Streamlit!
16
-
17
- Edit `/src/streamlit_app.py` to customize this app to your heart's desire. :heart:
18
-
19
- If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community
20
- forums](https://discuss.streamlit.io).
21
-
22
- # Chatbot Project
23
- Details
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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)