Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Lebourdais
s4d
Commits
70282f77
Commit
70282f77
authored
Mar 20, 2018
by
Sulfyderz
Browse files
[Error Update]:Correcting the DER scoring.
parent
4d3af019
Changes
1
Hide whitespace changes
Inline
Side-by-side
s4d/scoring.py
View file @
70282f77
...
...
@@ -25,22 +25,22 @@ class DER:
:attr not_assigned: a list of hypothesis cluster_list not associated to a reference cluster
"""
def
__init__
(
self
,
hyp_diarization
,
ref_diarization
,
uem_dirization
=
None
,
collar
=
0
,
no_overlap
=
False
):
def
__init__
(
self
,
hyp_diarization
,
ref_diarization
,
uem_di
a
rization
=
None
,
collar
=
0
,
no_overlap
=
False
):
"""
:param hyp_diarization: a hypothesis Diar object
:param ref_diarization: a reference Diar object
:param uem_dirization: a uem Diar object
:param uem_di
a
rization: a uem Diar object
:param collar: is the no-score zone around reference speaker segments
:param no_overlap: to limit scoring to those time regions in which only
a single speaker is speaking
"""
uem
=
uem_dirization
uem
=
uem_di
a
rization
self
.
collar
=
collar
self
.
match
=
None
if
uem_dirization
is
not
None
:
uem
=
copy
.
deepcopy
(
uem_dirization
)
if
uem_di
a
rization
is
not
None
:
uem
=
copy
.
deepcopy
(
uem_di
a
rization
)
if
len
(
uem
.
unique
(
'cluster'
))
>
1
:
raise
Exception
(
'UEM contains more than one cluster'
)
if
len
(
uem
.
unique
(
'show'
))
>
1
:
...
...
@@ -54,15 +54,15 @@ class DER:
raise
Exception
(
'REF contains more than one show'
)
else
:
self
.
show
=
lst
[
0
]
if
uem_dirization
is
None
:
if
uem_di
a
rization
is
None
:
print
(
'uem from ref'
)
self
.
uem_set
=
set
([
i
for
i
in
range
(
ref
[
0
][
'start'
],
ref
[
-
1
][
'stop'
]
+
1
)])
self
.
uem_set
=
set
([
i
for
i
in
range
(
min
(
ref
.
unique
(
'start'
)),
max
(
ref
.
unique
(
'stop'
))
+
1
)])
if
collar
>
0
:
rem
=
list
()
for
row
in
ref
:
rem
+=
[
i
for
i
in
range
(
row
[
'start'
]
-
collar
,
row
[
'start'
]
+
collar
+
1
)]
rem
+=
[
i
for
i
in
range
(
row
[
'stop'
]
-
collar
,
row
[
'stop'
]
+
collar
+
1
)]
rem
+=
[
i
for
i
in
range
(
row
[
'start'
]
-
collar
,
row
[
'start'
]
+
collar
)]
rem
+=
[
i
for
i
in
range
(
row
[
'stop'
]
-
collar
,
row
[
'stop'
]
+
collar
)]
self
.
uem_set_collar
=
self
.
uem_set
-
set
(
rem
)
else
:
self
.
uem_set_collar
=
self
.
uem_set
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment