Giter Club home page Giter Club logo

treelstm-1's Introduction

TreeLSTM

An attempt to implement the Constinuency Tree LSTM in "Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks" (Tai, Socher, and Manning, 2015) in Theano.

Python requirements:

  • Python 2.7
  • NumPy
  • Theano
  • gensim

Data requirements:

  • Stanford Sentiment Treebank in PTB Tree format: download
  • pretrained word2vec word vectors trained on Google News, available here

Installation:

  • download the source files or clone the repo
  • download the Stanford Sentiment Treebank in PTB format using the above link
  • download the pre-trained word2vec vectors using the above link, and unzip the file

To run:

To run using default settings:

python constituency_tree_lstm.py /path/to/stanfordSentimentTreebank/trees --word2vec_file=/path/to/GoogleNews-vectors-negative300.bin

To see additional options:

python constituency_tree_lstm.py -h

Differences from Original Implementation

The original Constituency Tree LSTM was implemented in Torch. In addition, the following are different about this implementation

  • no minibatches
  • adjusted learning rate and regularization strength to compensate for minibatches of size=1
  • using word2vec vectors, instead of Glove
  • no updatting of embeddings during training

Performance

Performance is not yet equivalent to the results of the original paper, perhaps because of the above differences. The best performance I have been able to obtain thus far is ~0.85 on the binary classification task.

treelstm-1's People

Contributors

dallascard avatar

Watchers

Steven Du avatar  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.