ASR Refactoring
State: closed | Pull request: yes

# Changelog
- Significant refactoring of `parts` in ASR to be more modular and systematic
- Move preprocessing steps of ASR text cleaning into `commons` collection.
- Add typing information to SpecAugment and SpecCutout
- Remove NLTK downloading on import and move it to class instantiation time
- Update docs to point to new paths for parts
- Cherry pick PR https://github.com/NVIDIA/NeMo/pull/2219 into this so that audio files that could not be loaded log a warning but do not immediately crash. 
- Make character based ASR models propagate their sample_rate and labels to dataloaders
- Update ASR training scripts to support easy finetuning via pretrained model name or .nemo file

# TODO
- [ ] Update all ASR configs in next PR to latest format

This pull request **fixes 4 alerts** when merging 4bb2fba8802557742830e81b58da9109482c32f8 into b8ed0839bcc7626efaa302d0b9d47baa0f47f580 - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-5bc8f85be7fd6c8ba3037e3e9a41c5f43034eb3a)

**fixed alerts:**

* 4 for Unused import

1 question, is there a reason you don't want training to fail if the audio file could not be loaded?
This might hide underlying issues in the dataset instead of forcing the user to fix the issue with the audio files.

@piraka9011 Main reason would be the case where more than one file fails - it would be problematic to await several minutes for data loaders to start up and then immediately crash after the first issue. If we log it (and hopefully it doesnt crash and it continues) there will be a continuous stream of error logs that will notify the user of which files are consistently problematic. Of course, this is under the assumption there is no fatal flaw and the data loader doesnt hard crash anyway.

I would agree on the utils thing @redoctopus - i pushed it into utils cause I saw like 6 files with _utils.py and I went - why not just move them under a utils folder then. Lets see, if theres a strong opinion on this from others we can just move them out again.

This pull request **fixes 4 alerts** when merging 9f2ec2a9912ac3ababc49cb45819b3adf550eaa6 into b8ed0839bcc7626efaa302d0b9d47baa0f47f580 - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-19c56da26cfdc189ec56781474801b6e8671dc3d)

**fixed alerts:**

* 4 for Unused import

This pull request **introduces 1 alert** and **fixes 4** when merging 0cf38b08ed5f81029aae14090380af865002fbd5 into b8ed0839bcc7626efaa302d0b9d47baa0f47f580 - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-ad6e83921bcc95a0fa54ba0ec9ea62e2b93cf107)

**new alerts:**

* 1 for &#39;import \*&#39; may pollute namespace

**fixed alerts:**

* 4 for Unused import

This pull request **introduces 5 alerts** and **fixes 4** when merging db47f139adee5733ac7bed3d02cbc9e85aedf2e6 into 6c60797a30ab640fcafbd6c647e32ff7ef93d6ec - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-d00b2658e3a349dd5a1442a33e48ae2f313ab615)

**new alerts:**

* 4 for Unnecessary delete statement in function
* 1 for &#39;import \*&#39; may pollute namespace

**fixed alerts:**

* 4 for Unused import

This pull request **introduces 5 alerts** and **fixes 4** when merging 2e37bc8595fdaa17886e5b5a41546e220c953945 into ea5cd10cdf86d82db17293e86e84e714be65c268 - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-3b792dbb882e49d65072c0bf4739ad43e99576c9)

**new alerts:**

* 4 for Unnecessary delete statement in function
* 1 for &#39;import \*&#39; may pollute namespace

**fixed alerts:**

* 4 for Unused import

This pull request **introduces 3 alerts** and **fixes 4** when merging 7b691a5a03d341548d2d9c496a8f5b68b48ef01d into b6c15c3c72da3c408ccba7a05119cf2a9b08c6aa - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-41bbbc594c9f278ea54a02560844a1151e59cff8)

**new alerts:**

* 1 for Unused import
* 1 for &#39;import \*&#39; may pollute namespace
* 1 for Unnecessary delete statement in function

**fixed alerts:**

* 4 for Unused import

This pull request **introduces 2 alerts** and **fixes 4** when merging 9df37a9e9bb812bc8a71a2943365dc4c59889861 into b6c15c3c72da3c408ccba7a05119cf2a9b08c6aa - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-475acb6090706f05d37dde9644f0776ad32f651d)

**new alerts:**

* 1 for &#39;import \*&#39; may pollute namespace
* 1 for Unnecessary delete statement in function

**fixed alerts:**

* 4 for Unused import

This pull request **introduces 2 alerts** and **fixes 4** when merging 24398a8613205e9abe640acb07c57019ee8fb431 into 9c75c348bc8137717ca79a34a93c50028ffdfd38 - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-5b9703b9cc976dad60cb9537d7bc0d9ad3638acd)

**new alerts:**

* 1 for &#39;import \*&#39; may pollute namespace
* 1 for Unnecessary delete statement in function

**fixed alerts:**

* 4 for Unused import

This pull request **introduces 2 alerts** and **fixes 4** when merging fb78e24712ca56f1a51d28f860abac4ef8bfc080 into 9c75c348bc8137717ca79a34a93c50028ffdfd38 - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-2dcd3261e0a3aabbef22457a4cb26eb9a75850cf)

**new alerts:**

* 1 for &#39;import \*&#39; may pollute namespace
* 1 for Unnecessary delete statement in function

**fixed alerts:**

* 4 for Unused import

This pull request **introduces 2 alerts** and **fixes 4** when merging 926f305b702fa3d51b8278bae0073e7c1e9d1fc6 into 9c75c348bc8137717ca79a34a93c50028ffdfd38 - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-19e69014bf2ceacc4e2c3ef8963ff035722d4e4e)

**new alerts:**

* 1 for &#39;import \*&#39; may pollute namespace
* 1 for Unnecessary delete statement in function

**fixed alerts:**

* 4 for Unused import

Looks like a better place for the preprocessing directory would be in asr/data.  I always found it difficult to find preprocessing code :), I think it would be much easier to find if it is in asr/data.

asr/data is meant to be only for **datasets**. The two ***_dataset.py** files are wrappers around said datasets so it is still valid. Parts is where everything else goes that doesnt belong to one of 5 main things - dataset/dataloader, models (which inherit ModelPT), neural modules, losses and metrics.

Furthermore that preprocessing is shared between asr and tts so best it goes into commons 

Also, hmm we need an updated high level architecture diagram. Will put that in a todo list.

This pull request **introduces 2 alerts** and **fixes 4** when merging ddd7f4bad5fd83cddad870229f4996f67193bf4f into b94c7a17accf40e4235b9f746caaf8d9ea5d20af - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-585563836962a28d62b98d6ef39247ef1df14f04)

**new alerts:**

* 1 for &#39;import \*&#39; may pollute namespace
* 1 for Unnecessary delete statement in function

**fixed alerts:**

* 4 for Unused import

This pull request **introduces 2 alerts** and **fixes 4** when merging aaec4c77d3e02cfb961b30771bcd99f7a4e181e9 into b94c7a17accf40e4235b9f746caaf8d9ea5d20af - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-cdf9bd3bd3bd789eaa36f43801ce9dfd12923129)

**new alerts:**

* 1 for &#39;import \*&#39; may pollute namespace
* 1 for Unnecessary delete statement in function

**fixed alerts:**

* 4 for Unused import