mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 00:58:34 +00:00
fix bug in prev commit
This commit is contained in:
@@ -370,7 +370,7 @@ const normalizeAws = (evt, channel, language) => {
|
||||
const copy = JSON.parse(JSON.stringify(evt));
|
||||
const alternatives = evt.Transcript?.Results[0]?.Alternatives.map((alt) => {
|
||||
const items = alt.Items.filter((item) => item.Type === 'pronunciation' && 'Confidence' in item);
|
||||
const confidence = items.reduce((acc, item) => acc + item.Confidence, 0) / alt.Items.length;
|
||||
const confidence = items.reduce((acc, item) => acc + item.Confidence, 0) / items.length;
|
||||
return {
|
||||
transcript: alt.Transcript,
|
||||
confidence
|
||||
|
||||
Reference in New Issue
Block a user