Coder Social home page Coder Social logo

huoliangyu / lstm_attention_tf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rantsandruse/lstm_attention_tf

0.0 1.0 0.0 71 KB

Add attention layer to LSTM/word2vec model for sentiment analysis using tensorflow

Python 35.10% Jupyter Notebook 64.90%

lstm_attention_tf's Introduction

Tensorflow implementation of LSTM based sentiment analysis with attention layer

Bag of Words vs. Bag of Popcorn as an example

This is an extension of the previous project (lstm_word2vec). Now we have a tensorflow implementation of LSTM for the purpose of sentiment analysis, with the option of adding an attention layer.

In this project, I reused the I/O function and data prep functions from lstm_word2vec.

The major improvements are:

  1. Migration of code from keras to TF.
  2. Added an optional attention layer plus visualization.
  3. Added a batch generator class that can be easily used for different datasets.

The main_lstm.ipynb show cases how to leverage existing functions to train your own LSTM + attention layer model.

Addition of the attention layer appears to marginally improve the results of the testing set. But further testing is needed to establish the significance of the improvement...

lstm_attention_tf's People

Contributors

rantsandruse avatar

Watchers

 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.