#financial-twitter-tracker
A semantic sentiment analyzer for tweets with a financial context. It's currently under development.
- Download and install (with python-setuptools) the tweetstream module.
- Download and install nltk.
- Download and install requests
- Download LMF and follow the installation guide. Don't forget to set LMF_HOME in $CATALINA_HOME/bin/setenv.sh and give permissions to this folder in UNIX systems.
- Configure LMF: we need to create a core for the semantic search. Under Semantic search->Core, create a new core with this content:
@prefix dc : <http://purl.org/dc/elements/1.1/> ;
@prefix sioc : <http://rdfs.org/sioc/ns#> ;
@prefix rdf : <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
@prefix marl : <http://purl.org/marl/> ;
@prefix dcterms : <http://purl.org/dc/terms/> ;
@filter rdf:type is <http://rdfs.org/sioc/types#MicroblogPost> ;
title = dc:title :: xsd:string ;
created = dcterms:created :: xsd:string ;
has_creator = sioc:has_creator :: xsd:string ;
opinionText = marl:opinionText :: xsd:string ;
polarityValue = marl:polarityValue :: xsd:string ;
minPolarityValue = marl:minPolarityValue :: xsd:string ;
maxPolarityValue = marl:maxPolarityValue :: xsd:string ;
hasPolarity = marl:hasPolarity :: xsd:string ;
The first time you will need to train the analyzer. The quality of the semantic annotation is related on the amount of tweets and their quality.
- Go to /analyzer/trainer/
- To train the analizer we need a lot of tweets. Execute twitterCollector.py to get a stream of filtered tweets and save them in /analyzer/data/tweets_raw.dat. Sucesive executions will append more tweets to this file.
- We also need the SentiWordNet sentiment dictionary, to use this dictionary you'll need to ask for it and is not included in the repository, and to place it under /analyzer/dict/sentiwordnet. A simpler financial dictionary it's also included and can be used setting USE_SENTIWORDNET_DICT to False in the configuration file.
- Execute tweetClassifier.py.
- Go to /analyzer
- Execute moodClassifierd.py debug and wait for it to start;
- Modify the configuration file to select what words do you want to search on twitter.
- Execute client.py in other terminal.
(TODO)
- Cyhex for smm.
- Natural Language Toolkit.
- Loughran and McDonald Financial Sentiment Dictionaries
- SentiWordNet.
- Christopher Potts for SentiWordNet Python inferface.
GPLv3