A containerized service for inferring the sentiments of tweets by topic.
The implementation is explained on code_description.md.
The service was deployed on heroku csi02-tsas.herokuapp.com.
There are six routes:
/api/list
: returns a list of tweets for the #1 Trend Topic with their sentiment analysis./api/list/<topic>
: returns a list of tweets for the given topic with their sentiment analysis./api/sumlist
: returns a list of tweets for the #1 Trend Topic with their sentiment analysis and a summary of that sentiment analysis./api/sumlist/<topic>
: returns a list of tweets for the given topic with their sentiment analysis and a summary of that sentiment analysis./api/summary
: returns just a summary of the sentiment analysis of the #1 Trend Topic./api/summary/<topic>
: returns just a summary of the sentiment analysis of the given topic.
The complete API documentation is available at https://csi02-tsas.herokuapp.com/.
⚠️ You will need a Twitter API key placed in asecrets/twitter_api_key.json
file like below:{ "API_KEY": "<your twitter api key>", "API_KEY_SECRET": "<your twitter api key secret>" }
⚠️ You will also need to generate your own Google Cloud key and put the resulting json file in the secrets folder as well.
docker build -t tsas/csi-02-tsas .
Without cache:
docker run -p 8000:8000 -ti tsas/csi-02-tsas
Saving cache:
docker run -p 8000:8000 -ti -v `pwd`/caches:/usr/src/app/caches tsas/csi-02-tsas
So you can access the service locally on localhost:8000.