pstrain — Peace Train
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.
What pstrain does
pstrain provides a 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.
Quickstart
Start with the terminal walkthrough: it covers Python and compiler prerequisites, an isolated installation, and a small training run using the included audio, followed by decoding and packaging. No Python programming or corpus download is needed for that example.
Training requires macOS or Linux and Python 3.11+. Native Windows supports the package and native tools, but cannot run the training pipeline; see the support policy.
The guide distinguishes building this checkout from installing a published
release, and starts with the faster ci-1g model before the default cd-8g.
Benchmark pin
The ARCTIC benchmark pin freezes the corpus, training modes, model identities, decoder, and per-utterance measurements used as the comparison baseline.
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
the preserved upstream oracle, historically attributed to stock SphinxTrain;
see its provenance limits.
The arms share one matched decode path but are NOT COMPARABLE for
implementation attribution because the oracle's producing lineage is unknown.
The two cells carry different weight. The 3,395-utterance set is three
speakers the model was not trained on: there pstrain records 22,703 errors
(75.7221% WER) against 22,638 (75.5053%) for that oracle — behind by 0.2168
percentage points, a margin these utterances cannot separate from zero (95%
paired interval [-0.2414, +0.6713], conditional on these three voices). The
per-speaker deltas disagree in sign; a speaker-level cluster bootstrap is wider,
at [-0.59, +0.91], and also straddles zero. Three voices do not say how the
model fares on unseen voices in general. SLT-55 is a
same-speaker held-out cell of 55 utterances; there pstrain is ahead, 139 errors
(27.0955% WER) against 144 (28.0702%), with 23 of 55 per-utterance error rows
differing, but its interval of [-3.6965, +1.6575] is consistent with anything
from a 3.7-point gain to a 1.7-point regression and so settles little on its
own. The larger cross-speaker set is where the evidence is. 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.
Documentation
- Getting started
- Package replacement safety
- Input formats
- Examples
- API reference
- Design documents
- Development guide
- Support and dependency policy
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.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pstrain-0.5.0.tar.gz | 3.5 MB | Details |
Built distributions (wheels)
Total release size: 67.2 MB
Release files / pstrain-0.5.0.tar.gz
| Download URL | pstrain-0.5.0.tar.gz |
|---|---|
| Size | 3.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b888180e6c9e2a74dbe4eb12362e08b9d98a0a5dd19a9cd6202056c6377a091
|
|
BLAKE2b-256 checksum How to use checksums |
501e3ac024c432c850cec0959da1e5adf66d3184468f2a2f8efb15c514580414
|
| 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 Sep 24, 2026.
Transparency logRelease files / pstrain-0.5.0-cp313-cp313-win_amd64.whl
| Download URL | pstrain-0.5.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 4.5 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
c1cb6cf9f22b9bc7f8ae84a828febc36d949765c5bcece6602915972edb69ca0
|
|
BLAKE2b-256 checksum How to use checksums |
d6351f628f5ce09778cbe786e7d63e40db6828fa88396257bbe5e03af54400c4
|
| 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 Sep 24, 2026.
Transparency logRelease files / pstrain-0.5.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pstrain-0.5.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 6.4 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
7da0332c4227529637e9dac2066b0dbd08ad4cf6b3c555406cb5f645fbfe8daa
|
|
BLAKE2b-256 checksum How to use checksums |
04167e4af4cfcb74e947201f1d30eb5f22c4e38dc271c262b8b7b264152d953c
|
| 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 Sep 24, 2026.
Transparency logRelease files / pstrain-0.5.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | pstrain-0.5.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.0 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
39049fbca451fc1bbc431b59482880ae961884d350f5f243c5100643a6cb6499
|
|
BLAKE2b-256 checksum How to use checksums |
409e21e170cdc4a841761ea98e8cc60973571e294cda05876fb62fdaeedf1773
|
| 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 Sep 24, 2026.
Transparency logRelease files / pstrain-0.5.0-cp313-cp313-macosx_10_13_x86_64.whl
| Download URL | pstrain-0.5.0-cp313-cp313-macosx_10_13_x86_64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.13 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
141511a3d40c901917e36cd56592f91fa3e0df7893e24abba825ab4457802f82
|
|
BLAKE2b-256 checksum How to use checksums |
f0092ca863498d00f46c814cf241950ad664966dfbf461e4d480ea66180bef67
|
| 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 Sep 24, 2026.
Transparency logRelease files / pstrain-0.5.0-cp312-cp312-win_amd64.whl
| Download URL | pstrain-0.5.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 4.5 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ffef1850fd81f8c7498bc280cfeb5010e75e38b47bebd9be5f36b588045477ee
|
|
BLAKE2b-256 checksum How to use checksums |
3d12e6ffc08c821eccdf3ff4913be885c3e5bf1e15995c331b3e59a2a7b60bf7
|
| 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 Sep 24, 2026.
Transparency logRelease files / pstrain-0.5.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pstrain-0.5.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 6.4 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
d6cce3e930efff7c6319bbf3e4023159a9218ef5f095b686e5e01a7bfb6325db
|
|
BLAKE2b-256 checksum How to use checksums |
b0c8173e5b028107206a6cabcfbaa31613989dc3bde9530a39f64c33d48bbfb8
|
| 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 Sep 24, 2026.
Transparency logRelease files / pstrain-0.5.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pstrain-0.5.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.0 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f0077b366dc5c4558a57a3b166071e786efc1943a82312d8bb26a870a7336738
|
|
BLAKE2b-256 checksum How to use checksums |
2bdab59ed38e03ca65ffe14fb6739a19b3e55244ded13600aef5c44a08daff1b
|
| 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 Sep 24, 2026.
Transparency logRelease files / pstrain-0.5.0-cp312-cp312-macosx_10_13_x86_64.whl
| Download URL | pstrain-0.5.0-cp312-cp312-macosx_10_13_x86_64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.12 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
a62056e68839796d3641a05b03ecbf84ee5146e674807baec30d31e23a7ef2f7
|
|
BLAKE2b-256 checksum How to use checksums |
92e5f7a4f7d635b2581a1ad31901598c56808bc21012e075cc63733346d73fef
|
| 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 Sep 24, 2026.
Transparency logRelease files / pstrain-0.5.0-cp311-cp311-win_amd64.whl
| Download URL | pstrain-0.5.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 4.5 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
4da8f260c125c2c81b2cc9516ef951d1cdc9165f161bfe45e1118dc5dce6c68c
|
|
BLAKE2b-256 checksum How to use checksums |
0d7451955f0bd66ee464cc7bcb3b2e4eae22c554dbf774949b4bfc739da3401c
|
| 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 Sep 24, 2026.
Transparency logRelease files / pstrain-0.5.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pstrain-0.5.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 6.4 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
61a3723884d0a0d7726f03cd5cbc7415840e500323d05de9c5d6031c027e0efc
|
|
BLAKE2b-256 checksum How to use checksums |
df545d8a1fc3f7fdbffc1267419d733b6857112ceba53e2563a55a4faaf4675f
|
| 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 Sep 24, 2026.
Transparency logRelease files / pstrain-0.5.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pstrain-0.5.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.0 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
4ce4cc0d0b309defeb6e0cdb2a54c214c92a70dd88aec6199e87f76174c38e70
|
|
BLAKE2b-256 checksum How to use checksums |
145a826c86645cefa6e14937c398da388907ed7d829b987e52b8b36ad1cdfd06
|
| 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 Sep 24, 2026.
Transparency logRelease files / pstrain-0.5.0-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | pstrain-0.5.0-cp311-cp311-macosx_10_9_x86_64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.11 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
04ee1cddc84c911fd13a5f934f1eb29a337fe6de2eb293824f758be6231f39ca
|
|
BLAKE2b-256 checksum How to use checksums |
7e1a92ec58850da1f6aa9f3dd50b2f264fa435f398f2758d7b4abbe287768a23
|
| 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 Sep 24, 2026.
Transparency log