Skip to content

Application that acts just like a chatbot- takes in voice input and prescription images to suggest meds with decent accuracy.

Notifications You must be signed in to change notification settings

duckduck123go/SmartHealthAssistant

Repository files navigation

🩺 Smart Healthcare Assistant – Virtual Nurse using Azure AI

A smart virtual nurse that understands patient speech, extracts medicines from handwritten prescriptions, and acts as your personalized health mentor using Azure AI, Flask, and Python.

🚀 Features

    1. Speech-to-Text: Speak your symptoms; it listens and transcribes using Azure Speech Services.
    1. Prescription Text Extraction: Upload handwritten prescriptions — even messy ones — and it extracts medicines using Azure Read API.
    1. Medicine Detection: Detects and highlights common medicines from the text.
    1. Timestamped Health Logs: All interactions are saved with timestamps (can be extended to cloud).
    1. Modular Design: Easily add fitness goals, chatbot, health suggestions, etc.

🛠️ Tech Stack

Tool Purpose
Python + Flask Backend + APIs
Azure Speech SDK Voice transcription
Azure Computer Vision Handwritten OCR
PyAudio + Wave Microphone handling
dotenv Secure key management
cURL / Postman For API testing

📁 Folder Structure

SmartHealthAssistant/
│
├── app.py                  # Main Flask server
├── azurekeys.py            # Azure keys/endpoint (use .env)
├── .env                    # Do not push this! Stores secrets
├── uploads/                # Stores uploaded images
├── requirements.txt        # All dependencies
└── README.md               # This file

🔐 Environment Variables

Create a .env file:

AZURE_SPEECH_KEY=your_speech_key_here
AZURE_SERVICE_REGION=centralindia
AZURE_COMPUTER_VISION_KEY=your_vision_key_here
AZURE_COMPUTER_VISION_ENDPOINT=https://your-endpoint.cognitiveservices.azure.com/

▶️ Running the App

1. Clone and set up:

git clone https://github.com/your-username/SmartHealthAssistant.git
cd SmartHealthAssistant
python -m venv .venv
.venv\Scripts\activate  # On Windows
pip install -r requirements.txt

2. Start Flask server:

python app.py

3. Open browser:

http://127.0.0.1:5000

🎙️ Voice Input (GET)

GET /voice

Returns JSON:

{
  "recognized_text": "Hello doctor, I have a headache.",
  "timestamp": "2025-03-27 05:20:13"
}

📸 Upload Prescription (POST)

curl.exe -X POST -F "file=@C:\path\to\prescription.jpg" http://127.0.0.1:5000/upload

Returns JSON:

{
  "extracted_text": "Take one tablet of Paracetamol after food.",
  "detected_medicines": ["Paracetamol"],
  "timestamp": "2025-03-27 05:45:30"
}

💡 Ideas for Future Work

  • ChatGPT integration for health Q&A
  • Personalized fitness dashboard
  • Multilingual voice input
  • Alert logic based on sentiment or symptoms
  • Push logs to Azure Blob/Firestore

Let’s build a healthier world together 💙


About

Application that acts just like a chatbot- takes in voice input and prescription images to suggest meds with decent accuracy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages