Skip to content

Commit d4f0504

Browse files
cursoragentsahil
andcommitted
Refactor: Clarify keyword and keyterm boosting in docs
Co-authored-by: sahil <[email protected]>
1 parent f3dbab6 commit d4f0504

File tree

1 file changed

+48
-27
lines changed

1 file changed

+48
-27
lines changed

fern/customization/custom-keywords.mdx

Lines changed: 48 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,78 +18,99 @@ 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.
2323

2424
## Enabling Keyword Boosting in Vapi
2525

2626
### API Call Integration
2727

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.
28+
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.
2929

3030
### Example of POST Request
3131

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

3434
```bash
35-
bashCopy code
3635
curl \
3736
--request POST \
3837
--header 'Authorization: Bearer <token>' \
3938
--header 'Content-Type: application/json' \
4039
--data '{
4140
"name": "Emma",
4241
"model": {
43-
"model": "gpt-4o",
44-
"provider": "openai"
42+
"model": "gpt-4o",
43+
"provider": "openai"
4544
},
4645
"voice": {
47-
"voiceId": "emma",
48-
"provider": "azure"
46+
"voiceId": "emma",
47+
"provider": "azure"
4948
},
5049
"transcriber": {
51-
"provider": "deepgram",
52-
"model": "nova-2",
53-
"language": "bg",
54-
"smartFormat": true,
55-
"keywords": [
56-
"snuffleupagus:1"
57-
]
50+
"provider": "deepgram",
51+
"model": "nova-2",
52+
"language": "en",
53+
"smartFormat": true,
54+
"keywords": [
55+
"snuffleupagus:5",
56+
"systrom",
57+
"krieger"
58+
],
59+
"keyterm": [
60+
"order number",
61+
"account ID",
62+
"PCI compliance"
63+
]
5864
},
5965
"firstMessage": "Hi, I am Emma, what is your name?",
6066
"firstMessageMode": "assistant-speaks-first"
6167
}' \
6268
https://api.vapi.ai/assistant
63-
6469
```
6570

6671
In this configuration:
6772

6873
- **name**: The name of the assistant.
6974
- **model**: Specifies the model and provider for the assistant's conversational capabilities.
7075
- **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.
76+
- **transcriber**: Specifies Deepgram as the transcription provider, along with the model, language, smart formatting, and both `keywords` (single words) and `keyterm` (phrases) for boosting.
7277
- **firstMessage**: The initial message the assistant will speak.
7378
- **firstMessageMode**: Specifies that the assistant speaks first.
7479

75-
### Intensifiers
80+
### Format and intensifiers
81+
82+
The `keywords` array accepts single-word tokens consisting of letters and digits, with an optional integer intensifier after a colon:
7683

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.
84+
- Accepted forms: `apple`, `apple:3`, `apple:-2`
85+
- Not accepted: `order number` (use `keyterm`), `hello-world`, `foo_bar`, `rate:1.5` (decimals are not supported by this schema)
86+
87+
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.
7888

7989
- **Boosting Example:** `keywords=snuffleupagus:5`
8090
- **Suppressing Example:** `keywords=kansas:-10`
8191

82-
### Best Practices for Keyword Boosting
92+
### Keyterm prompting (phrases)
93+
94+
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.
8395

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.
96+
Example: `"keyterm": ["account number", "confirmation code", "HIPAA compliance"]`
97+
98+
### Best Practices for Keyword and Keyterm Boosting
99+
100+
1. **Start small:** Begin without any boosting; add keywords/keyterms only where needed.
101+
2. **Send uncommon words:** Focus on proper nouns or domain terms the model often misses.
102+
3. **Use `keywords` for single words; `keyterm` for phrases:** Avoid spaces in `keywords`.
103+
4. **Avoid duplicates:** Send each keyword once; duplicates don't improve results.
104+
5. **Moderate intensifiers:** Use minimal integer boosts to reduce false positives; increase cautiously.
105+
6. **Correct spelling/casing:** Provide the spelling and capitalization you want in transcripts.
106+
7. **Consider custom models:** For extensive vocabularies, consider custom model training with Deepgram.
90107

91108
### Additional Resources
92109

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

95116
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)