Text Processing Tool
Prerequisites
You can download and install Python 2.7.11 from [here] (https://www.python.org/downloads/)
-
For Windows
Open commandline and run following command.
pip install nltk
run the following command to download necessary Corpora.
python -m nltk.downloader all
-
For Mac or Unix
To install NLTK you can consult Installing NLTK.
and for downloading necessary Corpora you can consult Installing NLTK Data
run the following command to install spacy
pip install spacy
Note: in windows environment if you face an issue like missing vcvarsall.bat
during spacy installation then first download vc_for_python
from http://aka.ms/vcpython27
install it and set environment variable for AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0
and AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin
and then retry to install spacy as above.
####Setup
- create twitter app prerequisites
- edit
ConfigFile.properties
file and enter your keys e.g.
accessToken=[enter your access token here]
consumerSecret=[enter your consumer secret key here]
consumerKey=[enter your consumer key here]
accessSecret=[enter your accessSecret key here]
- Run
Installation.bat
. It will download some necessary dependencies
Open cmd and run the following command
`python Main.py`For running Twitter Sentiment Analysis run one of the following commands.
-
dumpTweets -keyword <any keyword> -sentiment <positive|negative|neutral> -limit <integer>
-
dumpStreaming -keyword <any keyword> -sentiment <positive|negative|neutral> -limit <integer>
e.g. dumpTweets -keyword iphone -sentiment positive -limit 5
For Entity Extraction from a Given Sentence run one of the following command.
-
dumpTweets -keyword <any keyword> -entity -limit <integer>
-
dumpStreaming -keyword <any keyword> -entity -limit <integer>
e.g. dumpStreaming -keyword ipad -entity -limit 4