Language model refactoring
This pull request **introduces 2 alerts** when merging ed136b9b2a340c1c3e5ffa8c0e609e5d3de52d01 into b4040fb37350ae86b64a5f53be911371d7a3879d - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-55223cc7bf93f881bcbeaac5e0bdbb46892d0188)

**new alerts:**

* 2 for Unused import This pull request **introduces 2 alerts** when merging f6bdef3a27fc55767864fa6d0da5d49362305cb0 into fe7efb6adc536b3e9ca3937e15fdcb68dacdcec7 - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-962097c676a5aa27d4d893aa597d90dd3643a05a)

**new alerts:**

* 2 for Unused import This pull request **introduces 2 alerts** when merging 65219f584018a7de49d0285448252c5c86fa9659 into 26e5d3a9b3cc934db0004b1dd9263fb7bce9a964 - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-aa3235736ac34a5f12121be893fdb010c59b694d)

**new alerts:**

* 2 for Unused import This pull request **introduces 1 alert** when merging 40f5e5566e019d995480647aaa6cda1b9db8623f into 26e5d3a9b3cc934db0004b1dd9263fb7bce9a964 - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-d29acaf67c9c1608a52caa7d934dd37ef16f1e17)

**new alerts:**

* 1 for Unused import This pull request **introduces 1 alert** when merging 3318718c96564ec08c86ab8aefba97d54cb2f401 into 26e5d3a9b3cc934db0004b1dd9263fb7bce9a964 - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-595add236d3cea5440abf2fc37617128c2722511)

**new alerts:**

* 1 for Unused import This pull request **introduces 1 alert** when merging c022b0bcae924cf4bbedeea5a24b5bbd739e3f82 into 5316f2bcd0e326d336cb35bd8222b00914a5b77f - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-95ab97aa35785384fe258687344c8fcb2f4d5d77)

**new alerts:**

* 1 for Unused import > Thanks! Just one last change, can you please rename the dataset in `translate_ddp.py` as well?https://github.com/AlexGrinch/NeMo/blob/lm_training/examples/nlp/machine_translation/translate_ddp.py#L23. I should add a CI check for this at some point.

Hmm, I missed it. Now it should be consistent.
1. Language model training code refactored to be compatible with the latest changes in NMT.
2. Perplexity metric refactored to take into account samples of different length in a batch.