Exemple #1
0
    def run_train(cls, pkgs_classifications):
        bag_of_words = BagOfWords()
        pkgs_list = pkgs_classifications.keys()
        axi = xapian.Database(XAPIAN_DATABASE_PATH)

        bag_of_words.train_model(pkgs_list, axi)
        BagOfWords.save(bag_of_words, BagOfWords.BAG_OF_WORDS_MODEL)
Exemple #2
0
    def run_train(cls, pkgs_classifications):
        bag_of_words = BagOfWords()
        pkgs_list = pkgs_classifications.keys()
        axi = xapian.Database(XAPIAN_DATABASE_PATH)

        bag_of_words.train_model(pkgs_list, axi)
        BagOfWords.save(bag_of_words, BagOfWords.BAG_OF_WORDS_MODEL)
    def get_model(self, cross_item_score):
        super(CrossValidationBOW, self).get_model(cross_item_score)

        pkgs_list = cross_item_score.keys()
        bag_of_words = BagOfWords()

        bag_of_words.train_model(pkgs_list, self.axi, save_files=False)

        return bag_of_words
    def get_model(self, cross_item_score):
        super(CrossValidationBOW, self).get_model(cross_item_score)

        pkgs_list = cross_item_score.keys()
        bag_of_words = BagOfWords()

        bag_of_words.train_model(pkgs_list, self.axi, save_files=False)

        return bag_of_words