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.

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 cross-speaker, so it measures what the model does on voices it 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 the data cannot separate from zero (95% paired interval [-0.2414, +0.6713]). 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

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.4.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.4.0
File Size Uploaded
pstrain-0.4.0.tar.gz 3.4 MB Details

Built distributions (wheels)

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

Total release size: 66.5 MB

Release files / pstrain-0.4.0.tar.gz

Download URL pstrain-0.4.0.tar.gz
Size 3.4 MB
Tags Source
SHA-256 checksum
How to use checksums
a00d8bd75e539d10316ce9649e5357902d7a702e742cf0fa6a7e8324913e05bc
BLAKE2b-256 checksum
How to use checksums
32b9ae250827e4f0d65a816d7b3df2bac24ea6b1056617a399a5408d0965b75f
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 13, 2026.

Transparency log

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

Download URL pstrain-0.4.0-cp313-cp313-win_amd64.whl
Size 4.5 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
93151a57e662875efa0719f3baf14ee4100aefcadd200b09ae6f107c09d5b353
BLAKE2b-256 checksum
How to use checksums
4846d4ba7b7e6571ddf4636eccff6cbe0ea3998477e17da1b812ba186f2d2090
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 13, 2026.

Transparency log

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

Download URL pstrain-0.4.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
13938444026a3558dc84ade23fb5438b7a605743e7d9a766fcaddd361b650795
BLAKE2b-256 checksum
How to use checksums
1c9db2fe8d6c37c053f2756d88c592e8fc251bb013f9fb68e752d7ffe9343a88
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 13, 2026.

Transparency log

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

Download URL pstrain-0.4.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
7b68ab8e3698c8b4ffe23b0f338afc646ccda30a788962673cd4e5b4ca416f65
BLAKE2b-256 checksum
How to use checksums
7ff83aff60b5acb179403a24b693c34faf25f9e2909ed003209bc3f273ff47b1
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 13, 2026.

Transparency log

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

Download URL pstrain-0.4.0-cp313-cp313-macosx_10_13_x86_64.whl
Size 5.2 MB
Tags CPython 3.13 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
c82074d4c96c09d1d6221d2e6ab3b3b3365c3610242d6f29675832c1981fcee6
BLAKE2b-256 checksum
How to use checksums
8a2e9fdfb2f2fe7be7f429613db5e52e2cd8840f26fdd3759d9831e8ed822eb7
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 13, 2026.

Transparency log

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

Download URL pstrain-0.4.0-cp312-cp312-win_amd64.whl
Size 4.5 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
660d9c8c5a605b571487268b6e1ec61302b36c83121f31f44ce494151c3bdbb6
BLAKE2b-256 checksum
How to use checksums
46721a322a53261fe9f612b9e6a50d2bd727b1c49fcc4e8e8b662da8a0bd8360
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 13, 2026.

Transparency log

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

Download URL pstrain-0.4.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
ad52e533a203c587eab6c800cf8d9efdecf266fbc578c5e30771308d9e4569b2
BLAKE2b-256 checksum
How to use checksums
73cb528b6250c447a8108f2e4d3b0acd4c7b25b31b359deac1f945584dc180fc
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 13, 2026.

Transparency log

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

Download URL pstrain-0.4.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
40dc70fc60a80f362b53f3ae637fd49a77c6ad7e6aee5f23a8761a9d46b070e3
BLAKE2b-256 checksum
How to use checksums
c8f54830d2f07dce402fa6577a290f495f72a1c31b808b1d5844bafebf6dc223
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 13, 2026.

Transparency log

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

Download URL pstrain-0.4.0-cp312-cp312-macosx_10_13_x86_64.whl
Size 5.2 MB
Tags CPython 3.12 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
74f3c41e1617d1559e19a8a249f701edb24ed14b586d30e283ed055dc9099203
BLAKE2b-256 checksum
How to use checksums
fab387342b33a9519069656cc20cd99e8735df2181e2b9a26826bed83e20976e
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 13, 2026.

Transparency log

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

Download URL pstrain-0.4.0-cp311-cp311-win_amd64.whl
Size 4.5 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
832344c317135883f165a076fb1eda98686c4a5d63688e14ffb5768cf369ac72
BLAKE2b-256 checksum
How to use checksums
5067ef69cebfd50185275b71bf3377e76e4b495b97ece303235a0291a6b27fd0
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 13, 2026.

Transparency log

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

Download URL pstrain-0.4.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
dda2e1337bb5b463e83b08afb5756922e20dc8e7ff18493761681bd3437bde5e
BLAKE2b-256 checksum
How to use checksums
4f973557791df3a88bc705fad231dd15a1788d26e32bbce92e2a885cda51dfe6
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 13, 2026.

Transparency log

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

Download URL pstrain-0.4.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
4822e4a9fdd4692511030fccd38974969bcebfc1ae24df7e9387b830d1316be8
BLAKE2b-256 checksum
How to use checksums
c8526544bdb420f7c709d79c55c41dac0997f644a06c8de23ef8f648be3ac1c6
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 13, 2026.

Transparency log

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

Download URL pstrain-0.4.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
c622adabe3fb95a9bb5eafe2304e569fbc8cf574ad665d5e5ae0e3327090c614
BLAKE2b-256 checksum
How to use checksums
88c9afd970cd70609e421677edc47469e3c67b791031ee64aa4218b36cdfe079
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 13, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.0

13 release files

0.4.1

13 release files

This release

0.4.0 This release

13 release files

0.3.0

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