class_docstr: A utility class to help extract subsequences out of a batch
  of sequences
  
  Arguments
  ---------
  word_separator: int
      the index of the word separator (used in p_seq)
  word_separator_base int
      the index of word separators used in unprocessed
      targets (if different)
  
  Example
  -------
  >>> import torch
  >>> from speechbrain.lobes.models.g2p.homograph import SubsequenceExtractor
  >>> extractor = SubsequenceExtractor()
  >>> phns = torch.Tensor(
  ...     [[1, 2, 0, 1, 3, 0, 2, 1, 0],
  ...      [2, 1, 3, 0, 1, 2, 0, 3, 2]]
  ... )
  >>> phn_lens = torch.IntTensor([8, 9])
  >>> subsequence_phn_start = torch.IntTensor([3, 4])
  >>> subsequence_phn_end = torch.IntTensor([5, 7])
  >>> p_seq = torch.Tensor([
  ...     [[0., 1., 0., 0.],
  ...      [0., 0., 1., 0.],
  ...      [1., 0., 0., 0.],
  ...      [0., 1., 0., 0.],
  ...      [0., 0., 0., 1.],
  ...      [1., 0., 0., 0.],
  ...      [0., 0., 1., 0.],
  ...      [0., 1., 0., 0.],
  ...      [1., 0., 0., 0.]],
  ...     [[0., 0., 1., 0.],
  ...      [0., 1., 0., 0.],
  ...      [0., 0., 0., 1.],
  ...      [1., 0., 0., 0.],
  ...      [0., 1., 0., 0.],
  ...      [0., 0., 1., 0.],
  ...      [1., 0., 0., 0.],
  ...      [0., 0., 0., 1.],
  ...      [0., 0., 1., 0.]]
  ... ])
  >>> extractor.extract_seq(
  ...    phns,
  ...    phn_lens,
  ...    p_seq,
  ...    subsequence_phn_start,
  ...    subsequence_phn_end
  ... )
  (tensor([[[0., 1., 0., 0.],
           [0., 0., 0., 1.],
           [0., 0., 0., 0.]],
  <BLANKLINE>
          [[0., 1., 0., 0.],
           [0., 0., 1., 0.],
           [0., 0., 0., 0.]]]), tensor([[1., 3., 0.],
          [1., 2., 0.]]), tensor([0.6667, 1.0000]))
docstr: Extracts a single word out of a hypothesis sequence
  
  Arguments
  ---------
  hyps: list
      a hypotheses list (or tensor)
  separator_indexes: torch.Tensor
      a tensor of word separators
  word_index: int
      the index of the word to eb retrieved
  
  Returns
  -------
  result: list|str
      the extracted word
docstr_tok: ["Extracts","a","single","word","out","of","a","hypothesis","sequence","Arguments","--","--","--","--","-","hyps",":","list","a","hypotheses","list","(","or","tensor",")","separator_indexes",":","torch.Tensor","a","tensor","of","word","separators","word_index",":","int","the","index","of","the","word","to","eb","retrieved","Returns","--","--","--","-","result",":","list|str","the","extracted","word"]
code: def _extract_hyp_word(self, hyps, separator_indexes, word_index):
      """Extracts a single word out of a hypothesis sequence
  
      Arguments
      ---------
      hyps: list
          a hypotheses list (or tensor)
      separator_indexes: torch.Tensor
          a tensor of word separators
      word_index: int
          the index of the word to eb retrieved
  
      Returns
      -------
      result: list|str
          the extracted word
      """
      if word_index < len(separator_indexes):
          left = separator_indexes[word_index]
          if left is None:
              return ""
          left += 1
          right = separator_indexes[word_index + 1]
          result = hyps[left:right]
      else:
          result = []
      return result
  
imports: import torch
  from torch import nn
label_desc: Use image node_id 11 for calling the SubsequenceExtractor obj's underlying member method code with example usage: obj._extract_hyp_word(hyps, separator_indexes, word_index) and returns: result, str