class_docstr: The dataset class for prompt-tuning or p-tuning pretrained T5 models.
class_docstr_tok: ["The","dataset","class","for","prompt-tuning","or","p-tuning","pretrained","T5","models","."]
docstr: Format the input example according to the template 
docstr_tok: ["Format","the","input","example","according","to","the","template"]
code: def _insert_text_in_template(
      self, input_example, prompt_template_fields, doc, answer_field
  ):
      """Format the input example according to the template"""
      for field in prompt_template_fields:
          # discard the last one, {label} / {answer}
          # Or if some fields from the template aren't present, e.g. {answer} during inference
          # just remove that field from the template, leaving the space blank
          if field == answer_field or field not in doc.keys():
              input_example = input_example.replace(
                  "{" + field + "}", ""
              )
  
          else:
              field_text = doc[field]
              input_example = input_example.replace(
                  "{" + field + "}", field_text
              )
  
      return input_example.strip(" ")
  
file_path: NeMo/nemo/collections/nlp/data/language_modeling/megatron/t5_prompt_learning_dataset.py
imports: import json
  import torch
  from tqdm.auto import tqdm
  from nemo.collections.nlp.data.language_modeling.megatron.base_prompt_learning_dataset import BasePromptLearningDataset
  from nemo.collections.nlp.models.language_modeling.megatron_t5_model import T5Sentinel
  from nemo.collections.nlp.modules.common import VirtualPromptSource
  from nemo.collections.nlp.modules.common.megatron.utils import build_position_ids
  from nemo.utils import logging
label_desc: Use image node_id 3 for calling the T5PromptLearningDataset obj's underlying member method code with example usage: obj._insert_text_in_template(input_example, prompt_template_fields, doc, answer_field) and returns: input_example