Skip to content

Add "length_penalty" config option #7

@FredSRichardson

Description

@FredSRichardson

This is a very small change that helps quite a lot I've found. The WeNet decoder has an option "length_penalty" which really helps control deletion rates which by default tend to be really high.

A good reference for the code change is in the WeNet code base. The relevant lines are linked below. Basically you add "length_penalty" (a float param with a negative value like -3.0 - so a bonus...) the following two places in ProcessEmitting() in kaldi-decoder/csrc/faster-decoder.cc and of course add the corresponding config option to kaldi-decoder/csrc/faster-decoder.h and kaldi-decoder/python/csrc/faster-decoder.cc:

runtime/core/kaldi/decoder/lattice-faster-decoder.cc#L781-L783

runtime/core/kaldi/decoder/lattice-faster-decoder.cc#L811-L813

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions