Exemplo n.º 1
0
 def run(self):
     while(True):            
         data = self.harvester.queue.get(True, timeout=120)
         
         try:
             c = self.harvester.to_classification_object(data)
         except KeyError:
             continue
         
         c.process()
         LanguageClassifier.classify(c)
         if (c.tags['english'] > 0.8):
             self.publish(c)
             c.save()
Exemplo n.º 2
0
    def run(self):
        while (True):
            data = self.harvester.queue.get(True)

            try:
                c = self.harvester.to_classification_object(data)
            except KeyError:
                continue

            c.process()
            if LanguageClassifier._english_score(c.text.split()) > 0.8:
                c.save()
Exemplo n.º 3
0
 def run(self):
     while(True):            
         data = self.harvester.queue.get(True)
         
         try:
             c = self.harvester.to_classification_object(data)
         except KeyError:
             continue
         
         c.process()
         if LanguageClassifier._english_score(c.text.split()) > 0.8:
             c.save()
Exemplo n.º 4
0
    def run(self):
        while (True):
            data = None
            if (random.random() < 0.9):
                print "Real!"
                data = self.harvester.queue.get(True, timeout=120)
            else:
                print "Example!"
                data = self.example_movie_tweet()

            try:
                c = self.harvester.to_classification_object(data)
            except KeyError as e:
                continue

            c.process()

            LanguageClassifier.classify(c)
            self.NAIVE_BAYES.classify(c)

            if (self.exceeds_thresholds(c)):
                self.publish(c)
                c.save()
Exemplo n.º 5
0
    def run(self):
        while(True):
            data = None
            if (random.random() < 0.9):
                print "Real!"
                data = self.harvester.queue.get(True, timeout=120)
            else:
                print "Example!"
                data = self.example_movie_tweet()
            
            try:
                c = self.harvester.to_classification_object(data)
            except KeyError as e:
                continue
            
            c.process()
            
            LanguageClassifier.classify(c)
            self.NAIVE_BAYES.classify(c)

            if (self.exceeds_thresholds(c)):
                self.publish(c)
                c.save()