class_docstr: An example for training/inference.
class_docstr_tok: ["An","example","for","training\/inference","."]
docstr: Constructs an InputExample.
  Args:
      schema_config: configuration
      tokenizer: tokenizer object
      service_schema: A ServiceSchema object wrapping the schema for the service
          corresponding to this example.
      example_id: Unique identifier for the example, like: 'train-1_00000-00-Restaurants_1'
      example_id_num: dialogue_id and turn_id combined and service id combined into a list of ints,
          like: [1, 0, 0, 18]
docstr_tok: ["Constructs","an","InputExample",".","Args",":","schema_config",":","configuration","tokenizer",":","tokenizer","object","service_schema",":","A","ServiceSchema","object","wrapping","the","schema","for","the","service","corresponding","to","this","example",".","example_id",":","Unique","identifier","for","the","example",",","like",":","'train-1_00000-00-Restaurants_1'","example_id_num",":","dialogue_id","and","turn_id","combined","and","service","id","combined","into","a","list","of","ints",",","like",":","[","1",",","0",",","0",",","18","]"]
code: def __init__(
      self,
      schema_config: dict,
      tokenizer: object,
      service_schema: object = None,
      example_id: str = "NONE",
      example_id_num: List[int] = [],
  ):
      """
      Constructs an InputExample.
      Args:
          schema_config: configuration
          tokenizer: tokenizer object
          service_schema: A ServiceSchema object wrapping the schema for the service
              corresponding to this example.
          example_id: Unique identifier for the example, like: 'train-1_00000-00-Restaurants_1'
          example_id_num: dialogue_id and turn_id combined and service id combined into a list of ints,
              like: [1, 0, 0, 18]
      """
      self.schema_config = schema_config
      self.service_schema = service_schema
      self.service_id = None
      if service_schema:
          self.service_id = service_schema.service_id
      self.example_id = example_id
      self.example_id_num = example_id_num
      self._max_seq_length = schema_config["MAX_SEQ_LENGTH"]
      self._tokenizer = tokenizer
      if self._tokenizer is None:
          raise ValueError("Must specify tokenizer")
  
      self.user_utterance = ""
      self.system_utterance = ""
      # The id of each subword in the vocabulary for BERT.
      self.utterance_ids = [0] * self._max_seq_length
      # Denotes the identity of the sequence. Takes values 0 (schema description) and 1 (system and user utterance).
      self.utterance_segment = [0] * self._max_seq_length
      # Mask which takes the value 0 for padded tokens and 1 otherwise.
      self.utterance_mask = [0] * self._max_seq_length
      # Start and inclusive end character indices in the original utterance
      # corresponding to the tokens. This is used to obtain the character indices
      # from the predicted subword indices during inference.
      # NOTE: A positive value indicates the character indices in the schema description
      # whereas a negative value indicates the character indices in the
      # utterance. The indices are offset by 1 to prevent ambiguity in the
      # 0 index, which could be in either the schema description or utterance by the
      # above convention. Now the 0 index corresponds to padded tokens.
      self.start_char_idx = [0] * self._max_seq_length
      self.end_char_idx = [0] * self._max_seq_length
  
      # Id of categorical slot present in the example or 0 if not present.
      self.categorical_slot_id = 0
      # Id of non categorical slot present in the example or 0 if not present.
      self.noncategorical_slot_id = 0
      # The status of categorical slot in the example.
      self.categorical_slot_status = STATUS_OFF
      # The status of non categorical slot in the example.
      self.noncategorical_slot_status = STATUS_OFF
      # Masks out tasks not represented by example
      self.task_mask = [0] * schema_config["NUM_TASKS"]
  
      # The index of the starting subword corresponding to the slot span
      # for a non-categorical slot value.
      self.noncategorical_slot_value_start = 0
      # The index of the ending (inclusive) subword corresponding to the slot span
      # for a non-categorical slot value.
      self.noncategorical_slot_value_end = 0
  
      # Id of categorical slot value present in the example or 0 if not present.
      self.categorical_slot_value_id = 0
      # The status of categorical slot value in the example.
      self.categorical_slot_value_status = STATUS_OFF
      # Id of requested slot present in the example or 0 if not present.
      self.requested_slot_id = 0
      # Takes value 1 if the corresponding slot is requested, 0 otherwise.
      self.requested_slot_status = STATUS_OFF
  
      # ID of intent present in the example.
      self.intent_id = 0
      # Takes value 1 if the intent is active, 0 otherwise.
      self.intent_status = STATUS_OFF
  
file_path: NeMo/nemo/collections/nlp/data/dialogue/input_example/sgd_input_example.py
imports: from typing import List
  from nemo.collections.nlp.data.dialogue.input_example.input_example import DialogueInputExample
  from nemo.utils import logging
label_desc: Use image node_id 1 to create a new SGDInputExample object from inherited base classes: object with example: obj = SGDInputExample(schema_config, tokenizer, service_schema, example_id, example_id_num)