All Projects → chaitjo → Lstm Context Embeddings

chaitjo / Lstm Context Embeddings

Licence: mit
Augmenting word embeddings with their surrounding context using bidirectional RNN

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Lstm Context Embeddings

Pytorch Sentiment Analysis
Tutorials on getting started with PyTorch and TorchText for sentiment analysis.
Stars: ✭ 3,209 (+5529.82%)
Mutual labels:  cnn, lstm, word-embeddings
Sarcasmdetection
Sarcasm detection on tweets using neural network
Stars: ✭ 99 (+73.68%)
Mutual labels:  neural-networks, cnn, lstm
Ncrfpp
NCRF++, a Neural Sequence Labeling Toolkit. Easy use to any sequence labeling tasks (e.g. NER, POS, Segmentation). It includes character LSTM/CNN, word LSTM/CNN and softmax/CRF components.
Stars: ✭ 1,767 (+3000%)
Mutual labels:  neural-networks, cnn, lstm
Meme Generator
MemeGen is a web application where the user gives an image as input and our tool generates a meme at one click for the user.
Stars: ✭ 57 (+0%)
Mutual labels:  neural-networks, cnn
Tensorflow Tutorial
TensorFlow and Deep Learning Tutorials
Stars: ✭ 748 (+1212.28%)
Mutual labels:  neural-networks, cnn
Sincnet
SincNet is a neural architecture for efficiently processing raw audio samples.
Stars: ✭ 764 (+1240.35%)
Mutual labels:  neural-networks, cnn
Flashtorch
Visualization toolkit for neural networks in PyTorch! Demo -->
Stars: ✭ 561 (+884.21%)
Mutual labels:  neural-networks, cnn
Neural Image Captioning
Implementation of Neural Image Captioning model using Keras with Theano backend
Stars: ✭ 12 (-78.95%)
Mutual labels:  cnn, lstm
Tensorflow Tutorial
Some interesting TensorFlow tutorials for beginners.
Stars: ✭ 893 (+1466.67%)
Mutual labels:  cnn, lstm
Convisualize nb
Visualisations for Convolutional Neural Networks in Pytorch
Stars: ✭ 57 (+0%)
Mutual labels:  neural-networks, cnn
Neural Networks
All about Neural Networks!
Stars: ✭ 34 (-40.35%)
Mutual labels:  cnn, lstm
Lstm Char Cnn Tensorflow
in progress
Stars: ✭ 737 (+1192.98%)
Mutual labels:  cnn, lstm
Text Classification
Implementation of papers for text classification task on DBpedia
Stars: ✭ 682 (+1096.49%)
Mutual labels:  cnn, lstm
Quickdraw
Implementation of Quickdraw - an online game developed by Google
Stars: ✭ 805 (+1312.28%)
Mutual labels:  neural-networks, cnn
Multi Class Text Classification Cnn Rnn
Classify Kaggle San Francisco Crime Description into 39 classes. Build the model with CNN, RNN (GRU and LSTM) and Word Embeddings on Tensorflow.
Stars: ✭ 570 (+900%)
Mutual labels:  cnn, lstm
Deep Music Genre Classification
🎵 Using Deep Learning to Categorize Music as Time Progresses Through Spectrogram Analysis
Stars: ✭ 23 (-59.65%)
Mutual labels:  cnn, lstm
Rnn Theano
使用Theano实现的一些RNN代码,包括最基本的RNN,LSTM,以及部分Attention模型,如论文MLSTM等
Stars: ✭ 31 (-45.61%)
Mutual labels:  cnn, lstm
Twitter Sentiment Analysis
Sentiment analysis on tweets using Naive Bayes, SVM, CNN, LSTM, etc.
Stars: ✭ 978 (+1615.79%)
Mutual labels:  cnn, lstm
Yann
This toolbox is support material for the book on CNN (http://www.convolution.network).
Stars: ✭ 41 (-28.07%)
Mutual labels:  neural-networks, cnn
Textclassificationbenchmark
A Benchmark of Text Classification in PyTorch
Stars: ✭ 534 (+836.84%)
Mutual labels:  cnn, lstm

Overview

Presented here is a method to modify the word embeddings of a word in a sentence with its surrounding context using a bidirectional Recurrent Neural Network (RNN). The hypothesis is that these modified embeddings are a better input for performing text classification tasks like sentiment analysis or polarity detection.

Read the full blog post here: chaitjo.github.io/context-embeddings


Bidirectional RNN layer

Implementation

The code implements the proposed model as a pre-processing layer before feeding it into a Convolutional Neural Network for Sentence Classification (Kim, 2014). Two implementations are provided to run experiments: one with tensorflow and one with tflearn (A high-level API for tensorflow). Training happens end-to-end in a supervised manner: the RNN layer is simply inserted as part of the existing model's architecture for text classification.

The tensorflow version is built on top of Denny Britz's implementation of Kim's CNN, and also allows loading pre-trained word2vec embeddings.

Although both versions work exactly as intended, results in the blog post are from experiments with the tflearn version only.

Usage

I used Python 3.6 and Tensorflow 0.12.1 for my experiments. Tensorflow code is divided into model.py which abstracts the model as a class, and train.py which is used to train the model. It can be executed by running the train.py script (with optional flags to set hyperparameters)-

$ python train.py [--flag=1]

(Tensorflow code for Kim's baseline CNN can be found in /cnn-model.)

Tflearn code can be found in the /tflearn folder and can be run directly to start training (with optional flags to set hyperparameters)-

$ python tflearn/model.py [--flag=1]

The summaries generated during training (saved in /runs by default) can be used to visualize results using tensorboard with the following command-

$ tensorboard --logdir=<path_to_summary>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].