small fix
Browse files- handler.py +7 -2
handler.py
CHANGED
|
@@ -181,9 +181,11 @@ class Transcript:
|
|
| 181 |
for word in teacher_dict.keys():
|
| 182 |
teacher_dict_list.append(
|
| 183 |
{'text': word, 'value': teacher_dict[word], 'category': 'general'})
|
|
|
|
| 184 |
for word in student_dict.keys():
|
| 185 |
student_dict_list.append(
|
| 186 |
{'text': word, 'value': student_dict[word], 'category': 'general'})
|
|
|
|
| 187 |
sorted_dict_list = sorted(dict_list, key=lambda x: x['value'], reverse=True)
|
| 188 |
sorted_uptake_dict_list = sorted(uptake_dict_list, key=lambda x: x['value'], reverse=True)
|
| 189 |
return sorted_dict_list[:50], sorted_uptake_dict_list[:50], teacher_dict_list, student_dict_list
|
|
@@ -407,15 +409,18 @@ def run_math_density(transcript):
|
|
| 407 |
utt.math_terms = match_list
|
| 408 |
teacher_dict_list = []
|
| 409 |
student_dict_list = []
|
|
|
|
| 410 |
for word in teacher_math_word_cloud.keys():
|
| 411 |
teacher_dict_list.append(
|
| 412 |
{'text': word, 'value': teacher_math_word_cloud[word], 'category': "math"})
|
|
|
|
| 413 |
for word in student_math_word_cloud.keys():
|
| 414 |
student_dict_list.append(
|
| 415 |
-
{'text': word, 'value': student_math_word_cloud[word], 'category': "math"})
|
|
|
|
| 416 |
sorted_dict_list = sorted(dict_list, key=lambda x: x['value'], reverse=True)
|
| 417 |
# return sorted_dict_list[:50]
|
| 418 |
-
return sorted_dict_list, teacher_dict_list, student_dict_list
|
| 419 |
|
| 420 |
class EndpointHandler():
|
| 421 |
def __init__(self, path="."):
|
|
|
|
| 181 |
for word in teacher_dict.keys():
|
| 182 |
teacher_dict_list.append(
|
| 183 |
{'text': word, 'value': teacher_dict[word], 'category': 'general'})
|
| 184 |
+
dict_list.append({'text': word, 'value': teacher_dict[word], 'category': 'general'})
|
| 185 |
for word in student_dict.keys():
|
| 186 |
student_dict_list.append(
|
| 187 |
{'text': word, 'value': student_dict[word], 'category': 'general'})
|
| 188 |
+
dict_list.append({'text': word, 'value': student_dict[word], 'category': 'general'})
|
| 189 |
sorted_dict_list = sorted(dict_list, key=lambda x: x['value'], reverse=True)
|
| 190 |
sorted_uptake_dict_list = sorted(uptake_dict_list, key=lambda x: x['value'], reverse=True)
|
| 191 |
return sorted_dict_list[:50], sorted_uptake_dict_list[:50], teacher_dict_list, student_dict_list
|
|
|
|
| 409 |
utt.math_terms = match_list
|
| 410 |
teacher_dict_list = []
|
| 411 |
student_dict_list = []
|
| 412 |
+
dict_list = []
|
| 413 |
for word in teacher_math_word_cloud.keys():
|
| 414 |
teacher_dict_list.append(
|
| 415 |
{'text': word, 'value': teacher_math_word_cloud[word], 'category': "math"})
|
| 416 |
+
dict_list.append({'text': word, 'value': teacher_math_word_cloud[word], 'category': "math"})
|
| 417 |
for word in student_math_word_cloud.keys():
|
| 418 |
student_dict_list.append(
|
| 419 |
+
{'text': word, 'value': student_math_word_cloud[word], 'category': "math"})
|
| 420 |
+
dict_list.append({'text': word, 'value': student_math_word_cloud[word], 'category': "math"})
|
| 421 |
sorted_dict_list = sorted(dict_list, key=lambda x: x['value'], reverse=True)
|
| 422 |
# return sorted_dict_list[:50]
|
| 423 |
+
return sorted_dict_list[:50], teacher_dict_list, student_dict_list
|
| 424 |
|
| 425 |
class EndpointHandler():
|
| 426 |
def __init__(self, path="."):
|