Giter VIP home page Giter VIP logo

tensorflow-nlp's Introduction

Overview

The code in this repository implements ideas from 'Convolutional Neural Networks for Sentence Classification' by Yoon Kim from the New York University (https://arxiv.org/pdf/1404.2188.pdf) in context of detecting question duplicates on Quora. The implementation relies on pre-trained word2vec embeddings (https://code.google.com/archive/p/word2vec/) and adds a convolutional neural network to detect words in certain sequences. Specifically, there is a single embedding layer followed by one convolution - max-pooling - ReLu layer with dropout followed by a softmax classification layer.

The implementation is done in Tensorflow and therefore easily scalable.

Requirements

The computer this is run on should have at least 16Gb of RAM.

  1. Install python 3 and wget
  2. Install tensorflow for python 3 (https://www.tensorflow.org/install/)
  3. Install gensim (pip install gensim)
  4. Run ./prepare.sh

To train the model, use

python train.py

The resultant network is dumped every epoch. To use the trained model to predict the outcome for the submission set, run

python evaluate.py

tensorflow-nlp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ashokkrin mcsuy

tensorflow-nlp's Issues

Reading the vocabulary fails because missing `vocabulary.pickle`

I have all pre requisitions installed, initial phase of ./prepare.sh goes well and then fails without vocabulary.pickle

Reading the vocabulary...
Traceback (most recent call last):
  File "prepare_embeddings.py", line 11, in <module>
    dataset = DataSet()
  File "/tensorflow-nlp-master/dataset.py", line 54, in __init__
    self.vocabulary = self._read_vocabulary()
  File "/tensorflow-nlp-master/dataset.py", line 28, in _read_vocabulary
    with open('vocabulary.pickle', 'rb') as vocabulary_file:
FileNotFoundError: [Errno 2] No such file or directory: 'vocabulary.pickle'

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.