Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -54,13 +54,13 @@ model.eval()
|
|
| 54 |
def get_ai_explanation(diagnosis, probabilities):
|
| 55 |
if diagnosis == "normal":
|
| 56 |
prompt = f"""Given a chest X-ray analysis showing NORMAL results with {probabilities['normal']:.2%} confidence:
|
| 57 |
-
1. Explain what this means
|
| 58 |
-
2. Suggest when they should still consider consulting a doctor
|
| 59 |
-
3. List key symptoms that would warrant medical attention
|
| 60 |
Keep the tone professional yet reassuring."""
|
| 61 |
else:
|
| 62 |
prompt = f"""Given a chest X-ray analysis showing {diagnosis} pneumonia with {probabilities[diagnosis]:.2%} confidence:
|
| 63 |
-
1. Explain what {diagnosis} pneumonia is
|
| 64 |
2. List immediate steps the patient should take
|
| 65 |
3. Provide care recommendations
|
| 66 |
4. Mention warning signs to watch for
|
|
@@ -174,7 +174,7 @@ def create_interface():
|
|
| 174 |
|
| 175 |
welcome_message = """
|
| 176 |
<div class="welcome-message">
|
| 177 |
-
<h1
|
| 178 |
<p>PneumoInsight is a side project of EarlyMed—an initiative by our team at VIT-AP University dedicated to empowering you with early health insights.
|
| 179 |
Leveraging AI for early detection, our mission is simple: "Early Detection, Smarter Decision."
|
| 180 |
This project is one of our key efforts to help you stay informed before visiting a doctor.</p>
|
|
|
|
| 54 |
def get_ai_explanation(diagnosis, probabilities):
|
| 55 |
if diagnosis == "normal":
|
| 56 |
prompt = f"""Given a chest X-ray analysis showing NORMAL results with {probabilities['normal']:.2%} confidence:
|
| 57 |
+
1. Explain what this means, please remember that NORMAL ['normal'] means this user does not have any Pneumonia.
|
| 58 |
+
2. Suggest when they should still consider consulting a doctor even though this user does not have any penumonia as per the test result.
|
| 59 |
+
3. List key symptoms that would warrant medical attention. Always identify yourself as PneumoInsight Bot.
|
| 60 |
Keep the tone professional yet reassuring."""
|
| 61 |
else:
|
| 62 |
prompt = f"""Given a chest X-ray analysis showing {diagnosis} pneumonia with {probabilities[diagnosis]:.2%} confidence:
|
| 63 |
+
1. Explain what {diagnosis} pneumonia is . Always identify yourself as PneumoInsight Bot.
|
| 64 |
2. List immediate steps the patient should take
|
| 65 |
3. Provide care recommendations
|
| 66 |
4. Mention warning signs to watch for
|
|
|
|
| 174 |
|
| 175 |
welcome_message = """
|
| 176 |
<div class="welcome-message">
|
| 177 |
+
<h1>🫁 Welcome to PneumoInsight</h1>
|
| 178 |
<p>PneumoInsight is a side project of EarlyMed—an initiative by our team at VIT-AP University dedicated to empowering you with early health insights.
|
| 179 |
Leveraging AI for early detection, our mission is simple: "Early Detection, Smarter Decision."
|
| 180 |
This project is one of our key efforts to help you stay informed before visiting a doctor.</p>
|