File size: 2,374 Bytes
4028c58
ceea46c
 
 
 
4028c58
ceea46c
4028c58
 
ceea46c
4028c58
 
ceea46c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
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.