docstr: Initialize n-best list of hypotheses.
docstr_tok: ["Initialize","n-best","list","of","hypotheses","."]
code: def __init__(
      self, num_beams, max_length, length_penalty, early_stopping
  ):
      """
      Initialize n-best list of hypotheses.
      """
      self.max_length = max_length - 1  # ignoring bos_token
      self.length_penalty = length_penalty
      self.early_stopping = early_stopping
      self.num_beams = num_beams
      self.hyp = []
      self.worst_score = 1e9
  
file_path: fastNLP/fastNLP/modules/torch/generator/seq2seq_generator.py
imports: import torch
  from torch import nn
  import torch.nn.functional
  from ..decoder.seq2seq_decoder import Seq2SeqDecoder, State
  from functools import partial
label_desc: Use image node_id 1 to create a new BeamHypotheses object from inherited base classes: object with example: obj = BeamHypotheses(num_beams, max_length, length_penalty, early_stopping)