espnet / espnet/espnet_model_zoo
How to get the decoding result scores from
- Dominant language
- Python
- Stars
- 260
- Forks
- 44
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
Thanks for the work. I am trying to use the pre-trained model, but I don't know how to get the decoding score for the corresponding decoding results.
```
nbests = speech2text(speech)
text, *_ = nbests[0]
print(text)
```
The code above only prints text. I would like to get decoding confidence as well.
I checked speech2text class.
```
for hyp in nbest_hyps:
assert isinstance(hyp, Hypothesis), type(hyp)
# remove sos/eos and get results
token_int = hyp.yseq[1:-1].tolist()
# remove blank symbol id, which is assumed to be 0
token_int = list(filter(lambda x: x != 0, token_int))
# Change integer-ids to tokens
token = self.converter.ids2tokens(token_int)
if self.tokenizer is not None:
text = self.tokenizer.tokens2text(token)
else:
text = None
results.append((text, token, token_int, hyp))
assert check_return_type(results)
return results
```
From the code above I conjecture that the confidence should be obtained from the "hyp", but it is not clear to me how
to parse "hyp" to get the score.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.