Skip to main content

Automatic lyrics transcription evaluation toolkit

Project description

alt-eval

An automatic lyrics transcription (ALT) evaluation toolkit, released with the Jam-ALT benchmark.

The package implements metrics designed to work well with lyrics formatted according to music industry standards (see the Jam-ALT annotation guide), namely:

  • A word error rate (WER) computed on text tokenized in a way that accounts for non-standard spellings common in song lyrics.
  • A case error rate, measuring the rate of incorrectly predicted letter case.
  • Precision, recall and F-score for symbols important for written lyrics:
    • Punctuation
    • Parentheses (used to delimit background vocals)
    • Line breaks
    • Section breaks (i.e. double line breaks)

Under the hood, the text is pre-processed using the sacremoses tokenizer and punctuation normalizer. Note that apostrophes and single quotes are never treated as quotation marks, but as part of a word, marking an elision or a contraction. For writing systems that do not use spaces to separate words (Chinese, Japanese, Thai, Lao, Burmese, …), each character is considered as a separate word, as per Radford et al. (2022). See the test cases for examples of how different languages are tokenized.

Usage

Install the package with pip install alt-eval.

To compute the metrics:

from alt_eval import compute_metrics
compute_metrics(references, hypotheses)

where references and hypotheses are lists of strings. To specify the language (English by default), use the languages parameter, passing either a single language code, or a list of language codes corresponding to individual examples.

For JamALT, use:

from datasets import load_dataset
dataset = load_dataset("audioshake/jam-alt")["test"]
compute_metrics(dataset["text"], transcriptions, languages=dataset["language"])

Use visualize_errors=True to also get a list of HTML snippets that can be used to visualize the errors in each transcript.

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

alt-eval-1.1.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

alt_eval-1.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file alt-eval-1.1.0.tar.gz.

File metadata

  • Download URL: alt-eval-1.1.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for alt-eval-1.1.0.tar.gz
Algorithm Hash digest
SHA256 01f63836acad002a451124149ec798d4297b72ba4a64301b868c50745622cb02
MD5 257659325d4732808a376647af6242b7
BLAKE2b-256 75f42f695b5dc1060a14f9bc4645833c5d1806fbfd8313fcc4284357757a6f6e

See more details on using hashes here.

File details

Details for the file alt_eval-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: alt_eval-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for alt_eval-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61ba4f36c7c254a3488bece453eebc015d60f2ceb35c4605ad605c393efe143b
MD5 e3eb4091f29eb6ceaf25ad465ffdfae4
BLAKE2b-256 ff9eb8c3434521c91685a7060e828538a9b533ae5e54af9e069c09fd985e2fd9

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