@@ -47,7 +47,7 @@ def generate_user_response(self, botsim_action):
4747 """
4848 nl_message , semantic_message = "" , ""
4949 if botsim_action ["action" ] != "fail" :
50- template_responses , slots_responses = self .template_nlg .generate (botsim_action , "user" )
50+ template_responses , slots_responses = self .nlg_model .generate (botsim_action , "user" )
5151 if isinstance (template_responses [0 ], list ):
5252 for i , responses in enumerate (template_responses ):
5353 j = random .choice (range (0 , len (responses )))
@@ -341,7 +341,7 @@ def terminate_simulation_session_from_message(self,
341341 and not self .state ["intent_succeed" ]:
342342 self .state ["request_slots" ]["fall_back" ] = "UNK"
343343 bot_message = " " .join (bot_response )
344- best_matching_dialog_act , _ , _ , _ = self .intent_model .predict (bot_message , self .goal ["name" ])
344+ best_matching_dialog_act , _ , _ , _ = self .nlu_model .predict (bot_message , self .goal ["name" ])
345345 if best_matching_dialog_act == "" :
346346 return {"to_discard" : True }
347347 self .state ["intent_error" ] = (best_matching_dialog_act , self .state ["user_response" ], bot_message )
@@ -504,12 +504,12 @@ def enqueue_bot_actions_from_bot_messages(self,
504504 for bot_message in bot_api_response :
505505 # process one message in the bot api response list
506506 best_matching_dialog_act , best_matching_message , best_matching_score , matched_dialog_acts = \
507- self .intent_model .predict (bot_message , self .goal ["name" ])
507+ self .nlu_model .predict (bot_message , self .goal ["name" ])
508508 if bot_action ["round" ] == self .intent_check_turn_index :
509509 # check for intent errors on the intent_check_turn
510- for intent_index , task in enumerate (self .intent_model . intents ):
510+ for intent_index , task in enumerate (self .nlu_model . intent_templates ):
511511 if task ["intent" ] == self .goal ["name" ]: continue
512- _ , _ , match_score , _ = self .intent_model .predict (bot_message , task ["intent" ])
512+ _ , _ , match_score , _ = self .nlu_model .predict (bot_message , task ["intent" ])
513513 if match_score > best_matching_score :
514514 self .state ["request_slots" ]["fall_back" ] = "UNK"
515515 self .state ["intent_error" ] = \
0 commit comments