Esempio n. 1
0
 def docToclassvector(self, document, alltopicsandkeys):
     result = alltopicsandkeys  #self.traversePages("setTopicandTerms",'topicmodel')
     classifier = Classifier()
     classifier.init(result.topics, result.terms).MinKey(2)
     classifier.build(document)
     classifier.setweights()
     return classifier
Esempio n. 2
0
    def getTopics(self):
        result = self.traversePages("setTopicandTerms", 'topicmodel')

        classifier = Classifier()
        classifier.init(result.topics, result.terms).MinKey(2)

        classifier = self.traversePages("retrainClassifier", 'article',
                                        classifier).classifier
        classifier.setweights()
        os.remove("classvectors.json")
        classifier.tojson("classvectors")
        return "test2"