Code Monkey home page Code Monkey logo

stocknet-code's Introduction

stocknet-code

This repository releases the code for stock movement prediction from tweets and historical stock prices. Please cite the following paper [bib] if you use this code,

Yumo Xu and Shay B. Cohen. 2018. Stock Movement Prediction from Tweets and Historical Prices. In Proceedings of the 56st Annual Meeting of the Association for Computational Linguistics. Melbourne, Australia, volume 1.

Stock movement prediction is a challenging problem: the market is highly stochastic, and we make temporally-dependent predictions from chaotic data. We treat these three complexities and present a novel deep generative model jointly exploiting text and price signals for this task. Unlike the case with discriminative or topic modeling, our model introduces recurrent, continuous latent variables for a better treatment of stochasticity, and uses neural variational inference to address the intractable posterior inference. We also provide a hybrid objective with temporal auxiliary to flexibly capture predictive dependencies. We demonstrate the state-of-the-art performance of our proposed model on a new stock movement prediction dataset which we collected.

Should you have any query please contact me at [email protected].

Dependencies

  • Python 2.7.11
  • Tensorflow 1.4.0
  • Scipy 1.0.0
  • NLTK 3.2.5

Directories

  • src: source files;
  • res: resource files including,
    • Vocabulary file vocab.txt;
    • Pre-trained embeddings of GloVe. We used the GloVe obtained from the Twitter corpora which you could download here.
  • data: datasets consisting of tweets and prices which you could download here.

Configurations

Model configurations are listed in config.yml where you could set variant_type to hedge, tech, fund or discriminative to get four corresponding model variants, HedgeFundAnalyst, TechincalAnalyst, FundamentalAnalyst or DiscriminativeAnalyst described in the paper.

Additionally, when you set variant_type=hedge, alpha=0, you would acquire IndependentAnalyst without any auxiliary effects.

Running

After configuration, use sh src/run.sh in your terminal to start model learning and test the model after the training is completed. If you would like to do them separately, simply comment out exe.train_and_dev() or exe.restore_and_test() in Main.py.

stocknet-code's People

Contributors

yumoxu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.