Tarred Datasets for Monolingual Corpora
This pull request **introduces 6 alerts** when merging ace2826c3c6afa62827f773a1f427141640afdab into 562087498d68754aca6dcde8f4ac8813300e7b24 - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-31be61d5dc5e90974461a3ee4fb9ee9ed9f5fd98)

**new alerts:**

* 6 for Unused import This pull request **introduces 3 alerts** when merging 76a9e6c008aa0b85cb04152a1f02e6c14d631768 into 562087498d68754aca6dcde8f4ac8813300e7b24 - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-8f90296aecf16a1f1e165f812eb8da3f18077797)

**new alerts:**

* 3 for Unused import > @MaximumEntropy and @ericharper should we refactor `examples/nlp/machine_translation/create_tarred_parallel_dataset.py` to rely on logic in `nemo.collections.nlp.data.machine_translation.preproc_mt_data.MTDataPreproc` ?

Maybe we can just use the MTDataPreproc since we have the do_training=False flag? > > @MaximumEntropy and @ericharper should we refactor `examples/nlp/machine_translation/create_tarred_parallel_dataset.py` to rely on logic in `nemo.collections.nlp.data.machine_translation.preproc_mt_data.MTDataPreproc` ?
> 
> Maybe we can just use the MTDataPreproc since we have the do_training=False flag?

I think it is fine and useful to have these two scripts, my biggest concern is that the actual logic needs to be implemented in one place (MTDataPreproc class probably) This pull request **introduces 3 alerts** when merging aca99cf52649fd13d52d23960a1d61d79a16ee95 into 16b87d1f7d22126b8eb471ca0538f75ade9620cf - [view on LGTM.com](https://lgtm.com/projects/g/NVIDIA/NeMo/rev/pr-3f597f2c3735ec2ef59457a5c8d0e82cc329fdd9)

**new alerts:**

* 3 for Unused import
This PR introduces tarred datasets for monolingual text corpora to allow (back)translating large amounts of text. A tarred dataset can be created as follows:

```
python examples/nlp/machine_translation/create_tarred_monolingual_dataset.py \
    --tokenizer_model /path/to/tokenizer.model \
    --clean \
    --fname /path/to/monolingual_data.txt \
    --max_seq_length 128 \
    --min_seq_length 1 \
    --tokens_in_batch 32000 \
    --lines_per_dataset_fragment 5000000 \
    --num_batches_per_tarfile 500 \
    --out_dir /path/to/output_folder
```

Once the `output_folder` is created, we can batch translate data using a pre-trained model

```
python examples/nlp/machine_translation/translate_ddp.py \
    --model /path/to/pretrained_model.nemo \
    --text2translate /path/to/output_folder/batches.tokens.32000._OP_1..100_CL_.tar \
    --metadata_path /path/to/output_folder/metadata.json \
    --result_dir /path/to/translations \
    --topk 500 \
    --src_language en \
    --tgt_language de \
    --n_gpus 8
```