Skip to content

Commit 317b5cb

Browse files
Confidence fix get_correct_marks (#15128)
Signed-off-by: Nune <[email protected]>
1 parent 412bdc3 commit 317b5cb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

nemo/collections/asr/parts/utils/asr_confidence_benchmarking_utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ def get_correct_marks(r: Union[List[int], List[str]], h: Union[List[int], List[s
4444
4545
This method considers only insertions and substitutions as incorrect marks.
4646
"""
47-
return [a == b for a, b in (align([str(rr) for rr in r], [str(hh) for hh in h], "<eps>")[:-1]) if b != "<eps>"]
47+
alignment = align(
48+
[str(rr) for rr in r],
49+
[str(hh) for hh in h],
50+
"<eps>",
51+
)
52+
return [a == b for a, b in alignment if b != "<eps>"]
4853

4954

5055
def get_token_targets_with_confidence(hyp: Hypothesis) -> List[Tuple[str, float]]:

0 commit comments

Comments
 (0)