add blank_penalty for online transducer (#548)
This commit is contained in:
@@ -111,6 +111,17 @@ def get_args():
|
||||
""",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--blank-penalty",
|
||||
type=float,
|
||||
default=0.0,
|
||||
help="""
|
||||
The penalty applied on blank symbol during decoding.
|
||||
Note: It is a positive value that would be applied to logits like
|
||||
this `logits[:, 0] -= blank_penalty` (suppose logits.shape is
|
||||
[batch_size, vocab] and blank id is 0).
|
||||
""",
|
||||
)
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
@@ -136,6 +147,7 @@ def create_recognizer(args):
|
||||
provider=args.provider,
|
||||
hotwords_file=args.hotwords_file,
|
||||
hotwords_score=args.hotwords_score,
|
||||
blank_penalty=args.blank_penalty,
|
||||
)
|
||||
return recognizer
|
||||
|
||||
|
||||
Reference in New Issue
Block a user