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.1

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.1
File Size Uploaded
pstrain-0.1.1.tar.gz 3.1 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pstrain 0.1.1
File
pstrain-0.1.1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
pstrain-0.1.1-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.1-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
pstrain-0.1.1-cp313-cp313-macosx_10_13_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.13+ x86-64 Details
pstrain-0.1.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
pstrain-0.1.1-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.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
pstrain-0.1.1-cp312-cp312-macosx_10_13_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.13+ x86-64 Details
pstrain-0.1.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
pstrain-0.1.1-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.1.1-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
pstrain-0.1.1-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.1.1.tar.gz

Download URL pstrain-0.1.1.tar.gz
Size 3.1 MB
Tags Source
SHA-256 checksum
How to use checksums
239b56d769dd77a7bbdd3b57e24a72d813c63ee315434054c24cebbc3ed6e490
BLAKE2b-256 checksum
How to use checksums
9482b9ab6835e82a4b02b677ad455afbb6188448279a033ba44c7ae8b320446e
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.1-cp313-cp313-win_amd64.whl

Download URL pstrain-0.1.1-cp313-cp313-win_amd64.whl
Size 4.3 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
ef68646e2492e0479b6771dadbee240a31d148fff0e9652529679f58b48cbc1d
BLAKE2b-256 checksum
How to use checksums
237852775e9e4256c2ead0bf3509c1a9a8b4830715ff13ea8939ee40c85d7526
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.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pstrain-0.1.1-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
a6ce03b86e89d4a980143f09bc77db30725d2f87b804e33b41d2a7ea4a45df0c
BLAKE2b-256 checksum
How to use checksums
5c44b6fc51da7311acda69e8ea0cffb4fb138590ae213134ee26d12bc2c66a27
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.1-cp313-cp313-macosx_11_0_arm64.whl

Download URL pstrain-0.1.1-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
accee979fcddf17477ae47dc61594d92b64ea871574d6ec84d54e9a5fed41cb4
BLAKE2b-256 checksum
How to use checksums
62612c85100a2f5238238b6474285ff05c2dc8f8b41a7edfc442d3c3fa7c81b4
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.1-cp313-cp313-macosx_10_13_x86_64.whl

Download URL pstrain-0.1.1-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
bc3e7c4d7171e1b6fcb04ef651be6a66226c03a3695e0c8a2ea3c7688c434fe6
BLAKE2b-256 checksum
How to use checksums
9b20ef6c948cd7de52138c81c472d399fd95b45e72a3655894aa5aa5d5c33af1
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.1-cp312-cp312-win_amd64.whl

Download URL pstrain-0.1.1-cp312-cp312-win_amd64.whl
Size 4.3 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
44f20d17ca27dcef13e280aeacd1f2c72c3d017979677c0dd330f28bb03621ae
BLAKE2b-256 checksum
How to use checksums
8d691f97559e1feaa72d5d9be09f18adb38a526402712366bba0fd5b26e1f67f
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.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pstrain-0.1.1-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
a73bef55e95db7860ddcf06c8ac44af71d41e69c11e4f3fe7e4a17130560a407
BLAKE2b-256 checksum
How to use checksums
2d3026de6806298a37fdbeef519fe022c72a2c431837ce741c4a737c16c222c2
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.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL pstrain-0.1.1-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
f52e76512d7c1281f964d41ae079c0c1be9b8e0a33a8262474f267c23fbb2e35
BLAKE2b-256 checksum
How to use checksums
ba645b71dbe5e729818cad1fc8553fe2b05045a55a1210b2aabd2864d3da5d14
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.1-cp312-cp312-macosx_10_13_x86_64.whl

Download URL pstrain-0.1.1-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
2df10035ab0d414ab52adf9c520554dc53b28533412a4227d9b178dbdb99b422
BLAKE2b-256 checksum
How to use checksums
067920051002a79d21cb3c290fa2440532c60cc650ef1d359cd4132b4ddcbe64
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.1-cp311-cp311-win_amd64.whl

Download URL pstrain-0.1.1-cp311-cp311-win_amd64.whl
Size 4.3 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
e8fae88d7edab915326b9280804be587273a752347d00372d552a3b85a8f7d6e
BLAKE2b-256 checksum
How to use checksums
30030400fc3a6b2c123a871c347358b8bca4ebed72cfc8eee123a4d63fa4475d
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.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pstrain-0.1.1-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
e9af04b1a3e562c86c7232f6522d597f834d9f274237493b4ff3e4826d900fb5
BLAKE2b-256 checksum
How to use checksums
e292a36a1f3fd114502208b44f3d15b4a2bed2543a581f2e8e66e99e795caa92
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.1-cp311-cp311-macosx_11_0_arm64.whl

Download URL pstrain-0.1.1-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
3743e87863587d3c9e62171a964d7a89f7dd4f2a33d7bddaae561379e95cc348
BLAKE2b-256 checksum
How to use checksums
c0d06d52a12fde268c3e8df94262183b48e5c9d175009dd11fe9c82715641d05
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.1-cp311-cp311-macosx_10_9_x86_64.whl

Download URL pstrain-0.1.1-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
5023c61f61f711a1689a3d1d2496deb50239a059872f6c4030eb4b0c744c00ed
BLAKE2b-256 checksum
How to use checksums
e042c39489b2f021dafffd2f8c65d0853a62378a38a178f8c487d0fb9e9bba62
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

This release

0.1.1 This release

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