add check for math word in word clouds
Browse files- handler.py +5 -5
handler.py
CHANGED
@@ -160,17 +160,17 @@ class Transcript:
|
|
160 |
for utt in self.utterances:
|
161 |
words = (utt.get_clean_text(remove_punct=True)).split(' ')
|
162 |
for word in words:
|
163 |
-
for math_word in utt.math_terms:
|
164 |
-
if math_word in word: continue
|
165 |
if word in stop_words: continue
|
166 |
if utt.role == 'teacher':
|
167 |
-
if word not in teacher_dict:
|
168 |
-
teacher_dict[word] = 0
|
169 |
-
teacher_dict[word] += 1
|
170 |
if utt.uptake == 1:
|
171 |
if word not in uptake_teacher_dict:
|
172 |
uptake_teacher_dict[word] = 0
|
173 |
uptake_teacher_dict[word] += 1
|
|
|
|
|
|
|
|
|
|
|
174 |
else:
|
175 |
if word not in student_dict:
|
176 |
student_dict[word] = 0
|
|
|
160 |
for utt in self.utterances:
|
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 |
+
if any(math_word in word for math_word in utt.math_terms): continue
|
170 |
+
if word not in teacher_dict:
|
171 |
+
teacher_dict[word] = 0
|
172 |
+
teacher_dict[word] += 1
|
173 |
+
|
174 |
else:
|
175 |
if word not in student_dict:
|
176 |
student_dict[word] = 0
|