-
Notifications
You must be signed in to change notification settings - Fork 44
Open
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels