|
|
--- |
|
|
title: Healthcare Guidelines RAG Chatbot |
|
|
emoji: ๐ |
|
|
colorFrom: blue |
|
|
colorTo: indigo |
|
|
sdk: gradio |
|
|
sdk_version: 5.29.0 |
|
|
app_file: app.py |
|
|
pinned: false |
|
|
license: apache-2.0 |
|
|
--- |
|
|
|
|
|
|
|
|
# Healthcare Guidelines RAG Chatbot |
|
|
|
|
|
This application provides a Retrieval-Augmented Generation (RAG) system for healthcare clinical guidelines. It uses FAISS for efficient similarity search and a Hugging Face model for generating responses. |
|
|
|
|
|
## Features |
|
|
|
|
|
- PDF document processing and chunking |
|
|
- FAISS-based semantic search |
|
|
- Response generation using FLAN-T5 |
|
|
- Gradio web interface |
|
|
- Strict grounding in provided guidelines |
|
|
- Safety measures and disclaimers |
|
|
|
|
|
## Setup |
|
|
|
|
|
### Option 1: Local Setup |
|
|
2. Install dependencies: |
|
|
```bash |
|
|
pip install -r requirements.txt |
|
|
``` |
|
|
|
|
|
3. Place your clinical guidelines PDF in the directory: |
|
|
``` |
|
|
# Copy your PDF to clinical_guidelines.pdf |
|
|
``` |
|
|
|
|
|
1. Build the Docker image: |
|
|
```bash |
|
|
docker build -t healthcare-rag-chatbot . |
|
|
``` |
|
|
|
|
|
2. Run the container: |
|
|
```bash |
|
|
docker run -p 7860:7860 -v $(pwd)/data:/app/data healthcare-rag-chatbot |
|
|
``` |
|
|
|
|
|
The `-v` flag mounts your local `data` directory to the container, allowing you to easily update the clinical guidelines PDF without rebuilding the image. |
|
|
|
|
|
## Usage |
|
|
|
|
|
1. Run the application: |
|
|
```bash |
|
|
# If using local setup: |
|
|
python app.py |
|
|
|
|
|
# If using Docker: |
|
|
# The application will start automatically when running the container |
|
|
``` |
|
|
|
|
|
2. Open your browser and navigate to the provided local URL (typically http://127.0.0.1:7860) |
|
|
|
|
|
3. Enter your question about clinical guidelines in the input box |
|
|
|
|
|
## Important Notes |
|
|
|
|
|
- The system will only provide information that is explicitly stated in the provided guidelines |
|
|
- All responses include a medical disclaimer |
|
|
- The system will respond with "This information is not available in the current guidelines" when uncertain |
|
|
|
|
|
## Deployment |
|
|
|
|
|
To deploy on Hugging Face Spaces: |
|
|
|
|
|
1. Create a new Space on Hugging Face |
|
|
2. Connect your GitHub repository |
|
|
3. Select Gradio as the SDK |
|
|
4. The app will automatically deploy |
|
|
|
|
|
## Safety Measures |
|
|
|
|
|
- All responses are strictly grounded in the provided guidelines |
|
|
- A medical disclaimer is included with every response |
|
|
- The system explicitly states when information is not available |
|
|
- No medical advice is provided without proper context |
|
|
|
|
|
## License |
|
|
|
|
|
This project is for educational purposes only. Always consult healthcare professionals for medical advice. |