Boost term recognition
Hotwords help the model recognize terms it might otherwise miss -- business terms, product names, or proper nouns.
Submit a JSON array of hotword objects.
Example: Improve movie title recognition (Fun-ASR and Paraformer series models)
Field descriptions:
Hotword text length rules:
Hotwords are supported by Fun-ASR models. The following models are available in the international region:
Hotwords are free.
Audio file used in the examples: asr_example.wav.
Weight controls how strongly the model favors a hotword. Set it appropriately to improve target word accuracy without introducing false recognitions.
Start with
Use the same account for all operations.
For the hotword list JSON format, see Hotwords overview.
Check the following in order:
Hotword lists are created the same way. The calling method differs:
In addition to hotwords, consider the following:
Hotwords overview
Submit a JSON array of hotword objects.
Example: Improve movie title recognition (Fun-ASR and Paraformer series models)
| Field | Type | Required | Description |
|---|---|---|---|
| text | string | Yes | The hotword text. Must be supported by the selected model. Use actual words, not random characters. See length rules below. |
| weight | int | Yes | Priority weight, an integer from 1 to 5. Start with 4. Increase if results are weak, but too high a weight can hurt recognition of other words. |
| lang | string | No | Language code. Boosts hotwords for a specific language. Leave empty for auto-detection. See the model's API reference for supported codes. If you set language_hints, only matching hotwords take effect. |
-
Contains non-ASCII characters: Maximum 15 characters total, including non-ASCII characters (Chinese, Japanese kana, Korean Hangul, Russian Cyrillic) and ASCII characters.
Examples:
"厄洛替尼盐酸盐"(7 Chinese characters)"EGFR抑制剂"(3 Chinese characters and 4 ASCII characters, for a total of 7 characters)"こんにちは"(5 characters)"Фенибут Белфарм"(15 characters, including the space)"Клофелин Белмедпрепараты"(24 characters) -- exceeds limit
-
Contains only ASCII characters: Maximum 7 segments. A segment is a sequence of characters separated by spaces.
Examples:
"Exothermic reaction"-- 2 segments"Human immunodeficiency virus type 1"-- 5 segments"The effect of temperature variations on enzyme activity in biochemical reactions"-- 11 segments, exceeds limit
Supported models
Hotwords are supported by Fun-ASR models. The following models are available in the international region:
- Real-time speech recognition: fun-asr-realtime, fun-asr-realtime-2025-11-07
- Non-real-time speech recognition: fun-asr, fun-asr-2025-11-07, fun-asr-2025-08-25, fun-asr-mtl, fun-asr-mtl-2025-08-25
Billing
Hotwords are free.
Hotword quantity limits
- Each account can create up to 10 hotword lists, shared across all models. To increase this limit, submit a request.
- Each hotword list can have up to 500 words.
Getting started
Workflow
-
Create a hotword list by calling the Create API. Set
target_model(ortargetModelin Java) to the speech recognition model you plan to use. If you already have a list, skip this step and call Query all to view it. -
Pass the hotword list ID to the speech recognition API. The model must match the
target_model(ortargetModelin Java) from step 1.
Prerequisites
- Get an API key: Get your API key and export it as an environment variable.
- Install the SDK: Install the DashScope SDK.
Code examples
Audio file used in the examples: asr_example.wav.
- Python
- Java
Advanced usage
Adjust hotword weights
Weight controls how strongly the model favors a hotword. Set it appropriately to improve target word accuracy without introducing false recognitions.
| Weight | Effect | Best for |
|---|---|---|
| 1-2 | Slight preference | Hotwords that sound similar to common words, where overcorrection must be avoided |
| 3-4 | Clear preference (recommended) | The best starting point for most scenarios |
| 5 | Forced preference | Use only when the term appears frequently and is unlikely to be confused with other words. An excessively high weight can cause phonetically similar words to be misrecognized as the hotword. |
weight=4 and adjust incrementally based on recognition results.
Design hotword lists
- Group by scenario: Create separate vocabulary lists for different business scenarios (for example, one for medical terms and another for product names) to simplify maintenance and reuse.
- Mix multiple languages: A single vocabulary list can contain terms in different languages. Use the
langfield to distinguish them. Whenlanguage_hintsis specified during speech recognition, only hotwords that match the specified language take effect. - Clean up regularly: Delete unused vocabulary lists to free up quota. Each account supports up to 10 lists.
API reference
Use the same account for all operations.
Create a hotword list
For the hotword list JSON format, see Hotwords overview.
- Python SDK
- Java SDK
- RESTful API
API descriptionCode example
target_model must match the model used in your speech recognition calls.Query all hotword lists
- Python SDK
- Java SDK
- RESTful API
API descriptionCode exampleResponse example
Query a specific hotword list
- Python SDK
- Java SDK
- RESTful API
API descriptionCode exampleResponse example
Update a hotword list
- Python SDK
- Java SDK
- RESTful API
API descriptionCode example
Delete a hotword list
- Python SDK
- Java SDK
- RESTful API
API descriptionCode example
FAQ
Why don't hotwords improve recognition accuracy?
Check the following in order:
- Model mismatch: The
target_modelspecified when creating the list must match the model used by the speech recognition API. A mismatch doesn't cause an error, and recognition still returns results, but the hotwords don't take effect. - Unsupported model: The model must belong to the Fun-ASR family. Other families don't support hotwords. Calling the API with an unsupported model doesn't return an error, but the results may lack hotword enhancement.
- Inappropriate weight: Increase the weight from 4 to 5 and observe the results. If phonetically similar words start being misrecognized as the hotword, reduce it back to 4.
- Hotword list status: Use the Query API to confirm that
statusisOK.
Are hotwords used differently in real-time and file-based recognition?
Hotword lists are created the same way. The calling method differs:
- Real-time speech recognition: Pass
vocabulary_idin the Recognition or WebSocket connection parameters. - File-based speech recognition: Pass
vocabulary_idin the Transcription request parameters.
target_model must match the speech recognition model used in the API call.
How to improve recognition accuracy beyond hotwords?
In addition to hotwords, consider the following:
- Audio quality: Match the sample rate to the model requirements (16 kHz or 8 kHz) and reduce background noise.
- Choose the right model: Different scenarios call for different models. For details, see Speech-to-text models.
- Specify the language: Declare the audio language through
language_hintsto improve accuracy in single-language scenarios.