class_docstr: The G2P model evaluation wrapper
  
  Arguments
  ---------
  hparams: dict
      the dictionary from a parsed hyperparameter file
  device: str
      the device identifier
  model_state: dict
      a pre-loaded model state for a "warm start" if applicable
      - could be useful if hyperparameters have changed, but
      the same model can be reused from one run to the next
docstr: Retrieves the phoneme sequence corresponding to the provided grapheme
  sequence in a word-wise manner (running the evaluator for each word separately)
  
  Arguments
  ---------
  grapheme_encoded: speechbrain.dataio.batch.PaddedData
      An encoded grapheme sequence
  
  Returns
  -------
  hyps: list
      the hypotheses (the beam search result)
  scores: list
      the scores corresponding to the hypotheses
docstr_tok: ["Retrieves","the","phoneme","sequence","corresponding","to","the","provided","grapheme","sequence","in","a","word-wise","manner","(","running","the","evaluator","for","each","word","separately",")","Arguments","--","--","--","--","-","grapheme_encoded",":","speechbrain.dataio.batch.PaddedData","An","encoded","grapheme","sequence","Returns","--","--","--","-","hyps",":","list","the","hypotheses","(","the","beam","search","result",")","scores",":","list","the","scores","corresponding","to","the","hypotheses"]
code: def _get_phonemes_wordwise(self, grapheme_encoded):
      """Retrieves the phoneme sequence corresponding to the provided grapheme
      sequence in a word-wise manner (running the evaluator for each word separately)
  
      Arguments
      ---------
      grapheme_encoded: speechbrain.dataio.batch.PaddedData
          An encoded grapheme sequence
  
      Returns
      -------
      hyps: list
          the hypotheses (the beam search result)
      scores: list
          the scores corresponding to the hypotheses
      """
      if self.hparams.use_word_emb:
          raise NotImplementedError(
              "Wordwise evaluation is not supported with word embeddings"
          )
      if self._word_separator is None:
          self._word_separator = self.hparams.phoneme_encoder.lab2ind[
              " "
          ]
      hyps, scores = [], []
      for grapheme_item, grapheme_len in zip(
          grapheme_encoded.data, grapheme_encoded.lengths
      ):
          words_batch = self._split_words_batch(
              grapheme_item, grapheme_len
          )
          item_hyps, item_scores = self._get_phonemes(
              words_batch.grapheme_encoded
          )
          hyps.append(self._flatten_results(item_hyps))
          scores.append(self._flatten_scores(item_hyps, item_scores))
      return hyps, scores
  
imports: from hyperpyyaml import load_hyperpyyaml
  from speechbrain.dataio.batch import PaddedBatch
  from speechbrain.lobes.models.g2p.dataio import get_sequence_key
  from speechbrain.utils import hpopt
  from speechbrain.wordemb.util import expand_to_chars
  from train import dataio_prep, load_dependencies
  from types import SimpleNamespace
  from tqdm.auto import tqdm
  import math
  import itertools
  import speechbrain
  import torch
  import sys
  import logging
label_desc: Use image node_id 6 for calling the G2PEvaluator obj's underlying member method code with example usage: obj._get_phonemes_wordwise(grapheme_encoded) and returns: hyps,  scores