def whether_give_up(customer_utterance, senta_gru, confirm_interpreter):
    intent = judge_confirm_classification(customer_utterance, senta_gru,
                                          confirm_interpreter)
    print("whether_give_up", intent)
    if intent == "no" or intent == "stop":
        return True
    else:
        return False
Esempio n. 2
0
def confirm_consult_weather(customer_utterance, confirm_interpreter, senta_gru,
                            city_ls):
    ie_slot_result = ie_city_date(customer_utterance, city_ls)
    if ie_slot_result:
        print("nlu change", ie_slot_result)
        return "change", ie_slot_result
    confirm_state = confirm_nlu.judge_confirm_classification(
        customer_utterance, senta_gru, confirm_interpreter)
    print(confirm_state)
    return confirm_state, None
Esempio n. 3
0
def confirm_plan_ticket(customer_utterance, lac, intent_model, senta_gru,
                        confirm_interpreter):
    intent, entities = intent_model.get_intent(customer_utterance)
    ie_slot_result = ie_all_plan_ticket(customer_utterance, lac, entities)
    if ie_slot_result:
        return "change", ie_slot_result
    confirm_state = confirm_nlu.judge_confirm_classification(
        customer_utterance, senta_gru, confirm_interpreter)
    print(confirm_state)
    return confirm_state, None
def confirm_plan_scenic_spot(customer_utterance, lac, intent_model, senta_gru, confirm_interpreter, schemes):
    if schemes:
        scheme_no = ie_scheme_no(customer_utterance, [i for i in range(len(schemes))], lac)
        if scheme_no:
            if scheme_no == "overflow":
                return "nothing", None
            return "yes", scheme_no
    intent, entities = intent_model.get_intent(customer_utterance)
    ie_slot_result = ie_all_plan_scenic_spot(customer_utterance, lac, entities)
    if ie_slot_result:
        return "change", ie_slot_result
    confirm_state = confirm_nlu.judge_confirm_classification(customer_utterance, senta_gru, confirm_interpreter)
    print(confirm_state)
    return confirm_state, None
Esempio n. 5
0
def select_plan_ticket(customer_utterance, lac, intent_model, senta_gru,
                       confirm_interpreter, solutions):
    if solutions:
        solution_no = ie_solution_no(customer_utterance, solutions.keys(), lac)
        if solution_no:
            if solution_no == "overflow":
                return "nothing", None
            return "select_done", solution_no
    intent, entities = intent_model.get_intent(customer_utterance)
    ie_slot_result = ie_all_plan_ticket(customer_utterance, lac, entities)
    if ie_slot_result:
        return "change", ie_slot_result
    confirm_state = confirm_nlu.judge_confirm_classification(
        customer_utterance, senta_gru, confirm_interpreter)
    print(confirm_state)
    return confirm_state, None