Fix word boundaries in ctm dumps of lattices with subsampling #72
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When performing recognition, the traceback contains word boundaries in the form of integers that represent output time frames of the model in the case of time-synchronous decoding. These word boundaries are then written into the lattice.
Later, when dumping the lattice to a .ctm file, these boundaries are divided by 100 to form start- and end-times as well as durations of words. This assumes that a frame shift on the output time axis is 1/100 seconds (i.e. 10ms) which is wrong when subsampling is performed in the model (or if one was to use feature extraction with a different frame shift). This leads to wrong word boundaries in the .ctm file.
This PR replaces the
/ 100.0
by a multiplication with a configurable frame shift.