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.
This project is at an early stage and is under active development. Please expect that it will be updated frequently. Contributions are welcome.
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 --pre --upgrade mxnet
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.)