https://github.com/monarch1108/pdf_chatbot
https://github.com/monarch1108/pdf_chatbot
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/monarch1108/pdf_chatbot
- Owner: MONARCH1108
- License: mit
- Created: 2025-02-11T12:31:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-11T12:36:32.000Z (over 1 year ago)
- Last Synced: 2025-02-11T13:40:07.045Z (over 1 year ago)
- Language: Jupyter Notebook
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PDF Chatbot
## Overview
PDF Chatbot is a web application that allows users to upload a PDF containing medical symptoms and interact with a chatbot that references the document's content to provide accurate responses. This system integrates Natural Language Processing (NLP) and AI to process and analyze the uploaded medical information.
## Technologies Used
- **Frontend**: HTML, CSS, JavaScript
- **Backend**: Python (Flask, Flask-CORS)
- **PDF Processing**: PyMuPDF (Fitz)
- **Chatbot Logic**: NLP using spaCy
- **AI Model**: Google Generative AI (Gemini)
## Features
- Upload a PDF containing medical symptoms.
- Extract and preprocess text from the PDF.
- Utilize NLP techniques to clean and analyze the text.
- Generate intelligent responses using Google Gemini AI.
- Provide accurate symptom-based answers using chatbot integration.

## Workflow
1. **PDF Upload**: User uploads a PDF document.
2. **Text Extraction**: Fitz (PyMuPDF) extracts text from the uploaded PDF.
3. **Text Preprocessing**: The extracted text undergoes tokenization, punctuation removal, lowercasing, whitespace cleanup, and lemmatization using spaCy.
4. **AI Processing**: The cleaned text is fed into Gemini AI with constraints to ensure responses are strictly based on the provided content.
5. **User Interaction**: The chatbot responds to user queries based on the medical symptoms mentioned in the uploaded document.
6. **Frontend Integration**: A user-friendly web interface enables seamless interaction with the chatbot.
### Steps to Run
1. Navigate to the project directory:
```
cd PDF_Chatbot
```
2. Install dependencies:
```
pip install -r requirements.txt
```
3. Run the Flask application:
```
python app.py
```
4. After running `app.py`, the Flask development server will start, and you will see an output similar to:
```
Running on http://127.0.0.1:5000/
```
5. Open a web browser and navigate to `http://127.0.0.1:5000/` to use the application.
## Contribution
Contributions are welcome! Feel free to fork the repository and submit pull requests.