update to only include top 50 overall words for word clouds
Browse files- handler.py +4 -2
handler.py
CHANGED
|
@@ -500,7 +500,9 @@ class EndpointHandler():
|
|
| 500 |
word_cloud, uptake_word_cloud, teacher_general_cloud, student_general_cloud = transcript.get_word_clouds()
|
| 501 |
teacher_cloud = teacher_math_cloud + teacher_general_cloud
|
| 502 |
student_cloud = student_math_cloud + student_general_cloud
|
| 503 |
-
|
| 504 |
-
|
|
|
|
|
|
|
| 505 |
|
| 506 |
return return_dict
|
|
|
|
| 500 |
word_cloud, uptake_word_cloud, teacher_general_cloud, student_general_cloud = transcript.get_word_clouds()
|
| 501 |
teacher_cloud = teacher_math_cloud + teacher_general_cloud
|
| 502 |
student_cloud = student_math_cloud + student_general_cloud
|
| 503 |
+
sorted_teacher_cloud = sorted(teacher_cloud, key=lambda x: x['value'], reverse=True)[:50]
|
| 504 |
+
sorted_student_cloud = sorted(student_cloud, key=lambda x: x['value'], reverse=True)[:50]
|
| 505 |
+
return_dict['teacherTopWords'] = sorted_teacher_cloud
|
| 506 |
+
return_dict['studentTopWords'] = sorted_student_cloud
|
| 507 |
|
| 508 |
return return_dict
|