Skip to content

Instantly share code, notes, and snippets.

@erichare
Created July 14, 2022 14:29
Show Gist options
  • Save erichare/27139273c8f3032f509595040ef19c9a to your computer and use it in GitHub Desktop.
Save erichare/27139273c8f3032f509595040ef19c9a to your computer and use it in GitHub Desktop.
Pull Twitter data and then compute the sentiment
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