small fix
Browse files- handler.py +5 -3
handler.py
CHANGED
@@ -87,7 +87,6 @@ class Utterance:
|
|
87 |
'wordCount': self.word_count,
|
88 |
'numMathTerms': self.num_math_terms,
|
89 |
'mathTerms': self.math_terms,
|
90 |
-
"mathTermsRaw": self.math_terms_raw,
|
91 |
}
|
92 |
|
93 |
def __repr__(self):
|
@@ -161,12 +160,15 @@ class Transcript:
|
|
161 |
words = (utt.get_clean_text(remove_punct=True)).split(' ')
|
162 |
for word in words:
|
163 |
if word in stop_words: continue
|
|
|
164 |
if utt.role == 'teacher':
|
165 |
if utt.uptake == 1:
|
166 |
if word not in uptake_teacher_dict:
|
167 |
uptake_teacher_dict[word] = 0
|
168 |
uptake_teacher_dict[word] += 1
|
169 |
-
|
|
|
|
|
170 |
if word not in teacher_dict:
|
171 |
teacher_dict[word] = 0
|
172 |
teacher_dict[word] += 1
|
@@ -413,7 +415,7 @@ def run_math_density(transcript):
|
|
413 |
utt.num_math_terms = num_matches
|
414 |
utt.math_terms = match_list
|
415 |
# utt.math_match_positions = list(matched_positions)
|
416 |
-
utt.math_terms_raw = [text[start:end] for start, end in matched_positions]
|
417 |
teacher_dict_list = []
|
418 |
student_dict_list = []
|
419 |
dict_list = []
|
|
|
87 |
'wordCount': self.word_count,
|
88 |
'numMathTerms': self.num_math_terms,
|
89 |
'mathTerms': self.math_terms,
|
|
|
90 |
}
|
91 |
|
92 |
def __repr__(self):
|
|
|
160 |
words = (utt.get_clean_text(remove_punct=True)).split(' ')
|
161 |
for word in words:
|
162 |
if word in stop_words: continue
|
163 |
+
# handle uptake case
|
164 |
if utt.role == 'teacher':
|
165 |
if utt.uptake == 1:
|
166 |
if word not in uptake_teacher_dict:
|
167 |
uptake_teacher_dict[word] = 0
|
168 |
uptake_teacher_dict[word] += 1
|
169 |
+
# ignore math words so they don't get tagged as general
|
170 |
+
if any(math_word in word for math_word in utt.math_terms): continue
|
171 |
+
if utt.role == 'teacher':
|
172 |
if word not in teacher_dict:
|
173 |
teacher_dict[word] = 0
|
174 |
teacher_dict[word] += 1
|
|
|
415 |
utt.num_math_terms = num_matches
|
416 |
utt.math_terms = match_list
|
417 |
# utt.math_match_positions = list(matched_positions)
|
418 |
+
# utt.math_terms_raw = [text[start:end] for start, end in matched_positions]
|
419 |
teacher_dict_list = []
|
420 |
student_dict_list = []
|
421 |
dict_list = []
|