class_docstr: This class represents a data instance in a TextNormalizationTaggerDataset.
  
  Args:
      w_words: List of words in a sentence in the written form
      s_words: List of words in a sentence in the spoken form
      direction: Indicates the direction of the instance (i.e., INST_BACKWARD for ITN or INST_FORWARD for TN).
      lang: Language
class_docstr_tok: ["This","class","represents","a","data","instance","in","a","TextNormalizationTaggerDataset",".","Args",":","w_words",":","List","of","words","in","a","sentence","in","the","written","form","s_words",":","List","of","words","in","a","sentence","in","the","spoken","form","direction",":","Indicates","the","direction","of","the","instance","(","i.e.",",","INST_BACKWARD","for","ITN","or","INST_FORWARD","for","TN",")",".","lang",":","Language"]
code: def __init__(self, w_words, s_words, direction, lang):
      # moses tokenization before LM tokenization
      # e.g., don't -> don 't, 12/3 -> 12 / 3
      processor = MosesProcessor(lang_id=lang)
      # Build input_words and labels
      input_words, labels = [], []
      # Task Prefix
      if direction == constants.INST_BACKWARD:
          input_words.append(constants.ITN_PREFIX)
      if direction == constants.INST_FORWARD:
          input_words.append(constants.TN_PREFIX)
      labels.append(constants.TASK_TAG)
      # Main Content
      for w_word, s_word in zip(w_words, s_words):
          w_word = processor.tokenize(w_word)
          if not s_word in constants.SPECIAL_WORDS:
              s_word = processor.tokenize(s_word)
          # Update input_words and labels
          if (
              s_word == constants.SIL_WORD
              and direction == constants.INST_BACKWARD
          ):
              continue
  
          if s_word in constants.SPECIAL_WORDS:
              input_words.append(w_word)
              labels.append(constants.SAME_TAG)
          else:
              if direction == constants.INST_BACKWARD:
                  input_words.append(s_word)
              if direction == constants.INST_FORWARD:
                  input_words.append(w_word)
              labels.append(constants.TRANSFORM_TAG)
      self.input_words = input_words
      self.labels = labels
  
file_path: NeMo/nemo/collections/nlp/data/text_normalization/tagger_dataset.py
imports: import os
  import pickle
  from tqdm import tqdm
  from transformers import PreTrainedTokenizerBase
  from nemo.collections.common.tokenizers.moses_tokenizers import MosesProcessor
  from nemo.collections.nlp.data.text_normalization import constants
  from nemo.collections.nlp.data.text_normalization.utils import read_data_file
  from nemo.core.classes import Dataset
  from nemo.utils import logging
label_desc: Use image node_id 1 to create a new TaggerDataInstance object  with example: obj = TaggerDataInstance(w_words, s_words, direction, lang)