class_docstr: Base class for criteria with need to run beam search.
class_docstr_tok: ["Base","class","for","criteria","with","need","to","run","beam","search","."]
code: def __init__(self, args, src_dict, dst_dict):
      super().__init__(args, src_dict, dst_dict)
      self.translator = None
      self.scorer = bleu.Scorer(
          bleu.BleuConfig(
              pad=dst_dict.pad(),
              eos=dst_dict.eos(),
              unk=dst_dict.unk(),
          )
      )
  
imports: import copy
  import math
  import torch
  from fairseq import utils
  from fairseq.criterions import LegacyFairseqCriterion, register_criterion
  from fairseq.scoring import bleu
  from pytorch_translate import generate
label_desc: Use image node_id 1 to create a new BaseSequenceLossCriterion object from inherited base classes: LegacyFairseqCriterion with example: obj = BaseSequenceLossCriterion(args, src_dict, dst_dict)