@@ -24,7 +24,7 @@ def inference(conversation, workspace_id, test_data, max_retries=10, max_thread=
2424 attempt = 1
2525 while attempt <= max_retries :
2626 try :
27- prediction_json = retrieve_classifier_response (
27+ prediction_json = skills_util . retrieve_classifier_response (
2828 conversation , workspace_id , test_example , True )
2929 time .sleep (.3 )
3030
@@ -118,25 +118,6 @@ def thread_inference(conversation, workspace_id, test_data,
118118 result_df = pd .DataFrame (data = result )
119119 return result_df
120120
121- def retrieve_classifier_response (conversation , workspace_id , text_input , alternate_intents = False ):
122- """
123- retrieve classifier response
124- :param conversation: instance
125- :param workspace_id: workspace or skill id
126- :param text_input: the input utterance
127- :param alternate_intents:
128- :return response:
129- """
130- response = conversation .message (
131- input = {
132- 'message_type' : 'text' ,
133- 'text' : text_input
134- },
135- workspace_id = workspace_id ,
136- alternate_intents = alternate_intents ,
137- ).get_result ()
138- return response
139-
140121def get_intents_confidences (conversation , workspace_id , text_input ):
141122 """
142123 Retrieve a list of confidence for analysis purpose
@@ -145,7 +126,7 @@ def get_intents_confidences(conversation, workspace_id, text_input):
145126 :param text_input: input utterance
146127 :return intent_conf: intent confidences
147128 """
148- response_info = retrieve_classifier_response (
129+ response_info = skills_util . retrieve_classifier_response (
149130 conversation , workspace_id , text_input , True )['intents' ]
150131 intent_conf = [(r ['intent' ], r ['confidence' ]) for r in response_info ]
151132 return intent_conf
0 commit comments