docstr: load rescoring models
docstr_tok: ["load","rescoring","models"]
code: def load_rescore_models(self, args):
      """load rescoring models"""
      models = {}
      if args.l2r_model_path:
          (
              l2r_model,
              _,
              l2r_task,
          ) = pytorch_translate_utils.load_diverse_ensemble_for_inference(
              [args.l2r_model_path]
          )
          models["l2r_model"] = {
              "model": l2r_model[0],
              "task": l2r_task,
          }
      #
      if args.r2l_model_path:
          (
              r2l_model,
              _,
              r2l_task,
          ) = pytorch_translate_utils.load_diverse_ensemble_for_inference(
              [args.r2l_model_path]
          )
          models["r2l_model"] = {
              "model": r2l_model[0],
              "task": r2l_task,
          }
      #
      if args.reverse_model_path:
          (
              reverse_model,
              _,
              reverse_task,
          ) = pytorch_translate_utils.load_diverse_ensemble_for_inference(
              [args.reverse_model_path]
          )
          models["reverse_model"] = {
              "model": reverse_model[0],
              "task": reverse_task,
          }
      #
      if args.lm_model_path:
          (
              lm_model,
              _,
              lm_task,
          ) = pytorch_translate_utils.load_diverse_ensemble_for_inference(
              [args.lm_model_path]
          )
          models["lm_model"] = {"model": lm_model[0], "task": lm_task}
      #
      if args.cloze_transformer_path:
          (
              cloze_model,
              _,
              cloze_task,
          ) = pytorch_translate_utils.load_diverse_ensemble_for_inference(
              [args.cloze_transformer_path]
          )
          models["cloze_model"] = {
              "model": cloze_model[0],
              "task": cloze_task,
          }
      return models
  
file_path: translate/pytorch_translate/research/rescore/rescoring_criterion.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import math
  import torch
  from fairseq import utils
  from fairseq.criterions import LegacyFairseqCriterion, register_criterion
  from pytorch_translate import generate, utils
  from pytorch_translate.rescoring.model_scorers import SimpleModelScorer
  from pytorch_translate.rescoring.rescorer import add_args, combine_weighted_scores, Rescorer
label_desc: Use image node_id 6 for calling the RescoringCriterion obj's underlying member method code with example usage: obj.load_rescore_models(args) and returns: models