Proper way of configuring keywords with Node.js SDK #107
Replies: 1 comment 3 replies
-
Hi @lminiero, The correct way to do it is like this:
So what you were doing was close. I would change it to a whole integer, instead of a decimal number. Try that and let me know if that helps. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I've been tinkering with Deepgram for a while, and so far it's been working surprisingly well. There's a feature I haven't been able to activate or use properly, though, which are keywords. I'm using the Node.js
@deepgram/sdk
, feeding it Opus chunks of audio I'm proxying myself from a WebRTC server.My usage of the SDK is fairly basic, since I configure it like that (only keeping the relevant bits in):
I'm omitting the listeners for the sake of brevity, also because everything does work.
Now, looking at the documentation, there's ambiguous definitions for how keywords should be provided when added to the
options
object above: the official documentation only covers how to provide them via query string, while the page on npm seems to suggest an array of strings should be used instead; a different source suggested using an array of{ word: <string>, boost: <number> }
objects instead. I tried using both but to no avail, e.g.,or
but neither seemed to have any effect (I used different words too, the ones above are just an example) when I tried transcribing live audio that included those words. I also tried adding a
tier: 'enhanced'
property to the options, as some sources seemed to suggest keywords needed that, or at the very least worked better when it was enabled, but that didn't seem to make any difference.My main objective is to be able to properly detect some context specific terminology that makes a heavy use of acronyms, which I assume will be a challenge in itself (e.g., detecting something like "SMTP" when people spell the individual letters as you'd usually pronounce it), but at the moment I'm unable to add even custom words to that, which makes me think I'm doing something wrong.
Taking into account the snippets above, am I configuring this improperly, or are there different requirements for this to actually work? Not sure for instance if keywords only work when using custom models in premium subscriptions, or if they're supposed to work when using the pay-as-you-go plans too. Is there any way to query a currently active Deepgram session and check whether keywords are actually active, after it's been created?
Thanks in advance for any help you'll be able to provide! Please do let me know if there's more info I should add.
Beta Was this translation helpful? Give feedback.
All reactions