Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Use NLP to predict stock price movement associated with news
| Date | Stars |
|---|---|
| 2026-07-24 | 882 |
| 2026-07-25 | 882 |
| 2026-07-28 | 882 |
| 2026-07-30 | 882 |
| 2026-08-06 | 882 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Sentiment Analysis for Event-Driven Stock Prediction
Use natural-language processing (NLP) to predict stock price movement based on Reuters News
## Website
You are welcome to visit our website: [GolenRocks.me](http://goldenrocks.me/). The main purpose of this project is to build the connection between Bayesian DNN and stock price prediction based on News headline.
## Methodology
1. Data Collection and Preprocessing
1.1 crawl a ticker list to obtain the details of public companies
1.2 crawl news from Reuters using BeautifulSoup
1.3 crawl prices using urllib
2. Feature Engineering (Tokenization)
2.1 Unify word format: unify tense, singular & plural, remove punctuations & stop words
2.2 Implement one-hot encoding
2.3 Pad word sequence (essentially a matrix) to keep the same dimension
3. Train a set of Bayesian Convolutional Neural Networks using Stochastic Gradient Langevin Dynamics to obtain more robustness
4. Use thinning models to predict future news
## Requirement
* Python 3
* [PyTorch > 0.4](https://pytorch.org/)
* numpy
* [NLTK](https://www.nltk.org/install.html)
* Crawler tools
- pip3 install lxml
- pip3 install bs4
- pip3 install urllib
## Usage
Note: If you don't want to take time to crawl data and train the model, you can also directly go to step 4.
### 1. Data collection
#### 1.1 Download the ticker list from [NASDAQ](http://www.nasdaq.com/screening/companies-by-industry.aspx)
```bash
$ ./crawler/all_tickers.py 20 # keep the top e.g. 20% marketcap companies
```
#### 1.2 Use BeautifulSoup to crawl news headlines from [Reuters](http://www.reuters.com/finance/stocks/overview?symbol=FB.O)
*Note: you may need over one month to fetch the news you want.*
Suppose we find a piece of news about COO Lu Qi Resignation on May.18, 2018 at reuters.com

We can use the following script to crawl it and format it to our local file
```bash
$ ./crawler/reuters.py # we can relate the news with company and date, this is more precise than Bloomberg News
```

By brute-force iterating company tickers and dates, we can get the dataset with roughly 400,000 news in the end. Since a company may have multiple news in a single day, the current version will only use topStory news to train our models and ignore the others.
#### 1.3 Use urllib to crawl historical stock prices
Improvement here, use normalized return [5] over S&P 500 instead of return.
```bash
$ ./crawler/yahoo_finance.py # generate raw data: stockPrices_raw.json, containing open, close, ..., adjClose
$ ./create_label.py # use raw price data to generate stockReturns.json
```
### 2. Feature engineering (Tokenization)
Unify the word format, project word to a word vector, so every sentence results in a matrix.
Detail about unifying word format are: lower case, remove punctuation, get rid of stop words, unify tense and singular & plural.
```bash
$ ./tokenize_news.py
```
### 3. Train a Bayesian ConvNet to predict the stock price movement.
Type the following to train a set of robust Bayesian models.
```bash
$ ./main.py -epochs 500 -static False
```
### 4. Prediction and analysis
Let's show one example how the thinning models react to Baidu Lu Qi's resignation
```bash
$ ./main.py -predict "Top executive behind Baidu's artificial intelligence drive steps aside"
>> Sell
```
The prediction makes sense, let's find another one.
```
Eli Lilly and Co (LLY.N)
FRI, JUN 1 2018
UPDATE 2-Lilly gets U.S. nod for arthritis drug, sets price well below rivals
* Drug priced at $25,000/year, 60 pct lower to AbbVie's Humira
```
```bash
$ ./main.py -predict "UPDATE 2-Lilly gets U.S. nod for arthritis drug sets price well below rivals"
>> Sell
```
Lowering down drug prices looks helpful to gain market share in the business, however, they didn't mention too much about the updates of technology, we are inclined to regard it as the virulent price competition, which does not help to the coExcerpt of 8,204 characters
Read on GitHub306
13
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:fb979564fcfc6480, topic:sentiment-analysis, readme:natural language processing, readme:tokenization