Stocker is a real time stock news analyzer with AWS Comprehend integrated.
It's purpose is to crawl stock info web pages and analyze various news article with machine learning.
As shown above, Stocker is consisted with 4 main parts.
-
HTML Parsers
HTML Parsers takes raw HTML code and extract news articles.
-
AWS Handler
AWS API is call from the main program and returns analysis result.
-
Main Program
Manages all parsers and API.
-
Web Server
Runs webapp and display analysis data with charts and wordcloud
Machine learning text analyzer used in this project is AWS Comprehend.
Crawled news article datas are feeded through AWS Comprehend API and then processed.
Processed data can be received via JSON data format.
AWS Comprehend could be used with AWS Translate to provide wide variety of language support.
Collected datas from the AWS Comprehend are trimmed and organized to be displayed.
Data visualization is performed with Charts.js & D3.js which is popular open source JavaScript library.
To run this application on your own, you need to meet requirements shown below.
-
Linux
Linux webserver is required to run web application.
LAMP(Linux, Apache, MySQL, Python or PHP) is recommended.
See installation process below. -
Python 3
Python 3(Python 3.5.2) is required for web crawling.
built-inhtml.Parserlibrary is used to parse html code. -
AWS Account
AWS is required for AWS Comprehend service.
To learn more about AWS Comprehend, visit here
AWS is integrated as API in each crawler. -
AWS CLI
AWS Command Line Interface is required for AWS Comprehend API to work properly.
For setting up AWS CLI, check this tutorial. -
Apache web server
Required to actually run the application.
-
MySQL
Store data processed by AWS service using MySQL
-
This application requires Python 3. If you don't have it already installed, visit here and download the lastest version.
-
Use command below to install necessary modules for Python.
For Windows user, run with --user flag
$ pip install awscli$ pip install boto3$ pip install pymysql -
Set up linux server. Here, we use Ubuntu 16.04 with LAMP installed.
This is required if you want to run it on your own server!!
$ sudo apt install apache2$ sudo apt install mysql-server$ sudo apt install php php-mysql -
Put Webpage in apache2 directory.
/var/www/htmlis the default location for web files. -
Login AWS and create IAM User for AWS Comprehend API Access. For more info, visit here.
-
You are all set!!
-
Run crawler with stock name as first argument. For example,
$ python3 fidelity_parser.py aapl
$ python3 fidelity_parser.py amzn -
If you're running your own web server, visit localhost/index.html. If you're using our server, you can visit this page. Server status not guaranteed
-
Search with stock name and check result!!
