Skip to content

Latest commit

 

History

History
63 lines (46 loc) · 3.06 KB

README.md

File metadata and controls

63 lines (46 loc) · 3.06 KB

#financial-twitter-tracker

A semantic sentiment analyzer for tweets with a financial context. It's currently under development.

Installation:

  1. Download and install (with python-setuptools) the tweetstream module.
  2. Download and install nltk.
  3. Download and install requests
  4. 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.
  5. 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 ;

Usage:

Training the analyzer

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.

  1. Go to /analyzer/trainer/
  2. 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.
  3. 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.
  4. Execute tweetClassifier.py.

Getting semantic annotated tweets and saving them in LMF

  1. Go to /analyzer
  2. Execute moodClassifierd.py debug and wait for it to start;
  3. Modify the configuration file to select what words do you want to search on twitter.
  4. Execute client.py in other terminal.

Showing the data in the web frontend

(TODO)

Thanks to

License

GPLv3