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
b9771802
Commit
b9771802
authored
May 04, 2018
by
Florent Desnous
Browse files
Update viewer_utils.py:diar_diff(): fixed bug + added logging
parent
b974f805
Changes
1
Hide whitespace changes
Inline
Side-by-side
s4d/gui/viewer_utils.py
View file @
b9771802
import
logging
import
copy
from
s4d.diar
import
Diar
,
Segment
from
s4d.scoring
import
DER
...
...
@@ -93,23 +94,23 @@ def diar_diff(hyp, ref, match=True, inter=False, collar=25):
ref
.
add_attribut
(
'color'
,
(
0.6
,
0.0
,
0.0
,
1.0
))
ref
.
pack
()
diar
=
Diar
()
diar
.
append_diar
(
hyp
)
diar
.
append_diar
(
ref
)
der
=
DER
(
hyp
,
ref
)
der
.
confusion
()
assign
,
not_assign
=
der
.
assignment
()
add_match
(
ref
,
hyp
,
assign
,
not_assign
)
if
match
:
add_match
(
ref
,
hyp
,
assign
,
not_assign
)
else
:
add_prefix
(
ref
,
'REF: '
)
add_prefix
(
hyp
,
'HYP: '
)
diar
=
copy
.
deepcopy
(
ref
)
diar
.
append_diar
(
hyp
)
if
inter
:
print
(
'append intersection'
)
logging
.
info
(
'append intersection'
)
diar
.
append_diar
(
add_intersection
(
ref
,
hyp
,
assign
))
if
collar
>
0
:
pr
in
t
(
'append collar'
)
logg
in
g
(
'append collar'
)
add_collar
(
diar
,
collar
)
return
diar
\ No newline at end of file
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