Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,7 +30,7 @@ def interpret_medical_report(extracted_text, model):
|
|
| 30 |
f"The following is a medical report text:\n\n"
|
| 31 |
f"{extracted_text}\n\n"
|
| 32 |
"Please interpret this report for 7th grader and non native english speaker, "
|
| 33 |
-
"explaining the main findings in as short as possible"
|
| 34 |
)
|
| 35 |
response = model.generate_content([prompt])
|
| 36 |
interpretation = response.text.strip()
|
|
@@ -44,7 +44,7 @@ def provide_recommendations(extracted_text, model):
|
|
| 44 |
f"Based on the medical report text below:\n\n"
|
| 45 |
f"{extracted_text}\n\n"
|
| 46 |
"What recommendations would you give to the patient for managing their health?"
|
| 47 |
-
"Provide brief suggestions that are easy to understand for someone without medical knowledge."
|
| 48 |
)
|
| 49 |
response = model.generate_content([prompt])
|
| 50 |
recommendations = response.text.strip()
|
|
@@ -72,12 +72,12 @@ def main():
|
|
| 72 |
extracted_text = extract_text_from_image(uploaded_image, model)
|
| 73 |
|
| 74 |
# Interpret the extracted text
|
| 75 |
-
st.subheader("Interpretation
|
| 76 |
interpretation = interpret_medical_report(extracted_text, model)
|
| 77 |
st.text(interpretation)
|
| 78 |
|
| 79 |
# Provide health recommendations
|
| 80 |
-
st.subheader("
|
| 81 |
recommendations = provide_recommendations(extracted_text, model)
|
| 82 |
st.text(recommendations)
|
| 83 |
|
|
|
|
| 30 |
f"The following is a medical report text:\n\n"
|
| 31 |
f"{extracted_text}\n\n"
|
| 32 |
"Please interpret this report for 7th grader and non native english speaker, "
|
| 33 |
+
"explaining the main findings in as short as possible without any special character"
|
| 34 |
)
|
| 35 |
response = model.generate_content([prompt])
|
| 36 |
interpretation = response.text.strip()
|
|
|
|
| 44 |
f"Based on the medical report text below:\n\n"
|
| 45 |
f"{extracted_text}\n\n"
|
| 46 |
"What recommendations would you give to the patient for managing their health?"
|
| 47 |
+
"Provide brief suggestions that are easy to understand for someone without medical knowledge without any special character."
|
| 48 |
)
|
| 49 |
response = model.generate_content([prompt])
|
| 50 |
recommendations = response.text.strip()
|
|
|
|
| 72 |
extracted_text = extract_text_from_image(uploaded_image, model)
|
| 73 |
|
| 74 |
# Interpret the extracted text
|
| 75 |
+
st.subheader("Interpretation:")
|
| 76 |
interpretation = interpret_medical_report(extracted_text, model)
|
| 77 |
st.text(interpretation)
|
| 78 |
|
| 79 |
# Provide health recommendations
|
| 80 |
+
st.subheader("Recommendations:")
|
| 81 |
recommendations = provide_recommendations(extracted_text, model)
|
| 82 |
st.text(recommendations)
|
| 83 |
|