GluonNLP: NLP made easy¶
Get Started: 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 play button below to run this example.)
Model Zoo¶
Mapping words to vectors.
Learning the distribution and representation of sequences of words.
From “Hello” to “Bonjour”.
Categorize texts and documents.
Classifying polarity of emotions and opinions.
Dependency parsing.
Determine if the premise semantically entails the hypothesis.
Generating language from models.
Transferring pre-trained language representations to language understanding tasks.
Locating and classifying named entity mentioned in unstructured texts.
Predicting the intent of the query and extracting semantic concepts in the query.
Converting NLP models from other frameworks to GluonNLP.
And more in tutorials.
Installation¶
Select your preferences and run the install command.
OS: Linux macOS Windows
Version: Stable Nightly Source
Backend: Native CUDA MKL-DNN CUDA + MKL-DNN
Prerequisites:
Requires pip >= 9.. Python 3.5+ are supported.
Nightly build provides latest features for enthusiasts.
Command:
pip install --upgrade mxnet gluonnlp
# Here we assume CUDA 10.0 is installed. You can change the number
# according to your own CUDA version.
pip install --upgrade mxnet-cu100 gluonnlp
pip install --upgrade mxnet-mkl gluonnlp
# Here we assume CUDA 10.0 is installed. You can change the number
# according to your own CUDA version.
pip install --upgrade mxnet-cu100mkl gluonnlp
pip install --pre --upgrade mxnet https://github.com/dmlc/gluon-nlp/tarball/master
pip install --pre --upgrade mxnet-cu100 https://github.com/dmlc/gluon-nlp/tarball/master
pip install --pre --upgrade mxnet-mkl https://github.com/dmlc/gluon-nlp/tarball/master
pip install --pre --upgrade mxnet-cu100mkl https://github.com/dmlc/gluon-nlp/tarball/master
pip install --pre --upgrade mxnet
git clone https://github.com/dmlc/gluon-nlp --branch master
cd gluon-nlp && python setup.py install --user
pip install --pre --upgrade mxnet-cu100
git clone https://github.com/dmlc/gluon-nlp
cd gluon-nlp && python setup.py install --user
pip install --pre --upgrade mxnet-mkl
git clone https://github.com/dmlc/gluon-nlp
cd gluon-nlp && python setup.py install --user
pip install --pre --upgrade mxnet-cu100mkl
git clone https://github.com/dmlc/gluon-nlp
cd gluon-nlp && python setup.py install --user
Check Installation for more installation instructions and options.
About GluonNLP¶
Hint
You can find our the doc for our master development branch here.
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 five 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.
Tutorials to help get started on new NLP tasks.
Community support.
This toolkit assumes that users have basic knowledge about deep learning and NLP. Otherwise, please refer to an introductory course such as Dive into Deep Learning or Stanford CS224n. If you are not familiar with Gluon, check out the Gluon documentation. You may find the 60-min Gluon crash course linked from there especially helpful.