Skip to content

Commit 27c70a3

Browse files
sahilsuman933cursoragentsahil
authored
Update vapi docs with deepgram keyword info (#689)
* Refactor: Clarify keyword and keyterm boosting in docs Co-authored-by: sahil <[email protected]> * Refactor: Update custom keywords to keyterm prompting Co-authored-by: sahil <[email protected]> --------- Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: sahil <[email protected]>
1 parent f3dbab6 commit 27c70a3

File tree

1 file changed

+55
-29
lines changed

1 file changed

+55
-29
lines changed
Lines changed: 55 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Custom Keywords
3-
subtitle: Enhanced transcription accuracy guide
2+
title: Deepgram Keywords and Keyterm Prompting
3+
subtitle: Boost STT accuracy for domain words and phrases
44
slug: customization/custom-keywords
55
---
66

@@ -18,78 +18,104 @@ Keyword boosting is beneficial for:
1818
### Important Notes
1919

2020
- Keywords should be uncommon words or proper nouns not frequently recognized by the model.
21-
- Custom model training is the most effective way to ensure accurate keyword recognition.
22-
- For more than 50 keywords, consider custom model training by contacting Deepgram.
21+
- Use single words for `keywords` (no spaces or punctuation). For multi-word phrases, use `keyterm` instead.
22+
- Custom model training is the most effective way to ensure accurate keyword recognition when you need extensive vocabulary coverage.
23+
24+
### Model support
25+
26+
- Keywords is available on Deepgram Nova-2, Nova-1, Enhanced, and Base speech-to-text models.
27+
- For Nova-3 models, use Keyterm Prompting instead of Keywords.
2328

2429
## Enabling Keyword Boosting in Vapi
2530

2631
### API Call Integration
2732

28-
To enable keyword boosting, you need to add a `keywords` parameter to your Vapi assistant's transcriber section. This parameter should include the keywords and their respective intensifiers.
33+
To enable keyword boosting, add the `keywords` parameter to your assistant's `transcriber` configuration when using the Deepgram provider. You can also supply `keyterm` to boost recall for phrases.
2934

3035
### Example of POST Request
3136

3237
To create an assistant with keyword boosting enabled, you can make the following POST request to Vapi:
3338

3439
```bash
35-
bashCopy code
3640
curl \
3741
--request POST \
3842
--header 'Authorization: Bearer <token>' \
3943
--header 'Content-Type: application/json' \
4044
--data '{
4145
"name": "Emma",
4246
"model": {
43-
"model": "gpt-4o",
44-
"provider": "openai"
47+
"model": "gpt-4o",
48+
"provider": "openai"
4549
},
4650
"voice": {
47-
"voiceId": "emma",
48-
"provider": "azure"
51+
"voiceId": "emma",
52+
"provider": "azure"
4953
},
5054
"transcriber": {
51-
"provider": "deepgram",
52-
"model": "nova-2",
53-
"language": "bg",
54-
"smartFormat": true,
55-
"keywords": [
56-
"snuffleupagus:1"
57-
]
55+
"provider": "deepgram",
56+
"model": "nova-2",
57+
"language": "en",
58+
"smartFormat": true,
59+
"keywords": [
60+
"snuffleupagus:5",
61+
"systrom",
62+
"krieger"
63+
],
64+
"keyterm": [
65+
"order number",
66+
"account ID",
67+
"PCI compliance"
68+
]
5869
},
5970
"firstMessage": "Hi, I am Emma, what is your name?",
6071
"firstMessageMode": "assistant-speaks-first"
6172
}' \
6273
https://api.vapi.ai/assistant
63-
6474
```
6575

6676
In this configuration:
6777

6878
- **name**: The name of the assistant.
6979
- **model**: Specifies the model and provider for the assistant's conversational capabilities.
7080
- **voice**: Specifies the voice and provider for the assistant's speech.
71-
- **transcriber**: Specifies Deepgram as the transcription provider, along with the model, language, smart formatting, and keywords for boosting.
81+
- **transcriber**: Specifies Deepgram as the transcription provider, along with the model, language, smart formatting, and both `keywords` (single words) and `keyterm` (phrases) for boosting.
7282
- **firstMessage**: The initial message the assistant will speak.
7383
- **firstMessageMode**: Specifies that the assistant speaks first.
7484

75-
### Intensifiers
85+
### Format and intensifiers
86+
87+
The `keywords` array accepts single-word tokens consisting of letters and digits, with an optional integer intensifier after a colon:
88+
89+
- Accepted forms: `apple`, `apple:3`, `apple:-2`
90+
- Not accepted: `order number` (use `keyterm`), `hello-world`, `foo_bar`, `rate:1.5` (decimals are not supported by this schema)
7691

77-
Intensifiers are exponential factors that boost or suppress the likelihood of the specified keyword being recognized. The default intensifier is `1`. Higher values increase the likelihood, while `0` is equivalent to not specifying a keyword.
92+
Intensifiers are exponential factors that boost or suppress the likelihood of the specified keyword being recognized. The default intensifier is `1`. Higher values increase the likelihood, while `0` is equivalent to not specifying a keyword. Negative values suppress recognition.
7893

7994
- **Boosting Example:** `keywords=snuffleupagus:5`
8095
- **Suppressing Example:** `keywords=kansas:-10`
8196

82-
### Best Practices for Keyword Boosting
97+
### Keyterm prompting (phrases)
8398

84-
1. **Send Uncommon Keywords:** Focus on keywords not successfully transcribed by the model.
85-
2. **Send Keywords Once:** Avoid repeating keywords.
86-
3. **Use Individual Keywords:** Prefer individual terms over phrases.
87-
4. **Use Proper Spelling:** Spell proper nouns as you want them to appear in transcripts.
88-
5. **Moderate Intensifiers:** Start with small increments to avoid false positives.
89-
6. **Custom Model Training:** For extensive vocabulary needs, consider custom model training.
99+
Deepgram's Keyterm Prompting improves Keyword Recall Rate (KRR) for important keyterms or phrases. Use `keyterm` for multi‑word phrases you want the model to detect more reliably. Unlike `keywords`, keyterms are specified as plain strings without intensifiers.
100+
101+
Example: `"keyterm": ["account number", "confirmation code", "HIPAA compliance"]`
102+
103+
### Best Practices for Keyword and Keyterm Boosting
104+
105+
1. **Start small:** Begin without any boosting; add keywords/keyterms only where needed.
106+
2. **Send uncommon words:** Focus on proper nouns or domain terms the model often misses.
107+
3. **Use `keywords` for single words; `keyterm` for phrases:** Avoid spaces in `keywords`.
108+
4. **Avoid duplicates:** Send each keyword once; duplicates don't improve results.
109+
5. **Moderate intensifiers:** Use minimal integer boosts to reduce false positives; increase cautiously.
110+
6. **Correct spelling/casing:** Provide the spelling and capitalization you want in transcripts.
111+
7. **Consider custom models:** For extensive vocabularies, consider custom model training with Deepgram.
90112

91113
### Additional Resources
92114

93-
For more detailed information on Deepgram's keyword boosting feature, refer to the Deepgram Keyword Boosting Documentation.
115+
For more details, see:
116+
117+
- Deepgram Keywords: [developers.deepgram.com/docs/keywords](https://developers.deepgram.com/docs/keywords)
118+
- Deepgram Keyterm Prompting: [developers.deepgram.com/docs/keyterm](https://developers.deepgram.com/docs/keyterm)
119+
- API reference: Deepgram transcriber `keywords` and `keyterm` in the [API reference](https://api.vapi.ai/api#:~:text=DeepgramTranscriber)
94120

95121
By following these guidelines, you can effectively utilize Deepgram's keyword boosting feature within your Vapi assistant, ensuring enhanced transcription accuracy for specialized terminology and uncommon proper nouns.

0 commit comments

Comments
 (0)