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.2.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.2.0
File Size Uploaded
pstrain-0.2.0.tar.gz 3.1 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pstrain 0.2.0
File
pstrain-0.2.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
pstrain-0.2.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.17+ x86-64, Linux glibc 2.28+ x86-64 Details
pstrain-0.2.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
pstrain-0.2.0-cp313-cp313-macosx_10_13_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.13+ x86-64 Details
pstrain-0.2.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
pstrain-0.2.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.17+ x86-64, Linux glibc 2.28+ x86-64 Details
pstrain-0.2.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
pstrain-0.2.0-cp312-cp312-macosx_10_13_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.13+ x86-64 Details
pstrain-0.2.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
pstrain-0.2.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.17+ x86-64, Linux glibc 2.28+ x86-64 Details
pstrain-0.2.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
pstrain-0.2.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.5 MB

Release files / pstrain-0.2.0.tar.gz

Download URL pstrain-0.2.0.tar.gz
Size 3.1 MB
Tags Source
SHA-256 checksum
How to use checksums
58023849efc1eabdf4b0db391c2f8d6d7bddf49fe7cda2a73a85692d4466048a
BLAKE2b-256 checksum
How to use checksums
0dc736dede2ae081f6e52c7f33924fc3d0b4303667ffceab52262dd95c20b287
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 18, 2026.

Transparency log

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

Download URL pstrain-0.2.0-cp313-cp313-win_amd64.whl
Size 4.3 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
d0f1d9571670599827e1c17c2e48081001ec9cb5c742bc441061ad3d298abaee
BLAKE2b-256 checksum
How to use checksums
6693aa47f32e8ced311b91fe4ba0f78707a3859d4db1b345c06c22791e1e9f15
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 18, 2026.

Transparency log

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

Download URL pstrain-0.2.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
172ea9d99b903d85d3ebac37e455214762b55181f955ea42dd4a779fb05b60c0
BLAKE2b-256 checksum
How to use checksums
e441de3223a8f64bc8857d591af2c503d3fb0b6f3f9a44c88394200a0c429e33
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 18, 2026.

Transparency log

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

Download URL pstrain-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Size 4.8 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1a5e9520f95947365e88d8f0cb9d73948c5bc354ab8c605c4a316bdfd1168f2f
BLAKE2b-256 checksum
How to use checksums
ddc625c62a5116702fa8339eaa2368b5b3c42146e0be570b715427edf922c018
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 18, 2026.

Transparency log

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

Download URL pstrain-0.2.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
6c4374b6f686ae02fe3e36c188f2dc80e723ad8d8ce49c935d578c059f5ff0ca
BLAKE2b-256 checksum
How to use checksums
789c3460513b600e07fa5219ecdeaf25cf473efd7e8399848ecf3aa5554e9bce
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 18, 2026.

Transparency log

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

Download URL pstrain-0.2.0-cp312-cp312-win_amd64.whl
Size 4.3 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
7dda6bde7884086d49bb08ca25d3ceabbee7763940a73233e8ad2fbad0baebb4
BLAKE2b-256 checksum
How to use checksums
ff45d15c10b716ba0f2b85c98c7c260d19970552ab915eaee1213cd68d0d8e6b
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 18, 2026.

Transparency log

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

Download URL pstrain-0.2.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
608817abe4f01f00d70d433c89ccab3f485a727ca5de6715c596c8590f304ce2
BLAKE2b-256 checksum
How to use checksums
ab510da53ccf629a59ff9e203b6c3d75006f406894906b274aa1c403c63f77a3
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 18, 2026.

Transparency log

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

Download URL pstrain-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Size 4.8 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ef778c9a65761395846399b737a6cbf3c78ae8f3f55bcb43bae01b393b870ddd
BLAKE2b-256 checksum
How to use checksums
706f539241c7d2c44a603e647dda87ef7af34d02d6adc29b5e510f80476c1290
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 18, 2026.

Transparency log

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

Download URL pstrain-0.2.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
dee1101f0879419a9877bc7928848127651c0921710f3507d48066adba055574
BLAKE2b-256 checksum
How to use checksums
f44eb9494a3b8a8809e2fd834b023a5de03d3afc817887d5741e5f2b8233bc25
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 18, 2026.

Transparency log

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

Download URL pstrain-0.2.0-cp311-cp311-win_amd64.whl
Size 4.3 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
9c3294f81bcbf3147756a24389303a363f8d79abc30758da9cf2893a70ff72ac
BLAKE2b-256 checksum
How to use checksums
dcab65f172892859a40687d457832dcb66033cf6b1487e33a62b7cdad70cf49a
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 18, 2026.

Transparency log

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

Download URL pstrain-0.2.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
0b0ec4fdd688d2b29ae3da133a58349cdee04de62a8ea144ab32f44afb91837e
BLAKE2b-256 checksum
How to use checksums
8895bdef2e309c1d02735737d882403e0b517f953f2ffd5518bd5ad07acfdac0
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 18, 2026.

Transparency log

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

Download URL pstrain-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Size 4.8 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e0c7f7eec2e6d6a465c32e1dded12f3aeb0ca67a110a09a874f97599bc28f61d
BLAKE2b-256 checksum
How to use checksums
bcf969e937194a9b428aa28b28bbabf24894e6467b5170dbc936f97ea6fd1012
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 18, 2026.

Transparency log

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

Download URL pstrain-0.2.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
7dfd894d47c54d6606018c8ed7b4c39654a70713fca02ba0e224d80e0b2f7601
BLAKE2b-256 checksum
How to use checksums
89b1b4627917fc82bfb8f03f3d7db97bfe7cf6307b0b7b183ced8dad1b186cd0
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 18, 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

0.3.0

13 release files

This release

0.2.0 This release

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