class_docstr: Train a language model.
  
  Args:
      dictionary (~fairseq.data.Dictionary): the dictionary for the input of
          the language model
      output_dictionary (~fairseq.data.Dictionary): the dictionary for the
          output of the language model. In most cases it will be the same as
          *dictionary*, but could possibly be a more limited version of the
          dictionary (if ``--output-dictionary-size`` is used).
      targets (List[str]): list of the target types that the language model
          should predict.  Can be one of "self", "future", and "past".
          Defaults to "future".
  
  .. note::
  
      The language modeling task is compatible with :mod:`fairseq-train`,
      :mod:`fairseq-generate`, :mod:`fairseq-interactive` and
      :mod:`fairseq-eval-lm`.
  
  The language modeling task provides the following additional command-line
  arguments:
  
  .. argparse::
      :ref: fairseq.tasks.language_modeling_parser
      :prog:
class_docstr_tok: ["Train","a","language","model",".","Args",":","dictionary","(","~fairseq.data.Dictionary",")",":","the","dictionary","for","the","input","of","the","language","model","output_dictionary","(","~fairseq.data.Dictionary",")",":","the","dictionary","for","the","output","of","the","language","model",".","In","most","cases","it","will","be","the","same","as","*","dictionary","*",",","but","could","possibly","be","a","more","limited","version","of","the","dictionary","(","if","``","--","output-dictionary-size","``","is","used",")",".","targets","(","List","[","str","]",")",":","list","of","the","target","types","that","the","language","model","should","predict",".","Can","be","one","of","``","self","''",",","``","future","''",",","and","``","past","''",".","Defaults","to","``","future","''",".","..","note",":",":","The","language","modeling","task","is","compatible","with",":","mod",":","`","fairseq-train","`",",",":","mod",":","`","fairseq-generate","`",",",":","mod",":","`","fairseq-interactive","`","and",":","mod",":","`","fairseq-eval-lm","`",".","The","language","modeling","task","provides","the","following","additional","command-line","arguments",":","..","argparse",":",":",":","ref",":","fairseq.tasks.language_modeling_parser",":","prog",":"]
docstr: Return the :class:`~fairseq.data.Dictionary` for the language
  model.
docstr_tok: ["Return","the",":","class",":","`","~fairseq.data.Dictionary","`","for","the","language","model","."]
code: def target_dictionary(self):
      """Return the :class:`~fairseq.data.Dictionary` for the language
      model."""
      return self.output_dictionary
  
imports: import logging
  import os
  from dataclasses import dataclass, field
  from typing import Optional
  import numpy
  import torch
  from omegaconf import II
  from fairseq import utils
  from fairseq.data import AppendTokenDataset, ConcatDataset, Dictionary, IdDataset, LMContextWindowDataset, MonolingualDataset, NestedDictionaryDataset, NumelDataset, PadDataset, PrependTokenDataset, ResamplingDataset, SortDataset, StripTokenDataset, TokenBlockDataset, TruncatedDictionary, data_utils
  from fairseq.data.indexed_dataset import get_available_dataset_impl
  from fairseq.data.shorten_dataset import maybe_shorten_dataset
  from fairseq.dataclass import ChoiceEnum, FairseqDataclass
  from fairseq.tasks import LegacyFairseqTask, register_task
label_desc: Use image node_id 12 for calling the MultilingualLanguageModelingTask obj's underlying member method code with example usage: obj.target_dictionary() and returns: self