Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with pyannote/develop #2

Merged
merged 59 commits into from
Apr 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
8f56572
fix: fix broken images (#21)
hbredin Sep 3, 2018
4c9a159
doc: update changelog
hbredin Sep 3, 2018
2938db5
chore: remove now useles PDF versions
hbredin Sep 3, 2018
d198503
Merge branch 'hotfix/1.7.1'
hbredin Sep 3, 2018
1d6f348
Merge tag '1.7.1' into develop
hbredin Sep 3, 2018
10caf0e
fix: fix typo in IdentificationErrorAnalysis
benjisympa Oct 23, 2018
2dd578b
feat: add compound segmentation metric SegmentationPurityCoverageFMea…
diego-fustes Nov 7, 2018
28f3868
fix: fix indentation issue in docstring
hbredin Nov 7, 2018
7cee51f
doc: update changelog
hbredin Nov 7, 2018
0b43b81
setup: switch to latest pyannote.{core|database}
hbredin Nov 7, 2018
7e5712f
Merge branch 'release/1.8'
hbredin Nov 7, 2018
cdc3f57
Merge tag '1.8' into develop
hbredin Nov 7, 2018
57293d0
setup: switch to pyannote.core 2.0
hbredin Nov 19, 2018
ccce32d
doc: update changelog
hbredin Nov 19, 2018
b493445
Merge branch 'release/1.8.1'
hbredin Nov 19, 2018
31031cb
Merge tag '1.8.1' into develop
hbredin Nov 19, 2018
4ea95df
setup: switch to pyannote.core 2.1
hbredin Mar 12, 2019
7c6126f
BREAKING: drop support for all but RTTM files
hbredin Mar 12, 2019
30e03cf
travis: only test on 3.6 and 3.7
hbredin Mar 12, 2019
5ca1c33
travis: remove 3.7 build
hbredin Mar 14, 2019
430c1a7
fix: remove unicode characters
hbredin Mar 14, 2019
d1c55cf
setup: switch to pyannote.database 2.0
hbredin Mar 20, 2019
b13355c
doc: update changelog
hbredin Mar 20, 2019
cee1280
Merge branch 'release/2.0'
hbredin Mar 20, 2019
bb4c236
Merge tag '2.0' into develop
hbredin Mar 20, 2019
541a4a1
fix: fix error message printing
hbredin Mar 20, 2019
cfb0e98
doc: update changelog
hbredin Mar 20, 2019
efa42b9
Merge branch 'release/2.0.1'
hbredin Mar 20, 2019
e7fe04e
Merge tag '2.0.1' into develop
hbredin Mar 20, 2019
e683ac8
feat: add Jaccard Error Rate in pyannote.metrics.diarization
hbredin Mar 28, 2019
6720afc
fix: avoid division by zero
hbredin Apr 15, 2019
d8d6c61
doc: update changelog
hbredin Apr 15, 2019
b433fec
Merge branch 'hotfix/2.0.2'
hbredin Apr 15, 2019
c5b6488
Merge tag '2.0.2' into develop
hbredin Apr 15, 2019
714c7ad
fix: rewrite mapping and matching routines
hbredin Jun 25, 2019
7e1cba7
doc: update changelog
hbredin Jun 25, 2019
685027f
Version 2.1
hbredin Jun 25, 2019
af0ebc3
Merge tag '2.1' into develop
hbredin Jun 25, 2019
d9ca221
fix: fixes #28
hbredin Jul 5, 2019
c000488
feat: add "overlap" mode to evaluate overlapped speech detection
hbredin Oct 2, 2019
a233be9
doc: fix documentation build
hbredin Dec 13, 2019
d0066b2
actions: add documentation workflow
hbredin Dec 13, 2019
eea76f5
actions: add PyPI workflow
hbredin Dec 13, 2019
a4708b9
actions: add Test workflow
hbredin Dec 13, 2019
3dcbe84
fix: initialize preprocessors as dict
hbredin Dec 13, 2019
0b5b81e
fix: pass Flake8 tests
hbredin Dec 13, 2019
d5975be
setup: switch to pyannote.core 3.2
hbredin Dec 13, 2019
b1a98c5
chore: remove job announcement
hbredin Dec 13, 2019
b0535cf
doc: update changelog
hbredin Dec 13, 2019
407f7b9
Merge branch 'release/2.2'
hbredin Dec 13, 2019
a8edc70
Merge tag '2.2' into develop
hbredin Dec 13, 2019
94cee03
ci: remove support for Travis CI
hbredin Dec 13, 2019
5b75456
feat: add Github sponsor
hbredin Jan 18, 2020
2370bbb
feat: add DetectionPrecisionRecallFMeasure compound metric
MarvinLvn Feb 5, 2020
9f4b941
fix: fix a typo in documentation
wq2012 Feb 17, 2020
dcebea8
fix: fix corner case when both precision and recall are zero
MarvinLvn Feb 21, 2020
1899939
doc: update changelog
hbredin Feb 26, 2020
6deb010
Merge branch 'release/2.3'
hbredin Feb 26, 2020
69a7140
Merge tag '2.3' into develop
hbredin Feb 26, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: [hbredin]
38 changes: 38 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Documentation
on:
push:
branches:
- master

jobs:
build-and-deploy:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: |
python -m pip install --upgrade pip
pip install .
pip install -r docs/requirements.txt
- name: Build documentation
run: |
make --directory=docs html
touch ./docs/build/html/.nojekyll
- name: Deploy
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./docs/build/html
SCRIPT_MODE: true
run: |
wget https://raw.githubusercontent.com/peaceiris/actions-gh-pages/v2/entrypoint.sh
bash ./entrypoint.sh
27 changes: 27 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: PyPI

on:
push:
tags:
- '*'

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test

on:
pull_request:
branches:
- develop
push:
branches:
- develop
- master
- release/*

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install from source
run: |
python -m pip install --upgrade pip
pip install .
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 ./pyannote --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 ./pyannote --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pip install pytest
pytest
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Announcement
Open [Phd/postdoc positions](https://mycore.core-cloud.net/public.php?service=files&t=2b5f5a79d24ac81c3b3c371fcd80734b) at [LIMSI](https://www.limsi.fr/en/) combining machine learning, NLP, speech processing, and computer vision.


# pyannote.metrics

> a toolkit for reproducible evaluation, diagnostic, and error analysis of speaker diarization systems
Expand Down
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Sphinx==2.2.2
ipython==7.10.1
sphinx_rtd_theme==0.4.3
4 changes: 4 additions & 0 deletions docs/source/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ As such, they share a common set of methods.
For instance, once instantiated, they can be called directly to compute the value of the evaluation metric.

.. ipython::
:okwarning:

In [10]: from pyannote.metrics.diarization import DiarizationErrorRate

Expand All @@ -52,6 +53,7 @@ Accumulation & reporting
The same metric instance can be used to evaluate multiple files.

.. ipython::
:okwarning:

In [11]: other_reference = Annotation(uri='file2')
....: other_reference[Segment(0, 5)] = 'A'
Expand Down Expand Up @@ -116,12 +118,14 @@ For instance, the diarization error rate is the combination of false alarm (non-
Using ``detailed=True`` will return the value of each component:

.. ipython::
:okwarning:

In [13]: metric(reference, hypothesis, detailed=True)

The accumulated value of each component can also be obtained using the overriden :func:`~pyannote.metrics.base.BaseMetric.__getitem__` operator:

.. ipython::
:okwarning:

In [13]: metric(other_reference, other_hypothesis)

Expand Down
50 changes: 50 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,56 @@
Changelog
#########

Version 2.3 (2020-02-26)
~~~~~~~~~~~~~~~~~~~~~~~~

- feat: add DetectionPrecisionRecallFMeasure compound metric (@MarvinLvn)
- fix: fix corner "in f-measure" case when both precision and recall are zero (@MarvinLvn)
- fix: fix a typo in documentation (@wq2012)

Version 2.2 (2019-12-13)
~~~~~~~~~~~~~~~~~~~~~~~~

- feat: add support for evaluation of overlapped speech detection
- feat: setup continuous integration
- setup: switch to pyannote.core 3.2

Version 2.1 (2019-06-24)
~~~~~~~~~~~~~~~~~~~~~~~~

- chore: rewrite mapping and matching routines
- fix: remove buggy xarray dependency
- setup: switch to pyannote.core 3.0

Version 2.0.2 (2019-04-15)
~~~~~~~~~~~~~~~~~~~~~~~~~~

- fix: avoid division by zero

Version 2.0.1 (2019-03-20)
~~~~~~~~~~~~~~~~~~~~~~~~~~

- BREAKING: drop support for all file formats but RTTM
- BREAKING: drop Python 2.7 support
- setup: switch to pyannote.database 2.0
- setup: switch to pyannote.core 2.1

Version 1.8.1 (2018-11-19)
~~~~~~~~~~~~~~~~~~~~~~~~~~

- setup: switch to pyannote.core 2.0

Version 1.8 (2018-09-03)
~~~~~~~~~~~~~~~~~~~~~~~~

- feat: add compound segmentation metric SegmentationPurityCoverageFMeasure (@diego-fustes)
- fix: fix typo in IdentificationErrorAnalysis (@benjisympa)

Version 1.7.1 (2018-09-03)
~~~~~~~~~~~~~~~~~~~~~~~~~~

- fix: fix broken images in documentation

Version 1.7 (2018-03-17)
~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
7 changes: 3 additions & 4 deletions docs/source/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Here is an example use of the command line interface that is provided to solve t

.. code-block:: bash

$ pyannote.metrics.py diarization --subset=development Etape.SpeakerDiarization.TV hypothesis.mdtm
$ pyannote.metrics.py diarization --subset=development Etape.SpeakerDiarization.TV hypothesis.rttm

Diarization (collar = 0 ms) error purity coverage total correct % fa. % miss. % conf. %
-------------------------------------- ------- -------- ---------- -------- --------- ----- ------ ----- ------- ---- ------- -----
Expand All @@ -34,7 +34,7 @@ Tasks

Not only can ``pyannote.metrics.py`` command line tool be used to compute the diarization error rate using NIST implementation, one can also evaluate the typical four sub-modules used in most speaker diarization systems:

.. image:: images/pipeline.pdf
.. image:: images/pipeline.png

Practically, the first positional argument (e.g. ``diarization``, above) is a flag indicating which task should be evaluated.

Expand All @@ -53,8 +53,7 @@ Results are both reported for each file in the selected subset, and aggregated i

As of March 2017, ``pyannote.database`` packages exist for the ETAPE corpus, the REPERE corpus, and the AMI corpus. As more people contribute new ``pyannote.database`` packages, they will be added to the `pyannote` ecosystem.


File formats
------------

While the MDTM file format is used in this example, several other file formats are available (and can be contributed) thanks to the internal use of the ``pyannote.parser` package.
Hypothesis files must use the [Rich Transcription Time Marked](https://web.archive.org/web/20170119114252/http://www.itl.nist.gov/iad/mig/tests/rt/2009/docs/rt09-meeting-eval-plan-v2.pdf) (RTTM) format.
Binary file removed docs/source/images/diagnostic.pdf
Binary file not shown.
Binary file added docs/source/images/diagnostic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/source/images/pipeline.pdf
Binary file not shown.
Binary file added docs/source/images/pipeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/source/images/segmentation.pdf
Binary file not shown.
Binary file added docs/source/images/segmentation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions docs/source/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Evaluation metrics

Here is a typical speaker diarization pipeline:

.. image:: images/pipeline.pdf
.. image:: images/pipeline.png

The first step is usually dedicated to speech activity detection, where the objective is to get rid of all non-speech regions.
Then, speaker change detection aims at segmenting speech regions into homogeneous segments.
Expand Down Expand Up @@ -54,7 +54,7 @@ Segmentation

Change detection modules can be evaluated using two pairs of dual metrics: precision and recall, or purity and coverage.

.. image:: images/segmentation.pdf
.. image:: images/segmentation.png

Precision and recall are standard metrics based on the number of correctly detected speaker boundaries. Recall is 75% because 3 out of 4 reference boundaries were correctly detected, and precision is 100% because all hypothesized boundaries are correct.

Expand Down Expand Up @@ -109,7 +109,7 @@ Purity and coverage are two dual evaluation metrics that provide additional insi
\text{purity} & = & \frac{\displaystyle \sum_{\text{cluster}} \max_{\text{speaker}} |\text{cluster} \cap \text{speaker}| }{\displaystyle \sum_{\text{cluster}} |\text{cluster}|} \\
\text{coverage} & = & \frac{\displaystyle \sum_{\text{speaker}} \max_{\text{cluster}} |\text{speaker} \cap \text{cluster}| }{\displaystyle \sum_{\text{speaker}} |\text{speaker}|} \\

where :math:`|\text{speaker}|` (respectively :math:`|\text{cluster}|` is the speech duration of this particular reference speaker (resp. hypothesized cluster), and :math:`|\text{speaker} \cap \text{cluster}|` is the duration of their intersection.
where :math:`|\text{speaker}|` (respectively :math:`|\text{cluster}|`) is the speech duration of this particular reference speaker (resp. hypothesized cluster), and :math:`|\text{speaker} \cap \text{cluster}|` is the duration of their intersection.

Over-segmented results (e.g. too many speaker clusters) tend to lead to high purity and low coverage, while under-segmented results (e.g. when two speakers are merged into one large cluster) lead to low purity and higher coverage.

Expand All @@ -119,7 +119,7 @@ Use case
This figure depicts the evolution of a multi-stage speaker diarization system applied on the ETAPE dataset.
It is roughly made of four consecutive modules (segmentation, BIC clustering, Viterbi resegmentation, and CLR clustering).

.. image:: images/diagnostic.pdf
.. image:: images/diagnostic.png

From the upper part of the figure (DER as a function of the module), it is clear that each module improves the output of the previous one.

Expand Down
1 change: 1 addition & 0 deletions docs/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Several evaluation metrics are available, including the diarization error rate:


.. ipython::
:okwarning:

In [13]: from pyannote.metrics.diarization import DiarizationErrorRate

Expand Down
9 changes: 5 additions & 4 deletions pyannote/metrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# The MIT License (MIT)

# Copyright (c) 2012-2016 CNRS
# Copyright (c) 2012-2019 CNRS

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand All @@ -26,7 +26,8 @@
# AUTHORS
# Hervé BREDIN - http://herve.niderb.fr

from __future__ import unicode_literals
from multiprocessing import Manager
from .base import f_measure

from ._version import get_versions
__version__ = get_versions()['version']
Expand All @@ -36,7 +37,7 @@
# please open a pull request.
# I had to use this global multiprocessing manager for it to be accessible
# from anywhere, and make parallel computation of evaluation metric a reality
from multiprocessing import Manager
manager_ = Manager()

from .base import f_measure

__all__ = ['f_measure']
Loading