class_docstr: A loss function for a specific word in the output, used in
  the homograph disambiguation task
  The approach is as follows:
  1. Arrange only the target words from the original batch into a
  single tensor
  2. Find the word index of each target word
  3. Compute the beginnings and endings of words in the predicted
  sequences. The assumption is that the model has been trained well
  enough to identify word boundaries with a simple argmax without
  having to perform a beam search.
  Important! This loss can be used for fine-tuning only
  The model is expected to be able to already be able
  to correctly predict word boundaries
  Arguments
  ---------
  seq_cost: callable
      the loss to be used on the extracted subsequences
  word_separator: int
      the index of the "space" character (in phonemes)
  word_separator_base: str
      the index of word separators used in unprocessed
      targets (if different, used with tokenizations)
  
  Example
  -------
  >>> import torch
  >>> from speechbrain.lobes.models.g2p.homograph import SubsequenceLoss
  >>> from speechbrain.nnet.losses import nll_loss
  >>> loss = SubsequenceLoss(
  ...     seq_cost=nll_loss
  ... )
  >>> 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.]]
  ... ])
  >>> loss_value = loss(
  ...    phns,
  ...    phn_lens,
  ...    p_seq,
  ...    subsequence_phn_start,
  ...    subsequence_phn_end
  ... )
  >>> loss_value
  tensor(-0.8000)
docstr: Sets the base word separator
docstr_tok: ["Sets","the","base","word","separator"]
code: def word_separator_base(self, value):  # noqa
      """
      Sets the base word separator
      """
      self._subsequence_extractor.word_separator_base = value
  
imports: import torch
  from torch import nn
label_desc: Use image node_id 5 for calling the SubsequenceLoss obj's underlying member method code with example usage: obj.word_separator_base(value) without return types