Giter Club home page Giter Club logo

deep-attention-text-classifier-tf's Introduction

This repository contains code for text classification using attention mechanism in Tensorflow with tensorboard visualization.


Requirements

  • Python 3.6
  • Tensorflow 1.2.1
  • Numpy

Project Module

  • utility_dir: storage module for data, vocab files, saved models, tensorboard logs, outputs.

  • pre_processing_module: code for pre-processing text file which includes sampling infrequent words, creation of training vocab and classes in form of pickle dictionary.

  • implementation_module: code for model architecture, data reader, training pipeline and test pipeline.

  • settings_module: code to set directory paths (data path, vocab path, model path etc.), set model parameters (hidden dim, attention dim, regularization, dropout etc.), set vocab dictionary.

  • run_module: wrapper code to execute end-to-end train and test pipeline.

  • viz_module: code to generate embedding visualization via tensorboard.

  • utility_code: other utility codes


How to run

  • train: python -m global_module.run_module.run_train

  • test: python -m global_module.run_module.run_test

  • visualize tensorboard: tensorboard --logdir=PATH-TO-LOG-DIR


Data Sample

  • Utterance file

    • it is hard to resist
    • But something seems to be missing .
    • A movie of technical skill and rare depth of intellect and feeling .
    • Brosnan is more feral in this film than I 've seen him before
    • . . .
  • Utterance label

    • neg
    • neg
    • pos
    • neg
    • . . .

How to change model parameters

Go to set_params.py here.


Model Graph

alt text

Loss and Accuracy Plots

alt text

alt text

alt text

alt text

#Histogram

alt text

Embedding Visualization

alt text

alt text

alt text

alt text

alt text

deep-attention-text-classifier-tf's People

Contributors

krayush07 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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