class_docstr: Data Processor for SGD dialogues.
  
  More information at https://arxiv.org/abs/1909.05855
  
  ***Downloading the dataset***
      #   git clone https://github.com/google-research-datasets/dstc8-schema-guided-dialogue.git
  
  ***Data format***
  SGD data comes with a JSON schema file and dialogue files for each dataset split. 
  
  In the following we will show an example for a service entry in the schema file.
  * service_name
  * description
  * slots
      * name
      * description
      * is_categorical
      * possible values
  * intents
      * name
      * description
      * required_slots (not used)
      * is_transactional (not used)
      * optional_slots (not used)
      * result_slots (not used)
  
  
  In the following we will show an example for a dialogue. 
  * dialogue_id
  * services
  * turns
      * frames
          * actions
              * act
              * slot
              * values
          * service
          * slots
              * exclusive_end
              * slot
              * start
          * state
              * active_intent
              * requeste_slots
              * slot_values 
      * speaker - [USER, SYSTEM]
      * utterance
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 slot_span in 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
  
imports: import collections
  import json
  import os
  import pickle
  import re
  from typing import List
  from nemo.collections.nlp.data.dialogue.data_processor.data_processor import DialogueDataProcessor
  from nemo.collections.nlp.data.dialogue.input_example.input_example import DialogueInputExample
  from nemo.collections.nlp.data.dialogue.sgd.schema import Schema
  from nemo.utils import logging
  from nemo.utils.get_rank import is_global_rank_zero
label_desc: Use image node_id 15 for calling the DialogueSGDDataProcessor 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