Spaces:
Sleeping
Sleeping
Revise user guide and quick start instructions for clarity and accessibility in the simplified Gradio interface
Browse files- src/interface/simplified_gradio_app.py +104 -111
src/interface/simplified_gradio_app.py
CHANGED
|
@@ -477,117 +477,110 @@ def create_simplified_interface():
|
|
| 477 |
# Instructions tab
|
| 478 |
with gr.TabItem("📖 Help", id="help"):
|
| 479 |
gr.Markdown("""
|
| 480 |
-
##
|
| 481 |
-
|
| 482 |
-
###
|
| 483 |
-
This is a
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
-
|
| 500 |
-
-
|
| 501 |
-
|
| 502 |
-
**
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
-
|
| 511 |
-
-
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
###
|
| 524 |
-
**
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
**
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
-
|
| 582 |
-
-
|
| 583 |
-
-
|
| 584 |
-
- All conversations are confidential
|
| 585 |
-
|
| 586 |
-
### 🔐 Privacy & Security
|
| 587 |
-
- Session data is stored locally
|
| 588 |
-
- No data is shared externally
|
| 589 |
-
- Each session is independent
|
| 590 |
-
- Clear chat to remove history
|
| 591 |
""")
|
| 592 |
|
| 593 |
# Event handlers
|
|
|
|
| 477 |
# Instructions tab
|
| 478 |
with gr.TabItem("📖 Help", id="help"):
|
| 479 |
gr.Markdown("""
|
| 480 |
+
## 📖 User Guide (Non‑Technical)
|
| 481 |
+
|
| 482 |
+
### What this app is
|
| 483 |
+
This is a **Medical Assistant** that also watches for **emotional / spiritual distress** in the background.
|
| 484 |
+
You can chat naturally about health and lifestyle. If the system detects distress, it gently adapts the conversation.
|
| 485 |
+
|
| 486 |
+
---
|
| 487 |
+
|
| 488 |
+
## 🚀 Quick Start
|
| 489 |
+
|
| 490 |
+
### Quick Start: Chat (everyday use)
|
| 491 |
+
1. Open the **Chat** tab.
|
| 492 |
+
2. Type your question (symptoms, medications, lifestyle, recovery, etc.).
|
| 493 |
+
3. Read the response.
|
| 494 |
+
4. If the system detects distress, it may ask a few gentle follow‑up questions.
|
| 495 |
+
|
| 496 |
+
### Quick Start: Testing / QA (Enhanced Verification)
|
| 497 |
+
1. Open **Enhanced Verification**.
|
| 498 |
+
2. Choose one mode:
|
| 499 |
+
- **Manual Input** (test one message)
|
| 500 |
+
- **File Upload** (test many messages in a batch)
|
| 501 |
+
3. Run classification.
|
| 502 |
+
4. Export results as **CSV** or **JSON**.
|
| 503 |
+
|
| 504 |
+
---
|
| 505 |
+
|
| 506 |
+
## 💬 Chat: What to expect
|
| 507 |
+
Use Chat for:
|
| 508 |
+
- health questions and symptoms
|
| 509 |
+
- medication questions
|
| 510 |
+
- recovery and rehab guidance
|
| 511 |
+
- lifestyle support (activity, nutrition, habits)
|
| 512 |
+
|
| 513 |
+
The system continuously monitors messages for possible distress while you chat.
|
| 514 |
+
|
| 515 |
+
---
|
| 516 |
+
|
| 517 |
+
## 🧭 Distress levels (how the system reacts)
|
| 518 |
+
You may see one of these behaviors during a conversation:
|
| 519 |
+
|
| 520 |
+
### 🟢 GREEN — No distress detected
|
| 521 |
+
Normal medical conversation.
|
| 522 |
+
|
| 523 |
+
### 🟡 YELLOW — Possible distress
|
| 524 |
+
The assistant may ask **2–3 short, gentle questions** to clarify what you’re going through.
|
| 525 |
+
Goal: understand whether extra support (like a referral) may be helpful.
|
| 526 |
+
|
| 527 |
+
### 🔴 RED — Severe distress / safety concern
|
| 528 |
+
The assistant prioritizes safety and guidance.
|
| 529 |
+
It may generate referral‑style guidance and suggest urgent help.
|
| 530 |
+
|
| 531 |
+
---
|
| 532 |
+
|
| 533 |
+
## ⚙️ Model Settings (AI Model Configuration)
|
| 534 |
+
You can choose which AI model is used for different tasks (e.g., monitoring vs. medical advice).
|
| 535 |
+
|
| 536 |
+
**Session‑only:** Model changes apply only to your **current session**.
|
| 537 |
+
Starting a new session resets to defaults.
|
| 538 |
+
|
| 539 |
+
---
|
| 540 |
+
|
| 541 |
+
## 🔧 Edit Prompts (Customize behavior)
|
| 542 |
+
Prompts control *how* the AI behaves (tone, structure, rules).
|
| 543 |
+
|
| 544 |
+
**Session‑only:** Prompt edits apply only to your **current session**.
|
| 545 |
+
They do not affect other sessions.
|
| 546 |
+
|
| 547 |
+
Tip: after you click **Apply Changes**, the next message or batch run will use the updated prompt.
|
| 548 |
+
|
| 549 |
+
---
|
| 550 |
+
|
| 551 |
+
## ✅ Enhanced Verification (Testing modes)
|
| 552 |
+
Enhanced Verification is a testing/validation environment. It helps you measure quality and export results.
|
| 553 |
+
|
| 554 |
+
### ✏️ Manual Input Mode
|
| 555 |
+
Use this when you want to test a single message quickly:
|
| 556 |
+
1. Enter a message.
|
| 557 |
+
2. Run classification.
|
| 558 |
+
3. Review results and save the verification.
|
| 559 |
+
|
| 560 |
+
### 📁 File Upload Mode
|
| 561 |
+
Use this when you want to test an entire dataset:
|
| 562 |
+
1. Download the CSV template (in the UI).
|
| 563 |
+
2. Fill in your test messages.
|
| 564 |
+
3. Upload the CSV.
|
| 565 |
+
4. Start **batch classification** (one click).
|
| 566 |
+
5. Review totals and accuracy.
|
| 567 |
+
|
| 568 |
+
---
|
| 569 |
+
|
| 570 |
+
## 💾 Exports
|
| 571 |
+
Exports are available in Enhanced Verification:
|
| 572 |
+
- **CSV**
|
| 573 |
+
- **JSON**
|
| 574 |
+
|
| 575 |
+
CSV note:
|
| 576 |
+
- The **Notes** column contains **only the model `reasoning`** (when present).
|
| 577 |
+
|
| 578 |
+
---
|
| 579 |
+
|
| 580 |
+
## 🔐 Privacy & Safety
|
| 581 |
+
- Session data is stored locally.
|
| 582 |
+
- This tool does not replace professional medical advice.
|
| 583 |
+
- If there is an emergency, contact local emergency services.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 584 |
""")
|
| 585 |
|
| 586 |
# Event handlers
|