@@ -51,24 +51,37 @@ def hypothesis():
5151 return hypothesis
5252
5353
54- def test_ovl_der (reference_with_overlap , hypothesis ):
54+ @pytest .fixture
55+ def hypothesis_overlap ():
56+ hypothesis = Annotation ()
57+ hypothesis [Segment (2 , 13 )] = "a"
58+ hypothesis [Segment (10 , 14 )] = "d"
59+ hypothesis [Segment (14 , 24 )] = "b"
60+ hypothesis [Segment (22 , 38 )] = "c"
61+ hypothesis [Segment (36 , 40 )] = "d"
62+ return hypothesis
63+
64+
65+ def test_ovl_der (reference_with_overlap , hypothesis_overlap : Annotation ):
5566 der_ovl = OverlappedDiarizationErrorRate ()
5667 der_regular = DiarizationErrorRate ()
5768
58- error_rate_ovl = der_ovl (reference_with_overlap , hypothesis )
59- error_rate_regular = der_regular (reference_with_overlap , hypothesis )
69+ error_rate_ovl = der_ovl (reference_with_overlap , hypothesis_overlap )
70+ error_rate_regular = der_regular (reference_with_overlap , hypothesis_overlap )
6071
6172 npt .assert_almost_equal (error_rate_ovl , error_rate_regular , decimal = 7 )
6273
6374
64- def test_ovl_der_components (reference_with_overlap , hypothesis ):
75+ def test_ovl_der_components (reference_with_overlap , hypothesis_overlap ):
6576 for collar in [0.0 , 0.1 , 0.5 ]:
6677 der_ovl = OverlappedDiarizationErrorRate (collar = collar )
6778 der_regular = DiarizationErrorRate (collar = collar )
6879
69- comp_ovl : Details = der_ovl (reference_with_overlap , hypothesis , detailed = True )
80+ comp_ovl : Details = der_ovl (
81+ reference_with_overlap , hypothesis_overlap , detailed = True
82+ )
7083 comp_regular : Details = der_regular (
71- reference_with_overlap , hypothesis , detailed = True
84+ reference_with_overlap , hypothesis_overlap , detailed = True
7285 )
7386
7487 print (comp_ovl )
0 commit comments