class_docstr: Dataset to read the score file containing the beams and their score
  
  Args:
      data_path: path to the beams file
      tokenizer: tokenizer of the LM model
      manifest_path: manifest `.json` file which contains the ground truths transcripts
      beam_size: the number of beams per sample
      max_seq_length: the maximum length of sequences
class_docstr_tok: ["Dataset","to","read","the","score","file","containing","the","beams","and","their","score","Args",":","data_path",":","path","to","the","beams","file","tokenizer",":","tokenizer","of","the","LM","model","manifest_path",":","manifest","`",".json","`","file","which","contains","the","ground","truths","transcripts","beam_size",":","the","number","of","beams","per","sample","max_seq_length",":","the","maximum","length","of","sequences"]
code: def __getitem__(self, idx):
      text = str(self.data[0][idx])
      tokens = self.tokenizer.text_to_ids(text)
      if self.tokenizer.bos_id is not None:
          tokens = [self.tokenizer.bos_id] + tokens
      if self.tokenizer.eos_id is not None:
          tokens = tokens + [self.tokenizer.eos_id]
      input_ids = [self.pad_id] * self.max_seq_length
      input_ids[: len(tokens)] = tokens
      input_ids = np.array(input_ids)
      input_mask = np.zeros(self.max_seq_length)
      input_mask[: len(tokens)] = 1
      acoustic_score = self.data[1][idx]
      dist = editdistance.eval(
          text.split(),
          self.ground_truths[idx // self.beam_size].split(),
      )
      ref_len = len(self.ground_truths[idx // self.beam_size].split())
      len_in_chars = len(str(self.data[0][idx]))
      return (
          input_ids,
          input_mask,
          acoustic_score,
          dist,
          ref_len,
          len_in_chars,
          idx,
      )
  
imports: import contextlib
  import inspect
  import json
  from argparse import ArgumentParser
  import editdistance
  import matplotlib.pyplot
  import numpy
  import pandas
  import torch
  import tqdm
  from transformers import AutoModelForCausalLM
  from nemo.collections.nlp.models.language_modeling import TransformerLMModel
  from nemo.collections.nlp.modules.common.tokenizer_utils import get_tokenizer
  from nemo.utils import logging
label_desc: Use image node_id 3 for calling the BeamScoresDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: input_ids,  input_mask,  acoustic_score,  dist,  ref_len,  len_in_chars,  idx