Spaces:
Sleeping
Sleeping
Upload 7 files
Browse files- casl_analysis_improved.py +11 -22
casl_analysis_improved.py
CHANGED
@@ -1086,8 +1086,7 @@ def create_enhanced_interface():
|
|
1086 |
|
1087 |
patient_name = gr.Textbox(
|
1088 |
label="Patient Name",
|
1089 |
-
placeholder="Enter patient name"
|
1090 |
-
info="Required for record keeping"
|
1091 |
)
|
1092 |
record_id = gr.Textbox(
|
1093 |
label="Medical Record ID",
|
@@ -1099,8 +1098,7 @@ def create_enhanced_interface():
|
|
1099 |
label="Age (years)",
|
1100 |
value=8,
|
1101 |
minimum=1,
|
1102 |
-
maximum=120
|
1103 |
-
info="Patient's chronological age"
|
1104 |
)
|
1105 |
gender = gr.Radio(
|
1106 |
["male", "female", "other"],
|
@@ -1128,28 +1126,24 @@ def create_enhanced_interface():
|
|
1128 |
# Sample transcript selection
|
1129 |
sample_selector = gr.Dropdown(
|
1130 |
choices=list(SAMPLE_TRANSCRIPTS.keys()),
|
1131 |
-
label="Load Sample Transcript"
|
1132 |
-
info="Choose a sample for demonstration"
|
1133 |
)
|
1134 |
|
1135 |
file_upload = gr.File(
|
1136 |
label="Upload Transcript File",
|
1137 |
-
file_types=[".txt", ".cha", ".pdf"]
|
1138 |
-
info="Supports .txt, .cha, and .pdf files"
|
1139 |
)
|
1140 |
|
1141 |
transcript = gr.Textbox(
|
1142 |
label="Speech Transcript (CHAT format preferred)",
|
1143 |
placeholder="Enter or upload transcript...",
|
1144 |
-
lines=12
|
1145 |
-
info="Use CHAT format for best results"
|
1146 |
)
|
1147 |
|
1148 |
with gr.Row():
|
1149 |
analyze_btn = gr.Button(
|
1150 |
"π Analyze Transcript",
|
1151 |
-
variant="primary"
|
1152 |
-
size="lg"
|
1153 |
)
|
1154 |
save_record_btn = gr.Button(
|
1155 |
"πΎ Save Record",
|
@@ -1163,14 +1157,12 @@ def create_enhanced_interface():
|
|
1163 |
with gr.Tabs():
|
1164 |
with gr.TabItem("π Report"):
|
1165 |
analysis_output = gr.Markdown(
|
1166 |
-
label="Analysis Report"
|
1167 |
-
elem_classes=["output-markdown"]
|
1168 |
)
|
1169 |
|
1170 |
with gr.TabItem("π Visualizations"):
|
1171 |
plot_output = gr.Plot(
|
1172 |
-
label="Analysis Plots"
|
1173 |
-
info="Visual representation of assessment results"
|
1174 |
)
|
1175 |
|
1176 |
with gr.TabItem("π Data Tables"):
|
@@ -1217,14 +1209,12 @@ def create_enhanced_interface():
|
|
1217 |
label="Patient Age",
|
1218 |
value=8,
|
1219 |
minimum=1,
|
1220 |
-
maximum=120
|
1221 |
-
info="Age affects transcription model selection"
|
1222 |
)
|
1223 |
|
1224 |
audio_input = gr.Audio(
|
1225 |
type="filepath",
|
1226 |
-
label="Audio Recording"
|
1227 |
-
info="Upload .wav, .mp3, .m4a, or other audio files"
|
1228 |
)
|
1229 |
|
1230 |
transcribe_btn = gr.Button(
|
@@ -1236,8 +1226,7 @@ def create_enhanced_interface():
|
|
1236 |
transcription_output = gr.Textbox(
|
1237 |
label="Transcription Result",
|
1238 |
placeholder="Transcribed text will appear here...",
|
1239 |
-
lines=15
|
1240 |
-
info="CHAT-formatted transcription"
|
1241 |
)
|
1242 |
|
1243 |
transcription_status = gr.Markdown("")
|
|
|
1086 |
|
1087 |
patient_name = gr.Textbox(
|
1088 |
label="Patient Name",
|
1089 |
+
placeholder="Enter patient name"
|
|
|
1090 |
)
|
1091 |
record_id = gr.Textbox(
|
1092 |
label="Medical Record ID",
|
|
|
1098 |
label="Age (years)",
|
1099 |
value=8,
|
1100 |
minimum=1,
|
1101 |
+
maximum=120
|
|
|
1102 |
)
|
1103 |
gender = gr.Radio(
|
1104 |
["male", "female", "other"],
|
|
|
1126 |
# Sample transcript selection
|
1127 |
sample_selector = gr.Dropdown(
|
1128 |
choices=list(SAMPLE_TRANSCRIPTS.keys()),
|
1129 |
+
label="Load Sample Transcript"
|
|
|
1130 |
)
|
1131 |
|
1132 |
file_upload = gr.File(
|
1133 |
label="Upload Transcript File",
|
1134 |
+
file_types=[".txt", ".cha", ".pdf"]
|
|
|
1135 |
)
|
1136 |
|
1137 |
transcript = gr.Textbox(
|
1138 |
label="Speech Transcript (CHAT format preferred)",
|
1139 |
placeholder="Enter or upload transcript...",
|
1140 |
+
lines=12
|
|
|
1141 |
)
|
1142 |
|
1143 |
with gr.Row():
|
1144 |
analyze_btn = gr.Button(
|
1145 |
"π Analyze Transcript",
|
1146 |
+
variant="primary"
|
|
|
1147 |
)
|
1148 |
save_record_btn = gr.Button(
|
1149 |
"πΎ Save Record",
|
|
|
1157 |
with gr.Tabs():
|
1158 |
with gr.TabItem("π Report"):
|
1159 |
analysis_output = gr.Markdown(
|
1160 |
+
label="Analysis Report"
|
|
|
1161 |
)
|
1162 |
|
1163 |
with gr.TabItem("π Visualizations"):
|
1164 |
plot_output = gr.Plot(
|
1165 |
+
label="Analysis Plots"
|
|
|
1166 |
)
|
1167 |
|
1168 |
with gr.TabItem("π Data Tables"):
|
|
|
1209 |
label="Patient Age",
|
1210 |
value=8,
|
1211 |
minimum=1,
|
1212 |
+
maximum=120
|
|
|
1213 |
)
|
1214 |
|
1215 |
audio_input = gr.Audio(
|
1216 |
type="filepath",
|
1217 |
+
label="Audio Recording"
|
|
|
1218 |
)
|
1219 |
|
1220 |
transcribe_btn = gr.Button(
|
|
|
1226 |
transcription_output = gr.Textbox(
|
1227 |
label="Transcription Result",
|
1228 |
placeholder="Transcribed text will appear here...",
|
1229 |
+
lines=15
|
|
|
1230 |
)
|
1231 |
|
1232 |
transcription_status = gr.Markdown("")
|