Downloads · 30 days
0
milana0628659/Healthbuddy
Healthbuddy is a machine learning model from milana0628659. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated Nov 16, 2024
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md1.9 KB · 56%
From the Hugging Face model README
import time
CONDITION_DATABASE = { "fever": ["Flu", "Common Cold", "COVID-19"], "headache": ["Migraine", "Tension Headache", "Sinusitis"], "cough": ["Bronchitis", "Pneumonia", "Asthma"], "fatigue": ["Anemia", "Thyroid Issues", "Depression"], }
def show_disclaimer(): print("⚠️ HealthBuddy is a symptom-checking assistant.\n") print("This tool is for informational purposes only and does not provide medical advice. " "Always consult a qualified healthcare provider for a proper diagnosis.\n")
def get_user_symptoms(): print("Please enter your symptoms, separated by commas (e.g., 'fever, cough'):") symptoms = input("Your symptoms: ").lower() return [symptom.strip() for symptom in symptoms.split(",")]
def match_symptoms_to_conditions(symptoms): possible_conditions = [] for symptom in symptoms: if symptom in CONDITION_DATABASE: possible_conditions.extend(CONDITION_DATABASE[symptom]) return list(set(possible_conditions))
def health_buddy(): show_disclaimer() print("Welcome to HealthBuddy! Let's start by understanding your symptoms.\n") symptoms = get_user_symptoms() print("\nAnalyzing symptoms...") time.sleep(2) # Simulate processing time
matched_conditions = match_symptoms_to_conditions(symptoms)
if matched_conditions:
print("\nBased on your symptoms, here are some possible conditions to consider:")
for condition in matched_conditions:
print(f"- {condition}")
print("\nPlease consult a healthcare provider for a proper diagnosis and treatment plan.")
else:
print("\nSorry, I couldn't match your symptoms to any known conditions. Please consult a healthcare provider.")
if name == "main": health_buddy()