hylee
commited on
Commit
·
8e1280d
1
Parent(s):
766c6d0
return json in camel case
Browse files- handler.py +7 -7
handler.py
CHANGED
@@ -8,7 +8,7 @@ nltk.download('stopwords')
|
|
8 |
|
9 |
from utils import clean_str, clean_str_nopunct
|
10 |
import torch
|
11 |
-
from utils import MultiHeadModel, BertInputBuilder, get_num_words
|
12 |
|
13 |
import transformers
|
14 |
from transformers import BertTokenizer, BertForSequenceClassification
|
@@ -360,16 +360,16 @@ class EndpointHandler():
|
|
360 |
question_model.run_inference(transcript)
|
361 |
transcript.update_utterance_roles(uptake_speaker)
|
362 |
transcript.calculate_aggregate_word_count()
|
363 |
-
return_dict = {'
|
364 |
talk_dist, talk_len = transcript.get_talk_distribution_and_length(uptake_speaker)
|
365 |
-
return_dict['
|
366 |
-
return_dict['
|
367 |
talk_timeline = transcript.get_talk_timeline()
|
368 |
talk_moments = talk_timeline
|
369 |
-
return_dict['
|
370 |
word_cloud, uptake_word_cloud = transcript.get_word_cloud_dicts()
|
371 |
-
return_dict['
|
372 |
-
return_dict['
|
373 |
|
374 |
|
375 |
return return_dict
|
|
|
8 |
|
9 |
from utils import clean_str, clean_str_nopunct
|
10 |
import torch
|
11 |
+
from utils import MultiHeadModel, BertInputBuilder, get_num_words, MATH_PREFIXES, MATH_WORDS
|
12 |
|
13 |
import transformers
|
14 |
from transformers import BertTokenizer, BertForSequenceClassification
|
|
|
360 |
question_model.run_inference(transcript)
|
361 |
transcript.update_utterance_roles(uptake_speaker)
|
362 |
transcript.calculate_aggregate_word_count()
|
363 |
+
return_dict = {'talkDistribution': None, 'talkLength': None, 'talkMoments': None, 'commonTopWords': None, 'uptakeTopWords': None}
|
364 |
talk_dist, talk_len = transcript.get_talk_distribution_and_length(uptake_speaker)
|
365 |
+
return_dict['talkDistribution'] = talk_dist
|
366 |
+
return_dict['talkLength'] = talk_len
|
367 |
talk_timeline = transcript.get_talk_timeline()
|
368 |
talk_moments = talk_timeline
|
369 |
+
return_dict['talkMoments'] = talk_moments
|
370 |
word_cloud, uptake_word_cloud = transcript.get_word_cloud_dicts()
|
371 |
+
return_dict['commonTopWords'] = word_cloud
|
372 |
+
return_dict['uptakeTopwords'] = uptake_word_cloud
|
373 |
|
374 |
|
375 |
return return_dict
|