def get_wer_alignment_codes(hyp_str, ref_str):
    """
    INPUT: hypothesis string, reference string
    OUTPUT: List of alignment codes (intermediate results from WER computation)
    """
    t = WERTransformer(hyp_str, ref_str, verbose=0)
    return t.ed_.align(str2toks(ref_str), str2toks(hyp_str)).codes
INPUT: hypothesis string, reference string
OUTPUT: List of alignment codes (intermediate results from WER computation)
examples/speech_recognition/utils/wer_utils.py