Giter Site home page Giter Site logo

cnn_sentence's Introduction

Yoon Kim
[email protected]
September 24, 2014

Code for:

Convolutional Neural Networks for Sentence Classification
EMNLP 2014
http://arxiv.org/abs/1408.5882

Runs the model on Pang and Lee's movie review dataset (MR in the paper).
Please cite the original paper when using the data.

The code does not use GPUs. It should run much faster if you have a good GPU. See http://deeplearning.net/software/theano/tutorial/using_gpu.html for information on how to make it use GPUs.

Instructions:

1. with all the files in folder, run

python process_data.py -path

where -path points to the word2vec binary file (i.e. GoogleNews-vectors-negative300.bin file). 
Downloadable at https://code.google.com/p/word2vec/
This will create a pickle object called "mr.p" in the same folder, which contains the dataset in the right format.

2. run

python conv_net_sentence.py -nonstatic -rand
python conv_net_sentence.py -static -word2vec
python conv_net_sentence.py -nonstatic -word2vec

This will run the CNN-rand, CNN-static, and CNN-nonstatic models respectively in the paper.

*Note: Step 1 will create the dataset with different fold-assignments than was used in the paper.
You should still be getting a CV score of >81% with CNN-nonstatic model, though.

cnn_sentence's People

Contributors

yoonkim avatar

Watchers

 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.