class_docstr: Creates dataset to use to do end-to-end inference
  
  Args:
      input_file: path to the raw data file (e.g., train.tsv). For more info about the data format, refer to the `text_normalization doc <https://github.com/NVIDIA/NeMo/blob/main/docs/source/nlp/text_normalization.rst>`.
      mode: should be one of the values ['tn', 'itn', 'joint'].  `tn` mode is for TN only. `itn` mode is for ITN only. `joint` is for training a system that can do both TN and ITN at the same time.
      lang: Language of the dataset
class_docstr_tok: ["Creates","dataset","to","use","to","do","end-to-end","inference","Args",":","input_file",":","path","to","the","raw","data","file","(","e.g.",",","train.tsv",")",".","For","more","info","about","the","data","format",",","refer","to","the","`","text_normalization","doc","<","https",":","\/\/github.com\/NVIDIA\/NeMo\/blob\/main\/docs\/source\/nlp\/text_normalization.rst",">","`",".","mode",":","should","be","one","of","the","values","[","'tn","'",",","'itn","'",",","'joint","'","]",".","`","tn","`","mode","is","for","TN","only",".","`","itn","`","mode","is","for","ITN","only",".","`","joint","`","is","for","training","a","system","that","can","do","both","TN","and","ITN","at","the","same","time",".","lang",":","Language","of","the","dataset"]
docstr: Compute the sentence accuracy metric.
  
  Args:
      preds: List of predicted strings.
      targets: List of target strings.
      inst_directions: A list of str where each str indicates the direction of the corresponding instance (i.e., INST_BACKWARD or INST_FORWARD).
  Return: the sentence accuracy score
docstr_tok: ["Compute","the","sentence","accuracy","metric",".","Args",":","preds",":","List","of","predicted","strings",".","targets",":","List","of","target","strings",".","inst_directions",":","A","list","of","str","where","each","str","indicates","the","direction","of","the","corresponding","instance","(","i.e.",",","INST_BACKWARD","or","INST_FORWARD",")",".","Return",":","the","sentence","accuracy","score"]
code: def compute_sent_accuracy(
      preds: List[str], targets: List[str], inst_directions: List[str]
  ):
      """
      Compute the sentence accuracy metric.
  
      Args:
          preds: List of predicted strings.
          targets: List of target strings.
          inst_directions: A list of str where each str indicates the direction of the corresponding instance (i.e., INST_BACKWARD or INST_FORWARD).
      Return: the sentence accuracy score
      """
      assert len(preds) == len(targets)
      if len(targets) == 0:
          return "NA"
      # Sentence Accuracy
      correct_count = 0
      for inst_dir, pred, target in zip(
          inst_directions, preds, targets
      ):
          correct_count += TextNormalizationTestDataset.is_same(
              pred, target, inst_dir
          )
      sent_accuracy = correct_count / len(targets)
  
      return sent_accuracy
  
file_path: NeMo/nemo/collections/nlp/data/text_normalization/test_dataset.py
imports: from collections import defaultdict
  from typing import List
  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 normalize_str, read_data_file, remove_puncts
  from nemo.utils import logging
label_desc: Use image node_id 5 for calling the TextNormalizationTestDataset obj's underlying member method code with example usage: obj.compute_sent_accuracy(preds, targets, inst_directions) and returns: sent_accuracy, str