Commit 70282f77 authored by Sulfyderz's avatar Sulfyderz
Browse files

[Error Update]:Correcting the DER scoring.

parent 4d3af019
......@@ -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_diarization = 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_diarization: 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_diarization
self.collar = collar
self.match = None
if uem_dirization is not None:
uem = copy.deepcopy(uem_dirization)
if uem_diarization is not None:
uem = copy.deepcopy(uem_diarization)
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: = lst[0]
if uem_dirization is None:
if uem_diarization 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)
self.uem_set_collar = self.uem_set
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