sparshmehta commited on
Commit
216875f
·
verified ·
1 Parent(s): 1b24077

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -5
app.py CHANGED
@@ -56,9 +56,9 @@ class ProgressTracker:
56
  self.status = status_container
57
  self.progress = progress_bar
58
  self.current_step = 0
59
- self.total_steps = 5 # Total number of main processing steps
60
- self.substep_container = st.empty() # Add container for substep details
61
- self.metrics_container = st.container() # Add container for metrics
62
 
63
  def update(self, progress: float, message: str, substep: str = "", metrics: Dict[str, Any] = None):
64
  """Update progress bar and status message with enhanced UI feedback
@@ -2066,7 +2066,16 @@ class MentorEvaluator:
2066
  )
2067
  progress.next_step()
2068
 
2069
- # Step 4: Analyze teaching content
 
 
 
 
 
 
 
 
 
2070
  progress.update(0.0, "Analyzing teaching content...")
2071
  teaching_analysis = self.content_analyzer.analyze_content(
2072
  transcript,
@@ -2074,10 +2083,11 @@ class MentorEvaluator:
2074
  )
2075
  progress.next_step()
2076
 
2077
- # Step 5: Generate final evaluation
2078
  progress.update(0.0, "Generating final evaluation...")
2079
  evaluation = {
2080
  "audio_features": audio_features,
 
2081
  "transcript": transcript,
2082
  "teaching": teaching_analysis,
2083
  "recommendations": self._generate_recommendations(audio_features, teaching_analysis)
 
56
  self.status = status_container
57
  self.progress = progress_bar
58
  self.current_step = 0
59
+ self.total_steps = 6 # Update total steps to include speech metrics
60
+ self.substep_container = st.empty()
61
+ self.metrics_container = st.container()
62
 
63
  def update(self, progress: float, message: str, substep: str = "", metrics: Dict[str, Any] = None):
64
  """Update progress bar and status message with enhanced UI feedback
 
2066
  )
2067
  progress.next_step()
2068
 
2069
+ # Step 4: Calculate speech metrics (Add this step)
2070
+ progress.update(0.0, "Analyzing speech patterns...")
2071
+ speech_metrics = self._evaluate_speech_metrics(
2072
+ transcript,
2073
+ audio_features,
2074
+ progress_callback=lambda p, m: progress.update(p, "Analyzing speech patterns...", m)
2075
+ )
2076
+ progress.next_step()
2077
+
2078
+ # Step 5: Analyze teaching content
2079
  progress.update(0.0, "Analyzing teaching content...")
2080
  teaching_analysis = self.content_analyzer.analyze_content(
2081
  transcript,
 
2083
  )
2084
  progress.next_step()
2085
 
2086
+ # Step 6: Generate final evaluation
2087
  progress.update(0.0, "Generating final evaluation...")
2088
  evaluation = {
2089
  "audio_features": audio_features,
2090
+ "speech_metrics": speech_metrics, # Include speech metrics in the evaluation
2091
  "transcript": transcript,
2092
  "teaching": teaching_analysis,
2093
  "recommendations": self._generate_recommendations(audio_features, teaching_analysis)