Skip to content

WISCLab/alignment-comparison-plots

Repository files navigation

alignment-comparison-plots

PyPI Docs WiscLab CI CD

When two forced aligners (e.g. MFA and Wav2TextGrid) produce different .TextGrid files for the same audio, it can be hard to know where and how they disagree. This package provides ready-made Qt charts that let you visually audit alignment quality and inter-aligner agreement across an entire corpus in seconds:

Note

The analyses implemented here were originally developed in R by @tjmahr. This package adapts his work for Python.

Install

pip install alignment-comparison-plots
# or with uv
uv add alignment-comparison-plots

Requires Python ≥ 3.11.

Quickstart

import glob
from alignment_comparison_plots import plot_phoneme_counts

paths_a = glob.glob("/path/to/alignment_a/**/*.TextGrid", recursive=True)
paths_b = glob.glob("/path/to/alignment_b/**/*.TextGrid", recursive=True)

plot_phoneme_counts(paths_a=paths_a, paths_b=paths_b, label_a="Ref", label_b="Hyp")

Development

See the Contributing guide for instructions on adding new plot functions.

make serve-docs   # local docs preview at http://127.0.0.1:8000
make build-docs   # build static site into ./site
make typecheck    # run mypy on the source
make test         # run protocol conformance tests

License

MIT

About

Interactive phoneme-level plots for comparing forced-alignment outputs across Praat TextGrid corpora.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors