error_rate
Author: Heli Qi Affiliation: NAIST Date: 2022.07
ErrorRate
Bases: Criterion
Source code in speechain/criterion/error_rate.py
__call__(hypo_text, real_text, tokenizer=None, do_aver=False)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hypo_text
|
Tensor or List[str] or str
|
the hypothesis text |
required |
real_text
|
Tensor or List[str] or str
|
the reference text |
required |
tokenizer
|
Tokenizer
|
the tokenizer |
None
|
do_aver
|
bool
|
whether to average the error rate over the batch |
False
|
Returns:
Source code in speechain/criterion/error_rate.py
criterion_init(tokenizer=None, do_aver=False)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tokenizer
|
Tokenizer
|
Tokenizer |
None
|
do_aver
|
bool
|
bool |
False
|