hylee719 commited on
Commit
d51c12a
·
1 Parent(s): 0d3be54

change tuple assignment

Browse files
Files changed (1) hide show
  1. handler.py +5 -1
handler.py CHANGED
@@ -386,7 +386,11 @@ def run_math_density(transcript, uptake_speaker=None):
386
  matches = [match for match in matches if not any(match.start() in range(existing[0], existing[1]) for existing in matched_positions)]
387
  if len(matches) > 0:
388
  if math_terms_dict[term] not in math_word_cloud:
389
- math_word_cloud[math_terms_dict[term]] = (0, 'teacher' if utt.speaker == uptake_speaker else 'student')
 
 
 
 
390
  math_word_cloud[math_terms_dict[term]][0] += len(matches)
391
  match_list.append(math_terms_dict[term])
392
  # Update matched positions
 
386
  matches = [match for match in matches if not any(match.start() in range(existing[0], existing[1]) for existing in matched_positions)]
387
  if len(matches) > 0:
388
  if math_terms_dict[term] not in math_word_cloud:
389
+ math_word_cloud[math_terms_dict[term]] = (0, None)
390
+ if utt.speaker == uptake_speaker:
391
+ math_word_cloud[math_terms_dict[term]][1] = 'teacher'
392
+ else:
393
+ math_word_cloud[math_terms_dict[term]][1] = 'student'
394
  math_word_cloud[math_terms_dict[term]][0] += len(matches)
395
  match_list.append(math_terms_dict[term])
396
  # Update matched positions