#How do I use the keywords feature with the python sdk?

1 messages · Page 1 of 1 (latest)

paper locust
#

Keywords can boost or suppress specialized terminology.

I want to figure out when I use the Python SDK how to use this feature

orchid bridgeBOT
#

Hi @paper locust. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

To use the keywords feature with the Python SDK, you can specify the keywords in the options when working with the prerecorded transcribe. Here is an example of how you can do this:

options = PrerecordedOptions(
    model='nova-2-phonecall',
    smart_format=True,
    keywords=["<PROPER_NOUN>", ],
)

In this example, <PROPER_NOUN> is the keyword you want to boost. You can replace it with the actual word you want to boost. You can also add an intensifier value with keywords=["<PROPER_NOUN>:2"] (the default intensifier value is 1). Then you can add as many keywords as you need within that list.

Please note that the keywords feature is designed to provide the models with new vocabulary they have not previously encountered. It will not increase the likelihood that common words or proper nouns are predicted. If you require more than 100 keywords, you might need to consider training a custom model.

Also, be aware that phrases, acronyms, digits, and special characters are not supported by Deepgram’s Keywords feature. For example, an example of something that isn’t supported by keywords is “web 3.0”. This is a phrase, so the feature will separate the terms at the space, and boost “web” and “3.0” separately.

For more information, you can refer to the Deepgram's documentation on keywords (https://developers.deepgram.com/docs/keywords) and the discussion on GitHub (https://github.com/orgs/deepgram/discussions/698).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: