NVIDIA
NVIDIA
NeMo - Natural Language Processing
Collection
NVIDIA
NVIDIA
NeMo - Natural Language Processing

This collection contains NeMo models for Natural Language Processing (NLP): Question Answering, Translation, Named Entity Recognition, Punctuation and Capitalization, Base NLP models.

Overview

NVIDIA NeMo toolkit supports Natural Language Processing (NLP) models for the following tasks:

  • Language modelling (BERT, Megatron, etc)
  • Extractive questions answering
  • Named entity recognition
  • Text classification
  • Intent prediction and slot filling
  • Automatic text punctuation and capitalization
  • Neural machine translation

For detailed information regarding NeMo's NLP capabilities, visit the NeMo NLP documentation page.

Usage

You can instantiate many pretrained models automatically directly from NGC. To do so, start your script with:

import nemo
import nemo.collections.nlp as nemo_nlp

Then chose what type of model you would like to instantiate. See table below for the list of models that are available for each task. For example:

# Neural Machine Translation model for Russian to English translation
nmt_model = nemo_nlp.models.MTEncDecModel.from_pretrained(model_name='nmt_ru_en_transformer6x6').cuda()
# Use it to translate Russian text to English
english_text = nmt_model.translate(["Привет мир!"])
# This will print: "Hello world!"
print(english_text)

Note that you can also list all available models using API by calling <base_class>.list_available_models(...) method. You can also download a models ".nemo" files from the "File Browser" tab and then instantiate those models with <base_class>.restore_from(PATH_TO_DOTNEMO_FILE) method. In this case, make sure you are matching NeMo and models' versions.

Available pre-trained models

Model NameTaskModel Card
punctuation_en_bertPunctuation & CapitalizationNGC Model Card
punctuation_en_distilbertPunctuation & CapitalizationNGC Model Card
ner_en_bertNamed Entity RecognitionNGC Model Card
bertbaseuncasedLanguage ModelingNGC Model Card
bertlargeuncasedLanguage ModelingNGC Model Card
qa_squadv1_1_bertbaseQuestion AnsweringNGC Model Card
qa_squadv2_0_bertbaseQuestion AnsweringNGC Model Card
qa_squadv1_1_bertlargeQuestion AnsweringNGC Model Card
qa_squadv2_0_bertlargeQuestion AnsweringNGC Model Card
qa_squadv1_1_megatron_casedQuestion AnsweringNGC Model Card
qa_squadv2_0_megatron_casedQuestion AnsweringNGC Model Card
qa_squadv1_1_megatron_uncasedQuestion AnsweringNGC Model Card
qa_squadv2_0_megatron_uncasedQuestion AnsweringNGC Model Card
nmt_en_de_transformer12x2Machine TranslationNGC Model Card
nmt_de_en_transformer12x2Machine TranslationNGC Model Card
nmt_en_es_transformer12x2Machine TranslationNGC Model Card
nmt_es_en_transformer12x2Machine TranslationNGC Model Card
nmt_en_fr_transformer12x2Machine TranslationNGC Model Card
nmt_fr_en_transformer12x2Machine TranslationNGC Model Card
nmt_en_ru_transformer6x6Machine TranslationNGC Model Card
nmt_ru_en_transformer6x6Machine TranslationNGC Model Card
nmt_zh_en_transformer6x6Machine TranslationNGC Model Card
nmt_en_zh_transformer6x6Machine TranslationNGC Model Card

Compatibility with HuggingFace and Megatron language models.

It is possible to use pre-trained models from HuggingFace transformers library and NVIDIA Megatron as encoders for various NeMo NLP models. Please refer to this documentation section for details.

NVIDIA uses cookies to improve your experience on our web site. We and our third-party partners also use cookies and other tools to collect and record information you provide as well as information about your interactions with our websites for performance improvement, analytics, and to assist in marketing efforts. By clicking "Accept All", you consent to our use of cookies and other tools as described in our Cookie Policy. You can manage your cookie settings by clicking on "Manage Settings." By continuing to use this site or by clicking one of the buttons below, you agree to our Terms of Service (which contains important waivers). Please see our Privacy Policy for more information on our privacy practices.