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.1.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.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: discophon_evaluate-0.0.1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • 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.1.tar.gz
Algorithm Hash digest
SHA256 5e3bfe5e236a25715874f15a030f6d59e07d3e96d121ce4fe9427f64e60108cb
MD5 980a3011482e47e63e0734fda5d6fd4b
BLAKE2b-256 89058ce0763412c7ccf745e166053c717d7db3a459ec7618d91923114a60bc7e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: discophon_evaluate-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 774d2b3347b6263785255725c298fa31d3cb6a4904ad752d219ca53c1dd0e199
MD5 477d2f597a7513f26dbc3f412d06435c
BLAKE2b-256 05a4106eeca727a677453f984f6585b5e5617398d56a5ca0a8dde8d8f8237a62

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