Firs implementation of Classifier https://github.com/cardmagic/classifier, add to Gemfile
gem “classifier”
gem “stemmer”
gem “madeleine”
$ bundle install
Implementation of Bayes Motel
gem “bayes_motel”
$ bundle install
Upload data and generate the scaffold
$ mongoimport -h ds049157.mongolab.com:49157 -d twittermometro -c corpus_positive -u twitteruser -p demopass —file corpus_positive.csv —type csv —headerline
$ rails generate scaffold CorpusPositive sentence:text
Upload data to mongolab
$ mongoimport -h ds049157.mongolab.com:49157 -d twittermometro -c corpus_anews -u twitteruser -p demopass —file ANEW-Appendix.csv —type csv —headerline
Upload data to development
mongoimport -h localhost:27017 -d twittermometro_development -c corpus_anews —file ANEW-Appendix.csv —type csv —headerline
Start the collector
$ cd twittermometro/script
$ ./tweet_collector_v1.rb mass_media
- using Rake
rake RAILS_ENV=production cron
- ejecutar rake en Heroku
cd twittermometro
heroku run bundle exec rake RAILS_ENV=production twitterv3:tweet_collector mass_media
- start rails on production
rails s -e production