mgbam commited on
Commit
e34bc5c
Β·
verified Β·
1 Parent(s): b79bdce

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +100 -0
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" πŸ˜‰