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. Windows support is planned; today, WSL provides a Linux environment on Windows. See the support policy for details.

Quickstart

Install from PyPI:

pip install pstrain

The commands below use the small CMU ARCTIC fixture bundled in the repository for a complete local run; from a checkout, install with the decoding extra instead:

python -m pip install ".[test]"

The repository 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.1.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.1.0
File Size Uploaded
pstrain-0.1.0.tar.gz 3.1 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pstrain 0.1.0
File
pstrain-0.1.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.1.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
pstrain-0.1.0-cp313-cp313-macosx_10_13_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.13+ x86-64 Details
pstrain-0.1.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.1.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
pstrain-0.1.0-cp312-cp312-macosx_10_13_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.13+ x86-64 Details
pstrain-0.1.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.1.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
pstrain-0.1.0-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details

Total release size: 51.6 MB

Release files / pstrain-0.1.0.tar.gz

Download URL pstrain-0.1.0.tar.gz
Size 3.1 MB
Tags Source
SHA-256 checksum
How to use checksums
861994661dd4c413fceaba9f2aef3e5328ba999d515f5e2ca12d353c8d34e743
BLAKE2b-256 checksum
How to use checksums
b6781362779d5487e15ed513ede9c9607d9cb327fd18896e1e139c558bf920ab
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 17, 2026.

Transparency log

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

Download URL pstrain-0.1.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
10ee9178fe1648ea057d0040747ca6867c58d1b4a395f08e3335e1e7e7a6457c
BLAKE2b-256 checksum
How to use checksums
b5028dbd9afcf8e0bc656d6cebad3c3605928be7eabd072b25bb97848dbd8a61
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 17, 2026.

Transparency log

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

Download URL pstrain-0.1.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
735ef5738b3f2b7abd0e669c04c7f9a32fcbfc6f8a8a623620d72d800ece4d04
BLAKE2b-256 checksum
How to use checksums
4b5f048c1858d2fa2219d97a702f251a46c46e32aa75c1e7ed0ca83f71264bba
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 17, 2026.

Transparency log

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

Download URL pstrain-0.1.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
0bd56ed5ecbb49c4063bc834a400efbca1c7d7ae27c01d56f4df7e51633a6596
BLAKE2b-256 checksum
How to use checksums
86e6795c17ea819ce85b56e092877814052919d50461175cd29ed92f3715d1db
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 17, 2026.

Transparency log

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

Download URL pstrain-0.1.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
1ad1e4134e5bc873fe913c95d68104aa2dfb2e43e4b1a2e9190a10aed5b42024
BLAKE2b-256 checksum
How to use checksums
df82e576c9ec29806e5c6ce5ead2402f67da1ee1055a4e5dae24ce735b779d61
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 17, 2026.

Transparency log

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

Download URL pstrain-0.1.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
5f42bc9aee6b641f6f47739ed06a1b936103a9cc6bbb16bb0c4c0b20a408cccb
BLAKE2b-256 checksum
How to use checksums
ad86a1f6387d9556dfdf93ef37ca9a65b943ade753316c8ff90d2de8e43e8673
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 17, 2026.

Transparency log

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

Download URL pstrain-0.1.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
6e8cb1d400144f68970726bc8e5a140abd8c3b36297129d3aa6c1c54a502e70e
BLAKE2b-256 checksum
How to use checksums
2a06e624686086e9beebaedb744e770541a014199487868f4bb37c678c94011a
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 17, 2026.

Transparency log

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

Download URL pstrain-0.1.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
22990dc84040dd2c602a90fe4aad0becbf949187a19310e35fac9554b8e74271
BLAKE2b-256 checksum
How to use checksums
e0b63f718f9d5fafcfec99f222cbeda1f1150886b45b5212a911d8be6a83e0e7
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 17, 2026.

Transparency log

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

Download URL pstrain-0.1.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
78ca97ec9d1221491db35e2e35ccee89add19c05fe897ee2292c39bdd0c18665
BLAKE2b-256 checksum
How to use checksums
0ca9a51cc72bdcfa8c71a185c59be81bfb848797469216540a4bf3f70f202e51
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 17, 2026.

Transparency log

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

Download URL pstrain-0.1.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
bb2f92258c01cc8050ddd45f499f258897033ffb327f87228f3164aae04de485
BLAKE2b-256 checksum
How to use checksums
ed91c76020a6fae01ed250a363d797564555975a5aad1319e48183ee605b04ae
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 17, 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

0.2.0

13 release files

0.1.1

13 release files

This release

0.1.0 This release

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