Giter Club home page Giter Club logo

nlp-beginner-guide-keras's Introduction

In this repo, I will implement some NLP models for the nlp beginner learner. In each project folder contains a notebook floder to show the output in detail. I think this would help the beginner to understand what happens in the model.

I will list what resource used for each model implementation. All project based on Python3.6 and Keras2.1.6 with TensorFlow1.8 backend.

Deep Models for NLP beginners

You can find detail instruction in each project. Here I will list what you can learn in each project.

  • A keras implementation of CNN-non-static for text classification
  • train a word2vec model
  • Load pre-trained word2vec weights
  • Save and load a keras model
  • Use tensorboard to visualize your neural networks
  • Load pre-trained GloVe weights
  • How Keras deal with OOV token

What you can learn in this implementation:

In this project, I use three embedding levels, word/character/subword, to represent the text. And test them with two model, CNN and LSTM.

According to the result, subword-level embedding is useful for the dataset with many unknown words. The CNN not only achieve the better performance, but also take less training time. So if you want to implement a simple and powerful sentiment classification model, I highly recommend to use the CNN model.

Read the complete report on my blog: The Best Embedding Method for Sentiment Classification

I create this project to learn the NER task and implement the BiLSTM-CRF model by using keras-contrib.

Requirements

  • Python 3.6
  • Keras 2.1.6
  • Tensorflow 1.8
  • tensorboard 1.8
  • gensim 3.4.0
  • scikit-learn 0.19.1
  • numpy 1.14.3
  • h5py 2.8

I use conda to construct the environment, and I highly recommend you do it too. After clone this project, you can run the following command to construct the whole environment. Make sure you already install the conda tool.

conda env create -f py36.yml

After install the whole environment, you can use following command to switch to the py36 environment.

source activate py36

Bibtex

Please use the following bibtex, when you refer my implementations in your papers.

@misc{liang2018kerasnlpmodel,
    title  = {Keras Implementations for NLP Models},
    author = {Xu, Liang},
    url    = {https://github.com/BrambleXu/nlp-beginner-guide-keras},
    year   = {2018}
}

nlp-beginner-guide-keras's People

Contributors

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