From 666057ea12e59ca1aead5b99d14548443417096c Mon Sep 17 00:00:00 2001 From: Nishchal Bhandari Date: Wed, 17 Apr 2024 21:38:57 +0000 Subject: [PATCH] fix test --- test/data/short.sbs.txt | 110 +++++++++++++++++++++------------------- test/fstalign_Test.cc | 3 +- 2 files changed, 60 insertions(+), 53 deletions(-) diff --git a/test/data/short.sbs.txt b/test/data/short.sbs.txt index bb1cc40..532b2db 100644 --- a/test/data/short.sbs.txt +++ b/test/data/short.sbs.txt @@ -1,21 +1,21 @@ ref_token hyp_token IsErr Class Wer_Tag_Entities - yeah yeah - , ERR + Yeah Yeah + , , yeah ERR , ERR right right . ERR - yeah ERR + Yeah ERR , ERR all ERR right ERR - , i'll ERR + , I'll ERR probably do ERR just just that that - . ERR - are are + . ? ERR + Are Are there there any any visuals visuals @@ -23,54 +23,57 @@ come come to to mind mind - or or - yeah yeah - , ERR + or or ___100002_SYN_1-1___ + ? ERR + Yeah Yeah + , , sure sure - . ERR - when when - i i + . . + When When + I I hear hear - foobar foobar ###1_PROPER_NOUN###|###2_SPACY>ORG###| - , ERR - i i + Foobar Foobar ###1_PROPER_NOUN###|###2_SPACY>ORG###| + , , + I I think think about about just just that that - : ERR - foo foobar ERR + : : + Foobar ERR + foo , ERR a a ------------------------------------------------------------ Line Group - 4 , yeah , <-> *** - 8 . yeah , all right , probably <-> i'll do - 17 . <-> *** - 28 , <-> *** - 30 . <-> *** - 35 , <-> *** - 41 : foo <-> foobar + 5 yeah , <-> *** + 8 . Yeah , all right , probably <-> I'll do + 17 . <-> ? + 27 *** <-> ? + 43 foo <-> Foobar , ------------------------------------------------------------ Unigram Prec. Recall - , 0/0 (0.0 %) 0/6 (0.0 %) - . 0/0 (0.0 %) 0/3 (0.0 %) - : 0/0 (0.0 %) 0/1 (0.0 %) + ? 0/2 (0.0 %) 0/0 (0.0 %) + I'll 0/1 (0.0 %) 0/0 (0.0 %) all 0/0 (0.0 %) 0/1 (0.0 %) do 0/1 (0.0 %) 0/0 (0.0 %) foo 0/0 (0.0 %) 0/1 (0.0 %) - i'll 0/1 (0.0 %) 0/0 (0.0 %) probably 0/0 (0.0 %) 0/1 (0.0 %) - foobar 1/2 (50.0 %) 1/1 (100.0 %) + yeah 0/0 (0.0 %) 0/1 (0.0 %) + Foobar 1/2 (50.0 %) 1/1 (100.0 %) + , 3/4 (75.0 %) 3/6 (50.0 %) + . 1/1 (100.0 %) 1/3 (33.3 %) right 1/1 (100.0 %) 1/2 (50.0 %) - yeah 2/2 (100.0 %) 2/4 (50.0 %) + Yeah 2/2 (100.0 %) 2/3 (66.7 %) + : 1/1 (100.0 %) 1/1 (100.0 %) 1/1 (100.0 %) 1/1 (100.0 %) + Are 1/1 (100.0 %) 1/1 (100.0 %) + I 2/2 (100.0 %) 2/2 (100.0 %) + When 1/1 (100.0 %) 1/1 (100.0 %) a 1/1 (100.0 %) 1/1 (100.0 %) about 1/1 (100.0 %) 1/1 (100.0 %) any 1/1 (100.0 %) 1/1 (100.0 %) - are 1/1 (100.0 %) 1/1 (100.0 %) come 1/1 (100.0 %) 1/1 (100.0 %) hear 1/1 (100.0 %) 1/1 (100.0 %) - i 2/2 (100.0 %) 2/2 (100.0 %) just 2/2 (100.0 %) 2/2 (100.0 %) mind 1/1 (100.0 %) 1/1 (100.0 %) or 1/1 (100.0 %) 1/1 (100.0 %) @@ -80,46 +83,49 @@ think 1/1 (100.0 %) 1/1 (100.0 %) to 1/1 (100.0 %) 1/1 (100.0 %) visuals 1/1 (100.0 %) 1/1 (100.0 %) - when 1/1 (100.0 %) 1/1 (100.0 %) ------------------------------------------------------------ Bigram Precision Recall + , a 0/1 (0.0 %) 0/0 (0.0 %) , all 0/0 (0.0 %) 0/1 (0.0 %) - , i 0/0 (0.0 %) 0/1 (0.0 %) , probably 0/0 (0.0 %) 0/1 (0.0 %) , right 0/0 (0.0 %) 0/1 (0.0 %) - , sure 0/0 (0.0 %) 0/1 (0.0 %) , yeah 0/0 (0.0 %) 0/1 (0.0 %) - . are 0/0 (0.0 %) 0/1 (0.0 %) - . when 0/0 (0.0 %) 0/1 (0.0 %) - . yeah 0/0 (0.0 %) 0/1 (0.0 %) - : foo 0/0 (0.0 %) 0/1 (0.0 %) + . Are 0/0 (0.0 %) 0/1 (0.0 %) + . Yeah 0/0 (0.0 %) 0/1 (0.0 %) + : Foobar 0/1 (0.0 %) 0/0 (0.0 %) + ? Are 0/1 (0.0 %) 0/0 (0.0 %) + ? Yeah 0/1 (0.0 %) 0/0 (0.0 %) + I'll do 0/1 (0.0 %) 0/0 (0.0 %) all right 0/0 (0.0 %) 0/1 (0.0 %) do just 0/1 (0.0 %) 0/0 (0.0 %) foo a 0/0 (0.0 %) 0/1 (0.0 %) - foobar , 0/0 (0.0 %) 0/1 (0.0 %) - foobar a 0/1 (0.0 %) 0/0 (0.0 %) - i'll do 0/1 (0.0 %) 0/0 (0.0 %) + or ? 0/1 (0.0 %) 0/0 (0.0 %) probably just 0/0 (0.0 %) 0/1 (0.0 %) right , 0/0 (0.0 %) 0/1 (0.0 %) right . 0/0 (0.0 %) 0/1 (0.0 %) - sure . 0/0 (0.0 %) 0/1 (0.0 %) that . 0/0 (0.0 %) 0/1 (0.0 %) - that : 0/0 (0.0 %) 0/1 (0.0 %) - yeah , 0/0 (0.0 %) 0/4 (0.0 %) - yeah 1/1 (100.0 %) 1/1 (100.0 %) + that ? 0/1 (0.0 %) 0/0 (0.0 %) + yeah , 0/0 (0.0 %) 0/1 (0.0 %) + Foobar , 1/2 (50.0 %) 1/1 (100.0 %) + Yeah , 2/2 (100.0 %) 2/3 (66.7 %) + , I 1/1 (100.0 %) 1/1 (100.0 %) + , sure 1/1 (100.0 %) 1/1 (100.0 %) + . When 1/1 (100.0 %) 1/1 (100.0 %) + Yeah 1/1 (100.0 %) 1/1 (100.0 %) + Are there 1/1 (100.0 %) 1/1 (100.0 %) + I hear 1/1 (100.0 %) 1/1 (100.0 %) + I think 1/1 (100.0 %) 1/1 (100.0 %) + When I 1/1 (100.0 %) 1/1 (100.0 %) about just 1/1 (100.0 %) 1/1 (100.0 %) any visuals 1/1 (100.0 %) 1/1 (100.0 %) - are there 1/1 (100.0 %) 1/1 (100.0 %) come to 1/1 (100.0 %) 1/1 (100.0 %) - hear foobar 1/1 (100.0 %) 1/1 (100.0 %) - i hear 1/1 (100.0 %) 1/1 (100.0 %) - i think 1/1 (100.0 %) 1/1 (100.0 %) + hear Foobar 1/1 (100.0 %) 1/1 (100.0 %) just that 2/2 (100.0 %) 2/2 (100.0 %) mind or 1/1 (100.0 %) 1/1 (100.0 %) - or yeah 1/1 (100.0 %) 1/1 (100.0 %) + sure . 1/1 (100.0 %) 1/1 (100.0 %) + that : 1/1 (100.0 %) 1/1 (100.0 %) that come 1/1 (100.0 %) 1/1 (100.0 %) there any 1/1 (100.0 %) 1/1 (100.0 %) think about 1/1 (100.0 %) 1/1 (100.0 %) to mind 1/1 (100.0 %) 1/1 (100.0 %) visuals that 1/1 (100.0 %) 1/1 (100.0 %) - when i 1/1 (100.0 %) 1/1 (100.0 %) diff --git a/test/fstalign_Test.cc b/test/fstalign_Test.cc index e8ef9f1..7c30f46 100644 --- a/test/fstalign_Test.cc +++ b/test/fstalign_Test.cc @@ -680,8 +680,9 @@ TEST_CASE_METHOD(UniqueTestsFixture, "main-adapted-composition()") { } SECTION("NLP Hypothesis: wer with case and punctuation(nlp output)") { + const auto wer_sidecar_path = TEST_DATA + "short_punc.wer_tag.json"; const auto result = - exec(command("wer", approach, "short_punc.ref.nlp", "short_punc.hyp.nlp", sbs_output, nlp_output, TEST_SYNONYMS)+" --use-punctuation --use-case --wer-sidecar short_punc.wer_tag.json"); + exec(command("wer", approach, "short_punc.ref.nlp", "short_punc.hyp.nlp", sbs_output, nlp_output, TEST_SYNONYMS)+" --use-punctuation --use-case --wer-sidecar " + wer_sidecar_path); const auto testFile = std::string{TEST_DATA} + "short.aligned.punc_case.nlp"; const auto testSbsFile = std::string{TEST_DATA} + "short.sbs.txt";