Skip to main content

Evaluation package for the Phoneme Discovery benchmark

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Evaluation

pip install discophon.evaluate

This package provides low-level functions to evaluate your model's predictions on phoneme discovery.

Phoneme discovery

You can use the phoneme_discovery function with units: dict[str, list[int]], and phones: dict[str, list[str]]. You also need to set the number of units n_units, of phonemes n_phones, and the step (in ms) between consecutive units step_units.

Example:

from discophon.core import read_gold_annotations, read_submitted_units
from discophon.evaluate import phoneme_discovery

phones = read_gold_annotations("/path/to/alignments/dataset.align")
units = read_submitted_units("/path/to/predictions/units.jsonl")
result = phoneme_discovery(units, phones, n_units=256, n_phones=40, step_units=20)
print(result)

Or via the CLI:

❯ python -m discophon.evaluate --help
usage: discophon.evaluate [-h] [--n-units N_UNITS] [--n-phones N_PHONES] [--step-units STEP_UNITS] units phones

Evaluate predicted units on phoneme discovery

positional arguments:
  units                 path to predicted units
  phones                path to gold alignments

options:
  -h, --help            show this help message and exit
  --n-units N_UNITS     number of units
  --n-phones N_PHONES   number of phonemes
  --step-units STEP_UNITS
                        step between units (in ms)

ABX

The ABX evaluation is done separately. First, install this package with the abx optional dependency group:

pip install discophon.evaluate[abx]

Then, either run it in Python:

from discophon.evaluate.abx import discrete_abx, continuous_abx

result_discrete = discrete_abx("/path/to/item/dataset.item", "/path/to/predictions/units.jsonl", frequency=50)
print("Discrete: ", result_discrete)

result_continuous = continuous_abx("/path/to/item/dataset.item", "/path/to/features", frequency=50)
print("Continuous: ", result_discrete)

Or via the CLI:

❯ python -m discophon.evaluate.abx --help
usage: discophon.evaluate.abx [-h] --frequency FREQUENCY item root

Continuous or discrete ABX

positional arguments:
  item                  Path to the item file
  root                  Path to the JSONL with units or directory with continuous features

options:
  -h, --help            show this help message and exit
  --frequency FREQUENCY
                        Units frequency in Hz

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

discophon_evaluate-0.0.2.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

discophon_evaluate-0.0.2-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file discophon_evaluate-0.0.2.tar.gz.

File metadata

  • Download URL: discophon_evaluate-0.0.2.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for discophon_evaluate-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a4aa79e75e4416c62924ec92ba836ee5af96bac55c21ca20941bad796ec7f39c
MD5 a254a5480548deab13c967c9398bb03e
BLAKE2b-256 d1ed58c85522168edb53f4e26883b3001381f53c53b984ff4e3a8f1756ec2d71

See more details on using hashes here.

File details

Details for the file discophon_evaluate-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: discophon_evaluate-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for discophon_evaluate-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4d553c0a7353acaf8d347d302fcd8bb436ebc8f3654668c5c37632f2ea6fc95f
MD5 5e1a9eb36013865c316c0f66546c335d
BLAKE2b-256 ce02d3c2782d4b3634e8080aa3c15257276d522698a81cfbce103ef9a7d1f8ef

See more details on using hashes here.

Supported by

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