Commit b9771802 authored by Florent Desnous 's avatar Florent Desnous
Browse files

Update viewer_utils.py:diar_diff(): fixed bug + added logging

parent b974f805
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:
print('append collar')
logging('append collar')
add_collar(diar, collar)
return diar
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment