class_docstr: UL2 Dataset from https://arxiv.org/abs/2205.05131.
  Consists of three different objectives:
  1. Short span masking with small probabilities (ex: T5). Typically max ngram size of 5 with 0.15 mask prob.
  2. Extreme span masking with either large probabilities or large ngram sizes or both.
  3. Prefx-LM as in the T5 or LM-adapted T5 (prompt-tuning paper).
class_docstr_tok: ["UL2","Dataset","from","https",":","\/\/arxiv.org\/abs\/2205.05131",".","Consists","of","three","different","objectives",":","1",".","Short","span","masking","with","small","probabilities","(","ex",":","T5",")",".","Typically","max","ngram","size","of","5","with","0.15","mask","prob",".","2",".","Extreme","span","masking","with","either","large","probabilities","or","large","ngram","sizes","or","both",".","3",".","Prefx-LM","as","in","the","T5","or","LM-adapted","T5","(","prompt-tuning","paper",")","."]
code: def get_x_masking_training_sample(
      cls,
      sample,
      tokenizer,
      np_rng,
      target_seq_length: int,
      max_seq_length: int,
      max_seq_length_dec: int,
      masked_lm_prob: float,
      extreme_masked_lm_prob: float,
      max_ngram_size: int,
      min_ngram_size: int,
      mean_ngram_size: int,
      extreme_max_ngram_size: int,
      extreme_min_ngram_size: int,
      extreme_mean_ngram_size: int,
      extreme_ngram_span_length_distribution: LengthDistribution,
      sentinel_tokens: list,
      skip_masking_id: int,
  ):
      sample = UL2Dataset.build_extreme_masking_training_sample(
          sample=sample,
          target_seq_length=target_seq_length,
          np_rng=np_rng,
          max_seq_length=max_seq_length,
          max_seq_length_dec=max_seq_length_dec,
          masked_lm_prob=masked_lm_prob,
          extreme_masked_lm_prob=extreme_masked_lm_prob,
          mask_id=tokenizer.mask_id,
          max_ngram_size=max_ngram_size,
          min_ngram_size=min_ngram_size,
          extreme_max_ngram_size=extreme_max_ngram_size,
          extreme_mean_ngram_size=extreme_mean_ngram_size,
          extreme_min_ngram_size=extreme_min_ngram_size,
          extreme_ngram_span_length_distribution=extreme_ngram_span_length_distribution,
          mean_ngram_size=mean_ngram_size,
          sentinel_tokens=sentinel_tokens,
          bos_id=tokenizer.bos_id,
          eos_id=tokenizer.eos_id,
          pad_id=tokenizer.pad_id,
          skip_masking_id=skip_masking_id,
      )
      sample = UL2Dataset._prepend_mask_type_token(
          tokenizer, sample, "<extra_id_x>"
      )
      return sample
  
file_path: NeMo/nemo/collections/nlp/data/language_modeling/megatron/ul2_dataset.py
imports: import numpy
  from nemo.collections.common.tokenizers.tokenizer_spec import TokenizerSpec
  from nemo.collections.nlp.data.language_modeling.megatron.dataset_utils import create_extreme_masked_lm_predictions
  from nemo.collections.nlp.data.language_modeling.megatron.length_distribution_type import LengthDistribution
  from nemo.collections.nlp.data.language_modeling.megatron.lm_adapted_t5_dataset import T5LMAdaptedDataset
  from nemo.collections.nlp.data.language_modeling.megatron.t5_dataset import T5Dataset
label_desc: Use image node_id 4 for calling the UL2Dataset obj's underlying member method code with example usage: obj.get_x_masking_training_sample(cls, sample, tokenizer, np_rng, target_seq_length, max_seq_length, max_seq_length_dec, masked_lm_prob, extreme_masked_lm_prob, max_ngram_size, min_ngram_size, mean_ngram_size, extreme_max_ngram_size, extreme_min_ngram_size, extreme_mean_ngram_size, extreme_ngram_span_length_distribution, sentinel_tokens, skip_masking_id) and returns: sample