You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
subtitle: Boost STT accuracy for domain words and phrases
4
4
slug: customization/custom-keywords
5
5
---
6
6
@@ -18,78 +18,104 @@ Keyword boosting is beneficial for:
18
18
### Important Notes
19
19
20
20
- 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.
23
28
24
29
## Enabling Keyword Boosting in Vapi
25
30
26
31
### API Call Integration
27
32
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.
29
34
30
35
### Example of POST Request
31
36
32
37
To create an assistant with keyword boosting enabled, you can make the following POST request to Vapi:
33
38
34
39
```bash
35
-
bashCopy code
36
40
curl \
37
41
--request POST \
38
42
--header 'Authorization: Bearer <token>' \
39
43
--header 'Content-Type: application/json' \
40
44
--data '{
41
45
"name": "Emma",
42
46
"model": {
43
-
"model": "gpt-4o",
44
-
"provider": "openai"
47
+
"model": "gpt-4o",
48
+
"provider": "openai"
45
49
},
46
50
"voice": {
47
-
"voiceId": "emma",
48
-
"provider": "azure"
51
+
"voiceId": "emma",
52
+
"provider": "azure"
49
53
},
50
54
"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
+
]
58
69
},
59
70
"firstMessage": "Hi, I am Emma, what is your name?",
60
71
"firstMessageMode": "assistant-speaks-first"
61
72
}' \
62
73
https://api.vapi.ai/assistant
63
-
64
74
```
65
75
66
76
In this configuration:
67
77
68
78
-**name**: The name of the assistant.
69
79
-**model**: Specifies the model and provider for the assistant's conversational capabilities.
70
80
-**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.
72
82
-**firstMessage**: The initial message the assistant will speak.
73
83
-**firstMessageMode**: Specifies that the assistant speaks first.
74
84
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)
76
91
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.
78
93
79
94
-**Boosting Example:**`keywords=snuffleupagus:5`
80
95
-**Suppressing Example:**`keywords=kansas:-10`
81
96
82
-
### Best Practices for Keyword Boosting
97
+
### Keyterm prompting (phrases)
83
98
84
-
1.**Send Uncommon Keywords:** Focus on keywords not successfully transcribed by the model.
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.
- API reference: Deepgram transcriber `keywords` and `keyterm` in the [API reference](https://api.vapi.ai/api#:~:text=DeepgramTranscriber)
94
120
95
121
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