Created
July 14, 2022 14:29
-
-
Save erichare/27139273c8f3032f509595040ef19c9a to your computer and use it in GitHub Desktop.
Pull Twitter data and then compute the sentiment
This file contains hidden or 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
import pydaisi as pyd | |
tw_daisi = pyd.Daisi("erichare/Twitter Search") | |
sa_daisi = pyd.Daisi("erichare/Sentiment Analysis") | |
result = tw_daisi.fetch_tweets("Pepperoni Pizza", count=10).value | |
sentiment = sa_daisi.get_sentiment([x for x in result["text"].tolist()]).value | |
result["label"] = [x["label"] for x in sentiment] | |
result["score"] = [x["score"] for x in sentiment] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment