import gradio as gr import boto3 import json import pandas as pd import matplotlib.pyplot as plt import numpy as np import re import logging import os from PIL import Image import io import PyPDF2 from datetime import datetime # Configure logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) # AWS credentials for Bedrock API # For HuggingFace Spaces, set these as secrets in the Space settings AWS_ACCESS_KEY = os.getenv("AWS_ACCESS_KEY", "") AWS_SECRET_KEY = os.getenv("AWS_SECRET_KEY", "") AWS_REGION = os.getenv("AWS_REGION", "us-east-1") # Initialize Bedrock client if credentials are available bedrock_client = None if AWS_ACCESS_KEY and AWS_SECRET_KEY: try: bedrock_client = boto3.client( 'bedrock-runtime', aws_access_key_id=AWS_ACCESS_KEY, aws_secret_access_key=AWS_SECRET_KEY, region_name=AWS_REGION ) logger.info("Bedrock client initialized successfully") except Exception as e: logger.error(f"Failed to initialize Bedrock client: {str(e)}") # Sample transcript for the demo SAMPLE_TRANSCRIPT = """*PAR: today I would &-um like to talk about &-um a fun trip I took last &-um summer with my family. *PAR: we went to the &-um &-um beach [//] no to the mountains [//] I mean the beach actually. *PAR: there was lots of &-um &-um swimming and &-um sun. *PAR: we [/] we stayed for &-um three no [//] four days in a &-um hotel near the water [: ocean] [*]. *PAR: my favorite part was &-um building &-um castles with sand. *PAR: sometimes I forget [//] forgetted [: forgot] [*] what they call those things we built. *PAR: my brother he [//] he helped me dig a big hole. *PAR: we saw [/] saw fishies [: fish] [*] swimming in the water. *PAR: sometimes I wonder [/] wonder where fishies [: fish] [*] go when it's cold. *PAR: maybe they have [/] have houses under the water. *PAR: after swimming we [//] I eat [: ate] [*] &-um ice cream with &-um chocolate things on top. *PAR: what do you call those &-um &-um sprinkles! that's the word. *PAR: my mom said to &-um that I could have &-um two scoops next time. *PAR: I want to go back to the beach [/] beach next year.""" # =============================== # Utility Functions # =============================== def read_pdf(file_path): """Read text from a PDF file""" try: with open(file_path, 'rb') as file: pdf_reader = PyPDF2.PdfReader(file) text = "" for page in pdf_reader.pages: text += page.extract_text() return text except Exception as e: logger.error(f"Error reading PDF: {str(e)}") return "" def process_upload(file): """Process an uploaded file (PDF or text)""" if file is None: return "" file_path = file.name if file_path.endswith('.pdf'): return read_pdf(file_path) else: with open(file_path, 'r', encoding='utf-8', errors='ignore') as f: return f.read() # =============================== # AI Model Interface Functions # =============================== def call_bedrock(prompt, max_tokens=4096): """Call the AWS Bedrock API to analyze text using Claude""" if not bedrock_client: return "AWS credentials not configured. Please set your AWS credentials as secrets in the Space settings." try: body = json.dumps({ "anthropic_version": "bedrock-2023-05-31", "max_tokens": max_tokens, "messages": [ { "role": "user", "content": prompt } ], "temperature": 0.3, "top_p": 0.9 }) modelId = 'anthropic.claude-3-sonnet-20240229-v1:0' response = bedrock_client.invoke_model( body=body, modelId=modelId, accept='application/json', contentType='application/json' ) response_body = json.loads(response.get('body').read()) return response_body['content'][0]['text'] except Exception as e: logger.error(f"Error in call_bedrock: {str(e)}") return f"Error: {str(e)}" def generate_demo_response(prompt): """Generate a simulated response for demo purposes""" # This function generates a realistic but fake response for demo purposes # In a real deployment, you would call an actual LLM API random_seed = sum(ord(c) for c in prompt) % 1000 # Generate a seed based on prompt np.random.seed(random_seed) # Simulate speech factors with random but reasonable values factors = [ "Difficulty producing fluent speech", "Word retrieval issues", "Grammatical errors", "Repetitions and revisions", "Neologisms", "Perseveration", "Comprehension issues" ] occurrences = np.random.randint(1, 15, size=len(factors)) percentiles = np.random.randint(30, 95, size=len(factors)) # Simulate CASL scores domains = ["Lexical/Semantic", "Syntactic", "Supralinguistic"] scores = np.random.randint(80, 115, size=3) percentiles_casl = [int(np.interp(s, [70, 85, 100, 115, 130], [2, 16, 50, 84, 98])) for s in scores] perf_levels = [] for s in scores: if s < 70: perf_levels.append("Well Below Average") elif s < 85: perf_levels.append("Below Average") elif s < 115: perf_levels.append("Average") elif s < 130: perf_levels.append("Above Average") else: perf_levels.append("Well Above Average") # Build response response = "## Speech Factor Analysis\n\n" for i, factor in enumerate(factors): response += f"{factor}: {occurrences[i]}, {percentiles[i]}\n" response += "\n## CASL-2 Assessment\n\n" for i, domain in enumerate(domains): response += f"{domain} Skills: Standard Score ({scores[i]}), Percentile Rank ({percentiles_casl[i]}%), Performance Level ({perf_levels[i]})\n" response += "\n## Other analysis/Best plans of action:\n\n" suggestions = [ "Implement word-finding strategies with semantic cuing", "Practice structured narrative tasks with visual supports", "Use sentence formulation exercises with increasing complexity", "Incorporate self-monitoring techniques during structured conversations", "Work on grammatical forms through structured practice" ] for suggestion in suggestions: response += f"- {suggestion}\n" response += "\n## Explanation:\n\n" response += "Based on the analysis, this patient demonstrates moderate word-finding difficulties with compensatory strategies like filler words and repetitions. Their syntactic skills show some weakness in verb tense consistency. Treatment should focus on building vocabulary access, grammatical accuracy, and narrative structure using scaffolded support.\n" response += "\n## Additional Analysis:\n\n" response += "The patient shows relative strengths in conversation maintenance and topic coherence. Consider building on these strengths while addressing specific language formulation challenges. Recommended frequency: 2-3 sessions per week for 10-12 weeks with periodic reassessment." return response def generate_demo_transcription(audio_path): """Generate a simulated transcription response""" # In a real app, this would process an audio file return "*PAR: today I want to tell you about my favorite toy.\n*PAR: it's a &-um teddy bear that I got for my birthday.\n*PAR: he has &-um brown fur and a red bow.\n*PAR: I like to sleep with him every night.\n*PAR: sometimes I take him to school in my backpack." def generate_demo_qa_response(question): """Generate a simulated Q&A response""" qa_responses = { "what is casl": "CASL-2 (Comprehensive Assessment of Spoken Language, Second Edition) is a standardized assessment tool used by Speech-Language Pathologists to evaluate a child's oral language abilities across multiple domains including lexical/semantic, syntactic, and supralinguistic skills. It helps identify language disorders and guides intervention planning.", "how do i interpret scores": "CASL-2 scores include standard scores (mean=100, SD=15), percentile ranks, and performance levels. Standard scores below 85 indicate below average performance, 85-115 is average, and above 115 is above average. Percentile ranks show how a child performs relative to same-age peers.", "what activities help word finding": "Activities to improve word-finding skills include semantic feature analysis (describing attributes of objects), categorization tasks, word association games, rapid naming practice, and structured conversation with gentle cueing. Visual supports and semantic mapping can also be helpful.", "how often should therapy occur": "The recommended frequency for speech-language therapy typically ranges from 1-3 sessions per week, depending on the severity of the impairment. For moderate difficulties, twice weekly sessions of 30-45 minutes are common. Consistency is important for progress.", "when should i reassess": "Reassessment is typically recommended every 3-6 months to track progress and adjust treatment goals. For educational settings, annual reassessment is common. More frequent informal assessments can help guide ongoing intervention.", } # Simple keyword matching for demo purposes for key, response in qa_responses.items(): if key in question.lower(): return response return "I don't have specific information about that topic. For detailed professional guidance, consult with a licensed Speech-Language Pathologist who can provide advice specific to your situation." # =============================== # Analysis Functions # =============================== def parse_casl_response(response): """Parse the LLM response for CASL analysis into structured data""" lines = response.split('\n') data = { 'Factor': [], 'Occurrences': [], 'Severity': [] } casl_data = { 'Domain': ['Lexical/Semantic', 'Syntactic', 'Supralinguistic'], 'Standard Score': [0, 0, 0], 'Percentile': [0, 0, 0], 'Performance Level': ['', '', ''] } treatment_suggestions = [] explanation = "" additional_analysis = "" # Pattern to match factor lines factor_pattern = re.compile(r'([\w\s/]+):\s*(\d+)[,\s]+(\d+)') # Pattern to match CASL data casl_pattern = re.compile(r'(\w+/?\w*)\s+Skills:\s+Standard\s+Score\s+\((\d+)\),\s+Percentile\s+Rank\s+\((\d+)%\),\s+Performance\s+Level\s+\(([\w\s]+)\)') in_suggestions = False in_explanation = False in_additional = False for line in lines: line = line.strip() # Skip empty lines if not line: continue # Check for factor data factor_match = factor_pattern.search(line) if factor_match: factor = factor_match.group(1).strip() occurrences = int(factor_match.group(2)) severity = int(factor_match.group(3)) data['Factor'].append(factor) data['Occurrences'].append(occurrences) data['Severity'].append(severity) continue # Check for CASL data casl_match = casl_pattern.search(line) if casl_match: domain = casl_match.group(1) score = int(casl_match.group(2)) percentile = int(casl_match.group(3)) level = casl_match.group(4) if "Lexical" in domain: casl_data['Standard Score'][0] = score casl_data['Percentile'][0] = percentile casl_data['Performance Level'][0] = level elif "Syntactic" in domain: casl_data['Standard Score'][1] = score casl_data['Percentile'][1] = percentile casl_data['Performance Level'][1] = level elif "Supralinguistic" in domain: casl_data['Standard Score'][2] = score casl_data['Percentile'][2] = percentile casl_data['Performance Level'][2] = level continue # Check for section headers if "Other analysis/Best plans of action:" in line or "### Recommended Treatment Approaches" in line: in_suggestions = True in_explanation = False in_additional = False continue elif "Explanation:" in line or "### Clinical Rationale" in line: in_suggestions = False in_explanation = True in_additional = False continue elif "Additional Analysis:" in line: in_suggestions = False in_explanation = False in_additional = True continue # Add content to appropriate section if in_suggestions and line.startswith("- "): treatment_suggestions.append(line[2:]) # Remove the bullet point elif in_explanation: explanation += line + "\n" elif in_additional: additional_analysis += line + "\n" return { 'speech_factors': pd.DataFrame(data), 'casl_data': pd.DataFrame(casl_data), 'treatment_suggestions': treatment_suggestions, 'explanation': explanation, 'additional_analysis': additional_analysis } def create_casl_plots(speech_factors, casl_data): """Create visualizations for the CASL analysis results""" # Set a professional style for the plots plt.style.use('seaborn-v0_8-pastel') # Create figure with two subplots fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 6), dpi=100) # Plot speech factors - sorted by occurrence count if not speech_factors.empty: # Sort the dataframe speech_factors_sorted = speech_factors.sort_values('Occurrences', ascending=False) # Custom colors speech_colors = ['#4C72B0', '#55A868', '#C44E52', '#8172B3', '#CCB974', '#64B5CD', '#4C72B0'] # Create horizontal bar chart bars = ax1.barh(speech_factors_sorted['Factor'], speech_factors_sorted['Occurrences'], color=speech_colors[:len(speech_factors_sorted)]) # Add count labels at the end of each bar for bar in bars: width = bar.get_width() ax1.text(width + 0.3, bar.get_y() + bar.get_height()/2, f'{width:.0f}', ha='left', va='center') ax1.set_title('Speech Factors Analysis', fontsize=14, fontweight='bold') ax1.set_xlabel('Number of Occurrences', fontsize=11) # No y-label needed for horizontal bar chart # Remove top and right spines ax1.spines['top'].set_visible(False) ax1.spines['right'].set_visible(False) # Plot CASL domains domain_names = casl_data['Domain'] y_scores = casl_data['Standard Score'] # Custom color scheme casl_colors = ['#4C72B0', '#55A868', '#C44E52'] # Create bars with nice colors bars = ax2.bar(domain_names, y_scores, color=casl_colors) # Add score labels on top of each bar for bar in bars: height = bar.get_height() ax2.text(bar.get_x() + bar.get_width()/2., height + 1, f'{height:.0f}', ha='center', va='bottom') # Add score reference lines ax2.axhline(y=100, linestyle='--', color='gray', alpha=0.7, label='Average (100)') ax2.axhline(y=85, linestyle=':', color='orange', alpha=0.7, label='Below Average (<85)') ax2.axhline(y=115, linestyle=':', color='green', alpha=0.7, label='Above Average (>115)') # Add labels and title ax2.set_title('CASL-2 Standard Scores', fontsize=14, fontweight='bold') ax2.set_ylabel('Standard Score', fontsize=11) ax2.set_ylim(bottom=0, top=max(130, max(y_scores) + 15)) # Set y-axis limit with some padding # Add legend ax2.legend(loc='upper right', fontsize='small') # Remove top and right spines ax2.spines['top'].set_visible(False) ax2.spines['right'].set_visible(False) plt.tight_layout() # Save plot to buffer buf = io.BytesIO() plt.savefig(buf, format='png', bbox_inches='tight') buf.seek(0) plt.close() return buf def create_casl_radar_chart(speech_factors): """Create a radar chart for speech factors (percentiles)""" if speech_factors.empty or 'Severity' not in speech_factors.columns: # Create a placeholder image if no data plt.figure(figsize=(8, 8)) plt.text(0.5, 0.5, "No data available for radar chart", ha='center', va='center', fontsize=14) plt.axis('off') buf = io.BytesIO() plt.savefig(buf, format='png') buf.seek(0) plt.close() return buf # Prepare data for radar chart categories = speech_factors['Factor'].tolist() percentiles = speech_factors['Severity'].tolist() # Need to repeat first value to close the polygon categories = categories + [categories[0]] percentiles = percentiles + [percentiles[0]] # Convert to radians and calculate points N = len(categories) - 1 # Subtract 1 for the repeated point angles = [n / float(N) * 2 * np.pi for n in range(N)] angles += angles[:1] # Repeat the first angle to close the polygon # Create the plot fig = plt.figure(figsize=(8, 8)) ax = fig.add_subplot(111, polar=True) # Draw percentile lines with labels plt.xticks(angles[:-1], categories[:-1], size=12) ax.set_rlabel_position(0) plt.yticks([20, 40, 60, 80, 100], ["20", "40", "60", "80", "100"], color="grey", size=10) plt.ylim(0, 100) # Plot data ax.plot(angles, percentiles, linewidth=1, linestyle='solid', color='#4C72B0') ax.fill(angles, percentiles, color='#4C72B0', alpha=0.25) # Add title plt.title('Speech Factors Severity (Percentile)', size=15, fontweight='bold', pad=20) # Save to buffer buf = io.BytesIO() plt.savefig(buf, format='png', bbox_inches='tight') buf.seek(0) plt.close() return buf def analyze_transcript(transcript, age, gender): """Analyze a speech transcript using the CASL framework""" # Instructions for the LLM analysis instructions = """ You're a professional Speech-Language Pathologist analyzing this transcription sample. For your analysis, count occurrences of: 1. Difficulty producing fluent, grammatical speech - Speech that is slow, halting, with pauses while searching for words 2. Word retrieval issues - Trouble finding specific words, using fillers like "um", circumlocution, or semantically similar substitutions 3. Grammatical errors - Missing/incorrect function words, verb tense problems, simplified sentences 4. Repetitions and revisions - Repeating or restating due to word-finding or sentence construction difficulties 5. Neologisms - Creating nonexistent "new" words 6. Perseveration - Unintentionally repeating words or phrases 7. Comprehension issues - Difficulty understanding complex sentences or fast speech Analyze using the CASL-2 (Comprehensive Assessment of Spoken Language) framework: Lexical/Semantic Skills: - Evaluate vocabulary diversity, word retrieval difficulties, and semantic precision - Estimate Standard Score (mean=100, SD=15), percentile rank, and performance level Syntactic Skills: - Assess sentence structure, grammatical accuracy, and syntactic complexity - Estimate Standard Score, percentile rank, and performance level Supralinguistic Skills: - Evaluate figurative language use, inferencing, and contextual understanding - Estimate Standard Score, percentile rank, and performance level Format your analysis with: 1. Speech factor counts with severity percentiles 2. CASL-2 domain scores with performance levels 3. Treatment recommendations based on findings 4. Brief explanation of your rationale 5. Any additional insights """ # Prepare prompt for Claude prompt = f""" You are an experienced Speech-Language Pathologist analyzing this transcript for a patient who is {age} years old and {gender}. TRANSCRIPT: {transcript} {instructions} Be precise, professional, and empathetic in your analysis. Focus on the linguistic patterns present in the sample. """ # Call the appropriate API or fallback to demo mode if bedrock_client: response = call_bedrock(prompt) else: response = generate_demo_response(prompt) # Parse the response results = parse_casl_response(response) # Create visualizations plot_image = create_casl_plots(results['speech_factors'], results['casl_data']) radar_image = create_casl_radar_chart(results['speech_factors']) return results, plot_image, radar_image, response def generate_report(patient_info, analysis_results, report_type="formal"): """Generate a professional report based on analysis results""" patient_name = patient_info.get("name", "") record_id = patient_info.get("record_id", "") age = patient_info.get("age", "") gender = patient_info.get("gender", "") assessment_date = patient_info.get("assessment_date", datetime.now().strftime('%m/%d/%Y')) clinician = patient_info.get("clinician", "") prompt = f""" You are a professional Speech-Language Pathologist creating a {report_type} report based on an assessment. PATIENT INFORMATION: Name: {patient_name} Record ID: {record_id} Age: {age} Gender: {gender} Assessment Date: {assessment_date} Clinician: {clinician} ASSESSMENT RESULTS: {analysis_results} Please create a professional {report_type} report that includes: 1. Patient information and assessment details 2. Summary of findings (strengths and areas of concern) 3. Detailed analysis of language domains 4. Specific recommendations for therapy 5. Recommendation for frequency and duration of services Use clear, professional language appropriate for {'educational professionals' if report_type == 'formal' else 'parents and caregivers'}. Format the report with proper headings and sections. """ # Call the API or use demo mode if bedrock_client: report = call_bedrock(prompt, max_tokens=6000) else: # For demo, create a simulated report if report_type == 'formal': report = f""" # FORMAL LANGUAGE ASSESSMENT REPORT **Date of Assessment:** {assessment_date} **Clinician:** {clinician} ## PATIENT INFORMATION **Name:** {patient_name} **Record ID:** {record_id} **Age:** {age} **Gender:** {gender} ## ASSESSMENT SUMMARY The patient was assessed using the Comprehensive Assessment of Spoken Language, Second Edition (CASL-2) to evaluate language skills across multiple domains. The assessment involved language sample analysis and standardized testing. ## KEY FINDINGS **Areas of Strength:** - Ability to maintain conversational topics - Good vocabulary for everyday topics - Strong nonverbal communication skills **Areas of Challenge:** - Word-finding difficulties during conversation - Grammatical errors in complex sentences - Difficulty with abstract language concepts ## DETAILED ANALYSIS **Lexical/Semantic Skills:** Standard Score 91 (27th percentile) - Low Average Range The student demonstrates adequate vocabulary but struggles with retrieving specific words during conversation. Word-finding pauses were noted throughout the language sample. **Syntactic Skills:** Standard Score 85 (16th percentile) - Low Average Range The student shows difficulty with complex grammatical structures, particularly verb tense consistency and complex sentence formation. **Supralinguistic Skills:** Standard Score 83 (13th percentile) - Below Average Range The student struggles with understanding figurative language, making inferences, and comprehending abstract concepts. ## RECOMMENDATIONS 1. Speech-Language Therapy focused on: - Word-finding strategies using semantic feature analysis - Structured grammatical exercises to improve sentence complexity - Explicit instruction in figurative language comprehension - Narrative language development using visual supports 2. Frequency of service: Twice weekly sessions of 30 minutes each for 12 weeks, followed by a reassessment to measure progress. 3. Classroom accommodations including: - Extended time for verbal responses - Visual supports for complex instructions - Pre-teaching of vocabulary for academic units ## PROGNOSIS The prognosis for improvement is good with consistent therapeutic intervention and support. Regular reassessment is recommended to monitor progress. Respectfully submitted, {clinician} Speech-Language Pathologist """ else: report = f""" # PARENT-FRIENDLY LANGUAGE ASSESSMENT SUMMARY **Date of Assessment:** {assessment_date} **Clinician:** {clinician} ## PATIENT INFORMATION **Name:** {patient_name} **Record ID:** {record_id} **Age:** {age} **Gender:** {gender} ## ASSESSMENT SUMMARY We completed a language assessment to better understand your child's communication strengths and challenges. This helps us create a plan to support their development. ## KEY FINDINGS **Areas of Strength:** - Ability to maintain conversational topics - Good vocabulary for everyday topics - Strong nonverbal communication skills **Areas of Challenge:** - Word-finding difficulties during conversation - Grammatical errors in complex sentences - Difficulty with abstract language concepts ## DETAILED ANALYSIS **Lexical/Semantic Skills:** Standard Score 91 (27th percentile) - Low Average Range The student demonstrates adequate vocabulary but struggles with retrieving specific words during conversation. Word-finding pauses were noted throughout the language sample. **Syntactic Skills:** Standard Score 85 (16th percentile) - Low Average Range The student shows difficulty with complex grammatical structures, particularly verb tense consistency and complex sentence formation. **Supralinguistic Skills:** Standard Score 83 (13th percentile) - Below Average Range The student struggles with understanding figurative language, making inferences, and comprehending abstract concepts. ## RECOMMENDATIONS We recommend: - Word-finding strategies using semantic feature analysis - Structured grammatical exercises to improve sentence complexity - Explicit instruction in figurative language comprehension - Narrative language development using visual supports 2. We recommend therapy twice a week for 30 minutes. This consistency will help your child make better progress. 3. In school, your child may benefit from: - Extended time for verbal responses - Visual supports for complex instructions - Pre-teaching of vocabulary for academic units ## PROGNOSIS With regular therapy and support at home, we expect your child to make good progress in these areas. Please reach out with any questions! {clinician} Speech-Language Pathologist """ return report def transcribe_audio(audio_path, patient_age): """Transcribe an audio recording using CHAT format""" # In a real implementation, this would use a speech-to-text service # For demo purposes, we'll return a simulated transcription if bedrock_client: # In a real implementation, you would process the audio file and send it to a transcription service # Here we just simulate the result transcription = generate_demo_transcription(audio_path) else: transcription = generate_demo_transcription(audio_path) return transcription def answer_slp_question(question): """Answer a question about SLP practice or CASL assessment""" prompt = f""" You are an experienced Speech-Language Pathologist answering a question from a colleague. QUESTION: {question} Please provide a clear, evidence-based answer focused specifically on the question asked. Reference best practices and current research where appropriate. Keep your answer concise but comprehensive. """ if bedrock_client: answer = call_bedrock(prompt) else: answer = generate_demo_qa_response(question) return answer # =============================== # Gradio Interface # =============================== def create_interface(): """Create the main Gradio interface""" # Use a simple theme with default colors custom_theme = gr.themes.Soft( font=[gr.themes.GoogleFont("Inter"), "system-ui", "sans-serif"] ) with gr.Blocks(theme=custom_theme, css=""" .header { text-align: center; margin-bottom: 20px; } .header img { max-height: 100px; margin-bottom: 10px; } .container { border-radius: 10px; padding: 10px; margin-bottom: 20px; } .patient-info { background-color: #e3f2fd; } .speech-sample { background-color: #f0f8ff; } .results-container { background-color: #f9f9f9; } .viz-container { display: flex; justify-content: center; margin-bottom: 20px; } .footer { text-align: center; margin-top: 30px; padding: 10px; font-size: 0.8em; color: #78909C; } .info-box { background-color: #e8f5e9; border-left: 4px solid #4CAF50; padding: 10px 15px; margin-bottom: 15px; border-radius: 4px; } .warning-box { background-color: #fff8e1; border-left: 4px solid #FFC107; padding: 10px 15px; border-radius: 4px; } .markdown-text h3 { color: #2C7FB8; border-bottom: 1px solid #eaeaea; padding-bottom: 5px; } .evidence-table { border-collapse: collapse; width: 100%; } .evidence-table th, .evidence-table td { border: 1px solid #ddd; padding: 8px; text-align: left; } .evidence-table th { background-color: #f5f7fa; color: #333; } .evidence-table tr:nth-child(even) { background-color: #f9f9f9; } .tab-content { padding: 15px; background-color: white; border-radius: 0 0 8px 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); } """) as app: # Create header with logo gr.HTML( """
A comprehensive assessment tool for Speech-Language Pathologists
Factor | Evidence-based Approaches | References |
---|---|---|
Word Retrieval | Semantic feature analysis, phonological cueing, word generation tasks | Boyle, 2010; Kiran & Thompson, 2003 |
Grammatical Errors | Treatment of Underlying Forms (TUF), Morphosyntactic therapy | Thompson et al., 2003; Ebbels, 2014 |
Fluency/Prosody | Rate control, rhythmic cueing, contrastive stress exercises | Ballard et al., 2010; Tamplin & Baker, 2017 |