Skip to main content

batchalign

TalkBank CHAT processing pipeline — ASR, forced alignment, morphosyntax (%mor / %gra), utterance segmentation, translation, and compare. The user-facing Python package; the runtime is a PyO3 extension backed by the Rust crates in crates/batchalign/.

User and developer docs live in book/src/batchalign/ (the mdBook is the source of truth). See book/src/batchalign/developer/building.md for the canonical build recipe.

Install

From PyPI (stable wheels):

pip install batchalign

From source: use the just recipes — they go through Bazel, so every dep (proto codegen, Rust crates, PyO3 extension, Python wheel extras) is materialized for you. Don't reach for maturin develop or uv sync directly unless you're debugging the build itself.

just batchalign build              # build every Bazel target for batchalign
just batchalign test               # run every Bazel test target
just batchalign cli --help         # run `batchalign` via the development bridge
just batchalign pytest             # pytest (with full Bazel dep graph)
just batchalign wheel              # host-platform wheel at python/target/wheels/
just batchalign sidecar            # standalone daemon binary via PyApp
just batchalign lint               # mypy (+ ruff)
just batchalign versions           # source-of-truth version readout

just --list batchalign shows the full recipe list. The just recipes call into Bazel, so tools/bazel (the bundled wrapper) takes care of:

  • regenerating the pydantic-v2 wire types from crates/batchalign/batchalign-core/src/proto/*.rs
  • rebuilding the batchalign_core PyO3 cdylib via maturin under the hood
  • staging the binary into the wheel
  • propagating dependency changes to dependent targets

If you genuinely need bazel directly (because a recipe you want isn't wrapped):

bazel build //...           # everything
bazel test //...            # everything
bazel run //book:html       # static book HTML
bazel run //apps/batchalign/batchalign-gui:openapi   # GUI OpenAPI codegen

The base wheel ships only the lightweight runtime. Heavy ML backends are gated behind extras — install only what you use:

pip install 'batchalign[whisper]'      # Whisper ASR
pip install 'batchalign[malayalam]'    # Malayalam Wav2Vec2 XLSR ASR
pip install 'batchalign[stanza]'       # morphosyntax (%mor / %gra)
pip install 'batchalign[pyannote]'     # optional local Pyannote backend API
pip install 'batchalign[revai]'        # Rev.AI cloud ASR
pip install 'batchalign[google]'       # Gemini cloud ASR + diarization
pip install 'batchalign[cantonese]'    # Cantonese pipeline (FunASR, Tencent)
pip install 'batchalign[avqi]'         # Acoustic voice quality measurements
pip install 'batchalign[qwen3]'        # Qwen3 ASR + forced aligner
pip install 'batchalign[nllb]'         # NLLB translation
pip install 'batchalign[api]'          # FastAPI daemon (`batchalign daemon`)
pip install 'batchalign[all]'          # everything

CLI

batchalign --help

batchalign transcribe input_dir -o output_dir --lang eng
batchalign transcribe input_dir -o output_dir --lang eng --engine whisper --diarize --diarize-engine pyannote-ai
batchalign diarize    input_dir -o output_dir --engine pyannote-ai
batchalign align     input_dir -o output_dir --engine wav2vec
batchalign morphotag input_dir -o output_dir --language en
batchalign utseg     input_dir -o output_dir
batchalign translate input_dir -o output_dir --target eng
batchalign compare   input_dir gold_dir   -o output_dir

batchalign version                    # banner, version, git SHA
batchalign cache {path,stats,clear}   # local result cache
batchalign daemon                     # FastAPI server (needs [api])

When -o is omitted, results are written back in place. The CLI accepts either a single CHAT/media file or a folder (walked recursively).

The diarization CLI defaults to pyannoteAI cloud. Select the optional local backend with --engine pyannote (or --diarize-engine pyannote on transcribe). Configure the cloud API key in the shared Batchalign config file (or set BATCHALIGN_PYANNOTE_KEY):

[diarize]
engine.pyannote.key = YOUR_API_KEY

Programmatic API

import batchalign as ba

# Build a backend chain.
pipeline = ba.recipes.morphotag(
    stanza_backend=ba.StanzaBackend(lang="en"),
)

# Or compose your own.
asr = ba.WhisperBackend(language=ba.LanguageCode.from_iso("eng"))
utseg = ba.CHATUtteranceBackend(model="talkbank/CHATUtterance-en")
pipeline = ba.recipes.transcribe(asr_backend=asr, utseg_backend=utseg)

# Run.
inputs = [ba.media_from_path("session.wav")]
outcomes = list(pipeline.run(inputs))
for outcome in outcomes:
    outcome.write("session.cha")

Repository layout

This package is one slice of the talkbank-tools monorepo:

  • python/batchalign/ — Python package (this file).
  • crates/batchalign/ — Rust crates (batchalign-core, batchalign-engine).
  • The pinned TalkBank Chatter dependency supplies CHAT parsing, models, and transforms.
  • apps/batchalign/batchalign-gui/ — Tauri desktop GUI.
  • book/ — user + developer documentation (mdBook; source of truth).

For repo conventions, build commands, and the BA3 cutover plan, see CLAUDE.md at the repo root and book/src/batchalign/developer/landing-status.md.

Pasketti child-speech engines (English):

pip install 'batchalign[qwen3]'    # word ASR, via the Qwen3 backend
batchalign transcribe input_dir -o output_dir --lang eng --engine pasketti
pip install 'batchalign[phonetic]' # observed IPA, via WavLM CTC
batchalign phonetic timed_chat_dir -o output_dir --engine pasketti

These select pasketti-word and pasketti-phonetic, respectively. Phonetic transcription requires timed CHAT and matching audio; it uses the same pronunciation overrides and observed-phone projection as PhoneticXeus. The phonetic checkpoint runs in full precision. Word ASR uses the existing Qwen3 Transformers runtime and companion word aligner; DrivenData's published word-model example instead uses vLLM on Linux/NVIDIA.

AVQI measurements from paired sustained-vowel and continuous-speech recordings:

pip install 'batchalign[avqi]'
batchalign avqi vowels/ speech/ -o measurements/

This writes measurements/avqi.csv. Mirrored relative filenames (optionally .sv/.cs) identify pairs. The backend uses AVQI 03.01 coefficients with a versioned energy-window speech selector; it does not claim equivalence to the original clinical script. See the AVQI guide for input requirements, component measurements, and failed-row behavior.

Metadata

Release files for batchalign 0.10.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for batchalign 0.10.10
File Actions
batchalign-0.10.10-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for batchalign-0.10.10-cp310-abi3-win_amd64.whl
batchalign-0.10.10-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details for batchalign-0.10.10-cp310-abi3-manylinux_2_28_x86_64.whl
batchalign-0.10.10-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details for batchalign-0.10.10-cp310-abi3-manylinux_2_28_aarch64.whl
batchalign-0.10.10-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for batchalign-0.10.10-cp310-abi3-macosx_11_0_arm64.whl
batchalign-0.10.10-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for batchalign-0.10.10-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 29.2 MB

Release files / batchalign-0.10.10-cp310-abi3-win_amd64.whl

Download URL batchalign-0.10.10-cp310-abi3-win_amd64.whl
Size 5.7 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7e7f83358220b9113239603288b1c2c269c84ce1e18fb73c2cfd373130bebb71
BLAKE2b-256 checksum
How to use checksums
f7f76abfa0b1c11ea2e22739b5395878115b4274c5aa8ed5ae075aace2ab0bac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.15

Release files / batchalign-0.10.10-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL batchalign-0.10.10-cp310-abi3-manylinux_2_28_x86_64.whl
Size 5.9 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
50cfe3d5ab26f0fbc39d15ce3b326a19ed787774c57df3b1a5678145777625b3
BLAKE2b-256 checksum
How to use checksums
fa6d3f995865d545d8025ce50abc46ed27cf26bcdaf2bae6389bdea9fecf4ced
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.15

Release files / batchalign-0.10.10-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL batchalign-0.10.10-cp310-abi3-manylinux_2_28_aarch64.whl
Size 5.6 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
026360b3dfd7daba1f6aa3948e37eb1b8acd2fd6206d39a2f68e587539844aed
BLAKE2b-256 checksum
How to use checksums
9d041b8006d1156a1b7a95d5e18758b001d9f7a5843258911534e366fa3b43f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.15

Release files / batchalign-0.10.10-cp310-abi3-macosx_11_0_arm64.whl

Download URL batchalign-0.10.10-cp310-abi3-macosx_11_0_arm64.whl
Size 5.9 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c782ed98cbc6b86cd45211fcc47c528c362451e76521b482103f61e4be65d38a
BLAKE2b-256 checksum
How to use checksums
8aa8ac9c92345237714f6bcae4a369b3f19909a7947158cd6b96c8d4bc73c90c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.15

Release files / batchalign-0.10.10-cp310-abi3-macosx_10_12_x86_64.whl

Download URL batchalign-0.10.10-cp310-abi3-macosx_10_12_x86_64.whl
Size 6.1 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
6d3e828d08f0e4eccbd19773e6d787840dfc01e5076cf7d31a1e0d1338beea4f
BLAKE2b-256 checksum
How to use checksums
fd963a13c2814362d2e244d1d22c1887ec0a7b549283afafce4d9713d49dd300
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.15

Security for batchalign 0.10.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.10.10 This release

5 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page