def read_data_file(fp):
    ' Reading the raw data from a file of NeMo format\n    For more info about the data format, refer to the\n    `text_normalization doc <https://github.com/NVIDIA/NeMo/blob/main/docs/source/nlp/text_normalization.rst>`.\n    '
    (insts, w_words, s_words, classes) = ([], [], [], [])
    with open(fp, 'r', encoding='utf-8') as f:
        for line in tqdm(f):
            es = [e.strip() for e in line.strip().split('\t')]
            if (es[0] == '<eos>'):
                inst = (deepcopy(classes), deepcopy(w_words), deepcopy(s_words))
                insts.append(inst)
                (w_words, s_words, classes) = ([], [], [])
            else:
                classes.append(es[0])
                w_words.append(es[1])
                s_words.append(es[2])
    return insts
Reading the raw data from a file of NeMo format
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>`.
def read_data_file(fp):
    ' Reading the raw data from a file of NeMo format\n    For more info about the data format, refer to the\n    `text_normalization doc <https://github.com/NVIDIA/NeMo/blob/main/docs/source/nlp/text_normalization.rst>`.\n    '
    (insts, w_words, s_words, classes) = ([], [], [], [])
    with open(fp, 'r', encoding='utf-8') as f:
        for line in tqdm(f):
            es = [e.strip() for e in line.strip().split('\t')]
            if (es[0] == '<eos>'):
                inst = (deepcopy(classes), deepcopy(w_words), deepcopy(s_words))
                insts.append(inst)
                (w_words, s_words, classes) = ([], [], [])
            else:
                classes.append(es[0])
                w_words.append(es[1])
                s_words.append(es[2])
    return insts