From 4c7875c53e6e1bde1b10058e03707802baf57636 Mon Sep 17 00:00:00 2001 From: PanosAntoniadis Date: Fri, 30 Aug 2019 14:21:40 +0300 Subject: [PATCH 1/2] Fix error in Sphinx format where an additional score parameter exists near file id in hypothesis file --- asr_evaluation/asr_evaluation.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/asr_evaluation/asr_evaluation.py b/asr_evaluation/asr_evaluation.py index 02d70ee..6056190 100644 --- a/asr_evaluation/asr_evaluation.py +++ b/asr_evaluation/asr_evaluation.py @@ -200,14 +200,18 @@ def remove_tail_id(ref, hyp): """Assumes that the ID is the final token of the string which is common in Sphinx but not in Kaldi.""" ref_id = ref[-1] - hyp_id = hyp[-1] + hyp_id = hyp[-2] + ')' if ref_id != hyp_id: print('Reference and hypothesis IDs do not match! ' 'ref="{}" hyp="{}"\n' 'File lines in hyp file should match those in the ref file.'.format(ref_id, hyp_id)) exit(-1) ref = ref[:-1] - hyp = hyp[:-1] + hyp = hyp[:-2] + print(ref_id) + print(hyp_id) + print(ref) + print(hyp) return ref, hyp def print_instances(ref, hyp, sm, id_=None): From 286fe4e58e42c5c04e1475cc2b5e8ceea3ec49cc Mon Sep 17 00:00:00 2001 From: PanosAntoniadis Date: Fri, 30 Aug 2019 14:24:57 +0300 Subject: [PATCH 2/2] Remove unnecessary prints --- asr_evaluation/asr_evaluation.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/asr_evaluation/asr_evaluation.py b/asr_evaluation/asr_evaluation.py index 6056190..a6138ec 100644 --- a/asr_evaluation/asr_evaluation.py +++ b/asr_evaluation/asr_evaluation.py @@ -208,10 +208,6 @@ def remove_tail_id(ref, hyp): exit(-1) ref = ref[:-1] hyp = hyp[:-2] - print(ref_id) - print(hyp_id) - print(ref) - print(hyp) return ref, hyp def print_instances(ref, hyp, sm, id_=None):