├── .dockerignore ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── .readthedocs.yml ├── CONTRIBUTING.md ├── Dockerfile ├── Jenkinsfile ├── LICENSE ├── README.rst ├── docs ├── .nojekyll ├── Makefile ├── source │ ├── _static │ │ ├── css │ │ │ └── custom.css │ │ └── js │ │ │ └── pk_scripts.js │ ├── asr │ │ ├── api.rst │ │ ├── asr_all.bib │ │ ├── asr_language_modeling.rst │ │ ├── configs.rst │ │ ├── data │ │ │ ├── asr_results.csv │ │ │ ├── asrlm_results.csv │ │ │ ├── benchmark_ca.csv │ │ │ ├── benchmark_de.csv │ │ │ ├── benchmark_en.csv │ │ │ ├── benchmark_es.csv │ │ │ ├── benchmark_fr.csv │ │ │ ├── benchmark_it.csv │ │ │ ├── benchmark_pl.csv │ │ │ ├── benchmark_ru.csv │ │ │ └── benchmark_zh.csv │ │ ├── datasets.rst │ │ ├── images │ │ │ ├── citrinet_vertical.png │ │ │ ├── conformer_ctc.png │ │ │ ├── ctc_asr.png │ │ │ ├── jasper_layers.png │ │ │ ├── jasper_vertical.png │ │ │ └── quartz_vertical.png │ │ ├── intro.rst │ │ ├── models.rst │ │ ├── results.rst │ │ ├── speaker_diarization │ │ │ ├── api.rst │ │ │ ├── configs.rst │ │ │ ├── data │ │ │ │ └── diarization_results.csv │ │ │ ├── datasets.rst │ │ │ ├── images │ │ │ │ └── sd_pipeline.png │ │ │ ├── intro.rst │ │ │ ├── models.rst │ │ │ └── results.rst │ │ ├── speaker_recognition │ │ │ ├── configs.rst │ │ │ ├── data │ │ │ │ └── speaker_results.csv │ │ │ ├── datasets.rst │ │ │ ├── images │ │ │ │ └── ICASPP_SpeakerNet.png │ │ │ ├── intro.rst │ │ │ ├── models.rst │ │ │ └── results.rst │ │ └── speech_classification │ │ │ ├── configs.rst │ │ │ ├── data │ │ │ └── classification_results.csv │ │ │ ├── datasets.rst │ │ │ ├── images │ │ │ ├── marblenet_vertical.png │ │ │ └── matchboxnet_vertical.png │ │ │ ├── intro.rst │ │ │ ├── models.rst │ │ │ └── results.rst │ ├── common │ │ └── intro.rst │ ├── conf.py │ ├── core │ │ ├── core.rst │ │ └── whyntypes.gif │ ├── favicon.ico │ ├── index.rst │ ├── nemo_text_processing │ │ ├── api.rst │ │ ├── intro.rst │ │ ├── inverse_text_normalization.rst │ │ ├── text_normalization.rst │ │ └── textprocessing_all.bib │ ├── nlp │ │ ├── api.rst │ │ ├── bert_pretraining.rst │ │ ├── glue_benchmark.rst │ │ ├── information_retrieval.rst │ │ ├── intro.rst │ │ ├── joint_intent_slot.rst │ │ ├── language_modeling.rst │ │ ├── machine_translation.rst │ │ ├── megatron_finetuning.rst │ │ ├── models.rst │ │ ├── nlp_all.bib │ │ ├── nlp_model.rst │ │ ├── punctuation_and_capitalization.rst │ │ ├── question_answering.rst │ │ ├── sgd_qa.rst │ │ ├── text_classification.rst │ │ └── token_classification.rst │ ├── nv_logo.png │ ├── starthere │ │ ├── best-practices.rst │ │ ├── intro.rst │ │ └── tutorials.rst │ ├── tools │ │ ├── ctc_segmentation.rst │ │ ├── intro.rst │ │ ├── speech_data_explorer.rst │ │ ├── text_processing_deployment.rst │ │ └── tools_all.bib │ └── tts │ │ ├── api.rst │ │ ├── datasets.rst │ │ └── intro.rst └── update_docs_docker.sh ├── examples ├── asr │ ├── asr_webapp │ │ ├── Dockerfile │ │ ├── README.rst │ │ ├── asr_service.py │ │ ├── docker_container_build.sh │ │ ├── docker_container_run.sh │ │ ├── gunicorn.conf.py │ │ ├── model_api.py │ │ ├── requirements.txt │ │ ├── templates │ │ │ ├── main.html │ │ │ ├── toast_msg.html │ │ │ ├── transcripts.html │ │ │ └── updates │ │ │ │ ├── remove_files.html │ │ │ │ ├── upload_files_failed.html │ │ │ │ └── upload_files_successful.html │ │ └── wsgi.py │ ├── conf │ │ ├── citrinet │ │ │ ├── citrinet_384.yaml │ │ │ ├── citrinet_512.yaml │ │ │ └── config_bpe.yaml │ │ ├── config.yaml │ │ ├── conformer │ │ │ ├── conformer_ctc_bpe.yaml │ │ │ └── conformer_ctc_char.yaml │ │ ├── jasper │ │ │ └── jasper_10x5dr.yaml │ │ ├── marblenet │ │ │ └── marblenet_3x2x64.yaml │ │ ├── matchboxnet │ │ │ ├── matchboxnet_3x1x64_v1.yaml │ │ │ └── matchboxnet_3x1x64_v2.yaml │ │ └── quartznet │ │ │ ├── quartznet_15x5.yaml │ │ │ └── quartznet_15x5_zh.yaml │ ├── experimental │ │ ├── conformer │ │ │ └── conformer_rnnt_bpe.yaml │ │ ├── contextnet_rnnt │ │ │ ├── config_rnnt.yaml │ │ │ └── config_rnnt_bpe.yaml │ │ ├── quartznet │ │ │ └── quartznet_15x5_aug.yaml │ │ ├── sclite │ │ │ └── speech_to_text_sclite.py │ │ ├── structured │ │ │ ├── conf │ │ │ │ └── quartznet_15x5.yaml │ │ │ ├── speech_to_text_hybrid.py │ │ │ ├── speech_to_text_structured.py │ │ │ └── speech_to_text_structured_v2.py │ │ └── wav2vec │ │ │ ├── configs │ │ │ ├── wav2vec_pretrain.yaml │ │ │ └── wav2vec_pretrain_large.yaml │ │ │ └── wav2vec_pretrain.py │ ├── quantization │ │ ├── speech_to_text_calibrate.py │ │ ├── speech_to_text_quant_infer.py │ │ └── speech_to_text_quant_infer_trt.py │ ├── speech_to_label.py │ ├── speech_to_text.py │ ├── speech_to_text_bpe.py │ ├── speech_to_text_infer.py │ ├── speech_to_text_rnnt.py │ ├── speech_to_text_rnnt_bpe.py │ ├── transcribe_speech.py │ └── vad_infer.py ├── cv │ └── mnist_lenet5_image_classification_pure_lightning.py ├── nlp │ ├── dialogue_state_tracking │ │ ├── conf │ │ │ └── sgdqa_config.yaml │ │ └── sgd_qa.py │ ├── entity_linking │ │ ├── build_index.py │ │ ├── conf │ │ │ ├── tiny_example_entity_linking_config.yaml │ │ │ └── umls_medical_entity_linking_config.yaml │ │ ├── data │ │ │ └── umls_dataset_processing.py │ │ ├── query_index.py │ │ └── self_alignment_pretraining.py │ ├── glue_benchmark │ │ ├── glue_benchmark.py │ │ └── glue_benchmark_config.yaml │ ├── information_retrieval │ │ ├── bert_dpr.py │ │ ├── bert_joint_ir.py │ │ ├── conf │ │ │ └── bert_ir_config.yaml │ │ ├── construct_random_negatives.py │ │ └── get_msmarco.sh │ ├── intent_slot_classification │ │ ├── conf │ │ │ └── intent_slot_classification_config.yaml │ │ ├── data │ │ │ ├── assistant_utils.py │ │ │ └── import_datasets.py │ │ └── intent_slot_classification.py │ ├── language_modeling │ │ ├── bert_pretraining.py │ │ ├── conf │ │ │ ├── bert_pretraining_from_preprocessed_config.yaml │ │ │ ├── bert_pretraining_from_text_config.yaml │ │ │ └── transformer_lm_config.yaml │ │ ├── convert_weights_to_nemo1.0.py │ │ ├── get_wkt2.sh │ │ └── transformer_lm.py │ ├── machine_translation │ │ ├── conf │ │ │ ├── aayn_base.yaml │ │ │ └── huggingface.yaml │ │ ├── create_tarred_monolingual_dataset.py │ │ ├── create_tarred_parallel_dataset.py │ │ ├── enc_dec_nmt.py │ │ ├── nmt_transformer_infer.py │ │ ├── nmt_webapp │ │ │ ├── README.rst │ │ │ ├── config.json │ │ │ ├── index.html │ │ │ ├── nmt_service.py │ │ │ ├── requirements.txt │ │ │ └── style.css │ │ └── translate_ddp.py │ ├── question_answering │ │ ├── conf │ │ │ └── question_answering_squad_config.yaml │ │ ├── get_squad.py │ │ └── question_answering_squad.py │ ├── text2sparql │ │ ├── conf │ │ │ └── text2sparql_config.yaml │ │ ├── data │ │ │ └── import_datasets.py │ │ ├── evaluate_text2sparql.py │ │ └── text2sparql.py │ ├── text_classification │ │ ├── conf │ │ │ └── text_classification_config.yaml │ │ ├── data │ │ │ └── import_datasets.py │ │ ├── model_parallel_text_classification_evaluation.py │ │ └── text_classification_with_bert.py │ └── token_classification │ │ ├── conf │ │ ├── punctuation_capitalization_config.yaml │ │ └── token_classification_config.yaml │ │ ├── data │ │ ├── get_tatoeba_data.py │ │ ├── import_from_iob_format.py │ │ └── prepare_data_for_punctuation_capitalization.py │ │ ├── punctuation_capitalization_evaluate.py │ │ ├── punctuation_capitalization_train.py │ │ ├── token_classification_evaluate.py │ │ └── token_classification_train.py ├── speaker_recognition │ ├── README.md │ ├── conf │ │ ├── SpeakerNet_recognition_3x2x512.yaml │ │ ├── SpeakerNet_verification_3x2x512.yaml │ │ └── speaker_diarization.yaml │ ├── extract_speaker_embeddings.py │ ├── speaker_diarize.py │ ├── speaker_reco.py │ ├── speaker_reco_finetune.py │ ├── speaker_reco_infer.py │ └── voxceleb_eval.py └── tts │ ├── aligner.py │ ├── conf │ ├── aligner.yaml │ ├── degli.yaml │ ├── ed_mel2spec.yaml │ ├── fastpitch.yaml │ ├── fastpitch_align.yaml │ ├── fastpitch_hifigan_e2e.yaml │ ├── fastspeech2.yaml │ ├── fastspeech2_hifigan_e2e.yaml │ ├── glow_tts.yaml │ ├── hifigan │ │ ├── hifigan.yaml │ │ └── model │ │ │ ├── generator │ │ │ ├── v1.yaml │ │ │ ├── v2.yaml │ │ │ └── v3.yaml │ │ │ ├── train_ds │ │ │ ├── train_ds.yaml │ │ │ └── train_ds_finetune.yaml │ │ │ └── validation_ds │ │ │ ├── val_ds.yaml │ │ │ └── val_ds_finetune.yaml │ ├── melgan.yaml │ ├── squeezewave.yaml │ ├── tacotron2.yaml │ ├── talknet-durs.yaml │ ├── talknet-pitch.yaml │ ├── talknet-spect.yaml │ ├── uniglow.yaml │ └── waveglow.yaml │ ├── degli.py │ ├── ed_mel2spec.py │ ├── fastpitch.py │ ├── fastpitch_hifigan_e2e.py │ ├── fastspeech2.py │ ├── fastspeech2_hifigan_e2e.py │ ├── glow_tts.py │ ├── hifigan.py │ ├── melgan.py │ ├── squeezewave.py │ ├── tacotron2.py │ ├── talknet_durs.py │ ├── talknet_pitch.py │ ├── talknet_spect.py │ ├── test_tts_infer.py │ ├── uniglow.py │ └── waveglow.py ├── external ├── get_collections.py └── get_modules.py ├── nemo ├── README.md ├── __init__.py ├── collections │ ├── __init__.py │ ├── asr │ │ ├── __init__.py │ │ ├── data │ │ │ ├── __init__.py │ │ │ ├── audio_to_label.py │ │ │ ├── audio_to_label_dataset.py │ │ │ ├── audio_to_text.py │ │ │ ├── audio_to_text_dali.py │ │ │ ├── audio_to_text_dataset.py │ │ │ ├── feature_to_label.py │ │ │ ├── feature_to_label_dataset.py │ │ │ └── vocabs.py │ │ ├── losses │ │ │ ├── __init__.py │ │ │ ├── angularloss.py │ │ │ ├── ctc.py │ │ │ ├── rnnt.py │ │ │ └── wav2vecloss.py │ │ ├── metrics │ │ │ ├── __init__.py │ │ │ ├── rnnt_wer.py │ │ │ ├── rnnt_wer_bpe.py │ │ │ ├── wer.py │ │ │ └── wer_bpe.py │ │ ├── models │ │ │ ├── __init__.py │ │ │ ├── asr_model.py │ │ │ ├── classification_models.py │ │ │ ├── clustering_diarizer.py │ │ │ ├── configs │ │ │ │ ├── __init__.py │ │ │ │ ├── classification_models_config.py │ │ │ │ ├── ctc_models_config.py │ │ │ │ ├── matchboxnet_config.py │ │ │ │ └── quartznet_config.py │ │ │ ├── ctc_bpe_models.py │ │ │ ├── ctc_models.py │ │ │ ├── label_models.py │ │ │ ├── rnnt_bpe_models.py │ │ │ ├── rnnt_models.py │ │ │ └── wav2vec │ │ │ │ ├── __init__.py │ │ │ │ ├── wav2vec_config.py │ │ │ │ └── wav2vec_model.py │ │ ├── modules │ │ │ ├── __init__.py │ │ │ ├── audio_preprocessing.py │ │ │ ├── beam_search_decoder.py │ │ │ ├── conformer_encoder.py │ │ │ ├── conv_asr.py │ │ │ ├── lstm_decoder.py │ │ │ ├── rnnt.py │ │ │ ├── rnnt_abstract.py │ │ │ └── wav2vec_modules.py │ │ └── parts │ │ │ ├── __init__.py │ │ │ ├── features.py │ │ │ ├── mixins │ │ │ ├── __init__.py │ │ │ └── mixins.py │ │ │ ├── numba │ │ │ ├── __init__.py │ │ │ ├── rnnt_loss │ │ │ │ ├── __init__.py │ │ │ │ ├── rnnt.py │ │ │ │ ├── rnnt_numpy.py │ │ │ │ ├── rnnt_pytorch.py │ │ │ │ └── utils │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── cpu_utils │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── cpu_rnnt.py │ │ │ │ │ ├── cuda_utils │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── gpu_rnnt.py │ │ │ │ │ ├── gpu_rnnt_kernel.py │ │ │ │ │ └── reduce.py │ │ │ │ │ ├── global_constants.py │ │ │ │ │ └── rnnt_helper.py │ │ │ └── spec_augment │ │ │ │ ├── __init__.py │ │ │ │ └── spec_aug_numba.py │ │ │ ├── preprocessing │ │ │ ├── __init__.py │ │ │ ├── feature_loader.py │ │ │ ├── features.py │ │ │ ├── perturb.py │ │ │ └── segment.py │ │ │ ├── submodules │ │ │ ├── __init__.py │ │ │ ├── conformer_modules.py │ │ │ ├── jasper.py │ │ │ ├── multi_head_attention.py │ │ │ ├── rnnt_beam_decoding.py │ │ │ ├── rnnt_greedy_decoding.py │ │ │ ├── spectr_augment.py │ │ │ ├── subsampling.py │ │ │ └── wav2vec.py │ │ │ └── utils │ │ │ ├── __init__.py │ │ │ ├── activations.py │ │ │ ├── asr_module_utils.py │ │ │ ├── nmse_clustering.py │ │ │ ├── numba_utils.py │ │ │ ├── rnnt_utils.py │ │ │ ├── speaker_utils.py │ │ │ └── vad_utils.py │ ├── common │ │ ├── __init__.py │ │ ├── callbacks │ │ │ ├── __init__.py │ │ │ └── callbacks.py │ │ ├── data │ │ │ ├── __init__.py │ │ │ └── dataset.py │ │ ├── losses │ │ │ ├── __init__.py │ │ │ ├── aggregator.py │ │ │ ├── cross_entropy.py │ │ │ ├── mse_loss.py │ │ │ ├── multi_similarity_loss.py │ │ │ ├── smoothed_cross_entropy.py │ │ │ └── spanning_loss.py │ │ ├── metrics │ │ │ ├── __init__.py │ │ │ ├── classification_accuracy.py │ │ │ ├── global_average_loss_metric.py │ │ │ └── perplexity.py │ │ ├── parts │ │ │ ├── __init__.py │ │ │ ├── multi_layer_perceptron.py │ │ │ ├── patch_utils.py │ │ │ ├── preprocessing │ │ │ │ ├── __init__.py │ │ │ │ ├── cleaners.py │ │ │ │ ├── collections.py │ │ │ │ ├── manifest.py │ │ │ │ └── parsers.py │ │ │ ├── rnn.py │ │ │ ├── transformer_utils.py │ │ │ └── utils.py │ │ └── tokenizers │ │ │ ├── __init__.py │ │ │ ├── char_tokenizer.py │ │ │ ├── chinese_tokenizers.py │ │ │ ├── en_ja_tokenizers.py │ │ │ ├── fairseq_tokenizer.py │ │ │ ├── huggingface │ │ │ ├── __init__.py │ │ │ └── auto_tokenizer.py │ │ │ ├── moses_tokenizers.py │ │ │ ├── sentencepiece_tokenizer.py │ │ │ ├── tokenizer_spec.py │ │ │ ├── word_tokenizer.py │ │ │ └── youtokentome_tokenizer.py │ ├── cv │ │ ├── __init__.py │ │ ├── datasets │ │ │ ├── __init__.py │ │ │ └── mnist_dataset.py │ │ ├── losses │ │ │ ├── __init__.py │ │ │ └── nll_loss.py │ │ ├── models │ │ │ ├── __init__.py │ │ │ └── mnist_lenet5.py │ │ └── modules │ │ │ ├── __init__.py │ │ │ └── lenet5.py │ ├── nlp │ │ ├── __init__.py │ │ ├── data │ │ │ ├── __init__.py │ │ │ ├── data_utils │ │ │ │ ├── __init__.py │ │ │ │ └── data_preprocessing.py │ │ │ ├── dialogue_state_tracking │ │ │ │ ├── __init__.py │ │ │ │ └── sgd │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── data_processor.py │ │ │ │ │ ├── dataset.py │ │ │ │ │ ├── evaluate.py │ │ │ │ │ ├── input_example.py │ │ │ │ │ ├── metrics.py │ │ │ │ │ ├── prediction_utils.py │ │ │ │ │ └── schema.py │ │ │ ├── entity_linking │ │ │ │ ├── __init__.py │ │ │ │ └── entity_linking_dataset.py │ │ │ ├── glue_benchmark │ │ │ │ ├── __init__.py │ │ │ │ ├── data_processors.py │ │ │ │ └── glue_benchmark_dataset.py │ │ │ ├── information_retrieval │ │ │ │ ├── __init__.py │ │ │ │ └── information_retrieval_dataset.py │ │ │ ├── intent_slot_classification │ │ │ │ ├── __init__.py │ │ │ │ ├── intent_slot_classification_dataset.py │ │ │ │ └── intent_slot_classification_descriptor.py │ │ │ ├── language_modeling │ │ │ │ ├── __init__.py │ │ │ │ ├── l2r_lm_dataset.py │ │ │ │ ├── lm_bert_dataset.py │ │ │ │ └── sentence_dataset.py │ │ │ ├── machine_translation │ │ │ │ ├── __init__.py │ │ │ │ ├── machine_translation_dataset.py │ │ │ │ └── preproc_mt_data.py │ │ │ ├── neural_machine_translation │ │ │ │ ├── __init__.py │ │ │ │ └── neural_machine_translation_dataset.py │ │ │ ├── question_answering_squad │ │ │ │ ├── __init__.py │ │ │ │ ├── qa_dataset.py │ │ │ │ └── qa_squad_processing.py │ │ │ ├── text_classification │ │ │ │ ├── __init__.py │ │ │ │ └── text_classification_dataset.py │ │ │ └── token_classification │ │ │ │ ├── __init__.py │ │ │ │ ├── punctuation_capitalization_dataset.py │ │ │ │ ├── token_classification_dataset.py │ │ │ │ └── token_classification_utils.py │ │ ├── losses │ │ │ ├── __init__.py │ │ │ └── sgd_loss.py │ │ ├── metrics │ │ │ ├── __init__.py │ │ │ ├── classification_report.py │ │ │ └── sequence_perplexity.py │ │ ├── models │ │ │ ├── __init__.py │ │ │ ├── dialogue_state_tracking │ │ │ │ ├── __init__.py │ │ │ │ └── sgdqa_model.py │ │ │ ├── enc_dec_nlp_model.py │ │ │ ├── entity_linking │ │ │ │ ├── __init__.py │ │ │ │ └── entity_linking_model.py │ │ │ ├── glue_benchmark │ │ │ │ ├── __init__.py │ │ │ │ ├── glue_benchmark_model.py │ │ │ │ └── metrics_for_glue.py │ │ │ ├── information_retrieval │ │ │ │ ├── __init__.py │ │ │ │ ├── base_ir_model.py │ │ │ │ ├── bert_dpr_model.py │ │ │ │ └── bert_joint_ir_model.py │ │ │ ├── intent_slot_classification │ │ │ │ ├── __init__.py │ │ │ │ └── intent_slot_classification_model.py │ │ │ ├── language_modeling │ │ │ │ ├── __init__.py │ │ │ │ ├── bert_lm_model.py │ │ │ │ └── transformer_lm_model.py │ │ │ ├── machine_translation │ │ │ │ ├── __init__.py │ │ │ │ ├── mt_enc_dec_config.py │ │ │ │ └── mt_enc_dec_model.py │ │ │ ├── neural_machine_translation │ │ │ │ ├── __init__.py │ │ │ │ └── neural_machine_translation_model.py │ │ │ ├── nlp_model.py │ │ │ ├── question_answering │ │ │ │ ├── __init__.py │ │ │ │ └── qa_model.py │ │ │ ├── text_classification │ │ │ │ ├── __init__.py │ │ │ │ └── text_classification_model.py │ │ │ └── token_classification │ │ │ │ ├── __init__.py │ │ │ │ ├── punctuation_capitalization_model.py │ │ │ │ └── token_classification_model.py │ │ ├── modules │ │ │ ├── __init__.py │ │ │ ├── common │ │ │ │ ├── __init__.py │ │ │ │ ├── bert_module.py │ │ │ │ ├── classifier.py │ │ │ │ ├── decoder_module.py │ │ │ │ ├── encoder_module.py │ │ │ │ ├── huggingface │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── albert.py │ │ │ │ │ ├── bert.py │ │ │ │ │ ├── distilbert.py │ │ │ │ │ ├── huggingface_decoder.py │ │ │ │ │ ├── huggingface_encoder.py │ │ │ │ │ ├── huggingface_utils.py │ │ │ │ │ └── roberta.py │ │ │ │ ├── lm_utils.py │ │ │ │ ├── megatron │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── megatron_bert.py │ │ │ │ │ └── megatron_utils.py │ │ │ │ ├── sequence_classifier.py │ │ │ │ ├── sequence_regression.py │ │ │ │ ├── sequence_token_classifier.py │ │ │ │ ├── token_classifier.py │ │ │ │ ├── tokenizer_utils.py │ │ │ │ └── transformer │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── transformer.py │ │ │ │ │ ├── transformer_decoders.py │ │ │ │ │ ├── transformer_encoders.py │ │ │ │ │ ├── transformer_generators.py │ │ │ │ │ ├── transformer_modules.py │ │ │ │ │ └── transformer_utils.py │ │ │ └── dialogue_state_tracking │ │ │ │ ├── __init__.py │ │ │ │ ├── sgd_decoder.py │ │ │ │ └── sgd_encoder.py │ │ └── parts │ │ │ ├── __init__.py │ │ │ ├── nlp_overrides.py │ │ │ └── utils_funcs.py │ └── tts │ │ ├── __init__.py │ │ ├── data │ │ ├── __init__.py │ │ └── datalayers.py │ │ ├── helpers │ │ ├── __init__.py │ │ └── helpers.py │ │ ├── losses │ │ ├── __init__.py │ │ ├── aligner_loss.py │ │ ├── fastpitchloss.py │ │ ├── fastspeech2loss.py │ │ ├── glow_tts_loss.py │ │ ├── hifigan_losses.py │ │ ├── stftlosses.py │ │ ├── tacotron2loss.py │ │ ├── uniglowloss.py │ │ └── waveglowloss.py │ │ ├── models │ │ ├── __init__.py │ │ ├── aligner.py │ │ ├── base.py │ │ ├── degli.py │ │ ├── ed_mel2spec.py │ │ ├── fastpitch.py │ │ ├── fastpitch_hifigan_e2e.py │ │ ├── fastspeech2.py │ │ ├── fastspeech2_hifigan_e2e.py │ │ ├── glow_tts.py │ │ ├── hifigan.py │ │ ├── melgan.py │ │ ├── squeezewave.py │ │ ├── tacotron2.py │ │ ├── talknet.py │ │ ├── two_stages.py │ │ ├── uniglow.py │ │ └── waveglow.py │ │ └── modules │ │ ├── __init__.py │ │ ├── aligner.py │ │ ├── degli.py │ │ ├── ed_mel2spec.py │ │ ├── fastpitch.py │ │ ├── fastspeech2.py │ │ ├── fastspeech2_submodules.py │ │ ├── glow_tts.py │ │ ├── glow_tts_parser.py │ │ ├── glow_tts_submodules.py │ │ ├── hifigan_modules.py │ │ ├── melgan_modules.py │ │ ├── squeezewave.py │ │ ├── squeezewave_submodules.py │ │ ├── submodules.py │ │ ├── tacotron2.py │ │ ├── talknet.py │ │ ├── transformer.py │ │ ├── uniglow.py │ │ └── waveglow.py ├── constants.py ├── core │ ├── __init__.py │ ├── classes │ │ ├── __init__.py │ │ ├── common.py │ │ ├── dataset.py │ │ ├── exportable.py │ │ ├── loss.py │ │ ├── modelPT.py │ │ └── module.py │ ├── config │ │ ├── __init__.py │ │ ├── base_config.py │ │ ├── hydra_runner.py │ │ ├── modelPT.py │ │ ├── optimizers.py │ │ ├── pytorch.py │ │ ├── pytorch_lightning.py │ │ └── schedulers.py │ ├── neural_types │ │ ├── __init__.py │ │ ├── axes.py │ │ ├── comparison.py │ │ ├── elements.py │ │ └── neural_type.py │ ├── optim │ │ ├── __init__.py │ │ ├── lr_scheduler.py │ │ ├── novograd.py │ │ └── optimizers.py │ └── utils │ │ ├── __init__.py │ │ └── numba_utils.py ├── package_info.py └── utils │ ├── __init__.py │ ├── app_state.py │ ├── arguments.py │ ├── cloud.py │ ├── config_utils.py │ ├── decorators │ ├── __init__.py │ ├── deprecated.py │ ├── experimental.py │ └── port_docs.py │ ├── env_var_parsing.py │ ├── exceptions.py │ ├── exp_manager.py │ ├── export_utils.py │ ├── formatters │ ├── __init__.py │ ├── base.py │ ├── colors.py │ └── utils.py │ ├── get_rank.py │ ├── lightning_logger_patch.py │ ├── metaclasses.py │ ├── model_utils.py │ └── nemo_logging.py ├── nemo_text_processing ├── README.md ├── __init__.py ├── inverse_text_normalization │ ├── README.md │ ├── __init__.py │ ├── clean_eval_data.py │ ├── data │ │ ├── __init__.py │ │ ├── currency.tsv │ │ ├── electronic │ │ │ ├── __init__.py │ │ │ ├── domain.tsv │ │ │ └── server_name.tsv │ │ ├── magnitudes.tsv │ │ ├── measurements.tsv │ │ ├── months.tsv │ │ ├── numbers │ │ │ ├── __init__.py │ │ │ ├── digit.tsv │ │ │ ├── hundred.tsv │ │ │ ├── teen.tsv │ │ │ ├── thousands.tsv │ │ │ ├── ties.tsv │ │ │ └── zero.tsv │ │ ├── ordinals │ │ │ ├── __init__.py │ │ │ ├── digit.tsv │ │ │ └── teen.tsv │ │ ├── time │ │ │ ├── __init__.py │ │ │ ├── time_suffix.tsv │ │ │ ├── time_to.tsv │ │ │ └── time_zone.tsv │ │ └── whitelist.tsv │ ├── inverse_normalize.py │ ├── run_evaluate.py │ ├── run_predict.py │ ├── taggers │ │ ├── __init__.py │ │ ├── cardinal.py │ │ ├── date.py │ │ ├── decimal.py │ │ ├── electronic.py │ │ ├── fraction.py │ │ ├── measure.py │ │ ├── money.py │ │ ├── ordinal.py │ │ ├── punctuation.py │ │ ├── telephone.py │ │ ├── time.py │ │ ├── tokenize_and_classify.py │ │ ├── whitelist.py │ │ └── word.py │ ├── utils.py │ └── verbalizers │ │ ├── __init__.py │ │ ├── cardinal.py │ │ ├── date.py │ │ ├── decimal.py │ │ ├── electronic.py │ │ ├── fraction.py │ │ ├── measure.py │ │ ├── money.py │ │ ├── ordinal.py │ │ ├── telephone.py │ │ ├── time.py │ │ ├── verbalize.py │ │ ├── verbalize_final.py │ │ ├── whitelist.py │ │ └── word.py ├── setup.sh └── text_normalization │ ├── README.md │ ├── __init__.py │ ├── clean_eval_data.py │ ├── data │ ├── __init__.py │ ├── currency │ │ ├── __init__.py │ │ ├── currency.tsv │ │ ├── currency_minor.tsv │ │ └── currency_minor_one.tsv │ ├── electronic │ │ ├── __init__.py │ │ ├── domain.tsv │ │ ├── server_name.tsv │ │ └── symbols.tsv │ ├── letter_pronunciation.tsv │ ├── magnitudes.tsv │ ├── measurements.tsv │ ├── months │ │ ├── __init__.py │ │ ├── abbr.tsv │ │ ├── names.tsv │ │ └── numbers.tsv │ ├── numbers │ │ ├── __init__.py │ │ ├── cardinal_number_name.far │ │ ├── digit.tsv │ │ ├── hundred.tsv │ │ ├── teen.tsv │ │ ├── thousands.tsv │ │ ├── ties.tsv │ │ └── zero.tsv │ ├── ordinals │ │ ├── __init__.py │ │ ├── digit.tsv │ │ └── teen.tsv │ ├── roman │ │ ├── __init__.py │ │ ├── digit_teen.tsv │ │ ├── hundreds.tsv │ │ └── ties.tsv │ ├── suppletive.tsv │ ├── time_suffix.tsv │ ├── time_zone.tsv │ ├── whitelist.tsv │ └── whitelist_alternatives.tsv │ ├── data_loader_utils.py │ ├── graph_utils.py │ ├── normalize.py │ ├── normalize_with_audio.py │ ├── run_evaluate.py │ ├── run_predict.py │ ├── taggers │ ├── __init__.py │ ├── cardinal.py │ ├── date.py │ ├── decimal.py │ ├── electronic.py │ ├── fraction.py │ ├── measure.py │ ├── money.py │ ├── ordinal.py │ ├── punctuation.py │ ├── roman.py │ ├── telephone.py │ ├── time.py │ ├── tokenize_and_classify.py │ ├── whitelist.py │ └── word.py │ ├── token_parser.py │ └── verbalizers │ ├── __init__.py │ ├── cardinal.py │ ├── date.py │ ├── decimal.py │ ├── electronic.py │ ├── fraction.py │ ├── measure.py │ ├── money.py │ ├── ordinal.py │ ├── roman.py │ ├── telephone.py │ ├── time.py │ ├── verbalize.py │ ├── verbalize_final.py │ ├── whitelist.py │ └── word.py ├── reinstall.sh ├── requirements ├── requirements.txt ├── requirements_asr.txt ├── requirements_cv.txt ├── requirements_docs.txt ├── requirements_nlp.txt ├── requirements_test.txt ├── requirements_text_processing.txt └── requirements_tts.txt ├── scripts ├── asr_language_modeling │ ├── neural_rescorer │ │ ├── create_tarred_transformer_lm_dataset.py │ │ └── eval_neural_rescorer.py │ └── ngram_lm │ │ ├── eval_beamsearch_ngram.py │ │ ├── install_beamsearch_decoders.sh │ │ ├── kenlm_utils.py │ │ └── train_kenlm.py ├── average_model_checkpoints.py ├── dataset_processing │ ├── get_commonvoice_data.py │ ├── get_hi-mia_data.py │ ├── get_librispeech_data.py │ ├── get_openslr_rir_data.py │ ├── ljspeech │ │ ├── README │ │ ├── calculate_durs.py │ │ ├── create_manifests_and_textfiles.py │ │ ├── create_token2idx_dict.py │ │ ├── extract_ljspeech_energy_pitch.py │ │ └── extract_ljspeech_phonemes_and_durs.sh │ ├── process_an4_data.py │ ├── process_degli_data.py │ ├── process_hub5_data.py │ ├── process_speech_commands_data.py │ └── process_vad_data.py ├── export │ ├── convasr_to_enemo.py │ ├── convasr_to_onnx.py │ └── convasr_to_single_onnx.py ├── freesound_download_resample │ ├── download_resample_freesound.sh │ ├── freesound_download.py │ ├── freesound_requirements.txt │ └── freesound_resample.py ├── nemo_legacy_import │ └── asr_checkpoint_port.py ├── neural_machine_translation │ └── filter_langs_nmt.py ├── speaker_recognition │ ├── rttm_to_manifest.py │ └── scp_to_manifest.py ├── speech_recognition │ └── convert_to_tarred_audio_dataset.py ├── tokenizers │ └── process_asr_text_tokenizer.py └── voice_activity_detection │ ├── vad_overlap_posterior.py │ ├── vad_tune_threshold.py │ └── write_long_audio_manifest.py ├── setup.cfg ├── setup.py ├── tests ├── __init__.py ├── collections │ ├── asr │ │ ├── numba │ │ │ ├── rnnt_loss │ │ │ │ ├── test_rnnt_pytorch.py │ │ │ │ └── utils │ │ │ │ │ ├── test_gpu_rnnt_kernel.py │ │ │ │ │ ├── test_reduce.py │ │ │ │ │ └── test_rnnt_helper.py │ │ │ └── spec_augment │ │ │ │ └── test_spec_aug_numba.py │ │ ├── test_asr_classification_model.py │ │ ├── test_asr_ctc_encoder_model_bpe.py │ │ ├── test_asr_ctcencdec_model.py │ │ ├── test_asr_datasets.py │ │ ├── test_asr_exportables.py │ │ ├── test_asr_filterbankfeatures_seq_len.py │ │ ├── test_asr_metrics.py │ │ ├── test_asr_modules.py │ │ ├── test_asr_regression_model.py │ │ ├── test_asr_rnnt_encdec_model.py │ │ ├── test_asr_rnnt_encoder_model_bpe.py │ │ ├── test_jasper_block.py │ │ ├── test_label_datasets.py │ │ └── test_speaker_label_models.py │ ├── common │ │ ├── __init__.py │ │ ├── loss_inputs.py │ │ ├── perplexity_inputs.py │ │ ├── pl_utils.py │ │ ├── test_metrics.py │ │ └── test_spc_tokenizer.py │ ├── nlp │ │ ├── test_classification_report.py │ │ ├── test_entity_linking_model.py │ │ ├── test_huggingface.py │ │ ├── test_megatron.py │ │ ├── test_nlp_exportables.py │ │ ├── test_nmt_model.py │ │ └── test_pretrained_models_performance.py │ └── tts │ │ ├── test_tts_datasets.py │ │ ├── test_tts_exportables.py │ │ └── test_waveglow.py ├── conftest.py ├── core │ ├── test_config_utils.py │ ├── test_exp_manager.py │ ├── test_fileio.py │ ├── test_neural_types.py │ ├── test_optimizers_schedulers.py │ ├── test_save_restore.py │ ├── test_serialization.py │ └── test_typecheck.py ├── core_ptl │ └── check_for_ranks.py ├── hydra │ ├── config1.yaml │ ├── config1_invalid.yaml │ ├── config_subdir │ │ ├── config2.yaml │ │ └── config2_invalid.yaml │ ├── my_app.py │ └── test_hydra_runner.py ├── manualtest_model_downloads.py ├── nemo_text_processing │ ├── data_inverse_text_normalization │ │ ├── test_cases_cardinal.txt │ │ ├── test_cases_date.txt │ │ ├── test_cases_decimal.txt │ │ ├── test_cases_electronic.txt │ │ ├── test_cases_measure.txt │ │ ├── test_cases_money.txt │ │ ├── test_cases_ordinal.txt │ │ ├── test_cases_telephone.txt │ │ ├── test_cases_time.txt │ │ ├── test_cases_whitelist.txt │ │ └── test_cases_word.txt │ ├── data_text_normalization │ │ ├── test_cases_boundary.txt │ │ ├── test_cases_cardinal.txt │ │ ├── test_cases_date.txt │ │ ├── test_cases_decimal.txt │ │ ├── test_cases_electronic.txt │ │ ├── test_cases_fraction.txt │ │ ├── test_cases_measure.txt │ │ ├── test_cases_money.txt │ │ ├── test_cases_normalize_with_audio.txt │ │ ├── test_cases_ordinal.txt │ │ ├── test_cases_telephone.txt │ │ ├── test_cases_time.txt │ │ ├── test_cases_whitelist.txt │ │ └── test_cases_word.txt │ ├── test_boundary.py │ ├── test_cardinal.py │ ├── test_date.py │ ├── test_decimal.py │ ├── test_electronic.py │ ├── test_fraction.py │ ├── test_measure.py │ ├── test_money.py │ ├── test_normalization_with_audio.py │ ├── test_ordinal.py │ ├── test_sparrowhawk_inverse_text_normalization.sh │ ├── test_sparrowhawk_normalization.sh │ ├── test_telephone.py │ ├── test_time.py │ ├── test_whitelist.py │ ├── test_word.py │ └── utils.py └── test_data_dir.py ├── tools ├── ctc_segmentation │ ├── README.md │ ├── requirements.txt │ ├── run_sample.sh │ └── scripts │ │ ├── cut_audio.py │ │ ├── normalization_helpers.py │ │ ├── prepare_data.py │ │ ├── process_manifests.py │ │ ├── run_ctc_segmentation.py │ │ ├── utils.py │ │ └── verify_segments.py ├── speech_data_explorer │ ├── README.md │ ├── data_explorer.py │ ├── requirements.txt │ └── screenshot.png └── text_processing_deployment │ ├── Dockerfile │ ├── README.rst │ ├── docker │ ├── build.sh │ └── launch.sh │ ├── export_grammars.sh │ └── pynini_export.py └── tutorials ├── 00_NeMo_Primer.ipynb ├── 01_NeMo_Models.ipynb ├── AudioTranslationSample.ipynb ├── VoiceSwapSample.ipynb ├── asr ├── 01_ASR_with_NeMo.ipynb ├── 02_Online_ASR_Microphone_Demo.ipynb ├── 03_Speech_Commands.ipynb ├── 04_Online_Offline_Speech_Commands_Demo.ipynb ├── 05_Online_Noise_Augmentation.ipynb ├── 06_Voice_Activiy_Detection.ipynb ├── 07_Online_Offline_Microphone_VAD_Demo.ipynb ├── 08_ASR_with_Subword_Tokenization.ipynb ├── 10_ASR_CTC_Language_Finetuning.ipynb ├── Offline_ASR.ipynb └── images │ ├── alignment_example.png │ └── vad_post_overlap_diagram.png ├── nlp ├── 01_Pretrained_Language_Models_for_Downstream_Tasks.ipynb ├── 02_NLP_Tokenizers.ipynb ├── Entity_Linking_Medical.ipynb ├── GLUE_Benchmark.ipynb ├── Joint_Intent_and_Slot_Classification.ipynb ├── Neural_Machine_Translation-Text2Sparql.ipynb ├── Punctuation_and_Capitalization.ipynb ├── Question_Answering_Squad.ipynb ├── Relation_Extraction-BioMegatron.ipynb ├── Text_Classification_Sentiment_Analysis.ipynb ├── Token_Classification-BioMegatron.ipynb └── Token_Classification_Named_Entity_Recognition.ipynb ├── speaker_recognition ├── ASR_with_SpeakerDiarization.ipynb ├── Speaker_Diarization_Inference.ipynb └── Speaker_Recognition_Verification.ipynb ├── text_processing ├── Inverse_Text_Normalization.ipynb ├── Text_Normalization.ipynb └── images │ ├── deployment.png │ └── pipeline.png ├── tools ├── CTC_Segmentation_Tutorial.ipynb ├── DefinedCrowd_x_NeMo_ASR_Training_Tutorial.ipynb └── label-studio │ └── setup-asr-preannotations.ipynb └── tts ├── 1_TTS_inference.ipynb ├── 2_TTS_Tacotron2_Training.ipynb └── 3_TTS_TalkNet_Training.ipynb /.dockerignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | *.pyc 3 | *.pyo 4 | *.pyd 5 | .Python 6 | env 7 | pip-log.txt 8 | pip-delete-this-directory.txt 9 | .tox 10 | .coverage 11 | .coverage.* 12 | .cache 13 | nosetests.xml 14 | coverage.xml 15 | *,cover 16 | *.log 17 | .git 18 | **/*.nemo 19 | **/*.ckpt 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | 12 | A clear and concise description of what the bug is. 13 | 14 | **Steps/Code to reproduce bug** 15 | 16 | Please list *minimal* steps or code snippet for us to be able to reproduce the bug. 17 | 18 | A helpful guide on on how to craft a minimal bug report http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports. 19 | 20 | 21 | **Expected behavior** 22 | 23 | A clear and concise description of what you expected to happen. 24 | 25 | **Environment overview (please complete the following information)** 26 | 27 | - Environment location: [Bare-metal, Docker, Cloud(specify cloud provider - AWS, Azure, GCP, Collab)] 28 | - Method of NeMo install: [pip install or from source]. Please specify exact commands you used to install. 29 | - If method of install is [Docker], provide `docker pull` & `docker run` commands used 30 | 31 | **Environment details** 32 | 33 | If NVIDIA docker image is used you don't need to specify these. 34 | Otherwise, please provide: 35 | - OS version 36 | - PyTorch version 37 | - Python version 38 | 39 | **Additional context** 40 | 41 | Add any other context about the problem here. 42 | Example: GPU model 43 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: feature request 6 | assignees: okuchaiev 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | 12 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 13 | 14 | **Describe the solution you'd like** 15 | 16 | A clear and concise description of what you want to happen. 17 | Provide a code snippet on how new APIs/changes would be used by others. 18 | 19 | **Describe alternatives you've considered** 20 | 21 | A clear and concise description of any alternative solutions or features you've considered. 22 | 23 | **Additional context** 24 | 25 | Add any other context or screenshots about the feature request here. 26 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # Copyright (c) 2020 NVIDIA. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # ============================================================================= 16 | 17 | # Read the Docs configuration file 18 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 19 | 20 | # Required field. 21 | version: 2 22 | 23 | # Build documentation in the docs/ directory with Sphinx. 24 | sphinx: 25 | configuration: docs/source/conf.py 26 | 27 | # Set the version of Python and requirements required to build your docs 28 | python: 29 | version: 3.7 30 | install: 31 | - requirements: requirements/requirements_docs.txt 32 | -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/docs/.nojekyll -------------------------------------------------------------------------------- /docs/source/_static/js/pk_scripts.js: -------------------------------------------------------------------------------- 1 | document.addEventListener("DOMContentLoaded", function () { 2 | var params = window.location.search.substring(1).split("&").reduce(function (params, param) { 3 | if (!param) { 4 | return params; 5 | } 6 | 7 | var values = param.split("="); 8 | var name = values[0]; 9 | var value = values[1]; 10 | params[name] = value; 11 | return params; 12 | }, {}); 13 | 14 | var form = document.getElementById("feedback-form"); 15 | for (var name in params) { 16 | var input = form.querySelector("[name=" + name + "]"); 17 | input.value = params[name]; 18 | } 19 | }); -------------------------------------------------------------------------------- /docs/source/asr/data/asrlm_results.csv: -------------------------------------------------------------------------------- 1 | Model Name,Model Base Class,Model Card 2 | asrlm_en_transformer_large_ls,TransformerLMModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:asrlm_en_transformer_large_ls" 3 | -------------------------------------------------------------------------------- /docs/source/asr/data/benchmark_ca.csv: -------------------------------------------------------------------------------- 1 | Model,Model Base Class,Model Card 2 | stt_ca_quartznet15x5,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_ca_quartznet15x5" 3 | -------------------------------------------------------------------------------- /docs/source/asr/data/benchmark_de.csv: -------------------------------------------------------------------------------- 1 | Model,Model Base Class,Model Card 2 | stt_de_quartznet15x5,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_de_quartznet15x5" 3 | 4 | -------------------------------------------------------------------------------- /docs/source/asr/data/benchmark_es.csv: -------------------------------------------------------------------------------- 1 | Model,Model Base Class,Model Card 2 | stt_es_quartznet15x5,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_es_quartznet15x5" 3 | 4 | -------------------------------------------------------------------------------- /docs/source/asr/data/benchmark_fr.csv: -------------------------------------------------------------------------------- 1 | Model,Model Base Class,Model Card 2 | stt_fr_quartznet15x5,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_fr_quartznet15x5" 3 | 4 | -------------------------------------------------------------------------------- /docs/source/asr/data/benchmark_it.csv: -------------------------------------------------------------------------------- 1 | Model,Model Base Class,Model Card 2 | stt_it_quartznet15x5,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_it_quartznet15x5" 3 | 4 | -------------------------------------------------------------------------------- /docs/source/asr/data/benchmark_pl.csv: -------------------------------------------------------------------------------- 1 | Model,Model Base Class,Model Card 2 | stt_pl_quartznet15x5,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_pl_quartznet15x5" 3 | -------------------------------------------------------------------------------- /docs/source/asr/data/benchmark_ru.csv: -------------------------------------------------------------------------------- 1 | Model,Model Base Class,Model Card 2 | stt_ru_quartznet15x5,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_ru_quartznet15x5" 3 | 4 | -------------------------------------------------------------------------------- /docs/source/asr/data/benchmark_zh.csv: -------------------------------------------------------------------------------- 1 | Model,Model Base Class,Model Card 2 | stt_zh_quartznet15x5,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_zh_quartznet15x5" 3 | stt_zh_citrinet_512,EncDecCTCBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_zh_citrinet_512" 4 | -------------------------------------------------------------------------------- /docs/source/asr/images/citrinet_vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/docs/source/asr/images/citrinet_vertical.png -------------------------------------------------------------------------------- /docs/source/asr/images/conformer_ctc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/docs/source/asr/images/conformer_ctc.png -------------------------------------------------------------------------------- /docs/source/asr/images/ctc_asr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/docs/source/asr/images/ctc_asr.png -------------------------------------------------------------------------------- /docs/source/asr/images/jasper_layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/docs/source/asr/images/jasper_layers.png -------------------------------------------------------------------------------- /docs/source/asr/images/jasper_vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/docs/source/asr/images/jasper_vertical.png -------------------------------------------------------------------------------- /docs/source/asr/images/quartz_vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/docs/source/asr/images/quartz_vertical.png -------------------------------------------------------------------------------- /docs/source/asr/speaker_diarization/api.rst: -------------------------------------------------------------------------------- 1 | NeMo Speaker Diarization API 2 | ============================= 3 | 4 | 5 | Model Classes 6 | ------------- 7 | .. autoclass:: nemo.collections.asr.models.ClusteringDiarizer 8 | :show-inheritance: 9 | :members: init_speaker_model, set_vad_model, init_vad_model, setup_vad_test_data, setup_spkr_test_data, run_vad, extract_embeddings, path2audio_files_to_manifest, diarize, make_nemo_file_from_folder, save_to, unpack_nemo_file, restore_from 10 | 11 | 12 | Mixins 13 | ------ 14 | 15 | .. autoclass:: nemo.collections.asr.parts.mixins.mixins.DiarizationMixin 16 | :show-inheritance: 17 | :members: 18 | -------------------------------------------------------------------------------- /docs/source/asr/speaker_diarization/data/diarization_results.csv: -------------------------------------------------------------------------------- 1 | Model Name,Model Base Class,Model Card 2 | vad_marblenet,EncDecClassificationModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:vad_marblenet" 3 | vad_telephony_marblenet,EncDecClassificationModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:vad_telephony_marblenet" 4 | speakerdiarization_speakernet,EncDecSpeakerLabelModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:speakerdiarization_speakernet" 5 | -------------------------------------------------------------------------------- /docs/source/asr/speaker_diarization/images/sd_pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/docs/source/asr/speaker_diarization/images/sd_pipeline.png -------------------------------------------------------------------------------- /docs/source/asr/speaker_diarization/models.rst: -------------------------------------------------------------------------------- 1 | Models 2 | ====== 3 | 4 | 5 | Currenlty NeMo's Speaker Diarization pipeline uses `MarbleNet <../speech_classification/models.html#marblenet-vad>`__ model for Voice Activity Detection (VAD) and `SpeakerNet <../speaker_recognition/models.html#speakernet>`__ model for Speaker Embedding Extraction. -------------------------------------------------------------------------------- /docs/source/asr/speaker_recognition/data/speaker_results.csv: -------------------------------------------------------------------------------- 1 | Model Name,Model Base Class,Model Card 2 | speakerverification_speakernet,EncDecSpeakerLabelModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:speakerverification_speakernet" 3 | speakerrecognition_speakernet,EncDecSpeakerLabelModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:speakerrecognition_speakernet" 4 | speakerdiarization_speakernet,EncDecSpeakerLabelModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:speakerdiarization_speakernet" 5 | -------------------------------------------------------------------------------- /docs/source/asr/speaker_recognition/images/ICASPP_SpeakerNet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/docs/source/asr/speaker_recognition/images/ICASPP_SpeakerNet.png -------------------------------------------------------------------------------- /docs/source/asr/speech_classification/data/classification_results.csv: -------------------------------------------------------------------------------- 1 | Model Name,Model Base Class,Model Card 2 | vad_marblenet,EncDecClassificationModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:vad_marblenet" 3 | vad_telephony_marblenet,EncDecClassificationModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:vad_telephony_marblenet" 4 | commandrecognition_en_matchboxnet3x1x64_v1,EncDecClassificationModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:commandrecognition_en_matchboxnet3x1x64_v1" 5 | commandrecognition_en_matchboxnet3x2x64_v1,EncDecClassificationModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:commandrecognition_en_matchboxnet3x2x64_v1" 6 | commandrecognition_en_matchboxnet3x1x64_v2,EncDecClassificationModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:commandrecognition_en_matchboxnet3x1x64_v2" 7 | commandrecognition_en_matchboxnet3x2x64_v2,EncDecClassificationModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:commandrecognition_en_matchboxnet3x2x64_v2" 8 | commandrecognition_en_matchboxnet3x1x64_v2_subset_task,EncDecClassificationModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:commandrecognition_en_matchboxnet3x1x64_v2_subset_task" 9 | commandrecognition_en_matchboxnet3x2x64_v2_subset_task,EncDecClassificationModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:commandrecognition_en_matchboxnet3x2x64_v2_subset_task" -------------------------------------------------------------------------------- /docs/source/asr/speech_classification/images/marblenet_vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/docs/source/asr/speech_classification/images/marblenet_vertical.png -------------------------------------------------------------------------------- /docs/source/asr/speech_classification/images/matchboxnet_vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/docs/source/asr/speech_classification/images/matchboxnet_vertical.png -------------------------------------------------------------------------------- /docs/source/common/intro.rst: -------------------------------------------------------------------------------- 1 | Common Collection 2 | ================= 3 | 4 | The common collection contains things that could be used across all collections. 5 | 6 | Tokenizers 7 | ---------- 8 | .. automodule:: nemo.collections.common.tokenizers.AutoTokenizer 9 | :special-members: __init__ 10 | .. automodule:: nemo.collections.common.tokenizers.SentencePieceTokenizer 11 | :special-members: __init__ 12 | .. automodule:: nemo.collections.common.tokenizers.TokenizerSpec 13 | :special-members: __init__ 14 | 15 | 16 | Losses 17 | ------ 18 | .. automodule:: nemo.collections.common.losses.AggregatorLoss 19 | :special-members: __init__ 20 | 21 | .. automodule:: nemo.collections.common.losses.CrossEntropyLoss 22 | :special-members: __init__ 23 | 24 | .. automodule:: nemo.collections.common.losses.MSELoss 25 | :special-members: __init__ 26 | 27 | .. automodule:: nemo.collections.common.losses.SmoothedCrossEntropyLoss 28 | :special-members: __init__ 29 | .. automodule:: nemo.collections.common.losses.SpanningLoss 30 | :special-members: __init__ 31 | 32 | 33 | Metrics 34 | ------- 35 | 36 | .. autoclass:: nemo.collections.common.metrics.Perplexity 37 | :show-inheritance: 38 | :members: 39 | :undoc-members: 40 | -------------------------------------------------------------------------------- /docs/source/core/whyntypes.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/docs/source/core/whyntypes.gif -------------------------------------------------------------------------------- /docs/source/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/docs/source/favicon.ico -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | NVIDIA NeMo User Guide 2 | ====================== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | :caption: Getting Started 7 | :name: starthere 8 | 9 | starthere/intro 10 | starthere/tutorials 11 | starthere/best-practices 12 | 13 | 14 | .. toctree:: 15 | :maxdepth: 2 16 | :caption: NeMo Core 17 | :name: core 18 | 19 | core/core 20 | 21 | 22 | .. toctree:: 23 | :maxdepth: 2 24 | :caption: Speech Processing 25 | :name: Speech Processing 26 | 27 | asr/intro 28 | asr/speech_classification/intro 29 | asr/speaker_recognition/intro 30 | asr/speaker_diarization/intro 31 | 32 | .. toctree:: 33 | :maxdepth: 2 34 | :caption: Natural Language Processing 35 | :name: Natural Language Processing 36 | 37 | nlp/intro 38 | 39 | .. toctree:: 40 | :maxdepth: 2 41 | :caption: Text To Speech 42 | :name: Text To Speech 43 | :includehidden: 44 | :titlesonly: 45 | 46 | tts/intro 47 | 48 | .. toctree:: 49 | :maxdepth: 2 50 | :caption: Common 51 | :name: Common 52 | 53 | common/intro 54 | 55 | .. toctree:: 56 | :maxdepth: 2 57 | :caption: Text Processing 58 | :name: Text Processing 59 | 60 | nemo_text_processing/intro 61 | 62 | .. toctree:: 63 | :maxdepth: 2 64 | :caption: Tools 65 | :name: Tools 66 | 67 | tools/intro 68 | -------------------------------------------------------------------------------- /docs/source/nemo_text_processing/api.rst: -------------------------------------------------------------------------------- 1 | NeMo Text Processing API 2 | ======================== 3 | 4 | Model Classes 5 | ------------- 6 | 7 | .. autoclass:: nemo_text_processing.text_normalization.GraphFst 8 | :show-inheritance: 9 | :members: 10 | 11 | .. autoclass:: nemo_text_processing.text_normalization.ClassifyFst 12 | :show-inheritance: 13 | :members: 14 | 15 | 16 | .. autoclass:: nemo_text_processing.text_normalization.VerbalizeFst 17 | :show-inheritance: 18 | :members: 19 | 20 | .. autoclass:: nemo_text_processing.text_normalization.VerbalizeFinalFst 21 | :show-inheritance: 22 | :members: 23 | 24 | .. autoclass:: nemo_text_processing.inverse_text_normalization.ClassifyFst 25 | :show-inheritance: 26 | :members: 27 | 28 | .. autoclass:: nemo_text_processing.inverse_text_normalization.VerbalizeFst 29 | :show-inheritance: 30 | :members: 31 | 32 | .. autoclass:: nemo_text_processing.inverse_text_normalization.VerbalizeFinalFst 33 | :show-inheritance: 34 | :members: 35 | 36 | -------------------------------------------------------------------------------- /docs/source/nemo_text_processing/intro.rst: -------------------------------------------------------------------------------- 1 | Text Processing 2 | =============== 3 | 4 | `nemo_text_processing` is a python package that is installed with the `nemo_toolkit`. 5 | 6 | See :doc:`NeMo Introduction <../starthere/intro>` for installation details. 7 | 8 | Additional requirements can be found in `setup.sh `_. 9 | 10 | .. toctree:: 11 | :maxdepth: 1 12 | 13 | text_normalization 14 | inverse_text_normalization 15 | api 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/source/nlp/glue_benchmark.rst: -------------------------------------------------------------------------------- 1 | .. _glue_benchmark: 2 | 3 | GLUE Benchmark 4 | ============== 5 | 6 | We recommend you try the GLUE Benchmark model in a Jupyter notebook (can run on `Google's Colab `_): `NeMo/tutorials/nlp/GLUE_Benchmark.ipynb `__. 7 | 8 | Connect to an instance with a GPU (**Runtime** -> **Change runtime type** -> select **GPU** for the hardware accelerator). 9 | 10 | An example script on how to train the model can be found here: `NeMo/examples/nlp/glue_benchmark/glue_benchmark.py `__. 11 | -------------------------------------------------------------------------------- /docs/source/nlp/information_retrieval.rst: -------------------------------------------------------------------------------- 1 | .. _information_retrieval: 2 | 3 | Information Retrieval 4 | ===================== 5 | 6 | We recommend you try the Information Retrieval model in a Jupyter notebook (can run on `Google's Colab `_): `NeMo/tutorials/nlp/Information_Retrieval_MSMARCO.ipynb `__. 7 | 8 | Connect to an instance with a GPU (**Runtime** -> **Change runtime type** -> select **GPU** for hardware the accelerator), 9 | 10 | An example script on how to train the model can be found here: `NeMo/examples/nlp/information_retrieval `__. 11 | -------------------------------------------------------------------------------- /docs/source/nlp/intro.rst: -------------------------------------------------------------------------------- 1 | Natural Language Processing (NLP) 2 | ================================= 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | models 8 | megatron_finetuning 9 | api 10 | 11 | 12 | Example scripts for the NLP collection can be found under `NeMo/example/nlp/ `__. 13 | 14 | NLP notebook-tutorials are located under `NeMo/tutorials/nlp/ `__. Most NeMo 15 | tutorials can be run on `Google's Colab `_.), with more details in the :ref:`tutorials` section. 16 | -------------------------------------------------------------------------------- /docs/source/nlp/language_modeling.rst: -------------------------------------------------------------------------------- 1 | .. _language_modeling: 2 | 3 | Language Modeling 4 | ================= 5 | 6 | An example script on how to train the model can be found here: `NeMo/examples/nlp/language_modeling `__. 7 | -------------------------------------------------------------------------------- /docs/source/nlp/models.rst: -------------------------------------------------------------------------------- 1 | .. _nlp_models: 2 | 3 | Models 4 | ====== 5 | 6 | NeMo's NLP collection supports the following models: 7 | 8 | .. toctree:: 9 | :maxdepth: 1 10 | 11 | punctuation_and_capitalization 12 | token_classification 13 | joint_intent_slot 14 | text_classification 15 | bert_pretraining 16 | language_modeling 17 | question_answering 18 | sgd_qa 19 | glue_benchmark 20 | information_retrieval 21 | nlp_model 22 | machine_translation 23 | -------------------------------------------------------------------------------- /docs/source/nlp/sgd_qa.rst: -------------------------------------------------------------------------------- 1 | .. _sgd_qa: 2 | 3 | Dialogue State Tracking - SGD-QA Model 4 | ====================================== 5 | 6 | More details can be found in the paper 7 | `SGD-QA: Fast Schema-Guided Dialogue State Tracking for Unseen Services `__ :cite:`nlp-sgdqa-zhang2021sgdqa`. 8 | An example script on how to train the model can be found here: `NeMo/examples/nlp/dialogue_state_tracking/sgd_qa.py `__. 9 | 10 | 11 | References 12 | ---------- 13 | 14 | .. bibliography:: nlp_all.bib 15 | :style: plain 16 | :labelprefix: NLP-SGDQA 17 | :keyprefix: nlp-sgdqa- -------------------------------------------------------------------------------- /docs/source/nv_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/docs/source/nv_logo.png -------------------------------------------------------------------------------- /docs/source/tools/ctc_segmentation.rst: -------------------------------------------------------------------------------- 1 | Dataset Creation Tool Based on CTC-Segmentation 2 | =============================================== 3 | 4 | This tool provides functionality to align long audio files and the corresponding transcripts into shorter fragments 5 | that are suitable for an Automatic Speech Recognition (ASR) model training. 6 | 7 | More details could be found in `NeMo/tutorials/tools/CTC_Segmentation_Tutorial.ipynb `__ (can be executed with `Google's Colab `_). 8 | 9 | The tool is based on the `CTC-Segmentation `__ package and 10 | `CTC-Segmentation of Large Corpora for German End-to-end Speech Recognition 11 | `__ :cite:`tools-kurzinger2020ctc` 12 | 13 | 14 | References 15 | ---------- 16 | 17 | .. bibliography:: tools_all.bib 18 | :style: plain 19 | :labelprefix: TOOLS 20 | :keyprefix: tools- 21 | -------------------------------------------------------------------------------- /docs/source/tools/intro.rst: -------------------------------------------------------------------------------- 1 | Tools 2 | ===== 3 | 4 | NeMo provides a set of tools useful for developing Automatic Speech Recognitions (ASR) and Text-to-Speech (TTS) models: \ 5 | `https://github.com/NVIDIA/NeMo/tree/main/tools `__ . 6 | 7 | .. toctree:: 8 | :maxdepth: 1 9 | 10 | ctc_segmentation 11 | speech_data_explorer 12 | text_processing_deployment 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/source/tools/speech_data_explorer.rst: -------------------------------------------------------------------------------- 1 | Speech Data Explorer 2 | ==================== 3 | 4 | .. note:: 5 | 6 | The tool could be found under `NeMo/tools/speech_data_explorer `__. 7 | 8 | `Dash `__-based tool for interactive exploration of ASR/TTS datasets. 9 | 10 | Features: 11 | 12 | * dataset's statistics (alphabet, vocabulary, duration-based histograms) 13 | * navigation across dataset (sorting, filtering) 14 | * inspection of individual utterances (waveform, spectrogram, audio player) 15 | * errors' analysis (Word Error Rate, Character Error Rate, Word Match Rate, Mean Word Accuracy, diff) 16 | 17 | Please make sure that requirements are installed. Then run: 18 | 19 | .. code:: 20 | 21 | python data_explorer.py path_to_manifest.json 22 | 23 | 24 | JSON manifest file should contain the following fields: 25 | 26 | * `audio_filepath` (path to audio file) 27 | * `duration` (duration of the audio file in seconds) 28 | * `text` (reference transcript) 29 | 30 | Errors' analysis requires "pred_text" (ASR transcript) for all utterances. 31 | 32 | Any additional field will be parsed and displayed in 'Samples' tab. 33 | 34 | -------------------------------------------------------------------------------- /docs/source/tts/api.rst: -------------------------------------------------------------------------------- 1 | NeMo TTS Collection API 2 | ======================= 3 | 4 | TTS Base Classes 5 | ---------------- 6 | 7 | The classes below are the base of the TTS pipeline. 8 | To read more about them, see the `Base Classes <./intro.html#Base Classes>`__ section of the intro page. 9 | 10 | .. autoclass:: nemo.collections.tts.models.base.SpectrogramGenerator 11 | :show-inheritance: 12 | :members: 13 | 14 | .. autoclass:: nemo.collections.tts.models.base.Vocoder 15 | :show-inheritance: 16 | :members: 17 | 18 | .. autoclass:: nemo.collections.tts.models.base.TextToWaveform 19 | :show-inheritance: 20 | :members: 21 | 22 | TTS Datasets 23 | ------------ 24 | 25 | .. autoclass:: nemo.collections.tts.data.datalayers.AudioDataset 26 | :show-inheritance: 27 | :members: 28 | 29 | .. autoclass:: nemo.collections.tts.data.datalayers.MelAudioDataset 30 | :show-inheritance: 31 | :members: 32 | 33 | .. autoclass:: nemo.collections.tts.data.datalayers.SplicedAudioDataset 34 | :show-inheritance: 35 | :members: 36 | 37 | .. autoclass:: nemo.collections.tts.data.datalayers.NoisySpecsDataset 38 | :show-inheritance: 39 | :members: 40 | 41 | .. autoclass:: nemo.collections.asr.data.audio_to_text.FastPitchDataset 42 | :show-inheritance: 43 | :members: 44 | 45 | .. autoclass:: nemo.collections.tts.data.datalayers.FastSpeech2Dataset 46 | :show-inheritance: 47 | :members: 48 | -------------------------------------------------------------------------------- /docs/update_docs_docker.sh: -------------------------------------------------------------------------------- 1 | cd ../ 2 | docker run --rm -v $PWD:/workspace python:3.7 /bin/bash -c "cd /workspace && \ 3 | pip install -r requirements/requirements_docs.txt && cd docs/ && rm -rf build && make clean && make html && make html" 4 | -------------------------------------------------------------------------------- /examples/asr/asr_webapp/docker_container_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # build container 18 | DOCKER_BUILDKIT=1 docker build -f Dockerfile --progress=plain -t nemo-asr-service:latest . 19 | 20 | -------------------------------------------------------------------------------- /examples/asr/asr_webapp/docker_container_run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # run container 18 | docker run -d --gpus=all -p 8000:8000 --shm-size=8g --ulimit memlock=-1 --ulimit \ 19 | stack=67108864 nemo-asr-service:latest 20 | 21 | -------------------------------------------------------------------------------- /examples/asr/asr_webapp/gunicorn.conf.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # https://docs.gunicorn.org/en/stable/settings.html 16 | 17 | # NOTE: Do not import nemo / torch code here 18 | # Gunicorn creates forked processes - and CUDA cannot be used in forked multiprocessing environment. 19 | 20 | import shutil 21 | 22 | # General config 23 | bind = "0.0.0.0:8000" 24 | workers = 2 25 | 26 | # Worker specific config 27 | worker_connections = 1000 28 | timeout = 180 # 3 minutes of timeout 29 | 30 | 31 | def on_exit(server): 32 | # delete tmp dir 33 | print("Shutting down server ...") 34 | print("Deleteing tmp directory ...") 35 | shutil.rmtree('tmp/', ignore_errors=True) 36 | print("Tmp directory deleted !") 37 | -------------------------------------------------------------------------------- /examples/asr/asr_webapp/requirements.txt: -------------------------------------------------------------------------------- 1 | -e git+git://github.com/NVIDIA/NeMo.git@v1.0.2#egg=nemo_toolkit[all] 2 | flask 3 | flask-cors 4 | gunicorn 5 | -------------------------------------------------------------------------------- /examples/asr/asr_webapp/templates/toast_msg.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | -------------------------------------------------------------------------------- /examples/asr/asr_webapp/templates/updates/remove_files.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | {{ pre_exec }} 18 | -------------------------------------------------------------------------------- /examples/asr/asr_webapp/templates/updates/upload_files_failed.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | {{ pre_exec }} 18 | -------------------------------------------------------------------------------- /examples/asr/asr_webapp/templates/updates/upload_files_successful.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | {{ pre_exec }} 18 | -------------------------------------------------------------------------------- /examples/asr/asr_webapp/wsgi.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from asr_service import app 16 | 17 | if __name__ == '__main__': 18 | app.run() 19 | -------------------------------------------------------------------------------- /examples/nlp/information_retrieval/bert_dpr.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | import pytorch_lightning as pl 17 | from omegaconf import DictConfig, OmegaConf 18 | 19 | from nemo.collections.nlp.models import BertDPRModel 20 | from nemo.core.config import hydra_runner 21 | from nemo.utils import logging 22 | from nemo.utils.exp_manager import exp_manager 23 | 24 | 25 | @hydra_runner(config_path="conf", config_name="bert_ir_config") 26 | def main(cfg: DictConfig) -> None: 27 | logging.info(f'Config: {OmegaConf.to_yaml(cfg)}') 28 | trainer = pl.Trainer(**cfg.trainer) 29 | exp_manager(trainer, cfg.get("exp_manager", None)) 30 | bert_dpr_model = BertDPRModel(cfg.model, trainer=trainer) 31 | trainer.fit(bert_dpr_model) 32 | 33 | 34 | if __name__ == '__main__': 35 | main() 36 | -------------------------------------------------------------------------------- /examples/nlp/information_retrieval/bert_joint_ir.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | import pytorch_lightning as pl 17 | from omegaconf import DictConfig, OmegaConf 18 | 19 | from nemo.collections.nlp.models import BertJointIRModel 20 | from nemo.core.config import hydra_runner 21 | from nemo.utils import logging 22 | from nemo.utils.exp_manager import exp_manager 23 | 24 | 25 | @hydra_runner(config_path="conf", config_name="bert_ir_config") 26 | def main(cfg: DictConfig) -> None: 27 | logging.info(f'Config: {OmegaConf.to_yaml(cfg)}') 28 | trainer = pl.Trainer(**cfg.trainer) 29 | exp_manager(trainer, cfg.get("exp_manager", None)) 30 | bert_joint_ir_model = BertJointIRModel(cfg.model, trainer=trainer) 31 | trainer.fit(bert_joint_ir_model) 32 | 33 | 34 | if __name__ == '__main__': 35 | main() 36 | -------------------------------------------------------------------------------- /examples/nlp/information_retrieval/get_msmarco.sh: -------------------------------------------------------------------------------- 1 | echo "=== Acquiring MSMARCO dataset ===" 2 | echo "---" 3 | 4 | mkdir -p msmarco_dataset 5 | cd msmarco_dataset 6 | 7 | echo "- Downloading passages" 8 | wget --quiet --continue https://msmarco.blob.core.windows.net/msmarcoranking/collection.tar.gz 9 | tar -xzvf collection.tar.gz 10 | rm collection.tar.gz 11 | 12 | echo "- Downloading queries" 13 | wget --quiet --continue https://msmarco.blob.core.windows.net/msmarcoranking/queries.tar.gz 14 | tar -xzvf queries.tar.gz 15 | rm queries.tar.gz 16 | rm queries.eval.tsv 17 | 18 | echo "- Downloading relevance labels" 19 | wget --quiet --continue https://msmarco.blob.core.windows.net/msmarcoranking/qrels.train.tsv 20 | wget --quiet --continue https://msmarco.blob.core.windows.net/msmarcoranking/qrels.dev.tsv 21 | 22 | echo "---" -------------------------------------------------------------------------------- /examples/nlp/language_modeling/get_wkt2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | """ 4 | This file is adapted from 5 | https://github.com/salesforce/awd-lstm-lm/blob/master/getdata.sh 6 | Copyright by the AWD LSTM authors. 7 | """ 8 | DATA_DIR=$1 9 | echo "- Downloading WikiText-2" 10 | 11 | wget --continue -P $DATA_DIR https://s3.amazonaws.com/research.metamind.io/wikitext/wikitext-2-v1.zip 12 | unzip -q $DATA_DIR/wikitext-2-v1.zip -d $DATA_DIR 13 | cd $DATA_DIR/wikitext-2 14 | mv wiki.train.tokens train.txt 15 | sed -i -e "s//[UNK]/g" train.txt 16 | mv wiki.valid.tokens valid.txt 17 | sed -i -e "s//[UNK]/g" valid.txt 18 | mv wiki.test.tokens test.txt 19 | sed -i -e "s//[UNK]/g" test.txt 20 | cd .. 21 | rm wikitext-2-v1.zip 22 | 23 | echo "- WikiText-2 saved at $DATA_DIR/wikitext-2" 24 | -------------------------------------------------------------------------------- /examples/nlp/language_modeling/transformer_lm.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | import pytorch_lightning as pl 17 | from omegaconf import DictConfig, OmegaConf 18 | 19 | from nemo.collections.nlp.models.language_modeling import TransformerLMModel 20 | from nemo.core.config import hydra_runner 21 | from nemo.utils import logging 22 | from nemo.utils.exp_manager import exp_manager 23 | 24 | 25 | @hydra_runner(config_path="conf", config_name="transformer_lm_config") 26 | def main(cfg: DictConfig) -> None: 27 | logging.info(f'Config: {OmegaConf.to_yaml(cfg)}') 28 | trainer = pl.Trainer(**cfg.trainer) 29 | exp_manager(trainer, cfg.get("exp_manager", None)) 30 | transformer_lm = TransformerLMModel(cfg.model, trainer=trainer) 31 | trainer.fit(transformer_lm) 32 | 33 | 34 | if __name__ == '__main__': 35 | main() 36 | -------------------------------------------------------------------------------- /examples/nlp/machine_translation/nmt_webapp/README.rst: -------------------------------------------------------------------------------- 1 | **STEPS 2 RUN** 2 | =============== 3 | 0. (Make sure you have Flask installed - ``pip install -r requirements.txt``) 4 | 1. Edit "config.json" file to only contain models you need. If model's location starts with "NGC/" - it will load this model from NVIDIA's NGC. Otherwise, specify full path to .nemo file. 5 | 4. To run: ``python nmt_service.py`` 6 | 5. To translate: ``http://127.0.0.1:5000/translate?text=Frohe%20Weihnachten`` (here %20 means space) 7 | 6. Run web UI: ``python -m http.server`` -------------------------------------------------------------------------------- /examples/nlp/machine_translation/nmt_webapp/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "en-de": "NGC/nmt_en_de_transformer12x2", 3 | "de-en": "NGC/nmt_de_en_transformer12x2", 4 | "en-es": "NGC/nmt_en_es_transformer12x2", 5 | "es-en": "NGC/nmt_es_en_transformer12x2", 6 | "en-ru": "NGC/nmt_en_ru_transformer6x6", 7 | "ru-en": "NGC/nmt_ru_en_transformer6x6", 8 | "en-fr": "NGC/nmt_en_fr_transformer12x2", 9 | "fr-en": "NGC/nmt_fr_en_transformer12x2", 10 | "en-zh": "NGC/nmt_en_zh_transformer6x6", 11 | "zh-en": "NGC/nmt_zh_en_transformer6x6" 12 | } 13 | -------------------------------------------------------------------------------- /examples/nlp/machine_translation/nmt_webapp/requirements.txt: -------------------------------------------------------------------------------- 1 | nemo_toolkit[all]>=1.0.0rc1 2 | flask 3 | flask_cors -------------------------------------------------------------------------------- /examples/speaker_recognition/README.md: -------------------------------------------------------------------------------- 1 | # Speaker Recognition 2 | 3 | Documentation section for speaker related tasks can be found at: 4 | - [Speaker Recognition and Verification](https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/asr/speaker_recognition/intro.html) 5 | - [Speaker Diarization](https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/asr/speaker_diarization/intro.html) 6 | 7 | This folder contains scripts for performing various speaker related tasks as breiefly explained below: 8 | - **speaker_reco.py** 9 | : Training script for speaker verification and recognition 10 | - **speaker_reco_infer.py** 11 | : Inference for speaker recognition. Can be used to map labels using trained model on test set with known speaker labels from train set. (speaker id) 12 | - **extract_speaker_embeddings.py** 13 | : Extract speaker embeddings using trained model for speaker verification purposes. 14 | - **speaker_reco_finetune.py** 15 | : Sample script to demonstrate on how to finetune a already trained model for specific sub tasks. 16 | - **voxceleb_eval.py** 17 | : Helper script to evaluate speaker embeddings on voxceleb trail files. 18 | - **speaker_diarize.py** 19 | : Inference script for speaker diarization - knowing who spoke when. 20 | - **conf/** 21 | : Folder containing configuration files for training speaker tasks. We currently only support inference for speaker diarization. 22 | -------------------------------------------------------------------------------- /examples/speaker_recognition/conf/speaker_diarization.yaml: -------------------------------------------------------------------------------- 1 | name: &name "ClusterDiarizer" 2 | 3 | num_workers: 4 4 | sample_rate: &sample_rate 16000 5 | 6 | diarizer: 7 | oracle_num_speakers: ??? # oracle number of speakers or pass null if not known. [int or path to file containing uniq-id with num of speakers of that session] 8 | max_num_speakers: 20 # max number of speakers for each recording. If oracle num speakers is passed this value is ignored. 9 | out_dir: ??? 10 | paths2audio_files: ??? #file containing paths to audio files for inference 11 | path2groundtruth_rttm_files: null #file containing paths to ground truth rttm files for score computation or null if no reference rttms are present 12 | 13 | vad: 14 | model_path: null #.nemo local model path or pretrained model name or none 15 | window_length_in_sec: 0.15 16 | shift_length_in_sec: 0.01 17 | threshold: 0.7 # tune threshold on dev set. Check /scripts/voice_activity_detection/vad_tune_threshold.py 18 | vad_decision_smoothing: True 19 | smoothing_params: 20 | method: "median" 21 | overlap: 0.875 22 | 23 | speaker_embeddings: 24 | oracle_vad_manifest: null 25 | model_path: ??? #.nemo local model path or pretrained model name (speakerverification_speakernet or speakerdiarization_speakernet) 26 | window_length_in_sec: 1.5 # window length in sec for speaker embedding extraction 27 | shift_length_in_sec: 0.75 # shift length in sec for speaker embedding extraction 28 | -------------------------------------------------------------------------------- /examples/tts/aligner.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import pytorch_lightning as pl 16 | 17 | from nemo.collections.common.callbacks import LogEpochTimeCallback 18 | from nemo.collections.tts.models import AlignerModel 19 | from nemo.core.config import hydra_runner 20 | from nemo.utils.exp_manager import exp_manager 21 | 22 | 23 | @hydra_runner(config_path='conf', config_name='aligner') 24 | def main(cfg): 25 | trainer = pl.Trainer(**cfg.trainer) 26 | exp_manager(trainer, cfg.get('exp_manager', None)) 27 | model = AlignerModel(cfg=cfg.model, trainer=trainer) 28 | trainer.callbacks.extend([pl.callbacks.LearningRateMonitor(), LogEpochTimeCallback()]) # noqa 29 | trainer.fit(model) 30 | 31 | 32 | if __name__ == '__main__': 33 | main() # noqa pylint: disable=no-value-for-parameter 34 | -------------------------------------------------------------------------------- /examples/tts/conf/hifigan/model/generator/v1.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | _target_: nemo.collections.tts.modules.hifigan_modules.Generator 3 | resblock: 1 4 | upsample_rates: [8,8,2,2] 5 | upsample_kernel_sizes: [16,16,4,4] 6 | upsample_initial_channel: 512 7 | resblock_kernel_sizes: [3,7,11] 8 | resblock_dilation_sizes: [[1,3,5], [1,3,5], [1,3,5]] 9 | -------------------------------------------------------------------------------- /examples/tts/conf/hifigan/model/generator/v2.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | _target_: nemo.collections.tts.modules.hifigan_modules.Generator 3 | resblock: 1 4 | upsample_rates: [8,8,2,2] 5 | upsample_kernel_sizes: [16,16,4,4] 6 | upsample_initial_channel: 128 7 | resblock_kernel_sizes: [3,7,11] 8 | resblock_dilation_sizes: [[1,3,5], [1,3,5], [1,3,5]] 9 | -------------------------------------------------------------------------------- /examples/tts/conf/hifigan/model/generator/v3.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | _target_: nemo.collections.tts.modules.hifigan_modules.Generator 3 | resblock: 2 4 | upsample_rates: [8,8,4] 5 | upsample_kernel_sizes: [16,16,8] 6 | upsample_initial_channel: 256 7 | resblock_kernel_sizes: [3,5,7] 8 | resblock_dilation_sizes: [[1,2], [2,6], [3,12]] 9 | -------------------------------------------------------------------------------- /examples/tts/conf/hifigan/model/train_ds/train_ds.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | dataset: 3 | _target_: "nemo.collections.tts.data.datalayers.AudioDataset" 4 | manifest_filepath: ${train_dataset} 5 | max_duration: null 6 | min_duration: 0.75 7 | n_segments: 8192 8 | trim: false 9 | dataloader_params: 10 | drop_last: false 11 | shuffle: true 12 | batch_size: 16 13 | num_workers: 4 14 | -------------------------------------------------------------------------------- /examples/tts/conf/hifigan/model/train_ds/train_ds_finetune.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | dataset: 3 | _target_: "nemo.collections.tts.data.datalayers.MelAudioDataset" 4 | manifest_filepath: ${train_dataset} 5 | min_duration: 0.75 6 | n_segments: 8192 7 | dataloader_params: 8 | drop_last: false 9 | shuffle: true 10 | batch_size: 16 11 | num_workers: 4 12 | -------------------------------------------------------------------------------- /examples/tts/conf/hifigan/model/validation_ds/val_ds.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | dataset: 3 | _target_: "nemo.collections.tts.data.datalayers.AudioDataset" 4 | manifest_filepath: ${validation_datasets} 5 | max_duration: null 6 | min_duration: null 7 | n_segments: -1 8 | trim: false 9 | dataloader_params: 10 | drop_last: false 11 | shuffle: false 12 | batch_size: 16 13 | num_workers: 1 14 | -------------------------------------------------------------------------------- /examples/tts/conf/hifigan/model/validation_ds/val_ds_finetune.yaml: -------------------------------------------------------------------------------- 1 | # @package _group_ 2 | dataset: 3 | _target_: "nemo.collections.tts.data.datalayers.MelAudioDataset" 4 | manifest_filepath: ${validation_datasets} 5 | min_duration: 3 6 | n_segments: 66048 7 | dataloader_params: 8 | drop_last: false 9 | shuffle: false 10 | batch_size: 16 11 | num_workers: 4 12 | -------------------------------------------------------------------------------- /examples/tts/hifigan.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import pytorch_lightning as pl 16 | 17 | from nemo.collections.tts.models import HifiGanModel 18 | from nemo.core.config import hydra_runner 19 | from nemo.utils.exp_manager import exp_manager 20 | 21 | 22 | @hydra_runner(config_path="conf/hifigan", config_name="hifigan") 23 | def main(cfg): 24 | trainer = pl.Trainer(**cfg.trainer) 25 | exp_manager(trainer, cfg.get("exp_manager", None)) 26 | model = HifiGanModel(cfg=cfg.model, trainer=trainer) 27 | trainer.fit(model) 28 | 29 | 30 | if __name__ == '__main__': 31 | main() # noqa pylint: disable=no-value-for-parameter 32 | -------------------------------------------------------------------------------- /examples/tts/squeezewave.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import pytorch_lightning as pl 16 | 17 | from nemo.collections.common.callbacks import LogEpochTimeCallback 18 | from nemo.collections.tts.models import SqueezeWaveModel 19 | from nemo.core.config import hydra_runner 20 | from nemo.utils.exp_manager import exp_manager 21 | 22 | 23 | @hydra_runner(config_path="conf", config_name="squeezewave") 24 | def main(cfg): 25 | trainer = pl.Trainer(**cfg.trainer) 26 | exp_manager(trainer, cfg.get("exp_manager", None)) 27 | model = SqueezeWaveModel(cfg=cfg.model, trainer=trainer) 28 | epoch_time_logger = LogEpochTimeCallback() 29 | trainer.callbacks.extend([epoch_time_logger]) 30 | trainer.fit(model) 31 | 32 | 33 | if __name__ == '__main__': 34 | main() # noqa pylint: disable=no-value-for-parameter 35 | -------------------------------------------------------------------------------- /examples/tts/talknet_durs.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import pytorch_lightning as pl 16 | 17 | from nemo.collections.common.callbacks import LogEpochTimeCallback 18 | from nemo.collections.tts.models import TalkNetDursModel 19 | from nemo.core.config import hydra_runner 20 | from nemo.utils.exp_manager import exp_manager 21 | 22 | 23 | @hydra_runner(config_path='conf', config_name='talknet-durs') 24 | def main(cfg): 25 | trainer = pl.Trainer(**cfg.trainer) 26 | exp_manager(trainer, cfg.get('exp_manager', None)) 27 | model = TalkNetDursModel(cfg=cfg.model, trainer=trainer) 28 | trainer.callbacks.extend([pl.callbacks.LearningRateMonitor(), LogEpochTimeCallback()]) # noqa 29 | trainer.fit(model) 30 | 31 | 32 | if __name__ == '__main__': 33 | main() # noqa pylint: disable=no-value-for-parameter 34 | -------------------------------------------------------------------------------- /examples/tts/talknet_pitch.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import pytorch_lightning as pl 16 | 17 | from nemo.collections.common.callbacks import LogEpochTimeCallback 18 | from nemo.collections.tts.models import TalkNetPitchModel 19 | from nemo.core.config import hydra_runner 20 | from nemo.utils.exp_manager import exp_manager 21 | 22 | 23 | @hydra_runner(config_path='conf', config_name='talknet-pitch') 24 | def main(cfg): 25 | trainer = pl.Trainer(**cfg.trainer) 26 | exp_manager(trainer, cfg.get('exp_manager', None)) 27 | model = TalkNetPitchModel(cfg=cfg.model, trainer=trainer) 28 | trainer.callbacks.extend([pl.callbacks.LearningRateMonitor(), LogEpochTimeCallback()]) # noqa 29 | trainer.fit(model) 30 | 31 | 32 | if __name__ == '__main__': 33 | main() # noqa pylint: disable=no-value-for-parameter 34 | -------------------------------------------------------------------------------- /examples/tts/talknet_spect.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import pytorch_lightning as pl 16 | 17 | from nemo.collections.common.callbacks import LogEpochTimeCallback 18 | from nemo.collections.tts.models import TalkNetSpectModel 19 | from nemo.core.config import hydra_runner 20 | from nemo.utils.exp_manager import exp_manager 21 | 22 | 23 | @hydra_runner(config_path='conf', config_name='talknet-spect') 24 | def main(cfg): 25 | trainer = pl.Trainer(**cfg.trainer) 26 | exp_manager(trainer, cfg.get('exp_manager', None)) 27 | model = TalkNetSpectModel(cfg=cfg.model, trainer=trainer) 28 | trainer.callbacks.extend([pl.callbacks.LearningRateMonitor(), LogEpochTimeCallback()]) # noqa 29 | trainer.fit(model) 30 | 31 | 32 | if __name__ == '__main__': 33 | main() # noqa pylint: disable=no-value-for-parameter 34 | -------------------------------------------------------------------------------- /examples/tts/waveglow.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import pytorch_lightning as pl 16 | 17 | from nemo.collections.common.callbacks import LogEpochTimeCallback 18 | from nemo.collections.tts.models import WaveGlowModel 19 | from nemo.core.config import hydra_runner 20 | from nemo.utils.exp_manager import exp_manager 21 | 22 | 23 | @hydra_runner(config_path="conf", config_name="waveglow") 24 | def main(cfg): 25 | trainer = pl.Trainer(**cfg.trainer) 26 | exp_manager(trainer, cfg.get("exp_manager", None)) 27 | model = WaveGlowModel(cfg=cfg.model, trainer=trainer) 28 | epoch_time_logger = LogEpochTimeCallback() 29 | trainer.callbacks.extend([epoch_time_logger]) 30 | trainer.fit(model) 31 | 32 | 33 | if __name__ == '__main__': 34 | main() # noqa pylint: disable=no-value-for-parameter 35 | -------------------------------------------------------------------------------- /nemo/README.md: -------------------------------------------------------------------------------- 1 | NeMo (**Ne**ural **Mo**dules) is a toolkit for creating AI applications built around **neural modules**, conceptual blocks of neural networks that take *typed* inputs and produce *typed* outputs. 2 | 3 | **NeMo Core** provides common APIs all modules and models have to implement. 4 | 5 | **NeMo Collections** 6 | 7 | * ASR - collection of modules and models for building speech recognition networks 8 | * TTS - collection of modules and models for building speech synthesis networks 9 | * NLP - collection of modules and models for building NLP networks 10 | -------------------------------------------------------------------------------- /nemo/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | from nemo.package_info import ( 17 | __contact_emails__, 18 | __contact_names__, 19 | __description__, 20 | __download_url__, 21 | __homepage__, 22 | __keywords__, 23 | __license__, 24 | __package_name__, 25 | __repository_url__, 26 | __shortversion__, 27 | __version__, 28 | ) 29 | -------------------------------------------------------------------------------- /nemo/collections/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo/collections/asr/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.asr import data, losses, models, modules 16 | from nemo.package_info import __version__ 17 | 18 | # Set collection version equal to NeMo version. 19 | __version = __version__ 20 | 21 | # Authorship. 22 | __author__ = "NVIDIA Corporation" 23 | 24 | # Set collection name. 25 | __description__ = "Automatic Speech Recognition collection" 26 | -------------------------------------------------------------------------------- /nemo/collections/asr/data/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo/collections/asr/data/feature_to_label_dataset.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from nemo.collections.asr.data import feature_to_label 15 | 16 | 17 | def get_feature_seq_speakerlabel_dataset( 18 | feature_loader, config: dict 19 | ) -> feature_to_label.FeatureToSeqSpeakerLabelDataset: 20 | """ 21 | Instantiates a FeatureSeqSpeakerLabelDataset. 22 | Args: 23 | config: Config of the FeatureToSeqSpeakerLabelDataset. 24 | 25 | Returns: 26 | An instance of FeatureToSeqSpeakerLabelDataset. 27 | """ 28 | dataset = feature_to_label.FeatureToSeqSpeakerLabelDataset( 29 | manifest_filepath=config['manifest_filepath'], labels=config['labels'], feature_loader=feature_loader, 30 | ) 31 | return dataset 32 | -------------------------------------------------------------------------------- /nemo/collections/asr/losses/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.asr.losses.angularloss import AngularSoftmaxLoss 16 | from nemo.collections.asr.losses.ctc import CTCLoss 17 | -------------------------------------------------------------------------------- /nemo/collections/asr/metrics/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo/collections/asr/models/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.asr.models.asr_model import ASRModel 16 | from nemo.collections.asr.models.classification_models import EncDecClassificationModel 17 | from nemo.collections.asr.models.clustering_diarizer import ClusteringDiarizer 18 | from nemo.collections.asr.models.ctc_bpe_models import EncDecCTCModelBPE 19 | from nemo.collections.asr.models.ctc_models import EncDecCTCModel 20 | from nemo.collections.asr.models.label_models import EncDecSpeakerLabelModel, ExtractSpeakerEmbeddingsModel 21 | from nemo.collections.asr.models.rnnt_bpe_models import EncDecRNNTBPEModel 22 | from nemo.collections.asr.models.rnnt_models import EncDecRNNTModel 23 | -------------------------------------------------------------------------------- /nemo/collections/asr/models/wav2vec/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from nemo.collections.asr.models.wav2vec.wav2vec_model import Wav2VecEncoderModel 15 | -------------------------------------------------------------------------------- /nemo/collections/asr/modules/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.asr.modules.audio_preprocessing import ( 16 | AudioToMelSpectrogramPreprocessor, 17 | AudioToMFCCPreprocessor, 18 | CropOrPadSpectrogramAugmentation, 19 | SpectrogramAugmentation, 20 | ) 21 | from nemo.collections.asr.modules.beam_search_decoder import BeamSearchDecoderWithLM 22 | from nemo.collections.asr.modules.conformer_encoder import ConformerEncoder 23 | from nemo.collections.asr.modules.conv_asr import ( 24 | ConvASRDecoder, 25 | ConvASRDecoderClassification, 26 | ConvASREncoder, 27 | SpeakerDecoder, 28 | ) 29 | from nemo.collections.asr.modules.lstm_decoder import LSTMDecoder 30 | from nemo.collections.asr.modules.rnnt import RNNTDecoder, RNNTJoint 31 | -------------------------------------------------------------------------------- /nemo/collections/asr/parts/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo/collections/asr/parts/mixins/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.asr.parts.mixins.mixins import ASRBPEMixin, ASRModuleMixin, DiarizationMixin 16 | -------------------------------------------------------------------------------- /nemo/collections/asr/parts/numba/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.asr.parts.numba.rnnt_loss.rnnt_pytorch import RNNTLossNumba 16 | -------------------------------------------------------------------------------- /nemo/collections/asr/parts/numba/rnnt_loss/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.asr.parts.numba.rnnt_loss.rnnt import rnnt_loss_cpu, rnnt_loss_gpu 16 | from nemo.collections.asr.parts.numba.rnnt_loss.rnnt_pytorch import RNNTLossNumba 17 | -------------------------------------------------------------------------------- /nemo/collections/asr/parts/numba/rnnt_loss/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo/collections/asr/parts/numba/rnnt_loss/utils/cpu_utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | # Copyright 2018-2019, Mingkun Huang 16 | # 17 | # Licensed under the Apache License, Version 2.0 (the "License"); 18 | # you may not use this file except in compliance with the License. 19 | # You may obtain a copy of the License at 20 | # 21 | # http://www.apache.org/licenses/LICENSE-2.0 22 | # 23 | # Unless required by applicable law or agreed to in writing, software 24 | # distributed under the License is distributed on an "AS IS" BASIS, 25 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | # See the License for the specific language governing permissions and 27 | # limitations under the License. 28 | -------------------------------------------------------------------------------- /nemo/collections/asr/parts/numba/rnnt_loss/utils/cuda_utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | # Copyright 2018-2019, Mingkun Huang 16 | # 17 | # Licensed under the Apache License, Version 2.0 (the "License"); 18 | # you may not use this file except in compliance with the License. 19 | # You may obtain a copy of the License at 20 | # 21 | # http://www.apache.org/licenses/LICENSE-2.0 22 | # 23 | # Unless required by applicable law or agreed to in writing, software 24 | # distributed under the License is distributed on an "AS IS" BASIS, 25 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | # See the License for the specific language governing permissions and 27 | # limitations under the License. 28 | -------------------------------------------------------------------------------- /nemo/collections/asr/parts/numba/spec_augment/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.asr.parts.numba.spec_augment.spec_aug_numba import ( 16 | SpecAugmentNumba, 17 | spec_augment_launch_heuristics, 18 | ) 19 | -------------------------------------------------------------------------------- /nemo/collections/asr/parts/submodules/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo/collections/asr/parts/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo/collections/asr/parts/utils/activations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import torch.nn as nn 16 | 17 | __all__ = ['Swish'] 18 | 19 | 20 | class Swish(nn.SiLU): 21 | """ 22 | Swish activation function introduced in 'https://arxiv.org/abs/1710.05941' 23 | Mathematically identical to SiLU. See note in nn.SiLU for references. 24 | """ 25 | -------------------------------------------------------------------------------- /nemo/collections/common/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import nemo.collections.common.callbacks 16 | from nemo.collections.common import data, losses, parts, tokenizers 17 | from nemo.package_info import __version__ 18 | 19 | # Set collection version equal to NeMo version. 20 | __version = __version__ 21 | 22 | # Authorship. 23 | __author__ = "NVIDIA Corporation" 24 | 25 | # Set collection name. 26 | __description__ = "Common collection" 27 | -------------------------------------------------------------------------------- /nemo/collections/common/callbacks/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.common.callbacks.callbacks import LogEpochTimeCallback 16 | -------------------------------------------------------------------------------- /nemo/collections/common/data/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.common.data.dataset import ConcatDataset 16 | -------------------------------------------------------------------------------- /nemo/collections/common/losses/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.common.losses.aggregator import AggregatorLoss 16 | from nemo.collections.common.losses.cross_entropy import CrossEntropyLoss, NLLLoss 17 | from nemo.collections.common.losses.mse_loss import MSELoss 18 | from nemo.collections.common.losses.multi_similarity_loss import MultiSimilarityLoss 19 | from nemo.collections.common.losses.smoothed_cross_entropy import SmoothedCrossEntropyLoss 20 | from nemo.collections.common.losses.spanning_loss import SpanningLoss 21 | -------------------------------------------------------------------------------- /nemo/collections/common/metrics/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.common.metrics.classification_accuracy import TopKClassificationAccuracy 16 | from nemo.collections.common.metrics.global_average_loss_metric import GlobalAverageLossMetric 17 | from nemo.collections.common.metrics.perplexity import Perplexity 18 | -------------------------------------------------------------------------------- /nemo/collections/common/parts/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.common.parts.multi_layer_perceptron import MultiLayerPerceptron 16 | from nemo.collections.common.parts.transformer_utils import * 17 | from nemo.collections.common.parts.utils import * 18 | -------------------------------------------------------------------------------- /nemo/collections/common/parts/preprocessing/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo/collections/common/tokenizers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.common.tokenizers.char_tokenizer import CharTokenizer 16 | from nemo.collections.common.tokenizers.huggingface.auto_tokenizer import AutoTokenizer 17 | from nemo.collections.common.tokenizers.sentencepiece_tokenizer import SentencePieceTokenizer 18 | from nemo.collections.common.tokenizers.tokenizer_spec import TokenizerSpec 19 | from nemo.collections.common.tokenizers.word_tokenizer import WordTokenizer 20 | -------------------------------------------------------------------------------- /nemo/collections/common/tokenizers/huggingface/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.common.tokenizers.huggingface.auto_tokenizer import AutoTokenizer 16 | -------------------------------------------------------------------------------- /nemo/collections/cv/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.cv import datasets, losses, models, modules 16 | from nemo.package_info import __version__ 17 | 18 | # Set collection version equal to NeMo version. 19 | __version = __version__ 20 | 21 | # Authorship. 22 | __author__ = "NVIDIA Corporation" 23 | 24 | # Set collection name. 25 | __description__ = "Computer Vision collection" 26 | -------------------------------------------------------------------------------- /nemo/collections/cv/datasets/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.cv.datasets.mnist_dataset import MNISTDataset, MNISTDatasetConfig 16 | -------------------------------------------------------------------------------- /nemo/collections/cv/losses/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.cv.losses.nll_loss import NLLLoss 16 | -------------------------------------------------------------------------------- /nemo/collections/cv/models/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.cv.models.mnist_lenet5 import MNISTLeNet5, MNISTLeNet5Config 16 | -------------------------------------------------------------------------------- /nemo/collections/cv/modules/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.cv.modules.lenet5 import LeNet5 16 | -------------------------------------------------------------------------------- /nemo/collections/nlp/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp import data, losses, models, modules 16 | from nemo.package_info import __version__ 17 | 18 | # Set collection version equal to NeMo version. 19 | __version = __version__ 20 | 21 | # Authorship. 22 | __author__ = "NVIDIA Corporation" 23 | 24 | # Set collection name. 25 | __description__ = "Natural Language Processing collection" 26 | -------------------------------------------------------------------------------- /nemo/collections/nlp/data/data_utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.data.data_utils.data_preprocessing import * 16 | -------------------------------------------------------------------------------- /nemo/collections/nlp/data/dialogue_state_tracking/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.data.dialogue_state_tracking.sgd.data_processor import SGDDataProcessor 16 | from nemo.collections.nlp.data.dialogue_state_tracking.sgd.dataset import SGDDataset 17 | from nemo.collections.nlp.data.dialogue_state_tracking.sgd.schema import Schema 18 | -------------------------------------------------------------------------------- /nemo/collections/nlp/data/dialogue_state_tracking/sgd/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo/collections/nlp/data/entity_linking/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.data.entity_linking.entity_linking_dataset import EntityLinkingDataset 16 | -------------------------------------------------------------------------------- /nemo/collections/nlp/data/glue_benchmark/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.data.glue_benchmark.glue_benchmark_dataset import GLUEDataset 16 | -------------------------------------------------------------------------------- /nemo/collections/nlp/data/information_retrieval/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.data.information_retrieval.information_retrieval_dataset import ( 16 | BertInformationRetrievalDataset, 17 | ) 18 | -------------------------------------------------------------------------------- /nemo/collections/nlp/data/intent_slot_classification/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | from nemo.collections.nlp.data.intent_slot_classification.intent_slot_classification_dataset import ( 17 | IntentSlotClassificationDataset, 18 | IntentSlotInferenceDataset, 19 | ) 20 | from nemo.collections.nlp.data.intent_slot_classification.intent_slot_classification_descriptor import ( 21 | IntentSlotDataDesc, 22 | ) 23 | -------------------------------------------------------------------------------- /nemo/collections/nlp/data/language_modeling/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.data.language_modeling.l2r_lm_dataset import L2RLanguageModelingDataset 16 | from nemo.collections.nlp.data.language_modeling.lm_bert_dataset import ( 17 | BertPretrainingDataset, 18 | BertPretrainingPreprocessedDataloader, 19 | ) 20 | from nemo.collections.nlp.data.language_modeling.sentence_dataset import SentenceDataset, TarredSentenceDataset 21 | -------------------------------------------------------------------------------- /nemo/collections/nlp/data/machine_translation/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.data.machine_translation.machine_translation_dataset import ( 16 | TarredTranslationDataset, 17 | TranslationDataset, 18 | ) 19 | -------------------------------------------------------------------------------- /nemo/collections/nlp/data/neural_machine_translation/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | from nemo.collections.nlp.data.neural_machine_translation.neural_machine_translation_dataset import ( 17 | NeuralMachineTranslationDataset, 18 | ) 19 | -------------------------------------------------------------------------------- /nemo/collections/nlp/data/question_answering_squad/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo/collections/nlp/data/text_classification/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | from nemo.collections.nlp.data.text_classification.text_classification_dataset import ( 17 | TextClassificationDataset, 18 | calc_class_weights, 19 | ) 20 | -------------------------------------------------------------------------------- /nemo/collections/nlp/data/token_classification/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo/collections/nlp/losses/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.losses.sgd_loss import SGDDialogueStateLoss 16 | -------------------------------------------------------------------------------- /nemo/collections/nlp/metrics/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.metrics.classification_report import ClassificationReport 16 | from nemo.collections.nlp.metrics.sequence_perplexity import SequencePerplexity 17 | -------------------------------------------------------------------------------- /nemo/collections/nlp/models/dialogue_state_tracking/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.models.dialogue_state_tracking.sgdqa_model import SGDQAModel 16 | -------------------------------------------------------------------------------- /nemo/collections/nlp/models/entity_linking/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.models.entity_linking.entity_linking_model import EntityLinkingModel 16 | -------------------------------------------------------------------------------- /nemo/collections/nlp/models/glue_benchmark/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.models.glue_benchmark.glue_benchmark_model import GLUEModel 16 | -------------------------------------------------------------------------------- /nemo/collections/nlp/models/information_retrieval/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.models.information_retrieval.bert_dpr_model import BertDPRModel 16 | from nemo.collections.nlp.models.information_retrieval.bert_joint_ir_model import BertJointIRModel 17 | -------------------------------------------------------------------------------- /nemo/collections/nlp/models/intent_slot_classification/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.models.intent_slot_classification.intent_slot_classification_model import ( 16 | IntentSlotClassificationModel, 17 | ) 18 | -------------------------------------------------------------------------------- /nemo/collections/nlp/models/language_modeling/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.models.language_modeling.bert_lm_model import BERTLMModel 16 | from nemo.collections.nlp.models.language_modeling.transformer_lm_model import TransformerLMModel 17 | -------------------------------------------------------------------------------- /nemo/collections/nlp/models/machine_translation/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.models.machine_translation.mt_enc_dec_model import MTEncDecModel 16 | -------------------------------------------------------------------------------- /nemo/collections/nlp/models/neural_machine_translation/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.models.neural_machine_translation.neural_machine_translation_model import ( 16 | NeuralMachineTranslationModel, 17 | ) 18 | -------------------------------------------------------------------------------- /nemo/collections/nlp/models/question_answering/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.models.question_answering.qa_model import QAModel 16 | -------------------------------------------------------------------------------- /nemo/collections/nlp/models/text_classification/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.models.text_classification.text_classification_model import TextClassificationModel 16 | -------------------------------------------------------------------------------- /nemo/collections/nlp/models/token_classification/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | from nemo.collections.nlp.models.token_classification.punctuation_capitalization_model import ( 17 | PunctuationCapitalizationModel, 18 | ) 19 | from nemo.collections.nlp.models.token_classification.token_classification_model import TokenClassificationModel 20 | -------------------------------------------------------------------------------- /nemo/collections/nlp/modules/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | from nemo.collections.nlp.modules.common import ( 17 | AlbertEncoder, 18 | BertEncoder, 19 | BertModule, 20 | DistilBertEncoder, 21 | MegatronBertEncoder, 22 | RobertaEncoder, 23 | SequenceClassifier, 24 | SequenceRegression, 25 | SequenceTokenClassifier, 26 | get_lm_model, 27 | get_megatron_lm_models_list, 28 | get_pretrained_lm_models_list, 29 | get_tokenizer, 30 | get_tokenizer_list, 31 | ) 32 | from nemo.collections.nlp.modules.dialogue_state_tracking.sgd_decoder import SGDDecoder 33 | from nemo.collections.nlp.modules.dialogue_state_tracking.sgd_encoder import SGDEncoder 34 | -------------------------------------------------------------------------------- /nemo/collections/nlp/modules/common/huggingface/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.modules.common.huggingface.albert import AlbertEncoder 16 | from nemo.collections.nlp.modules.common.huggingface.bert import BertEncoder 17 | from nemo.collections.nlp.modules.common.huggingface.distilbert import DistilBertEncoder 18 | from nemo.collections.nlp.modules.common.huggingface.huggingface_utils import ( 19 | get_huggingface_lm_model, 20 | get_huggingface_pretrained_lm_models_list, 21 | ) 22 | from nemo.collections.nlp.modules.common.huggingface.roberta import RobertaEncoder 23 | -------------------------------------------------------------------------------- /nemo/collections/nlp/modules/common/huggingface/albert.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Google AI Language Team Authors and 2 | # The HuggingFace Inc. team. 3 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | from transformers import AlbertModel 18 | 19 | from nemo.collections.nlp.modules.common.bert_module import BertModule 20 | from nemo.core.classes import typecheck 21 | 22 | __all__ = ['AlbertEncoder'] 23 | 24 | 25 | class AlbertEncoder(AlbertModel, BertModule): 26 | """ 27 | Wraps around the Huggingface transformers implementation repository for easy use within NeMo. 28 | """ 29 | 30 | @typecheck() 31 | def forward(self, input_ids, attention_mask, token_type_ids): 32 | res = super().forward(input_ids=input_ids, attention_mask=attention_mask, token_type_ids=token_type_ids)[0] 33 | return res 34 | -------------------------------------------------------------------------------- /nemo/collections/nlp/modules/common/huggingface/bert.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Google AI Language Team Authors and 2 | # The HuggingFace Inc. team. 3 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | from transformers import BertModel 18 | 19 | from nemo.collections.nlp.modules.common.bert_module import BertModule 20 | from nemo.core.classes import typecheck 21 | 22 | __all__ = ['BertEncoder'] 23 | 24 | 25 | class BertEncoder(BertModel, BertModule): 26 | """ 27 | Wraps around the Huggingface transformers implementation repository for easy use within NeMo. 28 | """ 29 | 30 | @typecheck() 31 | def forward(self, input_ids, attention_mask, token_type_ids): 32 | res = super().forward(input_ids=input_ids, attention_mask=attention_mask, token_type_ids=token_type_ids)[0] 33 | return res 34 | -------------------------------------------------------------------------------- /nemo/collections/nlp/modules/common/huggingface/roberta.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Google AI Language Team Authors and 2 | # The HuggingFace Inc. team. 3 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | 18 | from transformers import RobertaModel 19 | 20 | from nemo.collections.nlp.modules.common.bert_module import BertModule 21 | from nemo.core.classes import typecheck 22 | 23 | __all__ = ['RobertaEncoder'] 24 | 25 | 26 | class RobertaEncoder(RobertaModel, BertModule): 27 | """ 28 | Wraps around the Huggingface transformers implementation repository for easy use within NeMo. 29 | """ 30 | 31 | @typecheck() 32 | def forward(self, input_ids, token_type_ids, attention_mask): 33 | res = super().forward(input_ids=input_ids, attention_mask=attention_mask)[0] 34 | return res 35 | -------------------------------------------------------------------------------- /nemo/collections/nlp/modules/common/megatron/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.modules.common.megatron.megatron_bert import MegatronBertEncoder 16 | from nemo.collections.nlp.modules.common.megatron.megatron_utils import ( 17 | get_megatron_checkpoint, 18 | get_megatron_lm_models_list, 19 | ) 20 | -------------------------------------------------------------------------------- /nemo/collections/nlp/modules/common/transformer/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.nlp.modules.common.transformer.transformer_decoders import * 16 | from nemo.collections.nlp.modules.common.transformer.transformer_encoders import * 17 | from nemo.collections.nlp.modules.common.transformer.transformer_generators import * 18 | from nemo.collections.nlp.modules.common.transformer.transformer_modules import * 19 | -------------------------------------------------------------------------------- /nemo/collections/nlp/modules/dialogue_state_tracking/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo/collections/nlp/parts/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | from nemo.collections.nlp.parts.utils_funcs import list2str, tensor2list 17 | -------------------------------------------------------------------------------- /nemo/collections/tts/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import nemo.collections.tts.data 16 | import nemo.collections.tts.helpers 17 | import nemo.collections.tts.models 18 | -------------------------------------------------------------------------------- /nemo/collections/tts/data/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import nemo.collections.tts.data.datalayers 16 | -------------------------------------------------------------------------------- /nemo/collections/tts/helpers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import nemo.collections.tts.helpers.helpers 16 | -------------------------------------------------------------------------------- /nemo/collections/tts/losses/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import nemo.collections.tts.losses.tacotron2loss 16 | import nemo.collections.tts.losses.waveglowloss 17 | -------------------------------------------------------------------------------- /nemo/collections/tts/modules/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.collections.tts.modules.degli import DegliModule 16 | from nemo.collections.tts.modules.ed_mel2spec import EDMel2SpecModule 17 | from nemo.collections.tts.modules.glow_tts import GlowTTSModule 18 | from nemo.collections.tts.modules.melgan_modules import ( 19 | MelGANDiscriminator, 20 | MelGANGenerator, 21 | MelGANMultiScaleDiscriminator, 22 | ) 23 | from nemo.collections.tts.modules.squeezewave import SqueezeWaveModule 24 | from nemo.collections.tts.modules.tacotron2 import Decoder as Taco2Decoder 25 | from nemo.collections.tts.modules.tacotron2 import Encoder as Taco2Encoder 26 | from nemo.collections.tts.modules.tacotron2 import Postnet as Taco2Postnet 27 | from nemo.collections.tts.modules.waveglow import WaveGlowModule 28 | -------------------------------------------------------------------------------- /nemo/constants.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | NEMO_ENV_VARNAME_ENABLE_COLORING = "NEMO_ENABLE_COLORING" 16 | NEMO_ENV_VARNAME_REDIRECT_LOGS_TO_STDERR = "NEMO_REDIRECT_LOGS_TO_STDERR" 17 | NEMO_ENV_VARNAME_TESTING = "NEMO_TESTING" # Set to True to enable nemo.util.logging's debug mode 18 | NEMO_ENV_VARNAME_VERSION = "NEMO_EXPM_VERSION" # Used for nemo.utils.exp_manager versioning 19 | -------------------------------------------------------------------------------- /nemo/core/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import nemo.core.neural_types 16 | from nemo.core.classes import * 17 | -------------------------------------------------------------------------------- /nemo/core/classes/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | from nemo.core.classes.common import ( 17 | FileIO, 18 | Model, 19 | PretrainedModelInfo, 20 | Serialization, 21 | Typing, 22 | is_typecheck_enabled, 23 | typecheck, 24 | ) 25 | from nemo.core.classes.dataset import Dataset, IterableDataset 26 | from nemo.core.classes.exportable import Exportable, ExportFormat 27 | from nemo.core.classes.loss import Loss 28 | from nemo.core.classes.modelPT import ModelPT 29 | from nemo.core.classes.module import NeuralModule 30 | -------------------------------------------------------------------------------- /nemo/core/classes/loss.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import torch 16 | 17 | from nemo.core.classes.common import Serialization, Typing 18 | 19 | __all__ = ['Loss'] 20 | 21 | 22 | class Loss(torch.nn.modules.loss._Loss, Typing, Serialization): 23 | """Inherit this class to implement custom loss.""" 24 | 25 | def __init__(self, **kwargs): 26 | super(Loss, self).__init__(**kwargs) 27 | -------------------------------------------------------------------------------- /nemo/core/config/base_config.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from dataclasses import dataclass 16 | from typing import Optional 17 | 18 | __all__ = ['Config'] 19 | 20 | 21 | @dataclass 22 | class Config: 23 | """ 24 | Abstract NeMo Configuration class. 25 | 26 | Args: 27 | name: name of the module/dataset/loss/model object (used in serialization, DEFAULT: None) 28 | """ 29 | 30 | name: Optional[str] = None 31 | -------------------------------------------------------------------------------- /nemo/core/neural_types/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | from nemo.core.neural_types.axes import * 17 | from nemo.core.neural_types.comparison import * 18 | from nemo.core.neural_types.elements import * 19 | from nemo.core.neural_types.neural_type import * 20 | -------------------------------------------------------------------------------- /nemo/core/neural_types/comparison.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from enum import Enum 16 | 17 | __all__ = ['NeuralTypeComparisonResult'] 18 | 19 | 20 | class NeuralTypeComparisonResult(Enum): 21 | """The result of comparing two neural type objects for compatibility. 22 | When comparing A.compare_to(B):""" 23 | 24 | SAME = 0 25 | LESS = 1 # A is B 26 | GREATER = 2 # B is A 27 | DIM_INCOMPATIBLE = 3 # Resize connector might fix incompatibility 28 | TRANSPOSE_SAME = 4 # A transpose and/or converting between lists and tensors will make them same 29 | CONTAINER_SIZE_MISMATCH = 5 # A and B contain different number of elements 30 | INCOMPATIBLE = 6 # A and B are incompatible 31 | SAME_TYPE_INCOMPATIBLE_PARAMS = 7 # A and B are of the same type but parametrized differently 32 | UNCHECKED = 8 # type comparison wasn't done 33 | -------------------------------------------------------------------------------- /nemo/core/optim/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.core.optim.lr_scheduler import ( 16 | CosineAnnealing, 17 | InverseSquareRootAnnealing, 18 | NoamAnnealing, 19 | PolynomialDecayAnnealing, 20 | PolynomialHoldDecayAnnealing, 21 | SquareAnnealing, 22 | SquareRootAnnealing, 23 | WarmupAnnealing, 24 | WarmupHoldPolicy, 25 | WarmupPolicy, 26 | prepare_lr_scheduler, 27 | ) 28 | from nemo.core.optim.novograd import Novograd 29 | from nemo.core.optim.optimizers import get_optimizer, parse_optimizer_args, register_optimizer 30 | -------------------------------------------------------------------------------- /nemo/core/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo.core.utils import numba_utils 16 | -------------------------------------------------------------------------------- /nemo/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | from nemo.utils.app_state import AppState 17 | from nemo.utils.nemo_logging import Logger as _Logger 18 | from nemo.utils.nemo_logging import LogMode as logging_mode 19 | from nemo.utils.lightning_logger_patch import add_memory_handlers_to_pl_logger 20 | 21 | logging = _Logger() 22 | add_memory_handlers_to_pl_logger() 23 | -------------------------------------------------------------------------------- /nemo/utils/decorators/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | from nemo.utils.decorators.deprecated import deprecated 17 | from nemo.utils.decorators.experimental import experimental 18 | from nemo.utils.decorators.port_docs import add_port_docs 19 | -------------------------------------------------------------------------------- /nemo/utils/decorators/experimental.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | __all__ = ['experimental'] 17 | 18 | from nemo.utils import logging 19 | 20 | 21 | def experimental(cls): 22 | """ Decorator which indicates that module is experimental. 23 | Use it to mark experimental or research modules. 24 | """ 25 | 26 | def wrapped(cls): 27 | logging.warning( 28 | f'Module {cls} is experimental, not ready for production and is not fully supported. Use at your own risk.' 29 | ) 30 | 31 | return cls 32 | 33 | return wrapped(cls=cls) 34 | -------------------------------------------------------------------------------- /nemo/utils/exceptions.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | class NeMoBaseException(Exception): 17 | """ NeMo Base Exception. All exceptions created in NeMo should inherit from this class""" 18 | 19 | pass 20 | -------------------------------------------------------------------------------- /nemo/utils/formatters/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo_text_processing/README.md: -------------------------------------------------------------------------------- 1 | **nemo_text_processing** 2 | ========================== 3 | 4 | Introduction 5 | ------------ 6 | 7 | NeMo's `nemo_text_processing` is a Python package that is installed with the `nemo_toolkit`. 8 | See [documentation](https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/) for details. -------------------------------------------------------------------------------- /nemo_text_processing/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/README.md: -------------------------------------------------------------------------------- 1 | Inverse Text Normalization system for english, e.g. `one hundred twenty three kilograms` -> `123 kg` 2 | Offers prediction and evaluation on text normalization data, e.g. [Google text normalization dataset](https://www.kaggle.com/richardwilliamsproat/text-normalization-for-english-russian-and-polish). 3 | 4 | 5 | Install dependencies: 6 | bash setup.sh 7 | 8 | Example prediction run: 9 | python run_predict.py --input=`INPUT_FILE` --output=`OUTPUT_FILE` [--verbose] 10 | 11 | Example evaluation run: 12 | python run_evaluate.py --input=./en_with_types/output-00001-of-00100 [--cat CATEGORY] [--filter] 13 | -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo_text_processing.inverse_text_normalization.taggers.tokenize_and_classify import ClassifyFst 16 | from nemo_text_processing.inverse_text_normalization.verbalizers.verbalize import VerbalizeFst 17 | from nemo_text_processing.inverse_text_normalization.verbalizers.verbalize_final import VerbalizeFinalFst 18 | 19 | from nemo.utils import logging 20 | 21 | try: 22 | import pynini 23 | 24 | PYNINI_AVAILABLE = True 25 | except (ModuleNotFoundError, ImportError): 26 | logging.warning( 27 | "`pynini` is not installed ! \n" 28 | "Please run the `nemo_text_processing/setup.sh` script" 29 | "prior to usage of this toolkit." 30 | ) 31 | 32 | PYNINI_AVAILABLE = False 33 | -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/currency.tsv: -------------------------------------------------------------------------------- 1 | $ dollar 2 | $ us dollar 3 | $ united states dollar 4 | £ pound 5 | € euro 6 | ₩ won 7 | nzd new zealand dollar 8 | rs rupee 9 | chf swiss franc 10 | dkk danish kroner 11 | fim finnish markka 12 | aed arab emirates dirham 13 | ¥ yen 14 | czk czech koruna 15 | mro mauritanian ouguiya 16 | pkr pakistani rupee 17 | crc costa rican colon 18 | hk$ hong kong dollar 19 | npr nepalese rupee 20 | awg aruban florin 21 | nok norwegian kroner 22 | tzs tanzanian shilling 23 | sek swedish kronor 24 | cyp cypriot pound 25 | r real 26 | sar saudi riyal 27 | cve cape verde escudo 28 | rsd serbian dinar 29 | dm german mark 30 | shp saint helena pounds 31 | php philippine peso 32 | cad canadian dollar 33 | ssp south sudanese pound 34 | scr seychelles rupee 35 | mvr maldivian rufiyaa -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/electronic/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/electronic/domain.tsv: -------------------------------------------------------------------------------- 1 | com com -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/electronic/server_name.tsv: -------------------------------------------------------------------------------- 1 | gmail g mail 2 | nvidia n vidia -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/magnitudes.tsv: -------------------------------------------------------------------------------- 1 | k thousand 2 | m million 3 | b billion 4 | t trillion -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/months.tsv: -------------------------------------------------------------------------------- 1 | january 2 | february 3 | march 4 | april 5 | may 6 | june 7 | july 8 | august 9 | september 10 | october 11 | november 12 | december -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/numbers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/numbers/digit.tsv: -------------------------------------------------------------------------------- 1 | one 1 2 | two 2 3 | three 3 4 | four 4 5 | five 5 6 | six 6 7 | seven 7 8 | eight 8 9 | nine 9 -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/numbers/hundred.tsv: -------------------------------------------------------------------------------- 1 | hundred -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/numbers/teen.tsv: -------------------------------------------------------------------------------- 1 | ten 10 2 | eleven 11 3 | twelve 12 4 | thirteen 13 5 | fourteen 14 6 | fifteen 15 7 | sixteen 16 8 | seventeen 17 9 | eighteen 18 10 | nineteen 19 -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/numbers/thousands.tsv: -------------------------------------------------------------------------------- 1 | thousand 2 | million 3 | billion 4 | trillion 5 | quadrillion 6 | quintillion 7 | sextillion 8 | septillion 9 | octillion 10 | nonillion 11 | decillion 12 | undecillion 13 | duodecillion 14 | tredecillion 15 | quattuordecillion 16 | quindecillion 17 | sexdecillion 18 | septendecillion 19 | octodecillion 20 | novemdecillion 21 | vigintillion 22 | centillion -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/numbers/ties.tsv: -------------------------------------------------------------------------------- 1 | twenty 2 2 | thirty 3 3 | forty 4 4 | fourty 4 5 | fifty 5 6 | sixty 6 7 | seventy 7 8 | eighty 8 9 | ninety 9 -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/numbers/zero.tsv: -------------------------------------------------------------------------------- 1 | zero 0 -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/ordinals/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/ordinals/digit.tsv: -------------------------------------------------------------------------------- 1 | first one 2 | second two 3 | third three 4 | fourth four 5 | fifth five 6 | sixth sixth 7 | seventh seven 8 | eighth eight 9 | ninth nine -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/ordinals/teen.tsv: -------------------------------------------------------------------------------- 1 | twelfth twelve -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/time/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/time/time_suffix.tsv: -------------------------------------------------------------------------------- 1 | p m p.m. 2 | pm p.m. 3 | p.m. 4 | p.m p.m. 5 | am a.m. 6 | a.m. 7 | a.m a.m. 8 | a m a.m. -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/time/time_to.tsv: -------------------------------------------------------------------------------- 1 | one 12 2 | two 1 3 | three 2 4 | four 3 5 | five 4 6 | six 5 7 | seven 6 8 | eigh 7 9 | nine 8 10 | ten 9 11 | eleven 10 12 | twelve 11 -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/time/time_zone.tsv: -------------------------------------------------------------------------------- 1 | cst c s t 2 | cet c e t 3 | pst p s t 4 | est e s t 5 | pt p t 6 | et e t 7 | gmt g m t 8 | -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/data/whitelist.tsv: -------------------------------------------------------------------------------- 1 | e.g. for example 2 | i.e. that is 3 | dr. doctor 4 | mr. mister 5 | mrs. misses 6 | ms. miss 7 | st. saint 8 | 7-eleven seven eleven 9 | es3 e s three 10 | s&p s and p 11 | -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/taggers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/taggers/fraction.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # Copyright 2015 and onwards Google, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | from nemo_text_processing.text_normalization.graph_utils import GraphFst 17 | 18 | 19 | class FractionFst(GraphFst): 20 | """ 21 | Finite state transducer for classifying fraction 22 | """ 23 | 24 | def __init__(self): 25 | super().__init__(name="fraction", kind="classify") 26 | # integer_part # numerator # denominator 27 | -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/utils.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import os 16 | from typing import Union 17 | 18 | import inflect 19 | 20 | _inflect = inflect.engine() 21 | 22 | 23 | def num_to_word(x: Union[str, int]): 24 | """ 25 | converts integer to spoken representation 26 | 27 | Args 28 | x: integer 29 | 30 | Returns: spoken representation 31 | """ 32 | if isinstance(x, int): 33 | x = str(x) 34 | x = _inflect.number_to_words(str(x)).replace("-", " ").replace(",", "") 35 | return x 36 | 37 | 38 | def get_abs_path(rel_path): 39 | """ 40 | Get absolute path 41 | 42 | Args: 43 | rel_path: relative path to this file 44 | 45 | Returns absolute path 46 | """ 47 | return os.path.dirname(os.path.abspath(__file__)) + '/' + rel_path 48 | -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/verbalizers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo_text_processing/inverse_text_normalization/verbalizers/fraction.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # Copyright 2015 and onwards Google, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | from nemo_text_processing.text_normalization.graph_utils import GraphFst 17 | 18 | 19 | class FractionFst(GraphFst): 20 | """ 21 | Finite state transducer for verbalizing fraction, 22 | """ 23 | 24 | def __init__(self): 25 | super().__init__(name="fraction", kind="verbalize") 26 | -------------------------------------------------------------------------------- /nemo_text_processing/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | conda install -c conda-forge -y pynini=2.1.3 -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/README.md: -------------------------------------------------------------------------------- 1 | Text Normalization system for english, e.g. `123 kg` -> `one hundred twenty three kilograms` 2 | Offers prediction and evaluation on text normalization data, e.g. [Google text normalization dataset](https://www.kaggle.com/richardwilliamsproat/text-normalization-for-english-russian-and-polish). 3 | 4 | 5 | Install dependencies: 6 | bash ../setup.sh 7 | 8 | Example prediction run: 9 | python run_predict.py --input=`INPUT_FILE` --output=`OUTPUT_FILE` [--verbose] 10 | Example evaluation run: 11 | python run_evaluate.py --input=./en_with_types/output-00001-of-00100 [--cat CATEGORY] 12 | -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from nemo_text_processing.text_normalization.graph_utils import GraphFst 16 | from nemo_text_processing.text_normalization.taggers.tokenize_and_classify import ClassifyFst 17 | from nemo_text_processing.text_normalization.verbalizers.verbalize import VerbalizeFst 18 | from nemo_text_processing.text_normalization.verbalizers.verbalize_final import VerbalizeFinalFst 19 | 20 | from nemo.utils import logging 21 | 22 | try: 23 | import pynini 24 | 25 | PYNINI_AVAILABLE = True 26 | except (ModuleNotFoundError, ImportError): 27 | logging.warning( 28 | "`pynini` is not installed ! \n" 29 | "Please run the `nemo_text_processing/setup.sh` script" 30 | "prior to usage of this toolkit." 31 | ) 32 | 33 | PYNINI_AVAILABLE = False 34 | -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/currency/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/currency/currency.tsv: -------------------------------------------------------------------------------- 1 | $ dollar 2 | $ us dollar 3 | $ united states dollar 4 | £ pound 5 | € euro 6 | ₩ won 7 | nzd new zealand dollar 8 | rs rupee 9 | chf swiss franc 10 | dkk danish kroner 11 | fim finnish markka 12 | aed arab emirates dirham 13 | ¥ yen 14 | czk czech koruna 15 | mro mauritanian ouguiya 16 | pkr pakistani rupee 17 | crc costa rican colon 18 | hk$ hong kong dollar 19 | npr nepalese rupee 20 | awg aruban florin 21 | nok norwegian kroner 22 | tzs tanzanian shilling 23 | sek swedish kronor 24 | cyp cypriot pound 25 | r real 26 | sar saudi riyal 27 | cve cape verde escudo 28 | rsd serbian dinar 29 | dm german mark 30 | shp saint helena pounds 31 | php philippine peso 32 | cad canadian dollar 33 | ssp south sudanese pound 34 | scr seychelles rupee 35 | mvr maldivian rufiyaa -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/currency/currency_minor.tsv: -------------------------------------------------------------------------------- 1 | cents 2 | pence -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/currency/currency_minor_one.tsv: -------------------------------------------------------------------------------- 1 | cent 2 | penny -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/electronic/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/electronic/domain.tsv: -------------------------------------------------------------------------------- 1 | com com -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/electronic/server_name.tsv: -------------------------------------------------------------------------------- 1 | gmail g mail 2 | nvidia n vidia -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/electronic/symbols.tsv: -------------------------------------------------------------------------------- 1 | . dot 2 | - dash 3 | _ underscore 4 | ! exclamation mark 5 | # number sign 6 | $ dollar sign 7 | % percent sign 8 | & ampersand 9 | ' quote 10 | * asterisk 11 | + plus 12 | / slash 13 | = equal sign 14 | ? question mark 15 | ^ circumflex 16 | ` right single quote 17 | { left brace 18 | | vertical bar 19 | } right brace 20 | ~ tilde -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/letter_pronunciation.tsv: -------------------------------------------------------------------------------- 1 | k kay 2 | j jay -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/magnitudes.tsv: -------------------------------------------------------------------------------- 1 | k thousand 2 | m million 3 | b billion 4 | t trillion -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/months/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/months/abbr.tsv: -------------------------------------------------------------------------------- 1 | jan january 2 | feb february 3 | mar march 4 | apr april 5 | jun june 6 | jul july 7 | aug august 8 | sep september 9 | sept september 10 | oct october 11 | nov november 12 | dec december -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/months/names.tsv: -------------------------------------------------------------------------------- 1 | january 2 | february 3 | march 4 | april 5 | may 6 | june 7 | july 8 | august 9 | september 10 | october 11 | november 12 | december 13 | -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/months/numbers.tsv: -------------------------------------------------------------------------------- 1 | 1 january 2 | 2 february 3 | 3 march 4 | 4 april 5 | 5 may 6 | 6 june 7 | 7 july 8 | 8 august 9 | 9 september 10 | 10 october 11 | 11 november 12 | 12 december 13 | 01 january 14 | 02 february 15 | 03 march 16 | 04 april 17 | 05 may 18 | 06 june 19 | 07 july 20 | 08 august 21 | 09 september 22 | 10 october 23 | 11 november 24 | 12 december -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/numbers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/numbers/cardinal_number_name.far: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/nemo_text_processing/text_normalization/data/numbers/cardinal_number_name.far -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/numbers/digit.tsv: -------------------------------------------------------------------------------- 1 | one 1 2 | two 2 3 | three 3 4 | four 4 5 | five 5 6 | six 6 7 | seven 7 8 | eight 8 9 | nine 9 -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/numbers/hundred.tsv: -------------------------------------------------------------------------------- 1 | hundred -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/numbers/teen.tsv: -------------------------------------------------------------------------------- 1 | ten 10 2 | eleven 11 3 | twelve 12 4 | thirteen 13 5 | fourteen 14 6 | fifteen 15 7 | sixteen 16 8 | seventeen 17 9 | eighteen 18 10 | nineteen 19 -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/numbers/thousands.tsv: -------------------------------------------------------------------------------- 1 | thousand 2 | million 3 | billion 4 | trillion 5 | quadrillion 6 | quintillion 7 | sextillion 8 | septillion 9 | octillion 10 | nonillion 11 | decillion 12 | undecillion 13 | duodecillion 14 | tredecillion 15 | quattuordecillion 16 | quindecillion 17 | sexdecillion 18 | septendecillion 19 | octodecillion 20 | novemdecillion 21 | vigintillion 22 | centillion -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/numbers/ties.tsv: -------------------------------------------------------------------------------- 1 | twenty 2 2 | thirty 3 3 | forty 4 4 | fifty 5 5 | sixty 6 6 | seventy 7 7 | eighty 8 8 | ninety 9 -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/numbers/zero.tsv: -------------------------------------------------------------------------------- 1 | zero 0 -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/ordinals/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/ordinals/digit.tsv: -------------------------------------------------------------------------------- 1 | first one 2 | second two 3 | third three 4 | fourth four 5 | fifth five 6 | sixth sixth 7 | seventh seven 8 | eighth eight 9 | ninth nine -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/ordinals/teen.tsv: -------------------------------------------------------------------------------- 1 | twelfth twelve -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/roman/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/roman/digit_teen.tsv: -------------------------------------------------------------------------------- 1 | i 1 2 | ii 2 3 | iii 3 4 | iv 4 5 | v 5 6 | vi 6 7 | vii 7 8 | viii 8 9 | ix 9 10 | x 10 11 | xi 11 12 | xii 12 13 | xiii 13 14 | xiv 14 15 | xv 15 16 | xvi 16 17 | xvii 17 18 | xviii 18 19 | xix 19 20 | xx 20 21 | xxi 21 22 | xxii 22 23 | xxiii 23 24 | xxiv 24 25 | xxv 25 26 | xxvi 26 27 | xxvii 27 28 | xxviii 28 29 | xxix 29 30 | xxx 30 31 | xxxi 31 32 | xxxii 32 33 | xxxiii 33 34 | xxxiv 34 35 | xxxv 35 36 | xxxvi 36 37 | xxxvii 37 38 | xxxviii 38 39 | xxxix 39 40 | xl 40 41 | xli 41 42 | xlii 42 43 | xliii 43 44 | xliv 44 45 | xlv 45 46 | xlvi 46 47 | xlvii 47 48 | xlviii 48 49 | xlix 49 -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/roman/hundreds.tsv: -------------------------------------------------------------------------------- 1 | c 100 2 | cc 200 3 | ccc 300 4 | cd 400 5 | d 500 6 | dc 600 7 | dcc 700 8 | dccc 800 9 | cm 900 -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/roman/ties.tsv: -------------------------------------------------------------------------------- 1 | l 50 2 | lx 60 3 | lxx 70 4 | lxxx 80 5 | xc 90 -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/suppletive.tsv: -------------------------------------------------------------------------------- 1 | deer 2 | fish 3 | sheep 4 | foot feet 5 | goose geese 6 | man men 7 | mouse mice 8 | tooth teeth 9 | woman women 10 | won 11 | child children 12 | ox oxen 13 | wife wives 14 | wolf wolves 15 | analysis analyses 16 | criterion criteria 17 | focus foci 18 | percent 19 | hertz 20 | kroner krone 21 | inch inches 22 | calory calories 23 | yen 24 | megahertz 25 | gigahertz 26 | kilohertz 27 | hertz 28 | c c 29 | horsepower 30 | hundredweight 31 | kilogram force kilograms force 32 | mega siemens 33 | revolution per minute revolutions per minute 34 | mile per hour miles per hour 35 | megabit per second megabits per second 36 | square foot square feet 37 | kilobit per second kilobits per second -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/time_suffix.tsv: -------------------------------------------------------------------------------- 1 | p.m. p m 2 | p.m. p m 3 | pm p m 4 | a.m. a m 5 | a.m a m 6 | am a m -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/time_zone.tsv: -------------------------------------------------------------------------------- 1 | cst c s t 2 | c.s.t c s t 3 | cet c e t 4 | c.e.t c e t 5 | pst p s t 6 | p.s.t p s t 7 | est e s t 8 | e.s.t e s t 9 | pt p t 10 | p.t p t 11 | et e t 12 | e.t e t 13 | gmt g m t 14 | g.m.t g m t 15 | -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/data/whitelist_alternatives.tsv: -------------------------------------------------------------------------------- 1 | Hon. Honorable 2 | Hon. Honourable 3 | St. Street 4 | St Street 5 | St. Saint 6 | St Saint 7 | Dr. Drive 8 | Dr. Doctor 9 | Mr. Mister 10 | Mrs. Misses 11 | Ms. Miss 12 | Mr Mister 13 | Mrs Misses 14 | Ms Miss 15 | &Co. and Co. 16 | § section 17 | = equals -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/taggers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /nemo_text_processing/text_normalization/verbalizers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /reinstall.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | INSTALL_OPTION=${1:-"dev"} 5 | 6 | 7 | PIP=pip 8 | 9 | echo 'Uninstalling stuff' 10 | ${PIP} uninstall -y nemo_toolkit 11 | ${PIP} uninstall -y sacrebleu 12 | 13 | # Kept for legacy purposes 14 | ${PIP} uninstall -y nemo_asr 15 | ${PIP} uninstall -y nemo_nlp 16 | ${PIP} uninstall -y nemo_tts 17 | ${PIP} uninstall -y nemo_simple_gan 18 | ${PIP} uninstall -y nemo_cv 19 | 20 | ${PIP} install -U setuptools 21 | 22 | echo 'Installing nemo and nemo_text_processing' 23 | if [[ "$INSTALL_OPTION" == "dev" ]]; then 24 | ${PIP} install --editable ".[all]" 25 | else 26 | rm -rf dist/ 27 | python setup.py bdist_wheel 28 | DIST_FILE=$(find ./dist -name "*.whl" | head -n 1) 29 | ${PIP} install "${DIST_FILE}[all]" 30 | fi 31 | 32 | echo 'Installing additional nemo_text_processing conda dependency' 33 | bash nemo_text_processing/setup.sh > /dev/null 2>&1 && echo "nemo_text_processing installed!" || echo "nemo_text_processing could not be installed!" 34 | 35 | if [ -x "$(command -v conda)" ]; then 36 | echo 'Attempting update to numba installation via conda' 37 | conda update -c numba numba -y > /dev/null 2>&1 && echo "Numba updated!" || echo "Numba could not be updated!" 38 | fi 39 | 40 | echo 'All done!' 41 | -------------------------------------------------------------------------------- /requirements/requirements.txt: -------------------------------------------------------------------------------- 1 | numpy>=1.18.2 2 | onnx>=1.7.0 3 | pytorch-lightning>=1.3.0 4 | python-dateutil 5 | torch 6 | wget 7 | wrapt 8 | ruamel.yaml 9 | scikit-learn 10 | omegaconf>=2.1.0 11 | hydra-core>=1.1.0 12 | transformers>=4.0.1 13 | sentencepiece<1.0.0 14 | webdataset>=0.1.48,<=0.1.62 15 | tqdm>=4.41.0 16 | opencc 17 | pangu 18 | jieba 19 | numba 20 | -------------------------------------------------------------------------------- /requirements/requirements_asr.txt: -------------------------------------------------------------------------------- 1 | braceexpand 2 | editdistance 3 | frozendict 4 | inflect 5 | kaldi-io 6 | librosa 7 | marshmallow 8 | packaging 9 | ruamel.yaml 10 | soundfile 11 | sox 12 | unidecode 13 | kaldi-python-io 14 | kaldiio 15 | scipy 16 | pandas 17 | g2p_en 18 | pydub 19 | pyannote.core 20 | pyannote.metrics 21 | pyamg 22 | torch-stft 23 | ipywidgets 24 | matplotlib 25 | -------------------------------------------------------------------------------- /requirements/requirements_cv.txt: -------------------------------------------------------------------------------- 1 | pillow 2 | torchvision 3 | -------------------------------------------------------------------------------- /requirements/requirements_docs.txt: -------------------------------------------------------------------------------- 1 | latexcodec 2 | sphinx>=3.0 3 | sphinx_rtd_theme 4 | sphinxcontrib-bibtex 5 | wrapt 6 | numpy 7 | -------------------------------------------------------------------------------- /requirements/requirements_nlp.txt: -------------------------------------------------------------------------------- 1 | boto3 2 | h5py 3 | matplotlib>=3.3.2 4 | sentencepiece 5 | unidecode 6 | youtokentome>=1.0.5 7 | numpy 8 | rapidfuzz 9 | gdown 10 | megatron-lm==2.2.0 11 | inflect 12 | sacrebleu[ja] 13 | sacremoses>=0.0.43 14 | -------------------------------------------------------------------------------- /requirements/requirements_test.txt: -------------------------------------------------------------------------------- 1 | black==19.10b0 2 | isort[requirements] < 5 3 | parameterized 4 | pytest 5 | pytest-runner 6 | ruamel.yaml 7 | sphinx 8 | sphinxcontrib-bibtex 9 | wrapt 10 | wget 11 | wandb 12 | -------------------------------------------------------------------------------- /requirements/requirements_text_processing.txt: -------------------------------------------------------------------------------- 1 | inflect 2 | regex 3 | -------------------------------------------------------------------------------- /requirements/requirements_tts.txt: -------------------------------------------------------------------------------- 1 | matplotlib 2 | pypinyin 3 | attrdict 4 | pystoi 5 | pesq 6 | g2p_en 7 | nltk 8 | -------------------------------------------------------------------------------- /scripts/asr_language_modeling/ngram_lm/install_beamsearch_decoders.sh: -------------------------------------------------------------------------------- 1 | git clone https://github.com/NVIDIA/OpenSeq2Seq -b ctc-decoders 2 | mv OpenSeq2Seq/decoders . 3 | rm -rf OpenSeq2Seq 4 | cd decoders 5 | ./setup.sh 6 | cd .. 7 | -------------------------------------------------------------------------------- /scripts/dataset_processing/ljspeech/README: -------------------------------------------------------------------------------- 1 | These scripts are used for extracting features from LJSpeech. 2 | 3 | You will need to run the following scripts (note that these will call the other 4 | scripts as necessary): 5 | 6 | - `create_manifests_and_textfiles.py`: Creates the manifest and text files that 7 | are used by the Montreal Forced Aligner (MFA) library. 8 | - `extract_ljspeech_phonemes_and_durs.sh`: Extracts phonemes and alignments via 9 | MFA and calculates phoneme durations. 10 | Needs to be run with Conda active since it creates a Conda environment. 11 | Also note that you may need to install OpenBlas manually (e.g. sudo apt-get 12 | install libopenblas-dev), sometimes MFA can't find it if installed via Conda. 13 | (This script calls `create_token2idx_dict.py` and `calculate_durs.py`.) 14 | - `extract_ljspeech_energy_pitch.py` 15 | -------------------------------------------------------------------------------- /scripts/freesound_download_resample/freesound_requirements.txt: -------------------------------------------------------------------------------- 1 | git+git://github.com/MTG/freesound-python.git 2 | requests 3 | requests_oauthlib 4 | joblib 5 | librosa 6 | sox -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/collections/common/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/hydra/config1.yaml: -------------------------------------------------------------------------------- 1 | dataset_name: dark 2 | -------------------------------------------------------------------------------- /tests/hydra/config1_invalid.yaml: -------------------------------------------------------------------------------- 1 | dataset_name: magic 2 | password: secret -------------------------------------------------------------------------------- /tests/hydra/config_subdir/config2.yaml: -------------------------------------------------------------------------------- 1 | dataset_name: ala_config2 2 | -------------------------------------------------------------------------------- /tests/hydra/config_subdir/config2_invalid.yaml: -------------------------------------------------------------------------------- 1 | dataset_name: ala_config2 2 | password: ala_secret2 -------------------------------------------------------------------------------- /tests/hydra/my_app.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from dataclasses import dataclass 16 | 17 | import hydra 18 | from omegaconf import MISSING, OmegaConf 19 | 20 | from nemo.core.config import hydra_runner 21 | 22 | 23 | @dataclass 24 | class DefaultConfig: 25 | """ 26 | This is structured config for this application. 27 | 28 | It provides the schema used for validation of user-written spec file 29 | as well as default values of the selected parameters. 30 | """ 31 | 32 | # Dataset. Available options: [imdb, sst2] 33 | dataset_name: str = MISSING 34 | 35 | 36 | @hydra_runner(config_name="DefaultConfig", schema=DefaultConfig) 37 | def my_app(cfg): 38 | print(OmegaConf.to_yaml(cfg)) 39 | # Get dataset_name. 40 | dataset_name = cfg.dataset_name 41 | 42 | 43 | if __name__ == "__main__": 44 | my_app() 45 | -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_inverse_text_normalization/test_cases_date.txt: -------------------------------------------------------------------------------- 1 | july twenty fifth two thousand twelve~july 25 2012 2 | nineteen eighties~1980s 3 | two thousand and twenty~2020 4 | two thousand and nine~2009 5 | the twenty fifth of july twenty twelve~25 july 2012 6 | the twenty fifth of july two thousand twelve~25 july 2012 7 | the twenty second of july twenty twelve~22 july 2012 8 | the fifteenth of january~15 january 9 | the seventeenth of may twenty ten~17 may 2010 10 | january first~january 1 11 | july twenty second two thousand eight~july 22 2008 12 | june thirty~june 30 13 | july twenty fifth twenty twelve~july 25 2012 14 | nineteen seventeen~1917 15 | twenty twelve~2012 16 | march sixteen sixty five~march 1665 17 | sixteen sixty five~1665 18 | july two thousand twelve~july 2012 19 | october nineteen oh five~october 1905 20 | july fifteen o six~july 1506 21 | the twenty fifth of july twenty twelve~25 july 2012 22 | july twenty fifth twenty twelve~july 25 2012 23 | july twenty fifth two thousand twelve~july 25 2012 24 | july one thousand eight hundred seventy six~july 1876 25 | february twenty fifth twenty sixteen~february 25 2016 26 | november twenty fourth twenty fourteen~november 24 2014 27 | nineteen ninety four~1994 28 | two thousand three~2003 29 | one thousand eight~1008 30 | nineteen seventy six~1976 31 | june twentieth twenty fourteen~june 20 2014 32 | nineteen seventy three~1973 33 | nineteen seventy five~1975 34 | eleven fifty five~1155 -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_inverse_text_normalization/test_cases_electronic.txt: -------------------------------------------------------------------------------- 1 | a dot b c at g mail dot com~a.bc@gmail.com 2 | c d f at a b c dot e d u~cdf@abc.edu 3 | a b c at g mail dot a b c~abc@gmail.abc 4 | a b c at a b c dot com~abc@abc.com 5 | a s d f one two three at a b c dot com~asdf123@abc.com 6 | a one b two at a b c dot com~a1b2@abc.com 7 | a b three dot s d d dot three at g mail dot com~ab3.sdd.3@gmail.com -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_inverse_text_normalization/test_cases_ordinal.txt: -------------------------------------------------------------------------------- 1 | one hundredth~100th 2 | twenty five thousand one hundred eleventh~25111th 3 | second~2nd 4 | zeroth~0th 5 | first~1st 6 | second~2nd 7 | third~3rd 8 | fourth~4th 9 | eleventh~11th 10 | twelfth~12th 11 | thirteenth~13th 12 | twenty first~21st 13 | twenty third~23rd 14 | one hundred eleventh~111th 15 | one thousandth~1000th 16 | one hundred twenty first~121st 17 | second~2nd 18 | tenth~10th 19 | sixth~6th 20 | third~3rd 21 | nineteenth~19th 22 | third~3rd 23 | twelfth~12th 24 | forty eighth~48th 25 | seventy first~71st 26 | third~3rd 27 | forty second~42nd 28 | seventeenth~17th 29 | twentieth~20th 30 | twenty first~21st 31 | seventh~7th 32 | second~2nd 33 | fifth~5th -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_inverse_text_normalization/test_cases_telephone.txt: -------------------------------------------------------------------------------- 1 | one two three one two three five six seven eight~123-123-5678 2 | zero two three one two three five six seven eight~023-123-5678 3 | o two three one two three five six seven eight~023-123-5678 4 | oh two three one two three five six seven eight~023-123-5678 -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_inverse_text_normalization/test_cases_time.txt: -------------------------------------------------------------------------------- 1 | eight oclock g m t~08:00 gmt 2 | seven a m e s t~07:00 a.m. est 3 | two p m~02:00 p.m. 4 | two thirty~02:30 5 | three o'clock~03:00 6 | quarter past one~01:15 7 | half past three~03:30 8 | eight fifty one~08:51 9 | eight fifty two~08:52 10 | eight forty~08:40 11 | eight nineteen~08:19 12 | eight o six~08:06 13 | eight thirty eight~08:38 14 | eight thirty two~08:32 15 | eight twenty nine~08:29 16 | eleven fifty five p m~11:55 p.m. 17 | eleven fifty three p m~11:53 p.m. 18 | eleven forty a m~11:40 a.m. 19 | eleven forty five a m~11:45 a.m. 20 | eleven forty p m~11:40 p.m. 21 | eleven forty six a m~11:46 a.m. 22 | eleven o six p m~11:06 p.m. 23 | eleven thirteen a m~11:13 a.m. 24 | half past twelve~12:30 25 | quarter past one~01:15 26 | quarter to one~12:45 27 | quarter to twelve~11:45 -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_inverse_text_normalization/test_cases_whitelist.txt: -------------------------------------------------------------------------------- 1 | doctor dao~dr. dao 2 | miss smith~ms. smith 3 | misses smith~mrs. smith 4 | mister dao~mr. dao 5 | saint george~st. george 6 | i like for example ice cream~i like e.g. ice cream 7 | s and p five hundred~s&p 500 8 | seven eleven stores~7-eleven stores 9 | -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_inverse_text_normalization/test_cases_word.txt: -------------------------------------------------------------------------------- 1 | ~ 2 | e s three~es3 3 | yahoo!~yahoo! 4 | twenty!~20 ! 5 | x ~x 6 | —~— 7 | aaa~aaa 8 | aabach~aabach 9 | aabenraa~aabenraa 10 | aabye~aabye 11 | aaccessed~aaccessed 12 | aach~aach 13 | aachen's~aachen's 14 | aadri~aadri 15 | aafia~aafia 16 | aagaard~aagaard 17 | aagadu~aagadu 18 | aagard~aagard 19 | aagathadi~aagathadi 20 | aaghart's~aaghart's 21 | aagnes~aagnes 22 | aagomoni~aagomoni 23 | aagon~aagon 24 | aagoo~aagoo 25 | aagot~aagot 26 | aahar~aahar 27 | aahh~aahh 28 | aahperd~aahperd 29 | aaibinterstate~aaibinterstate 30 | aajab~aajab 31 | aakasa~aakasa 32 | aakervik~aakervik 33 | aakirkeby~aakirkeby 34 | aalam~aalam 35 | aalbaek~aalbaek 36 | aaldiu~aaldiu 37 | aalem~aalem 38 | a'ali~a'ali 39 | aalilaassamthey~aalilaassamthey 40 | aalin~aalin 41 | aaliyan~aaliyan 42 | aaliyan's~aaliyan's 43 | aamadu~aamadu 44 | aamara~aamara 45 | aambala~aambala 46 | aamera~aamera 47 | aamer's~aamer's 48 | aamina~aamina 49 | aaminah~aaminah 50 | aamjiwnaang~aamjiwnaang 51 | -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_text_normalization/test_cases_boundary.txt: -------------------------------------------------------------------------------- 1 | 1~one 2 | 1~one 3 | 1, ~one , 4 | 1!!!!~one ! ! ! ! 5 | (1)Hello~(1)Hello 6 | !1~! one 7 | 1!hello~1!hello -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_text_normalization/test_cases_cardinal.txt: -------------------------------------------------------------------------------- 1 | 1~one 2 | 2~two 3 | -2~minus two 4 | 3~three 5 | 123~one hundred twenty three 6 | 13,000~thirteen thousand 7 | 13,000~thirteen thousand 8 | 123,123,000~one hundred twenty three million one hundred twenty three thousand 9 | 123,000,012~one hundred twenty three million twelve 10 | t-0t25d12-f~t oh t two five d one two f 11 | 133-ABC~one hundred thirty three ABC 12 | B2A23C~B two A two three C 13 | 25d08A~two five d oh eight A 14 | C24~C two four 15 | W2s~W two s 16 | 1-4-a-b-1-5~one four a b one five 17 | b-c-1-5-b-s-b~b c one five b s b 18 | 1/f-4s~one f four s 19 | -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_text_normalization/test_cases_date.txt: -------------------------------------------------------------------------------- 1 | july 25 2012~july twenty fifth twenty twelve 2 | jul 25 2012~july twenty fifth twenty twelve 3 | 1980s~nineteen eighties 4 | 1980 s~nineteen eighties 5 | 25 july 2012~the twenty fifth of july twenty twelve 6 | 25 jul 2012~the twenty fifth of july twenty twelve 7 | 22 july 2012~the twenty second of july twenty twelve 8 | 15 january~the fifteenth of january 9 | 17 may 2010~the seventeenth of may twenty ten 10 | january 1~january first 11 | june 30~june thirtieth 12 | 2012~twenty twelve 13 | july 1506~july fifteen o six 14 | july 1876~july eighteen seventy six 15 | 1994~nineteen ninety four 16 | 1976~nineteen seventy six 17 | june 20 2014~june twentieth twenty fourteen 18 | 1973~nineteen seventy three 19 | 1975~nineteen seventy five 20 | 1155~eleven fifty five 21 | 2006-08-05~august fifth two thousand six 22 | august 23, 2002~august twenty third two thousand two 23 | 20 january~the twentieth of january 24 | 2016-11-03~november third twenty sixteen 25 | 2016/07/03~july third twenty sixteen 26 | 1980s~nineteen eighties 27 | 01.10.2010~january tenth twenty ten 28 | 10/06/2005~october sixth two thousand five 29 | 1910s~nineteen tens 30 | 25 sept.~the twenty fifth of september 31 | 1000~one thousand 32 | SEPT. 15TH~september fifteenth 33 | -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_text_normalization/test_cases_decimal.txt: -------------------------------------------------------------------------------- 1 | .1665~point one six six five 2 | 2.0~two point zero 3 | 2.00~two point o o 4 | 2.050~two point o five o 5 | 100 million~one hundred million 6 | 0.1 billion~zero point one billion 7 | .1 trillion~point one trillion 8 | -0.1~minus zero point one 9 | -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_text_normalization/test_cases_electronic.txt: -------------------------------------------------------------------------------- 1 | a.bc@gmail.com~a dot b c at g mail dot com 2 | cdf@abc.edu~c d f at a b c dot e d u 3 | abc@gmail.abc~a b c at g mail dot a b c 4 | abc@abc.com~a b c at a b c dot com 5 | asdf123@abc.com~a s d f one two three at a b c dot com 6 | a1b2@abc.com~a one b two at a b c dot com 7 | ab3.sdd.3@gmail.com~a b three dot s d d dot three at g mail dot com 8 | email is abc1@gmail.com~email is a b c one at g mail dot com 9 | test .b@gmail.com~test . b at g mail dot com 10 | email is a-1.b3_c&-d@gma4i-l.com test~email is a dash one dot b three underscore c ampersand dash d at g m a four i dash l dot com test -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_text_normalization/test_cases_fraction.txt: -------------------------------------------------------------------------------- 1 | 1/2007~one two thousand seventh 2 | 12639/12640~twelve thousand six hundred thirty nine twelve thousand six hundred fortieths 3 | 2/4~two quarters 4 | 1/4~one quarter 5 | 31/32~thirty one thirty seconds 6 | 22/3~twenty two thirds 7 | 1/3~one third 8 | 142/1~one hundred forty two over one 9 | 1/2~one half 10 | 2 1/2~two and a half 11 | 1795 / 1805~one thousand seven hundred ninety five one thousand eight hundred fifths -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_text_normalization/test_cases_measure.txt: -------------------------------------------------------------------------------- 1 | 12kg~twelve kilograms 2 | 12/kg~twelve per kilogram 3 | 12kg/kg~twelve kilograms per kilogram 4 | 1 mbps~one megabit per second 5 | 3 mbps~three megabits per second 6 | 3 cc/s~three c c per second 7 | 100 million kg~one hundred million kilograms 8 | a 4-kilogram bag~a four kilogram bag 9 | 55-millimeters long~fifty five millimeters long 10 | a 123.2-millimeters long~a one hundred twenty three point two millimeters long 11 | covid-19.5~covid nineteen point five 12 | covid-19~covid nineteen 13 | a 4-kilogram bag~a four kilogram bag 14 | 7.2-millimeter bullet~seven point two millimeter bullet 15 | 4 1/2 lbs~four and a half pounds 16 | -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_text_normalization/test_cases_ordinal.txt: -------------------------------------------------------------------------------- 1 | 0th~zeroth 2 | 11th~eleventh 3 | 23rd~twenty third 4 | 1000th~one thousandth 5 | 1,000th~one thousandth 6 | 1000000th~one millionth -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_text_normalization/test_cases_telephone.txt: -------------------------------------------------------------------------------- 1 | +1 123-123-5678~one, one two three, one two three, five six seven eight 2 | 123-123-5678~one two three, one two three, five six seven eight 3 | +1-123-123-5678~one, one two three, one two three, five six seven eight 4 | +1 (123)-123-5678~one, one two three, one two three, five six seven eight 5 | +1(123) 123-5678~one, one two three, one two three, five six seven eight 6 | (123)-123-5678~one two three, one two three, five six seven eight 7 | (123) 123-5678~one two three, one two three, five six seven eight 8 | 123-123-5678-1111~one two three, one two three, five six seven eight, one one one one 9 | 123-123-5678-1~one two three, one two three, five six seven eight, one -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_text_normalization/test_cases_time.txt: -------------------------------------------------------------------------------- 1 | 01:00~one o'clock 2 | 01:00 am~one a m 3 | 01:00 a.m.~one a m 4 | 01:00 a.m~one a m 5 | 1 a.m.~one a m 6 | 23:00~twenty three o'clock 7 | 1:00 a.m.~one a m 8 | 1:00a.m.~one a m 9 | 1.59 p.m.~one fifty nine p m 10 | 01:59 p.m.~one fifty nine p m 11 | 1:59 p.m.~one fifty nine p m 12 | 1:59 p.m. est~one fifty nine p m e s t 13 | 1:59 p.m.est~one fifty nine p m e s t 14 | 1:59 p.m. e.s.t~one fifty nine p m e s t -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_text_normalization/test_cases_whitelist.txt: -------------------------------------------------------------------------------- 1 | dr. Evil~doctor Evil 2 | mrs. Norris~misses Norris 3 | Dr. Evil~Dr. Evil 4 | -------------------------------------------------------------------------------- /tests/nemo_text_processing/data_text_normalization/test_cases_word.txt: -------------------------------------------------------------------------------- 1 | ~ 2 | es3~e s three 3 | x ~x 4 | X!~X! 5 | 2!~two ! 6 | —~— 7 | aabach~aabach 8 | aabenraa~aabenraa 9 | aabye~aabye 10 | aaccessed~aaccessed 11 | aach~aach 12 | aachen's~aachen's 13 | aadri~aadri 14 | aafia~aafia 15 | aagaard~aagaard 16 | aagadu~aagadu 17 | aagard~aagard 18 | aagathadi~aagathadi 19 | aaghart's~aaghart's 20 | aalem~aalem 21 | a'ali~a'ali 22 | aaliyan's~aaliyan's 23 | mother-in-law~mother-in-law 24 | -------------------------------------------------------------------------------- /tests/test_data_dir.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | from os.path import exists, join 17 | 18 | import pytest 19 | 20 | 21 | class TestDataDir: 22 | @pytest.mark.unit 23 | def test_test_data_dir(self, test_data_dir): 24 | """" Just a dummy tests showing how to use the test_data_dir fixture. """ 25 | # test_data_dir contains the absolute path to nemo -> tests/.data 26 | assert exists(test_data_dir) 27 | assert exists(join(test_data_dir, "test_data.tar.gz")) 28 | -------------------------------------------------------------------------------- /tools/ctc_segmentation/requirements.txt: -------------------------------------------------------------------------------- 1 | ctc_segmentation==1.1.0 2 | num2words -------------------------------------------------------------------------------- /tools/speech_data_explorer/README.md: -------------------------------------------------------------------------------- 1 | Speech Data Explorer 2 | -------------------- 3 | 4 | [Dash](https://plotly.com/dash/)-based tool for interactive exploration of ASR/TTS datasets. 5 | 6 | Features: 7 | - dataset's statistics (alphabet, vocabulary, duration-based histograms) 8 | - navigation across dataset (sorting, filtering) 9 | - inspection of individual utterances (waveform, spectrogram, audio player) 10 | - errors' analysis (Word Error Rate, Character Error Rate, Word Match Rate, Mean Word Accuracy, diff) 11 | 12 | Please make sure that requirements are installed. Then run: 13 | ``` 14 | python data_explorer.py path_to_manifest.json 15 | ``` 16 | 17 | JSON manifest file should contain the following fields: 18 | - "audio_filepath" (path to audio file) 19 | - "duration" (duration of the audio file in seconds) 20 | - "text" (reference transcript) 21 | 22 | Errors' analysis requires "pred_text" (ASR transcript) for all utterances. 23 | 24 | Any additional field will be parsed and displayed in 'Samples' tab. 25 | 26 | ![Speech Data Explorer](screenshot.png) 27 | -------------------------------------------------------------------------------- /tools/speech_data_explorer/requirements.txt: -------------------------------------------------------------------------------- 1 | librosa 2 | dash 3 | dash_html_components 4 | dash_bootstrap_components 5 | plotly 6 | dash_core_components 7 | dash_table 8 | numpy 9 | diff_match_patch 10 | editdistance 11 | -------------------------------------------------------------------------------- /tools/speech_data_explorer/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/tools/speech_data_explorer/screenshot.png -------------------------------------------------------------------------------- /tools/text_processing_deployment/README.rst: -------------------------------------------------------------------------------- 1 | **Text Processing Deployment** 2 | ========================================= 3 | 4 | Introduction 5 | ------------ 6 | 7 | This folder provides scripts to deploy WFST-based grammars in `NeMo Text Processing `_ for 8 | for production. 9 | 10 | See `documentation `_ for details. -------------------------------------------------------------------------------- /tools/text_processing_deployment/docker/build.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | #!/bin/bash 17 | 18 | docker build . --rm -t sparrowhawk -------------------------------------------------------------------------------- /tutorials/asr/images/alignment_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/tutorials/asr/images/alignment_example.png -------------------------------------------------------------------------------- /tutorials/asr/images/vad_post_overlap_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/tutorials/asr/images/vad_post_overlap_diagram.png -------------------------------------------------------------------------------- /tutorials/text_processing/images/deployment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/tutorials/text_processing/images/deployment.png -------------------------------------------------------------------------------- /tutorials/text_processing/images/pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SortAnon/NeMo/ef81d2e2dfb9ea9ff09ab0d61edcd7bc91cebc91/tutorials/text_processing/images/pipeline.png --------------------------------------------------------------------------------