mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-10-21 19:04:21 +00:00
fix bug in prev commit
This commit is contained in:
1 parent
6043921067
commit
11283edf6f
1 file changed
+1
-1
@@ -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