This project is a webapp that runs a sentiment analysis on tweets of a Twitter handle and gives feedback on sentiments over a period of time.
1) Fire up your favourite console & clone this repo somewhere:
❍ git clone https://github.com/vahiwe/TwitterAnalysis.git
2) Enter this directory:
❍ cd TwitterAnalysis/model_setup
3) Install python if not already installed and run this command to install python packages/dependencies:
❍ pip install -e .
4) Go back to previous directory:
❍ cd ..
5) Generate secret key for Django project here and input in TwitterAnalysis/config.py
:
KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
6) Get your Twitter Developer credentials and input in sentiment/config.py
:
consumer_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
consumer_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
access_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
access_token_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
7) Install spacy language model:
❍ python -m spacy download en
8) Run to create migrations for changes:
❍ python manage.py makemigrations
9) Run to apply those changes to the database:
❍ python manage.py migrate
10) Start the server to view the webapp:
❍ python manage.py runserver
11) Open your browser and type in this URL to view the webapp:
❍ http://127.0.0.1:8000/
Happy developing!