From 8eea212df27d9ba9d5158df04aa8af179becbdcb Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Sat, 1 Jun 2024 18:38:36 +0700 Subject: [PATCH] Fix/verbio stt (#770) * fix verbio stt normalization * wip --- lib/utils/transcription-utils.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/utils/transcription-utils.js b/lib/utils/transcription-utils.js index f93d4e15..3da05cc2 100644 --- a/lib/utils/transcription-utils.js +++ b/lib/utils/transcription-utils.js @@ -376,6 +376,20 @@ const normalizeNuance = (evt, channel, language) => { }; }; +const normalizeVerbio = (evt, channel, language) => { + const copy = JSON.parse(JSON.stringify(evt)); + return { + language_code: language, + channel_tag: channel, + is_final: evt.is_final, + alternatives: evt.alternatives, + vendor: { + name: 'verbio', + evt: copy + } + }; +}; + const normalizeMicrosoft = (evt, channel, language, punctuation = true) => { const copy = JSON.parse(JSON.stringify(evt)); const nbest = evt.NBest; @@ -463,6 +477,8 @@ module.exports = (logger) => { return normalizeCobalt(evt, channel, language); case 'assemblyai': return normalizeAssemblyAi(evt, channel, language, shortUtterance); + case 'verbio': + return normalizeVerbio(evt, channel, language); default: if (vendor.startsWith('custom:')) { return normalizeCustom(evt, channel, language, vendor);