Simple machine learning and analysis applied to news.
After installing Homebrew, download and install Mongo and GSL by running the following from the project root:
brew install mongodb
brew install gsl # improves classification performance
Ensure that Mongo is running with:
brew services start mongodb
After installing Ruby and Bundler, run the following from the project's root to install necessary gem dependencies:
bundle install
After installing Node and NPM, run the following from the project's root:
npm install
## Crawling News Sources
To crawl news sources and save their content to the `articles` collection of the `news_classifier` database, run the following from the project root:
```shell
ruby scripts/crawl.rb
To drop the articles
collection before crawling, add the --drop-collection
option:
ruby scripts/crawl.rb --drop-collection
Once the news sources have been crawled, run the following command to launch the interactive classifier:
ruby scripts/classify.rb
Once the news sources have been crawled, run the following command to find content related to provided strings:
ruby scripts/find_related.rb
Onde the news sources have been crawled, run the following command to calculate the average sentiment for each source.
node scripts/sentiment.js