コード例 #1
0
    def to_classification_object(cls, json):
        c = ClassificationObject()

        c.source = 'twitter'
        c.text = json['text']
        c.created_at = json['created_at']

        return c
コード例 #2
0
ファイル: naive_bayes.py プロジェクト: antsemot/nosy
    def classify_text(self, text):
        if not hasattr(self, 'classifiers'): self.train()

        # Extract keywords like we do when learning
        c = ClassificationObject()
        c.text = text
        c.process()
        
        return self.classify(c)
コード例 #3
0
def save_classification_object(line, tags):
    c = ClassificationObject()
    c.text = line
    c.process()
    c.tags = tags
    c.save()