Giter Club home page Giter Club logo

gluon-nlp's Introduction

GluonNLP: Your Choice of Deep Learning for NLP

GluonNLP is a toolkit that enables easy text preprocessing, datasets loading and neural models building to help you speed up your Natural Language Processing (NLP) research.

News

  • Tutorial proposal for GluonNLP is accepted at EMNLP 2019, Hong Kong.
  • GluonNLP was featured in:
    • AWS re:invent 2018 in Las Vegas, 2018-11-28! Checkout details.
    • PyData 2018 NYC, 2018-10-18! Checkout the awesome talk by Sneha Jha.
    • KDD 2018 London, 2018-08-21, Apache MXNet Gluon tutorial! Check out https://kdd18.mxnet.io.

Installation

Make sure you have Python 2.7 or Python 3.6 and recent version of MXNet. You can install MXNet and GluonNLP using pip.

GluonNLP is based on the most recent version of MXNet.

In particular, if you want to install the most recent MXNet release:

pip install --upgrade mxnet>=1.4.0

Else, if you want to install the most recent MXNet nightly build:

pip install --pre --upgrade mxnet

Then, you can install GluonNLP:

pip install gluonnlp

Please check more installation details.

Docs ๐Ÿ“–

GluonNLP documentation is available at our website.

Community

GluonNLP is a community that believes in sharing.

For questions, comments, and bug reports, Github issues is the best way to reach us.

We now have a new Slack channel here. (register).

How to Contribute

GluonNLP community welcomes contributions from anyone!

There are lots of opportunities for you to become our contributors:

  • Ask or answer questions on GitHub issues.
  • Propose ideas, or review proposed design ideas on GitHub issues.
  • Improve the documentation.
  • Contribute bug reports GitHub issues.
  • Write new scripts to reproduce state-of-the-art results.
  • Write new examples to explain key ideas in NLP methods and models.
  • Write new public datasets (license permitting).
  • Most importantly, if you have an idea of how to contribute, then do it!

For a list of open starter tasks, check good first issues.

Also see our contributing guide on simple how-tos, contribution guidelines and more.

Resources

Check out how to use GluonNLP for your own research or projects.

If you are new to Gluon, please check out our 60-minute crash course.

For getting started quickly, refer to notebook runnable examples at Examples.

For advanced examples, check out our Scripts.

For experienced users, check out our API Notes.

Quick Start Guide

Load the Wikitext-2 dataset, for example:

>>> import gluonnlp as nlp
>>> train = nlp.data.WikiText2(segment='train')
>>> train[0][0:5]
['=', 'Valkyria', 'Chronicles', 'III', '=']

Build vocabulary based on the above dataset, for example:

>>> vocab = nlp.Vocab(counter=nlp.data.Counter(train[0]))
>>> vocab
Vocab(size=33280, unk="<unk>", reserved="['<pad>', '<bos>', '<eos>']")

From the models package, apply a Standard RNN language model to the above dataset:

>>> model = nlp.model.language_model.StandardRNN('lstm', len(vocab),
...                                              200, 200, 2, 0.5, True)
>>> model
StandardRNN(
  (embedding): HybridSequential(
    (0): Embedding(33280 -> 200, float32)
    (1): Dropout(p = 0.5, axes=())
  )
  (encoder): LSTM(200 -> 200.0, TNC, num_layers=2, dropout=0.5)
  (decoder): HybridSequential(
    (0): Dense(200 -> 33280, linear)
  )
)

For example, load a GloVe word embedding, one of the state-of-the-art English word embeddings:

>>> glove = nlp.embedding.create('glove', source='glove.6B.50d')
# Obtain vectors for 'baby' in the GloVe word embedding
>>> type(glove['baby'])
<class 'mxnet.ndarray.ndarray.NDArray'>
>>> glove['baby'].shape
(50,)

New to Deep Learning or NLP?

For background knowledge of deep learning or NLP, please refer to the open source book Dive into Deep Learning.

gluon-nlp's People

Contributors

astonzhang avatar bikestra avatar bkktimber avatar brettkoonce avatar cgraywang avatar eric-haibin-lin avatar fiercex avatar garima3292 avatar hankcs avatar haven-jeon avatar hhexiy avatar imgarylai avatar ishitori avatar jonomon avatar junrushao avatar kurtjanssensai avatar leezu avatar lixin4ever avatar qyhfbqz avatar rravu3 avatar sravanbabuiitm avatar sxjscience avatar szha avatar szhengac avatar taolv avatar thomasdelteil avatar vanewu avatar xiaotinghe avatar ymjiang avatar zhreshold avatar

Watchers

 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.