Spaces:
Sleeping
Sleeping
Update annotated_casl_app.py
Browse files- annotated_casl_app.py +6 -6
annotated_casl_app.py
CHANGED
|
@@ -1388,7 +1388,7 @@ with gr.Blocks(title="Speech Analysis", theme=gr.themes.Soft()) as demo:
|
|
| 1388 |
example_btn = gr.Button("π Load Example Transcript", variant="secondary", size="sm")
|
| 1389 |
|
| 1390 |
# Single main analysis button
|
| 1391 |
-
ultimate_analysis_btn = gr.Button("π Run Complete
|
| 1392 |
|
| 1393 |
with gr.Column(scale=3):
|
| 1394 |
status_display = gr.Markdown("Ready to analyze transcript")
|
|
@@ -1683,7 +1683,7 @@ with gr.Blocks(title="Speech Analysis", theme=gr.themes.Soft()) as demo:
|
|
| 1683 |
|
| 1684 |
# STEP 4: Create the final comprehensive prompt
|
| 1685 |
final_prompt = f"""
|
| 1686 |
-
You are a speech-language pathologist conducting the FINAL COMPREHENSIVE 12-SECTION
|
| 1687 |
|
| 1688 |
Patient: {age}-year-old {gender}
|
| 1689 |
|
|
@@ -1781,8 +1781,8 @@ with gr.Blocks(title="Speech Analysis", theme=gr.themes.Soft()) as demo:
|
|
| 1781 |
|
| 1782 |
return annotated_transcript, analysis_result, "β
Complete analysis finished!"
|
| 1783 |
|
| 1784 |
-
def
|
| 1785 |
-
"""Run the complete
|
| 1786 |
if not transcript_content or len(transcript_content.strip()) < 50:
|
| 1787 |
return "Error: Please provide a longer transcript for analysis.", "", "β Error"
|
| 1788 |
|
|
@@ -1795,11 +1795,11 @@ with gr.Blocks(title="Speech Analysis", theme=gr.themes.Soft()) as demo:
|
|
| 1795 |
# Step 2: Run ultimate analysis
|
| 1796 |
ultimate_result = run_ultimate_analysis(annotated_transcript, transcript_content, age, gender, slp_notes)
|
| 1797 |
|
| 1798 |
-
return annotated_transcript, ultimate_result, "β
Complete
|
| 1799 |
|
| 1800 |
# Single main event handler
|
| 1801 |
ultimate_analysis_btn.click(
|
| 1802 |
-
fn=
|
| 1803 |
inputs=[transcript_input, age_input, gender_input, slp_notes_input],
|
| 1804 |
outputs=[annotated_output, analysis_output, status_display]
|
| 1805 |
)
|
|
|
|
| 1388 |
example_btn = gr.Button("π Load Example Transcript", variant="secondary", size="sm")
|
| 1389 |
|
| 1390 |
# Single main analysis button
|
| 1391 |
+
ultimate_analysis_btn = gr.Button("π Run Complete Speech Analysis", variant="primary", size="lg")
|
| 1392 |
|
| 1393 |
with gr.Column(scale=3):
|
| 1394 |
status_display = gr.Markdown("Ready to analyze transcript")
|
|
|
|
| 1683 |
|
| 1684 |
# STEP 4: Create the final comprehensive prompt
|
| 1685 |
final_prompt = f"""
|
| 1686 |
+
You are a speech-language pathologist conducting the FINAL COMPREHENSIVE 12-SECTION SPEECH ANALYSIS.
|
| 1687 |
|
| 1688 |
Patient: {age}-year-old {gender}
|
| 1689 |
|
|
|
|
| 1781 |
|
| 1782 |
return annotated_transcript, analysis_result, "β
Complete analysis finished!"
|
| 1783 |
|
| 1784 |
+
def run_complete_speech_analysis(transcript_content, age, gender, slp_notes):
|
| 1785 |
+
"""Run the complete speech analysis pipeline with ultimate analysis"""
|
| 1786 |
if not transcript_content or len(transcript_content.strip()) < 50:
|
| 1787 |
return "Error: Please provide a longer transcript for analysis.", "", "β Error"
|
| 1788 |
|
|
|
|
| 1795 |
# Step 2: Run ultimate analysis
|
| 1796 |
ultimate_result = run_ultimate_analysis(annotated_transcript, transcript_content, age, gender, slp_notes)
|
| 1797 |
|
| 1798 |
+
return annotated_transcript, ultimate_result, "β
Complete speech analysis finished!"
|
| 1799 |
|
| 1800 |
# Single main event handler
|
| 1801 |
ultimate_analysis_btn.click(
|
| 1802 |
+
fn=run_complete_speech_analysis,
|
| 1803 |
inputs=[transcript_input, age_input, gender_input, slp_notes_input],
|
| 1804 |
outputs=[annotated_output, analysis_output, status_display]
|
| 1805 |
)
|