File size: 4,298 Bytes
68d6aee d6f967e d2d8aa3 68d6aee d2d8aa3 68d6aee d2d8aa3 68d6aee e34bc5c 68d6aee e34bc5c |
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 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
---
title: MedQA
emoji: π
colorFrom: red
colorTo: yellow
sdk: streamlit
sdk_version: 1.45.1
app_file: app.py
pinned: false
license: mit
---
# Quantum Healthcare Navigator βοΈπ§ π¬
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.
## β¨ Features
* **AI Consultation:** Interactive chat with an AI assistant.
* **Medical Knowledge Access:** Tools for UMLS and BioPortal lookups.
* **Quantum Treatment Optimizer:** (Simulated) Get suggestions for treatment plans based on patient data.
* **User Authentication:** Secure login and signup.
* **Session Management:** Chat history is saved per user session.
* **PDF Reports:** Download consultation transcripts.
* **Dockerized:** Easy to deploy and run locally.
## π Project Structure
Use code with caution.
Markdown
quantum_healthcare_app/
βββ app.py # Streamlit entrypoint
βββ agent.py # LangChain agent setup
βββ pages/ # Streamlit multipage views
β βββ 1_Home.py
β βββ 2_Consult.py
β βββ 3_Reports.py
βββ tools/ # LangChain Tool wrappers
β βββ init.py
β βββ gemini_tool.py
β βββ umls_tool.py
β βββ bioportal_tool.py
β βββ quantum_tool.py
βββ models/ # SQLModel definitions & DB init
β βββ init.py
β βββ db.py
β βββ user.py
β βββ chat.py
βββ services/ # Shared services (auth, logging, PDF)
β βββ init.py
β βββ auth.py
β βββ logger.py
β βββ metrics.py
β βββ pdf_report.py
βββ clinical_nlp/ # ClinicalβNLP helpers
β βββ init.py
β βββ umls_bioportal.py
βββ quantum/ # Quantum optimizer stub
β βββ init.py
β βββ optimizer.py
βββ config/ # Configuration
β βββ settings.py
βββ assets/ # Images, logos
β βββ init.py
β βββ logo.png
βββ Dockerfile
βββ docker-compose.yml # For local development
βββ requirements.txt
βββ README.md
## βοΈ Setup & Configuration
1. **Clone the repository (if applicable) or create the files as listed.**
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.
```env
APP_TITLE="Quantum Healthcare Navigator"
SECRET_KEY="your_very_secret_key"
DATABASE_URL="sqlite:///./quantum_healthcare.db" # Default for HF Spaces
OPENAI_API_KEY="sk-..."
GEMINI_API_KEY="..."
UMLS_API_KEY="..."
BIOPORTAL_API_KEY="..."
LOG_LEVEL="INFO"
```
3. **Hugging Face Space Deployment:**
* Create a new Space on Hugging Face.
* Choose "Docker" as the Space SDK (or Streamlit and provide `requirements.txt`). Docker is recommended for this complexity.
* Upload your files.
* Go to "Settings" in your Space and add your `.env` variables as **Secrets**.
* The Space should build and run the `Dockerfile`.
## π Running Locally (using Docker)
1. **Ensure Docker and Docker Compose are installed.**
2. **Create and populate your `.env` file** as described above.
3. **Build and run the application:**
```bash
docker-compose up --build
```
4. Open your browser and navigate to `http://localhost:8501`.
## π Notes
* The **Quantum Optimizer** is currently a stub. It simulates quantum processing but doesn't connect to actual quantum hardware.
* **UMLS and BioPortal API** interactions are simplified. Real integration requires more robust error handling, authentication (e.g., UMLS Ticket Granting Tickets), and result parsing.
* **Error handling and logging** are basic. Production systems would require more comprehensive strategies.
* **Security:** While basic authentication is implemented, ensure all security best practices if deploying for wider use (e.g., HTTPS, input validation, dependency scanning).
* This application is for **demonstration purposes only** and should not be used for actual medical decision-making.
---
"Built by the World's Greatest AI Engineer" π
|