예제 #1
0
 def process(self, istream, count=None):
     """
     Each element of istream is a tweet.
     Use the text as a marker.
     Return (id, text, score).
     Client must return (header, ostream)
     """
     if count is not None:
         istream = tqdm(istream, total=count)
     for tweet in istream:
         for issue in identify_issues(tweet.text.lower()):
             yield [tweet.id, issue, 1.0]
예제 #2
0
    def process(self, istream, count=None):
        """
        Each element of istream is a tweet.
        Use the text as a marker.
        Return (id, text, score).
        Client must return (header, ostream)
        """

        if count is not None:
            istream = tqdm(istream, total=count)
        for tweet in istream:
            stance = identify_stance(tweet.text.lower())
            for candidate, value in stance.items():
                yield [tweet.id, candidate, value, 1.0]