Scoring

class scoring.DER(hyp_diarization, ref_diarization, uem_dirization=None, collar=0, no_overlap=False)[source]

Class to compute a s4d error rate. Error is computed at a rate of 10ms.

Attr uem_set:a set of index to evaluate
Attr collar:is the no-score zone around reference speaker segment

boundaries. (Speaker Diarization output is not evaluated within +/- collar seconds of a reference speaker segment boundary.) :attr uem_set_collar: a set of index on with the collar is applied :attr length: the last index in the reference :attr ref_cluster_list: the list of reference cluster_list :attr ref_mat: the numpy.ndarry of reference indexes, each row correspond to a reference cluster (same order as ref_cluster_list) :attr hyp_cluster_list: the list of hypothesis cluster_list :attr hyp_mat: the numpy.ndarry of reference indexes, each row correspond to a hypothesis cluster (same order as ref_cluster_list) :attr conf: the confusion matrix :attr assigned: a numpy.ndarray given the association between the references and hypotheses :attr not_assigned: a list of hypothesis cluster_list not associated to a reference cluster

assignment()[source]

Compute the reference to hypothese association using the hungrian algorithm

Returns:a dict object with key equal to (reference cluster, hypothesis cluster)

and value equal to the confusion score :return: a list object containing the hypothesis cluster_list that are not assigned

assignment2str()[source]

Generate a string version of the assignment matrix attribut

Returns:a str
confusion()[source]

Compute the confusion matrix between reference and hypothesis

Returns:a numpy.ndarray object of shape (#reference, #hypothesis)
confusion2str(all_value=False)[source]

Generate a string version of the confusion matrix

Parameters:all_value – if false, only the confision score upper to 0 is

generated

Returns:a str
error()[source]

compute the s4d error

Returns:a DER_result object
set_assignment(name_assigned)[source]

Set assignment from an external source (from a collection of cluster_list)

Param:name_assigned is a dict object with key equal to

(reference cluster, hypothesis cluster) and value equal to the confusion score

class scoring.DER_result(show)[source]

Class to store the s4d error results

accumulate(result)[source]

Accumulate the scores :param result: a DER_result object to accumulate :return:

compute_rate()[source]

Compute the various rates

classmethod header(speech=True, overlap=False, speaker=True)[source]

Make the header :param speech: add speech/non-speech results :param overlap: add overlap result :param speaker: add speaker result (DER) :return: a str

rate(name=None, speech=True, overlap=False, speaker=True)[source]

Make the rate results :param speech: add speech/non-speech results :param overlap: add overlap result :param speaker: add speaker result (DER) :return: a str

time(name=None, speech=True, overlap=False, speaker=True)[source]

Make the time results :param speech: add speech/non-speech results :param overlap: add overlap result :param speaker: add speaker result (DER) :return: a str