From c7dc8c3c6d92a69472e32cf8c858e3a0eebe19a8 Mon Sep 17 00:00:00 2001 From: nikkie Date: Sun, 25 Oct 2020 19:55:23 +0900 Subject: [PATCH 1/2] remove redundant whitespace in new-project.rst (#4346) resolve https://github.com/PyTorchLightning/pytorch-lightning/issues/4345 Co-authored-by: Nicki Skafte --- docs/source/new-project.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/new-project.rst b/docs/source/new-project.rst index 1f051ca1838ff..fabc5cf6e5766 100644 --- a/docs/source/new-project.rst +++ b/docs/source/new-project.rst @@ -719,7 +719,7 @@ Lightning has many tools for debugging. Here is an example of just a few of them .. code-block:: python # train only 20% of an epoch - trainer = pl. Trainer(limit_train_batches=0.2) + trainer = pl.Trainer(limit_train_batches=0.2) .. code-block:: python From 8b3adb96694776286bf0edbaec0278086f76b8e8 Mon Sep 17 00:00:00 2001 From: Eric Harper Date: Sun, 25 Oct 2020 04:57:04 -0600 Subject: [PATCH 2/2] Update to NeMo Documentation (#4328) * updated header and small fixes Signed-off-by: ericharper * updated header and small fixes Signed-off-by: ericharper * updated header and small fixes Signed-off-by: ericharper * updated header and small fixes Signed-off-by: ericharper --- docs/source/{asr_tts.rst => asr_nlp_tts.rst} | 128 +++++++++---------- docs/source/index.rst | 2 +- 2 files changed, 62 insertions(+), 68 deletions(-) rename docs/source/{asr_tts.rst => asr_nlp_tts.rst} (83%) diff --git a/docs/source/asr_tts.rst b/docs/source/asr_nlp_tts.rst similarity index 83% rename from docs/source/asr_tts.rst rename to docs/source/asr_nlp_tts.rst index 5d47ccdc8e5a8..06353aee85413 100644 --- a/docs/source/asr_tts.rst +++ b/docs/source/asr_nlp_tts.rst @@ -1,7 +1,8 @@ -######### -ASR & TTS -######### -These are amazing ecosystems to help with Automatic Speech Recognition (ASR) and Text to speech (TTS). +################# +Conversational AI +################# + +These are amazing ecosystems to help with Automatic Speech Recognition (ASR), Natural Language Processing (NLP), and Text to speech (TTS). ---- @@ -91,7 +92,7 @@ For Docker users, the NeMo container is available on .. code-block:: bash - docker run --runtime=nvidia -it --rm -v --shm-size=8g -p 8888:8888 -p 6006:6006 --ulimit memlock=-1 --ulimit stack=67108864 nvcr.io/nvidia/nemo:1.0.0b1 + docker run --runtime=nvidia -it --rm -v --shm-size=8g -p 8888:8888 -p 6006:6006 --ulimit memlock=-1 --ulimit stack=67108864 nvcr.io/nvidia/nemo:v1.0.0b1 Experiment Manager ------------------ @@ -134,13 +135,13 @@ that can be restored for immediate use. Some typical ASR tasks are included with NeMo: -- `Audio transcription `_ -- `Byte Pair/Word Piece Training `_ -- `Speech Commands `_ -- `Voice Activity Detection `_ -- `Speaker Recognition `_ +- `Audio transcription `_ +- `Byte Pair/Word Piece Training `_ +- `Speech Commands `_ +- `Voice Activity Detection `_ +- `Speaker Recognition `_ -See this `asr notebook `_ +See this `asr notebook `_ for a full tutorial on doing ASR with NeMo, PyTorch Lightning, and Hydra. Specify ASR Model Configurations with YAML File @@ -148,7 +149,7 @@ Specify ASR Model Configurations with YAML File NeMo Models and the PyTorch Lightning Trainer can be fully configured from .yaml files using Hydra. -See this `asr config `_ +See this `asr config `_ for the entire speech to text .yaml file. .. code-block:: yaml @@ -165,11 +166,11 @@ for the entire speech to text .yaml file. model: ... encoder: - _target_: nemo.collections.asr.modules.ConvASREncoder + cls: nemo.collections.asr.modules.ConvASREncoder params: - feat_in: *n_mels - activation: relu - conv_mask: true + feat_in: *n_mels + activation: relu + conv_mask: true jasper: - filters: 128 @@ -185,7 +186,7 @@ for the entire speech to text .yaml file. Developing ASR Model From Scratch --------------------------------- -`speech_to_text.py `_ +`speech_to_text.py `_ .. code-block:: python @@ -318,13 +319,13 @@ NeMo can also be used for pretraining BERT-based language models from HuggingFac Any of the HuggingFace encoders or Megatron-LM encoders can easily be used for the NLP tasks that are included with NeMo: -- `Glue Benchmark (All tasks) `_ -- `Intent Slot Classification `_ -- `Language Modeling (BERT Pretraining) `_ -- `Question Answering `_ -- `Text Classification `_ (including Sentiment Analysis) -- `Token Classifcation `_ (including Named Entity Recognition) -- `Punctuation and Capitalization `_ +- `Glue Benchmark (All tasks) `_ +- `Intent Slot Classification `_ +- `Language Modeling (BERT Pretraining) `_ +- `Question Answering `_ +- `Text Classification `_ (including Sentiment Analysis) +- `Token Classifcation `_ (including Named Entity Recognition) +- `Punctuation and Capitalization `_ Named Entity Recognition (NER) ------------------------------ @@ -332,15 +333,15 @@ Named Entity Recognition (NER) NER (or more generally token classifcation) is the NLP task of detecting and classifying key information (entities) in text. This task is very popular in Healthcare and Finance. In finance, for example, it can be important to identify geographical, geopolitical, organizational, persons, events, and natural phenomenon entities. -See this `NER notebook `_ +See this `NER notebook `_ for a full tutorial on doing NER with NeMo, PyTorch Lightning, and Hydra. Specify NER Model Configurations with YAML File ----------------------------------------------- -..note NeMo Models and the PyTorch Lightning Trainer can be fully configured from .yaml files using Hydra. +.. note:: NeMo Models and the PyTorch Lightning Trainer can be fully configured from .yaml files using Hydra. -See this `token classification config `_ +See this `token classification config `_ for the entire NER (token classification) .yaml file. .. code-block:: yaml @@ -379,7 +380,7 @@ for the entire NER (token classification) .yaml file. Developing NER Model From Scratch --------------------------------- -`token_classification.py `_ +`token_classification.py `_ .. code-block:: python @@ -432,7 +433,7 @@ Hydra makes every aspect of the NeMo model, including the PyTorch Lightning Trai ----------- Tokenizers -========== +---------- Tokenization is the process of converting natural langauge text into integer arrays which can be used for machine learning. @@ -450,7 +451,7 @@ To see the list of supported tokenizers: nemo_nlp.modules.get_tokenizer_list() -See this `tokenizer notebook `_ +See this `tokenizer notebook `_ for a full tutorial on using tokenizers in NeMo. Language Models @@ -460,7 +461,7 @@ Language models are used to extract information from (tokenized) text. Much of the state-of-the-art in natural language processing is achieved by fine-tuning pretrained language models on the downstream task. -With NeMo, you can either `pretrain `_ +With NeMo, you can either `pretrain `_ a BERT model on your data or use a pretrained lanugage model from `HuggingFace Transformers `_ or `NVIDIA Megatron-LM `_. @@ -476,7 +477,7 @@ Easily switch between any language model in the above list by using `.get_lm_mod nemo_nlp.modules.get_lm_model(pretrained_model_name='distilbert-base-uncased') -See this `language model notebook `_ +See this `language model notebook `_ for a full tutorial on using pretrained language models in NeMo. Using a Pre-trained NER Model @@ -573,22 +574,22 @@ Second, a model is used to generate audio from a mel spectrogram. Mel Spectrogram Generators: -- `Tacotron 2 `_ -- `Glow-TTS `_ +- `Tacotron 2 `_ +- `Glow-TTS `_ Audio Generators: - Griffin-Lim -- `WaveGlow `_ -- `SqueezeWave `_ +- `WaveGlow `_ +- `SqueezeWave `_ Specify TTS Model Configurations with YAML File ----------------------------------------------- -..note NeMo Models and PyTorch Lightning Trainer can be fully configured from .yaml files using Hydra. +.. note:: NeMo Models and PyTorch Lightning Trainer can be fully configured from .yaml files using Hydra. -`tts/conf/glow_tts.yaml `_ +`tts/conf/glow_tts.yaml `_ .. code-block:: yaml @@ -604,21 +605,21 @@ Specify TTS Model Configurations with YAML File model: ... encoder: - _target_: nemo.collections.tts.modules.glow_tts.TextEncoder - params: - n_vocab: 148 - out_channels: *n_mels - hidden_channels: 192 - filter_channels: 768 - filter_channels_dp: 256 - ... + cls: nemo.collections.tts.modules.glow_tts.TextEncoder + params: + n_vocab: 148 + out_channels: *n_mels + hidden_channels: 192 + filter_channels: 768 + filter_channels_dp: 256 + ... # all other configuration, data, optimizer, parser, preprocessor, etc ... Developing TTS Model From Scratch --------------------------------- -`tts/glow_tts.py `_ +`tts/glow_tts.py `_ .. code-block:: python @@ -641,7 +642,7 @@ Hydra makes every aspect of the NeMo model, including the PyTorch Lightning Trai validation_datasets=/path/to/val/data \ model.train_ds.batch_size = 64 \ -..note Training NeMo TTTs models from scratch take days/weeks so it is highly recommended to use multiple GPUs and multiple nodes with the PyTorch Lightning Trainer. +.. note:: Training NeMo TTS models from scratch can take days or weeks so it is highly recommended to use multiple GPUs and multiple nodes with the PyTorch Lightning Trainer. Using State-Of-The-Art Pre-trained TTS Model -------------------------------------------- @@ -649,7 +650,7 @@ Using State-Of-The-Art Pre-trained TTS Model Generate speech using models trained on `LJSpeech `, around 24 hours of single speaker data. -See this `TTS notebook `_ +See this `TTS notebook `_ for a full tutorial on generating speech with NeMo, PyTorch Lightning, and Hydra. .. code-block:: python @@ -692,7 +693,7 @@ NeMo TTS Model Under the Hood Any aspect of TTS training or model architecture design can easily be customized with PyTorch Lightning since every NeMo model is a LightningModule. -`glow_tts.py `_ +`glow_tts.py `_ .. code-block:: python @@ -787,22 +788,15 @@ for a production-grade application. Learn More ========== -Download pre-trained -`ASR `_, -`NLP `_, -and `TTS `_ models -on `NVIDIA NGC `_ to quickly get started with NeMo. - - -Become an expert on Building Conversational AI applications with -our `tutorials `_, -and `example scripts `_, - -.. note:: Most NeMo tutorial notebooks can be run on `Google Colab `_. +- Watch the `NVIDIA NeMo Intro Video `_ +- Watch the `PyTorch Lightning and NVIDIA NeMo Discussion Video `_ +- Visit the `NVIDIA NeMo Developer Website `_ +- Read the `NVIDIA NeMo PyTorch Blog `_ +- Download pre-trained `ASR `_, `NLP `_, and `TTS `_ models on `NVIDIA NGC `_ to quickly get started with NeMo. +- Become an expert on Building Conversational AI applications with our `tutorials `_, and `example scripts `_, +- See our `developer guide `_ for more information on core NeMo concepts, ASR/NLP/TTS collections, and the NeMo API. -`NVIDIA NeMo `_ is actively being developed on GitHub. -`Contributions `_ are welcome! +.. note:: NeMo tutorial notebooks can be run on `Google Colab `_. -See our `developer guide `_ for -more information on core NeMo concepts, ASR/NLP/TTS collections, -and the NeMo API. +NVIDIA `NeMo `_ is actively being developed on GitHub. +`Contributions `_ are welcome! diff --git a/docs/source/index.rst b/docs/source/index.rst index 108f93b606f4f..6ea7709a8e72f 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -111,7 +111,7 @@ PyTorch Lightning Documentation :name: Partner Domain Frameworks :caption: Partner Domain Frameworks - asr_tts + asr_nlp_tts .. toctree:: :maxdepth: 1