File size: 1,305 Bytes
a9fda12 618d4cb a9fda12 |
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 |
import streamlit as st
from transformers import pipeline
import requests
from geopy.geocoders import Nominatim
API_URL = "https://api-inference.huggingface.co/models/dmis-lab/biobert-base-cased-v1.1"
headers = {"Authorization": "secret"}
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
def main():
st.title("Healthcare Companion")
st.write("This app provides healthcare guidance, prescription information, and locates nearby clinics or pharmacies.")
# User input for medical question
question = st.text_input("Enter your medical question:")
if question:
context = "General medical context." # Adjust this as needed
result = query({"inputs": {"question": question, "context": context}})
st.write("**Answer:**")
st.write(result.get('answer', "Sorry, I don't know the answer."))
# User input for address to find nearby clinics/pharmacies
address = st.text_input("Enter your address to find nearby clinics/pharmacies:")
if address:
location = find_nearby_clinics(address)
st.write(f"**Nearby Clinics/Pharmacies (Coordinates):** {location}")
# Additional features like prescription info can be added similarly
if __name__ == "__main__":
main()
|