GluonNLP: a Deep Learning Toolkit for Natural Language Processing (NLP)¶
GluonNLP provides implementations of the state-of-the-art (SOTA) deep learning models in NLP, and build blocks for text data pipelines and models. It is designed for engineers, researchers, and students to fast prototype research ideas and products based on these models. This toolkit offers four main features:
- Training scripts to reproduce SOTA results reported in research papers.
- Pre-trained models for common NLP tasks.
- Carefully designed APIs that greatly reduce the implementation complexity.
- Community support.
The toolkit supports the following NLP tasks:
- Word Embedding
- Language Model
- Machine Translation
- Text Classification
- Sentiment Analysis
- Text Generation
You can find our the doc for our master development branch here.
GluonNLP relies on the recent version of MXNet. The easiest way to install MXNet is through pip. The following command installs a nightly built CPU version of MXNet.
pip install --upgrade mxnet==1.3.0
There are other pre-build MXNet packages that enable GPU supports and accelerate CPU performance, please refer to this tutorial for details. Some training scripts are recommended to run on GPUs, if you don’t have a GPU machine at hands, you may consider running on AWS.
Then install the GluonNLP toolkit by
pip install gluonnlp
A Quick Example¶
Here is a quick example that downloads and creates a word embedding model and then computes the cosine similarity between two words.
(You can click the go button on the right bottom corner to run this example.)