class_docstr: A task for training primal model and dual models jointly.
  It takes:
      - unlabelled source (aka source monolingual data for translation task),
      - unlabelled target (aka target monolingual data for translation task),
      - labelled (source, target) (aka parallel data for translation task),
class_docstr_tok: ["A","task","for","training","primal","model","and","dual","models","jointly",".","It","takes",":","-","unlabelled","source","(","aka","source","monolingual","data","for","translation","task",")",",","-","unlabelled","target","(","aka","target","monolingual","data","for","translation","task",")",",","-","labelled","(","source",",","target",")","(","aka","parallel","data","for","translation","task",")",","]
code: def add_args(parser):
      PytorchTranslateTask.add_args(parser)
      """Add semi-supervised arguments to the parser."""
      parser.add_argument(
          "--dual-criterion",
          default="unsupervised_criterion",
          help="Criterion for jointly train primal and dual models",
      )
      parser.add_argument(
          "--reward-alpha",
          type=float,
          default=0.005,
          help="Hyperparam to weigh two rewards",
      )
      parser.add_argument(
          "--soft-updates",
          type=int,
          metavar="N",
          default=15000,
          help="Number of updates before training with mono",
      )
      parser.add_argument(
          "--forward-train-source-binary-path",
          default="",
          metavar="FILE",
          help="Path for the binary file containing source training "
          "examples for forward model.",
      )
      parser.add_argument(
          "--forward-train-target-binary-path",
          default="",
          metavar="FILE",
          help="Path for the binary file containing target training "
          "examples for forward model.",
      )
      parser.add_argument(
          "--forward-eval-source-binary-path",
          default="",
          metavar="FILE",
          help="Path for the binary file containing source valid "
          "examples for forward model.",
      )
      parser.add_argument(
          "--forward-eval-target-binary-path",
          default="",
          metavar="FILE",
          help="Path for the binary file containing target training "
          "examples for forward model.",
      )
      parser.add_argument(
          "--backward-train-source-binary-path",
          default="",
          metavar="FILE",
          help="Path for the binary file containing source training "
          "examples for backward model.",
      )
      parser.add_argument(
          "--backward-train-target-binary-path",
          default="",
          metavar="FILE",
          help="Path for the binary file containing target training "
          "examples for backward model.",
      )
      parser.add_argument(
          "--backward-eval-source-binary-path",
          default="",
          metavar="FILE",
          help="Path for the binary file containing source valid "
          "examples for backward model.",
      )
      parser.add_argument(
          "--backward-eval-target-binary-path",
          default="",
          metavar="FILE",
          help="Path for the binary file containing target training "
          "examples for backward model.",
      )
      parser.add_argument(
          "--remove-eos-at-src",
          action="store_true",
          help="If True, remove eos",
      )
      parser.add_argument(
          "--pretrained-forward-checkpoint",
          default="",
          help="Load pretrained forward model",
      )
      parser.add_argument(
          "--pretrained-backward-checkpoint",
          default="",
          help="Load pretrained backward model",
      )
      parser.add_argument(
          "--reconstruction-bleu-order",
          default=2,
          help="BLEU score order to use as reward for reconstruction",
      )
  
imports: from collections import OrderedDict
  import torch
  from fairseq import optim, utils
  from fairseq.criterions import CRITERION_REGISTRY
  from fairseq.data import LanguagePairDataset, RoundRobinZipDatasets
  from fairseq.tasks import LegacyFairseqTask, register_task
  from pytorch_translate.data import dictionary, utils
  from pytorch_translate.dual_learning import dual_learning_models
  from pytorch_translate.dual_learning.dual_learning_criterion import UnsupervisedCriterion
  from pytorch_translate.tasks.pytorch_translate_task import PytorchTranslateTask
  from pytorch_translate.weighted_criterions import WeightedLabelSmoothedCrossEntropyCriterion
label_desc: Use image node_id 1 for calling the DualLearningTask obj's underlying member method code with example usage: obj.add_args(parser) without return types