Last active
February 13, 2019 02:10
-
-
Save AnasAlmasri/3b981668e544570dc2ddeb7ff5251b1b to your computer and use it in GitHub Desktop.
Function to build Test data set based on a search term
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def buildTestSet(search_keyword): | |
try: | |
tweets_fetched = twitter_api.GetSearch(search_keyword, count = 100) | |
print("Fetched " + str(len(tweets_fetched)) + " tweets for the term " + search_keyword) | |
return [{"text":status.text, "label":None} for status in tweets_fetched] | |
except: | |
print("Unfortunately, something went wrong..") | |
return None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment