Update README.md
Browse files
README.md
CHANGED
@@ -9,4 +9,104 @@ app_file: app.py
|
|
9 |
pinned: false
|
10 |
license: mit
|
11 |
---
|
|
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
pinned: false
|
10 |
license: mit
|
11 |
---
|
12 |
+
# Quantum Healthcare Navigator βοΈπ§ π¬
|
13 |
|
14 |
+
Welcome to the Quantum Healthcare Navigator, an AI-powered application designed for healthcare professionals. This Hugging Face Space demonstrates the integration of Large Language Models (LLMs), specialized medical information tools, and (simulated) quantum-inspired optimization for treatment suggestions.
|
15 |
+
|
16 |
+
## β¨ Features
|
17 |
+
|
18 |
+
* **AI Consultation:** Interactive chat with an AI assistant.
|
19 |
+
* **Medical Knowledge Access:** Tools for UMLS and BioPortal lookups.
|
20 |
+
* **Quantum Treatment Optimizer:** (Simulated) Get suggestions for treatment plans based on patient data.
|
21 |
+
* **User Authentication:** Secure login and signup.
|
22 |
+
* **Session Management:** Chat history is saved per user session.
|
23 |
+
* **PDF Reports:** Download consultation transcripts.
|
24 |
+
* **Dockerized:** Easy to deploy and run locally.
|
25 |
+
|
26 |
+
## π Project Structure
|
27 |
+
Use code with caution.
|
28 |
+
Markdown
|
29 |
+
quantum_healthcare_app/
|
30 |
+
βββ app.py # Streamlit entrypoint
|
31 |
+
βββ agent.py # LangChain agent setup
|
32 |
+
βββ pages/ # Streamlit multipage views
|
33 |
+
β βββ 1_Home.py
|
34 |
+
β βββ 2_Consult.py
|
35 |
+
β βββ 3_Reports.py
|
36 |
+
βββ tools/ # LangChain Tool wrappers
|
37 |
+
β βββ init.py
|
38 |
+
β βββ gemini_tool.py
|
39 |
+
β βββ umls_tool.py
|
40 |
+
β βββ bioportal_tool.py
|
41 |
+
β βββ quantum_tool.py
|
42 |
+
βββ models/ # SQLModel definitions & DB init
|
43 |
+
β βββ init.py
|
44 |
+
β βββ db.py
|
45 |
+
β βββ user.py
|
46 |
+
β βββ chat.py
|
47 |
+
βββ services/ # Shared services (auth, logging, PDF)
|
48 |
+
β βββ init.py
|
49 |
+
β βββ auth.py
|
50 |
+
β βββ logger.py
|
51 |
+
β βββ metrics.py
|
52 |
+
β βββ pdf_report.py
|
53 |
+
βββ clinical_nlp/ # ClinicalβNLP helpers
|
54 |
+
β βββ init.py
|
55 |
+
β βββ umls_bioportal.py
|
56 |
+
βββ quantum/ # Quantum optimizer stub
|
57 |
+
β βββ init.py
|
58 |
+
β βββ optimizer.py
|
59 |
+
βββ config/ # Configuration
|
60 |
+
β βββ settings.py
|
61 |
+
βββ assets/ # Images, logos
|
62 |
+
β βββ init.py
|
63 |
+
β βββ logo.png
|
64 |
+
βββ Dockerfile
|
65 |
+
βββ docker-compose.yml # For local development
|
66 |
+
βββ requirements.txt
|
67 |
+
βββ README.md
|
68 |
+
## βοΈ Setup & Configuration
|
69 |
+
|
70 |
+
1. **Clone the repository (if applicable) or create the files as listed.**
|
71 |
+
2. **Create a `.env` file** in the root `quantum_healthcare_app/` directory based on `.env.example`. Populate it with your API keys and desired settings.
|
72 |
+
```env
|
73 |
+
APP_TITLE="Quantum Healthcare Navigator"
|
74 |
+
SECRET_KEY="your_very_secret_key"
|
75 |
+
|
76 |
+
DATABASE_URL="sqlite:///./quantum_healthcare.db" # Default for HF Spaces
|
77 |
+
|
78 |
+
OPENAI_API_KEY="sk-..."
|
79 |
+
GEMINI_API_KEY="..."
|
80 |
+
UMLS_API_KEY="..."
|
81 |
+
BIOPORTAL_API_KEY="..."
|
82 |
+
|
83 |
+
LOG_LEVEL="INFO"
|
84 |
+
```
|
85 |
+
3. **Hugging Face Space Deployment:**
|
86 |
+
* Create a new Space on Hugging Face.
|
87 |
+
* Choose "Docker" as the Space SDK (or Streamlit and provide `requirements.txt`). Docker is recommended for this complexity.
|
88 |
+
* Upload your files.
|
89 |
+
* Go to "Settings" in your Space and add your `.env` variables as **Secrets**.
|
90 |
+
* The Space should build and run the `Dockerfile`.
|
91 |
+
|
92 |
+
## π Running Locally (using Docker)
|
93 |
+
|
94 |
+
1. **Ensure Docker and Docker Compose are installed.**
|
95 |
+
2. **Create and populate your `.env` file** as described above.
|
96 |
+
3. **Build and run the application:**
|
97 |
+
```bash
|
98 |
+
docker-compose up --build
|
99 |
+
```
|
100 |
+
4. Open your browser and navigate to `http://localhost:8501`.
|
101 |
+
|
102 |
+
## π Notes
|
103 |
+
|
104 |
+
* The **Quantum Optimizer** is currently a stub. It simulates quantum processing but doesn't connect to actual quantum hardware.
|
105 |
+
* **UMLS and BioPortal API** interactions are simplified. Real integration requires more robust error handling, authentication (e.g., UMLS Ticket Granting Tickets), and result parsing.
|
106 |
+
* **Error handling and logging** are basic. Production systems would require more comprehensive strategies.
|
107 |
+
* **Security:** While basic authentication is implemented, ensure all security best practices if deploying for wider use (e.g., HTTPS, input validation, dependency scanning).
|
108 |
+
* This application is for **demonstration purposes only** and should not be used for actual medical decision-making.
|
109 |
+
|
110 |
+
---
|
111 |
+
|
112 |
+
"Built by the World's Greatest AI Engineer" π
|