class_docstr: Dataset Class 
      1. Performs Model-dependent (but Data-independent) operations (tokenization etc)
      2. This can allow the same model preprocessing for multiple datasources
      3. Users can configurate which labels to use for modelling 
          (e.g. intent classification, slot filling or both together etc)
class_docstr_tok: ["Dataset","Class","1",".","Performs","Model-dependent","(","but","Data-independent",")","operations","(","tokenization","etc",")","2",".","This","can","allow","the","same","model","preprocessing","for","multiple","datasources","3",".","Users","can","configurate","which","labels","to","use","for","modelling","(","e.g",".","intent","classification",",","slot","filling","or","both","together","etc",")"]
docstr: Find indices for subwords corresponding to slot values.
  Args:
      slot_values: slot - slot value pairs
      utterance: utterance
      char_slot_spans: char - slot spans
      alignments: alignments
      subwords: subtokens mapping
      bias: offset
  Returns:
      span_boundaries: span boundaries
docstr_tok: ["Find","indices","for","subwords","corresponding","to","slot","values",".","Args",":","slot_values",":","slot","-","slot","value","pairs","utterance",":","utterance","char_slot_spans",":","char","-","slot","spans","alignments",":","alignments","subwords",":","subtokens","mapping","bias",":","offset","Returns",":","span_boundaries",":","span","boundaries"]
code: def _find_subword_indices(
      self,
      slot_values: dict,
      utterance: str,
      char_slot_spans: dict,
      alignments: List[int],
      subwords: List[str],
      bias: int,
  ) -> dict:
      """
      Find indices for subwords corresponding to slot values.
      Args:
          slot_values: slot - slot value pairs
          utterance: utterance
          char_slot_spans: char - slot spans
          alignments: alignments
          subwords: subtokens mapping
          bias: offset
      Returns:
          span_boundaries: span boundaries
      """
      span_boundaries = {}
      for slot, values in slot_values.items():
          # Get all values present in the utterance for the specified slot.
          value_char_spans = {}
          for key, slot_span in char_slot_spans.items():
              # print(key, slot, slot_span, char_slot_spans)
              if slot_span["slot"] == slot:
                  value = utterance[
                      slot_span["start"] : slot_span["exclusive_end"]
                  ]
                  start_tok_idx = alignments[slot_span["start"]]
                  end_tok_idx = alignments[
                      slot_span["exclusive_end"] - 1
                  ]
                  if 0 <= start_tok_idx < len(subwords):
                      end_tok_idx = min(end_tok_idx, len(subwords) - 1)
                      value_char_spans[value] = (
                          start_tok_idx + bias,
                          end_tok_idx + bias,
                      )
          for v in values:
              if v in value_char_spans:
                  span_boundaries[slot] = value_char_spans[v]
                  break
      return span_boundaries
  
file_path: NeMo/nemo/collections/nlp/data/dialogue/dataset/dialogue_sgd_bert_dataset.py
imports: import os
  import re
  from typing import List
  import numpy
  from nemo.collections.nlp.data.dialogue.dataset.dialogue_dataset import DialogueDataset
  from nemo.collections.nlp.data.dialogue.input_example.sgd_input_example import SGDInputExample
label_desc: Use image node_id 10 for calling the DialogueSGDBERTDataset obj's underlying member method code with example usage: obj._find_subword_indices(slot_values, utterance, char_slot_spans, alignments, subwords, bias) and returns: span_boundaries