Skip to content

Warn when an acoustic model directory has no feat.params - #494

Open
lenzo-ka wants to merge 1 commit into
cmusphinx:mainfrom
lenzo-ka:warn_missing_feat_params
Open

Warn when an acoustic model directory has no feat.params#494
lenzo-ka wants to merge 1 commit into
cmusphinx:mainfrom
lenzo-ka:warn_missing_feat_params

Conversation

@lenzo-ka

@lenzo-ka lenzo-ka commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

A model directory lacking feat.params was accepted without any diagnostic. The front end is then built from caller-supplied values plus generic defaults (transform=legacy, nfilt=40, nfft=0, lifter=0), which can silently produce a feature recipe that does not match the model's training while initialization and decoding still appear successful. For scale, the shipped en-us model's own file specifies -nfilt 25, -transform dct, and -lifter 22.

PocketSphinx cannot infer the training-time front end from the acoustic parameter files, so it cannot validate the configuration. It can, however, observe that a model directory was supplied and no feature parameter record exists. This change emits one warning during model configuration expansion in exactly that case, naming the directory and stating that the front end will be built from defaults plus caller-supplied configuration. It is deliberately a warning, not an error: a caller may legitimately supply the complete front-end configuration itself. No other behavior changes.

The new unit test test_featparams asserts that a model shipping feat.params loads without the warning, and that a copy of the same model with the file removed initializes with the warning and a null effective featparams. The stripped case fails against the previous implementation.

Fixes #497

Tested on macOS (Apple clang) and Linux x86-64 (GCC 13.3); full unit and regression suite passes on both.

A model directory lacking feat.params was accepted silently, and the
front end was built from caller-supplied values plus generic defaults.
That can produce a feature recipe that does not match the model's
training while initialization and decoding still appear successful.

Emit a warning during model configuration expansion when hmm is set
and no feature parameter file is available, naming the directory.
This is deliberately a warning, not an error: a caller may
legitimately supply the complete front-end configuration itself.
No other behavior change.

test_featparams asserts that a model shipping feat.params loads
without the warning, and that a copy of the same model stripped of
feat.params initializes with the warning and a null effective
featparams. The stripped case fails against the previous
implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Silent acceptance of an acoustic model directory with no feat.params

1 participant