Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,7 +27,9 @@ API_URL = f"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-f
|
|
| 27 |
INTRO_TEXT = """
|
| 28 |
<div>
|
| 29 |
<h1>國防醫學大學 醫學模擬實驗室 - 「One-Minute Summary」考核評分</h1>
|
|
|
|
| 30 |
<p>本系統根據 <b>等第制 (A~F)</b> 與七大題項 (總分100分) 對你的總結給出評分與評語。</p>
|
|
|
|
| 31 |
<p> Builder: 鄭文隆(M115) Supervisor: 劉峰誠(M92) </p>
|
| 32 |
</div>
|
| 33 |
"""
|
|
@@ -58,7 +60,7 @@ def call_gemini(summary):
|
|
| 58 |
|
| 59 |
headers = {"Content-Type": "application/json"}
|
| 60 |
# ⚠️ 保留你的完整 prompt,不修改
|
| 61 |
-
prompt = f"""你是臨床教師,根據以下七大題項和等第制,請對實習醫學生的一分鐘總結進行評分與評論。
|
| 62 |
評分規準:
|
| 63 |
• 優異(A):90-100分
|
| 64 |
o 評語: 內容精確、邏輯嚴謹,能對病程變化做出全面且深入的分析。能將各項資訊融會貫通,並在鑑別診斷中展現清晰的臨床思維。
|
|
@@ -126,6 +128,7 @@ ________________________________________
|
|
| 126 |
3. 等第 (A~F)
|
| 127 |
4. 總結性評論
|
| 128 |
5. 簡要全人照護面向評估與分數(5-五全: 全人、全家、全程、全隊、全社區 / 4-四面向: 生、心、靈、社會 /3-三要素: 知識、態度、技能 (KAS))
|
|
|
|
| 129 |
|
| 130 |
學生的一分鐘總結如下:
|
| 131 |
{summary}
|
|
@@ -169,26 +172,26 @@ with gr.Blocks(title="One-Minute Summary 評分") as demo:
|
|
| 169 |
gr.HTML(INTRO_TEXT)
|
| 170 |
|
| 171 |
level = gr.Dropdown(
|
| 172 |
-
choices=["主治醫師", "住院醫師", "PGY2", "PGY1", "Clerk2", "Clerk1","其他"],
|
| 173 |
value="Clerk1",
|
| 174 |
label="請選擇職級"
|
| 175 |
)
|
| 176 |
|
| 177 |
name = gr.Textbox(label="姓名", lines=1, placeholder="請輸入姓名")
|
| 178 |
|
| 179 |
-
p1 = gr.Textbox(label="1. 年齡、性別、Chief Complaint (10分)", lines=2)
|
| 180 |
-
p2 = gr.Textbox(label="2. 個人病史 (10分)", lines=2)
|
| 181 |
-
p3 = gr.Textbox(label="3. 家族史 (10分)", lines=2)
|
| 182 |
-
p4 = gr.Textbox(label="4. 身體檢查陽性發現 (10分)", lines=2)
|
| 183 |
-
p5 = gr.Textbox(label="5. 實驗室與影像結果 (10分)", lines=2)
|
| 184 |
-
p6 = gr.Textbox(label="6. 鑑別診斷 (10分)", lines=2)
|
| 185 |
-
p7 = gr.Textbox(label="7. 處置與治療 (40分)", lines=2)
|
| 186 |
|
| 187 |
with gr.Row():
|
| 188 |
-
submit_btn = gr.Button("送出評分", variant="primary")
|
| 189 |
-
clear_btn = gr.Button("清空")
|
| 190 |
|
| 191 |
-
result = gr.Markdown(label="評分結果")
|
| 192 |
|
| 193 |
submit_btn.click(
|
| 194 |
collect_and_score,
|
|
|
|
| 27 |
INTRO_TEXT = """
|
| 28 |
<div>
|
| 29 |
<h1>國防醫學大學 醫學模擬實驗室 - 「One-Minute Summary」考核評分</h1>
|
| 30 |
+
<h1>National Defense Medical University Medical Simulation Lab - 「One-Minute Summary」</h1>
|
| 31 |
<p>本系統根據 <b>等第制 (A~F)</b> 與七大題項 (總分100分) 對你的總結給出評分與評語。</p>
|
| 32 |
+
<p>The System is based on <b> ranking A~F</b> and 7 questions (totoal 100) to evaluate your summary</p>
|
| 33 |
<p> Builder: 鄭文隆(M115) Supervisor: 劉峰誠(M92) </p>
|
| 34 |
</div>
|
| 35 |
"""
|
|
|
|
| 60 |
|
| 61 |
headers = {"Content-Type": "application/json"}
|
| 62 |
# ⚠️ 保留你的完整 prompt,不修改
|
| 63 |
+
prompt = f"""你是臨床教師,根據以下七大題項和等第制,請對實習醫學生的一分鐘總結進行評分與評論。學生主要用什麼語言回答你就用什麼語言給分打回饋。
|
| 64 |
評分規準:
|
| 65 |
• 優異(A):90-100分
|
| 66 |
o 評語: 內容精確、邏輯嚴謹,能對病程變化做出全面且深入的分析。能將各項資訊融會貫通,並在鑑別診斷中展現清晰的臨床思維。
|
|
|
|
| 128 |
3. 等第 (A~F)
|
| 129 |
4. 總結性評論
|
| 130 |
5. 簡要全人照護面向評估與分數(5-五全: 全人、全家、全程、全隊、全社區 / 4-四面向: 生、心、靈、社會 /3-三要素: 知識、態度、技能 (KAS))
|
| 131 |
+
學生主要用什麼語言回答你就用什麼語言給分打回饋。
|
| 132 |
|
| 133 |
學生的一分鐘總結如下:
|
| 134 |
{summary}
|
|
|
|
| 172 |
gr.HTML(INTRO_TEXT)
|
| 173 |
|
| 174 |
level = gr.Dropdown(
|
| 175 |
+
choices=["主治醫師Visiting Staff", "住院醫師Resident", "PGY2", "PGY1", "Clerk2", "Clerk1","其他Other"],
|
| 176 |
value="Clerk1",
|
| 177 |
label="請選擇職級"
|
| 178 |
)
|
| 179 |
|
| 180 |
name = gr.Textbox(label="姓名", lines=1, placeholder="請輸入姓名")
|
| 181 |
|
| 182 |
+
p1 = gr.Textbox(label="1. 年齡Age、性別Sex、Chief Complaint (10分)", lines=2)
|
| 183 |
+
p2 = gr.Textbox(label="2. 個人病史Personal History (10分)", lines=2)
|
| 184 |
+
p3 = gr.Textbox(label="3. 家族史Family History (10分)", lines=2)
|
| 185 |
+
p4 = gr.Textbox(label="4. 身體檢查陽性發現Physical Examination (10分)", lines=2)
|
| 186 |
+
p5 = gr.Textbox(label="5. 實驗室與影像結果Lab and Image (10分)", lines=2)
|
| 187 |
+
p6 = gr.Textbox(label="6. 鑑別診斷Differential Diagnosis (10分)", lines=2)
|
| 188 |
+
p7 = gr.Textbox(label="7. 處置與治療Treatment (40分)", lines=2)
|
| 189 |
|
| 190 |
with gr.Row():
|
| 191 |
+
submit_btn = gr.Button("送出評分 Submit", variant="primary")
|
| 192 |
+
clear_btn = gr.Button("清空 Clear")
|
| 193 |
|
| 194 |
+
result = gr.Markdown(label="評分結果Result ")
|
| 195 |
|
| 196 |
submit_btn.click(
|
| 197 |
collect_and_score,
|