Skip to content

Conversation

SimBe195
Copy link
Collaborator

@SimBe195 SimBe195 commented Oct 1, 2025

This adds a parameter ignored-transition-types to the LabelScorer base class which allows users to specify a list of transition types which will always get assigned score 0 and not affect the ScoringContext. This can be especially helpful when building combined label scorers with multiple sub-scorers of different label topology such as for example CTC + LSTM LM where the LM needs to ignore all blank transitions as well as label loops and CTC on the other hand needs to ignore the sentence-end.

Do achieve this, extendedScoringContext, computeScoreWithTime and computeScoresWithTimes are implemented in the base LabelScorer and call protected functions {extendedScoringContext|computeScoreWithTime|computeScoresWithTimes}Internal which are overridden in child classes.

Depends on modifications to the transition type handling from #138.

Edit:
This logic was changed so that instead of a blacklist, the LabelScorer has a parameter transition-preset which enables a preconfigured list of used transition types for specific models and any additional ones can be enabled via another parameter extra-transition-types. The available presets for now are "default", "none", "ctc", "transducer" and "lm". When the default preset is used, it takes a preset that is specified by each LabelScorer subclass individually and should be the most common use-case for that class. For example for CombineLabelScorer the default will use preset "all", for NoContextOnnxLabelScorer the default will use preset "ctc" and so on.

Base automatically changed from tdp_label_scorer to master October 8, 2025 12:59
@curufinwe curufinwe changed the title Option to disable transition types in LabelScorer Add option to disable some transition types in Nn::LabelScorer Oct 10, 2025
@SimBe195 SimBe195 changed the title Add option to disable some transition types in Nn::LabelScorer Partial enabling of transition types for different label scorers Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants