Пример #1
0
    def train_from_human_classification(self, filename, language):
        'Method for training current bayesian filter from external human classification file'
	filehandler = open(filename, 'rb')
        content = pickle.load(filehandler)

        for entry_id in content:
            e = Entry(entry_id, list(content[entry_id])[1], list(content[entry_id])[2])
            if e.get_language() == language:
                self._add_to_human_classification(e, list(content[entry_id])[0])
        self.human.store()
        self.word_dict.store()
Пример #2
0
    def train_from_human_classification(self, filename, language):
        'Method for training current bayesian filter from external human classification file'
        filehandler = open(filename, 'rb')
        content = pickle.load(filehandler)

        for entry_id in content:
            e = Entry(entry_id,
                      list(content[entry_id])[1],
                      list(content[entry_id])[2])
            if e.get_language() == language:
                self._add_to_human_classification(e,
                                                  list(content[entry_id])[0])
        self.human.store()
        self.word_dict.store()