class StudentAgent:
    def __init__(self, verbose):
        self._verbose = verbose

        self.knowledge = Knowledge()
        self.knowledge.add_to_memory(CS4635Context())

    # Takes in list of words, returns question_object and data_requested
    def input_output(self, word_list):
        context = self.knowledge.infer_context(word_list)

        context.infer_topic(word_list)
        _data_requested = context.topic

        qframe = QuestionFrame(word_list, context)
        _question_object = qframe.object

        return _question_object, _data_requested
Example #2
0
class StudentAgent:
    def __init__(self, verbose):
        self._verbose = verbose

        self.knowledge = Knowledge()
        self.knowledge.add_to_memory(CS4635Context())

        self.invalid_list = list()

    def input_output(self, word_list):
        # Understand
        context = self.knowledge.infer_context(word_list)
        working_memory = self.knowledge.understand(word_list, context)

        if working_memory is None:
            self.invalid_list.append(word_list)

        # Classify
        case = self.knowledge.classify(working_memory, context)

        _intent = case.label
        return _intent