コード例 #1
0
    def execute_agent(self, configuration):
        """Runs the conversational agent and executes the dialogue by calling
        the basic components of IAI MovieBot

        Args:
            configuration: the settings for the agent

        """
        agent = Agent(configuration)
        agent.initialize()
        print(
            'The components for the conversation are initialized successfully.'
        )
        user_options = {}
        agent_response, user_options = agent.start_dialogue()
        print(f'AGENT: {agent_response}')
        while not agent.terminated_dialogue():
            utterance = input('User: '******'text': utterance})
            agent_response, user_options = agent.continue_dialogue(
                user_utterance, user_options)
            print(f'AGENT: {agent_response}')
            if user_options:
                print(list(user_options.values()))
        agent.end_dialogue()
コード例 #2
0
ファイル: evaluation.py プロジェクト: iai-group/moviebot
def get_slot_annotator(config):
    """Loads an agent with a given config.

    Args:
        config (Dict): Contents of a configuration file.

    Returns:
        SlotAnnotator: Returns a SlotAnnotator instance.
    """
    agent = Agent(config)
    agent.initialize()
    return agent.nlu.intents_checker.slot_annotator