Skip to main content

pstrain — Peace Train

Tests

The name pstrain is short for PocketSphinx train; it is pronounced "peace train."

pstrain is a toolkit for training continuous-density HMM/GMM acoustic models. It combines a C library for the numerical work with a Python interface for project setup, configuration, and training pipelines.

pstrain descends from CMU SphinxTrain and the wider CMU Sphinx lineage. We are grateful to the developers, researchers, institutions, and community members whose work made this project possible.

pstrain rebuilds SphinxTrain with its C core vendored and its orchestration reimplemented. On the shared CMU Arctic benchmark, pstrain under its shipped defaults except for split.test_count=0 (including multiple-pronunciation training) shows no statistically significant regression on either cell versus stock SphinxTrain. On SLT-55, aggregate WER and error count are identical even though 26 of 55 per-utterance error rows differ. The benchmark pin and its machine-readable record preserve the evidence and measurement conditions. Run make verified for the repository's aggregate verification command; its Arctic gate authenticates the pinned measurement conditions against the current checkout and re-derives the recorded paired statistics from the stored per-utterance rows without re-decoding. The end-to-end pstrain-versus-baseline WER comparison is produced by the full scripts/bench_arctic.py benchmark run, not by make verified.

What pstrain does

pstrain provides an in-process training pipeline for:

  • acoustic feature extraction and corpus splitting;
  • flat initialization and Baum–Welch training;
  • context-independent and context-dependent models;
  • Gaussian splitting, decision-tree state tying, and model packaging;
  • forced alignment and PocketSphinx decoding with WER/CER evaluation; and
  • multiple-pronunciation training, where pronunciation variants participate as parallel paths in each utterance's training graph.

pstrain supports macOS and Linux, and now Windows. See support policy for details.

Quickstart

From PyPI

pip install pstrain

Train with your own audio, prompt list, pronunciation dictionary, phoneset, and filler dictionary:

pstrain train /tmp/pstrain-project \
  --audio your-audio/ \
  --prompts your-prompts.txt \
  --dictionary your-dictionary.dict \
  --phoneset your-phoneset.txt \
  --filler-dict your-filler.dict \
  -j 1

Prompt lists are assumed to be pre-normalized to match the lexicon.

From a checkout

Clone the repository and install it in editable mode with the decoding extra:

git clone https://github.com/lenzo-ka/pstrain.git
cd pstrain
python -m pip install -e ".[test]"

The checkout includes a small CMU ARCTIC fixture for a complete local run. Set up a project and train the default eight-Gaussian context-dependent model:

pstrain train /tmp/pstrain-demo \
  --audio tests/fixtures/mini_arctic/wav \
  --prompts tests/fixtures/mini_arctic/transcription.txt \
  --dictionary tests/fixtures/mini_arctic/dictionary.dict \
  --phoneset tests/fixtures/mini_arctic/phoneset.txt \
  --filler-dict tests/fixtures/mini_arctic/filler.dict \
  -j 1

The command stores separate typed training and decoder transcripts. Decode the held-out set without a language model directly—no transcript conversion is needed:

pstrain test cd-8g --project-dir /tmp/pstrain-demo --no-lm

For a project of your own, pstrain train --help describes the accepted audio, prompt, dictionary, phoneset, and configuration inputs. The lower-level setup, validate, and build commands remain available for decomposed workflows. The getting-started guide continues from project setup.

The default pstrain train target is cd-8g. Use --target ci-1g when only the faster context-independent bootstrap model is wanted.

Benchmark pin

The ARCTIC benchmark pin freezes the corpus, training modes, model identities, decoder, and per-utterance measurements used as the comparison baseline.

Documentation

The documentation can be built locally with make -C docs html.

License

New pstrain code is available under the BSD 2-Clause license. CMU-derived code retains its applicable CMU BSD-style license alongside the license for pstrain modifications. See LICENSE, csrc/LICENSE.sphinx, and THIRD_PARTY_NOTICES.md for the complete terms and credits.

Release files for pstrain 0.3.0

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

Source distribution (sdist)

Source distribution for pstrain 0.3.0
File Size Uploaded
pstrain-0.3.0.tar.gz 3.1 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pstrain 0.3.0
File
pstrain-0.3.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
pstrain-0.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details
pstrain-0.3.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
pstrain-0.3.0-cp313-cp313-macosx_10_13_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.13+ x86-64 Details
pstrain-0.3.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
pstrain-0.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details
pstrain-0.3.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
pstrain-0.3.0-cp312-cp312-macosx_10_13_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.13+ x86-64 Details
pstrain-0.3.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
pstrain-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details
pstrain-0.3.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
pstrain-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details

Total release size: 64.6 MB

Release files / pstrain-0.3.0.tar.gz

Download URL pstrain-0.3.0.tar.gz
Size 3.1 MB
Tags Source
SHA-256 checksum
How to use checksums
39f6cee8ddab40e96e410937c838586926cc48af7b9bccaffb84aa98e2e2828b
BLAKE2b-256 checksum
How to use checksums
58937bda1fbd61d59241a297cd6072278f196baa0d5238036571e3b60a7110ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Release files / pstrain-0.3.0-cp313-cp313-win_amd64.whl

Download URL pstrain-0.3.0-cp313-cp313-win_amd64.whl
Size 4.3 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
1d5ac660b45448c24db81eb0d2e66eb40c34d9f8d4ff673f402aab6b0f579218
BLAKE2b-256 checksum
How to use checksums
77c7a69163fa78f1b7b3ea4d46e113fc68c9d5f5a94b98a7934f70da33c0d2c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Release files / pstrain-0.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pstrain-0.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 6.2 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
bf43d9830a52918ad4d8de5a5b95c57c7c2fc3c9df461af8e9412b91c90d4343
BLAKE2b-256 checksum
How to use checksums
832e1bcaff34da7c10df45ce940513262c98c1353ed202ec6bcd5288d6783b5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Release files / pstrain-0.3.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL pstrain-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
Size 4.9 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0f4312b61a3e7c724a88c786691dd514f85f4767dfcb4c6f4e8609d1e8b0da56
BLAKE2b-256 checksum
How to use checksums
5099263704808490fe47b8e62bc308da014282b9b4bc3c7ec566b69a3d6b19c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Release files / pstrain-0.3.0-cp313-cp313-macosx_10_13_x86_64.whl

Download URL pstrain-0.3.0-cp313-cp313-macosx_10_13_x86_64.whl
Size 5.1 MB
Tags CPython 3.13 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
3a8cc04c898712f1efe4951920404ce2a8895333399f844f0bd9da7cf6f8876a
BLAKE2b-256 checksum
How to use checksums
ec703f8aa66aa67e6e7a2459de465c5720a8db9c94b3a3558a9f34c002108ca8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Release files / pstrain-0.3.0-cp312-cp312-win_amd64.whl

Download URL pstrain-0.3.0-cp312-cp312-win_amd64.whl
Size 4.3 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
f2f08ac63b6b56d791006eadca8f77d0da459c77790702bab39aa5344138f00b
BLAKE2b-256 checksum
How to use checksums
7d0725c6e76514972f73742a2f0a9300a13d219da88a2df8e73cf931c8a97439
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Release files / pstrain-0.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pstrain-0.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 6.2 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9df27c157fb68f676e11327c2219fdf1e8a2e98b62cccadaf3518442aa563da1
BLAKE2b-256 checksum
How to use checksums
32a5d7e8d13d38c21a512728570717c0af1d2d1df41fc0284e0b656c050b7c43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Release files / pstrain-0.3.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL pstrain-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
Size 4.9 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
26ecf644c20e811898bed805eb90b4f54129fb88ad642a3e7a07d60d24357f32
BLAKE2b-256 checksum
How to use checksums
9ca6e8395608fde7221b8d16a360bc4b456f3cb0fdd72e3016019bba2b8a9e62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Release files / pstrain-0.3.0-cp312-cp312-macosx_10_13_x86_64.whl

Download URL pstrain-0.3.0-cp312-cp312-macosx_10_13_x86_64.whl
Size 5.1 MB
Tags CPython 3.12 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
ed48fe1e7ac31670b732ad12f04cea0f3341bfc8cc18638615afbc2c3a77821a
BLAKE2b-256 checksum
How to use checksums
ff840cf1df9884a92f6e31798bba6d3b6a181542303d8946f473c8670ca2eed0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Release files / pstrain-0.3.0-cp311-cp311-win_amd64.whl

Download URL pstrain-0.3.0-cp311-cp311-win_amd64.whl
Size 4.3 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
f06c94732fa587d9994c0ac9a4ca5afa9a89d0044adda6b5f1fba08c3e11d473
BLAKE2b-256 checksum
How to use checksums
3b56c752a239d2cf6be32621a930590f7b5f305be51eb130d65e8253aaade6ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Release files / pstrain-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pstrain-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 6.2 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f7a79972ca0d1659f0e1c13828ace68b2e403bb12559fa827059aac84a84caf8
BLAKE2b-256 checksum
How to use checksums
9b2d6aa3ae4c00971fc979cb1cd88aad8cc548fdc9b5eb69bac0fad95f711c4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Release files / pstrain-0.3.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL pstrain-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Size 4.9 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
30dfdf2fbbdf77b2029b691a72fd209491dab87dbdf662796581913d9dad2d5c
BLAKE2b-256 checksum
How to use checksums
e5cab45bfdd86e679e074b6d03529bf59334c6f0c5f855792cc12ebc56ec55e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Release files / pstrain-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl

Download URL pstrain-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl
Size 5.1 MB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
305534d549d1767568a1c18f04d89fd7a26576b991c863b2d0c6ccee67ca7317
BLAKE2b-256 checksum
How to use checksums
eac609dece34306a9bdfec174ad2cba2f767071a7166f6d4e792834677c2d9da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.0

13 release files

0.4.1

13 release files

0.4.0

13 release files

This release

0.3.0 This release

13 release files

0.2.0

13 release files

0.1.1

13 release files

0.1.0

10 release files

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