Skip to content

Commit

Permalink
Update name to ConfidenceMethodConfig
Browse files Browse the repository at this point in the history
Signed-off-by: smajumdar <[email protected]>
  • Loading branch information
titu1994 committed Oct 3, 2023
1 parent 6af30c9 commit 764652a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions nemo/collections/asr/parts/submodules/ctc_greedy_decoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ class GreedyCTCInferConfig:
preserve_alignments: bool = False
compute_timestamps: bool = False
preserve_frame_confidence: bool = False
confidence_measure_cfg: Optional[ConfidenceMeasureConfig] = field(
default_factory=lambda: ConfidenceMeasureConfig()
confidence_measure_cfg: Optional[ConfidenceMethodConfig] = field(
default_factory=lambda: ConfidenceMethodConfig()

Check notice

Code scanning / CodeQL

Unnecessary lambda Note

This 'lambda' is just a simple wrapper around a callable object. Use that object directly.
)
confidence_method_cfg: str = "DEPRECATED"

Expand Down
8 changes: 4 additions & 4 deletions nemo/collections/asr/parts/submodules/rnnt_greedy_decoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -2185,8 +2185,8 @@ class GreedyRNNTInferConfig:
max_symbols_per_step: Optional[int] = 10
preserve_alignments: bool = False
preserve_frame_confidence: bool = False
confidence_measure_cfg: Optional[ConfidenceMeasureConfig] = field(
default_factory=lambda: ConfidenceMeasureConfig()
confidence_measure_cfg: Optional[ConfidenceMethodConfig] = field(
default_factory=lambda: ConfidenceMethodConfig()

Check notice

Code scanning / CodeQL

Unnecessary lambda Note

This 'lambda' is just a simple wrapper around a callable object. Use that object directly.
)
confidence_method_cfg: str = "DEPRECATED"

Expand All @@ -2204,8 +2204,8 @@ class GreedyBatchedRNNTInferConfig:
max_symbols_per_step: Optional[int] = 10
preserve_alignments: bool = False
preserve_frame_confidence: bool = False
confidence_measure_cfg: Optional[ConfidenceMeasureConfig] = field(
default_factory=lambda: ConfidenceMeasureConfig()
confidence_measure_cfg: Optional[ConfidenceMethodConfig] = field(
default_factory=lambda: ConfidenceMethodConfig()
)
confidence_method_cfg: str = "DEPRECATED"

Expand Down
2 changes: 1 addition & 1 deletion nemo/collections/asr/parts/utils/asr_confidence_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class ConfidenceConfig:
preserve_word_confidence: bool = False
exclude_blank: bool = True
aggregation: str = "min"
measure_cfg: ConfidenceMeasureConfig = field(default_factory=lambda: ConfidenceMeasureConfig())
measure_cfg: ConfidenceMethodConfig = field(default_factory=lambda: ConfidenceMethodConfig())

Check notice

Code scanning / CodeQL

Unnecessary lambda Note

This 'lambda' is just a simple wrapper around a callable object. Use that object directly.
method_cfg: str = "DEPRECATED"

def __post_init__(self):
Expand Down
2 changes: 1 addition & 1 deletion scripts/confidence_ensembles/build_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class BuildEnsembleConfig:
preserve_frame_confidence=True,
exclude_blank=True,
aggregation="mean",
measure_cfg=ConfidenceMeasureConfig(name="entropy", entropy_type="renyi", alpha=0.25, entropy_norm="lin",),
measure_cfg=ConfidenceMethodConfig(name="entropy", entropy_type="renyi", alpha=0.25, entropy_norm="lin",),
)
)
temperature: float = 1.0
Expand Down

0 comments on commit 764652a

Please sign in to comment.