Skip to main content

A lightweight library to compute Diarization Error Rate (DER).

Project description

SimpleDER Build Status PyPI Version Python Versions Downloads codecov Documentation

Overview

This is a lightweight library to compute Diarization Error Rate (DER).

Features NOT supported:

  • Handling overlapped speech, i.e. two speakers speaking at the same time.
  • Allowing segment boundary tolerance, a.k.a. the collar value.

For more sophisticated metrics with these supports, please use pyannote-metrics instead.

To learn more about speaker diarization, here is a curated list of resources: awesome-diarization.

Diarization Error Rate

Diarization Error Rate (DER) is the most commonly used metrics for speaker diarization.

Its strict form is:

       False Alarm + Miss + Overlap + Confusion
DER = ------------------------------------------
                   Reference Length

The definition of each term:

  • Reference Length: The total length of the reference (ground truth).
  • False Alarm: Length of segments which are considered as speech in hypothesis, but not in reference.
  • Miss: Length of segments which are considered as speech in reference, but not in hypothesis.
  • Overlap: Length of segments which are considered as overlapped speech in hypothesis, but not in reference. This library does NOT support overlap.
  • Confusion: Length of segments which are assigned to different speakers in hypothesis and reference (after applying an optimal assignment).

The unit of each term is seconds.

Note that DER can theoretically be larger than 1.0.

References:

Tutorial

Install

Install the package by:

pip3 install simpleder

or

python3 -m pip install simpleder

API

Here is a minimal example:

import simpleder

# reference (ground truth)
ref = [("A", 0.0, 1.0),
       ("B", 1.0, 1.5),
       ("A", 1.6, 2.1)]

# hypothesis (diarization result from your algorithm)
hyp = [("1", 0.0, 0.8),
       ("2", 0.8, 1.4),
       ("3", 1.5, 1.8),
       ("1", 1.8, 2.0)]

error = simpleder.DER(ref, hyp)

print("DER={:.3f}".format(error))

This should output:

DER=0.350

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simpleder-0.0.3.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

simpleder-0.0.3-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file simpleder-0.0.3.tar.gz.

File metadata

  • Download URL: simpleder-0.0.3.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.8

File hashes

Hashes for simpleder-0.0.3.tar.gz
Algorithm Hash digest
SHA256 0105d8a0a1e1e9f5517f8cfb093957033e3fc8d1b8f513e2b3890d399dcd7b0b
MD5 2a852179a1fb230cd32097e42b53d76d
BLAKE2b-256 44618abe2c7da65bcad2af65768e4a8bd4ed5485f8d9eebb49d66d7bfe2ece48

See more details on using hashes here.

File details

Details for the file simpleder-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: simpleder-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.8

File hashes

Hashes for simpleder-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 74f6fef891455353b48cb6a9a838d3670a1d3fb8127c5733e9da703829ef4e0c
MD5 44a7daa47c58409961802623821b8232
BLAKE2b-256 9930753524ad7b95aed7a7f2cbb9913a99e0987c3b98d07c2980941c958c9647

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page