Skip to main content
Speech-to-text

Improve recognition accuracy

Improve recognition of names, product names, and industry terms with hotwords (instant or precompiled) and contextual biasing.

Choose an optimization method

Names, product names, and industry terms can sound like common words, resulting in homophones or incorrect spellings in transcripts. Hotwords and contextual biasing supply correct spellings or relevant background to help improve recognition. Choose based on the information your application already has: use hotwords for a known list of terms, or contextual biasing for existing conversations or business descriptions. For hotwords, choose instant or precompiled lists depending on whether the same list needs to be reused across requests. Check Supported models and regions before use.
MethodWhen to useHow to use
Instant hotwordsNames and terms change with each request, or you have a few temporary terms and do not need to store a list.Include a term-to-weight object in each recognition request. The application supplies the correct spellings and can adjust how strongly the model favors each term through its weight.
Precompiled hotwordsYou have a business glossary or repeatedly recognize the same set of terms and want to maintain one shared list.Create a list of terms, weights, and optional languages, then reference its ID during recognition. Update the list when the glossary changes instead of resubmitting all entries in every request.
Contextual biasingYour application already stores recent conversations, business descriptions, or domain text that can help recognition.Send the relevant text as context messages with the audio. You do not need to extract individual terms or assign weights. Include the correct spellings of target terms. A known term list can also be used as hotwords to address the same type of error.

Use hotwords

Before running the examples, download the sample audio and prepare an API key from the QwenCloud console. Audio text: “Please send the quarterly project report to Kelyra before Friday.”

Instant hotwords

Instant hotwords suit terms that change with each request. Set parameters.vocabulary to a JSON object whose keys are hotword strings and whose values are integer weights. You do not need to create a list first.
  1. Recognize the audio without hotwords Without hotwords, the name in this sample is not recognized accurately. The following request returns the unconfigured recognition result.
cURL
# Singapore (ap-southeast-1). For another region, replace ap-southeast-1 in the URL.
# API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
curl --request POST 'https://ap-southeast-1.maas.qwencloudapi.com/api/v1/services/aigc/multimodal-generation/generation' \
  --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
  --header "Content-Type: application/json" \
  --header "X-DashScope-SSE: disable" \
  --data '
{
  "model": "qwen-audio-3.1-asr-flash",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "input_audio",
            "input_audio": {
              "data": "https://g-adoc.alcasset.com/media/maas_docs/sfm-cn/en/audios/6a4b3c2d1e0f9092.wav"
            }
          }
        ]
      }
    ]
  },
  "parameters": {
    "format": "wav",
    "sample_rate": 16000
  }
}
'
  1. Add instant hotwords to the request Add “Kelyra” to the same request with a weight of 4. Keep the other inputs unchanged. For weight ranges and tuning, see Adjust hotword weights.
cURL
# Singapore (ap-southeast-1). For another region, replace ap-southeast-1 in the URL.
# API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
curl --request POST 'https://ap-southeast-1.maas.qwencloudapi.com/api/v1/services/aigc/multimodal-generation/generation' \
  --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
  --header "Content-Type: application/json" \
  --header "X-DashScope-SSE: disable" \
  --data '
{
  "model": "qwen-audio-3.1-asr-flash",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "input_audio",
            "input_audio": {
              "data": "https://g-adoc.alcasset.com/media/maas_docs/sfm-cn/en/audios/6a4b3c2d1e0f9092.wav"
            }
          }
        ]
      }
    ]
  },
  "parameters": {
    "format": "wav",
    "sample_rate": 16000,
    "vocabulary": {
      "Kelyra": 4
    }
  }
}
'
Compare the example transcripts before and after configuration:
ConfigurationExample transcript
Without configurationPlease send the quarterly project report to Kellira before Friday.
With configurationPlease send the quarterly project report to Kelyra before Friday.

Precompiled hotwords

Precompiled hotwords suit business vocabularies that need to be reused across requests. Create a list in advance, then pass vocabulary_id during recognition instead of sending all entries again. Submit entries as a JSON array when creating a list. Each entry has the following fields:
FieldTypeRequiredDescription
textstringYesAn actual word in a language supported by the selected model. For length requirements, see Hotword text rules.
weightintegerYesUse 1–5 for regular hotwords, starting at 4. Some models also support a super hotword weight of 50. See Adjust hotword weights.
langstringNoLanguage code that determines which language the entry applies to. Omit it if unknown. For its relationship with the recognition parameter language_hints, see Organize and maintain vocabularies.
The target model specified when creating the list must match the recognition model.
Hotword management and speech recognition must use the same account. Otherwise, recognition cannot access the vocabulary.
  • HTTP / cURL
  • SDK
  1. Create a hotword list This example uses qwen-audio-3.1-asr-flash and specifies the target model through target_model. Save output.vocabulary_id from the response.
cURL
# Singapore (ap-southeast-1). For another region, replace ap-southeast-1 in the URL.
# API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
curl --request POST 'https://ap-southeast-1.maas.qwencloudapi.com/api/v1/services/audio/asr/customization' \
  --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
  --header "Content-Type: application/json" \
  --data @- <<EOF
{
  "model": "speech-biasing",
  "input": {
    "action": "create_vocabulary",
    "target_model": "qwen-audio-3.1-asr-flash",
    "prefix": "testpfx",
    "vocabulary": [
      {
        "text": "Kelyra",
        "weight": 4,
        "lang": "en"
      }
    ]
  }
}
EOF
  1. Check that the list is ready Replace <vocabulary_id> with the ID returned by the create request, then query the list. Proceed with recognition when output.status is OK.
cURL
export VOCABULARY_ID="<vocabulary_id>"

# Singapore (ap-southeast-1). For another region, replace ap-southeast-1 in the URL.
# API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
curl --request POST 'https://ap-southeast-1.maas.qwencloudapi.com/api/v1/services/audio/asr/customization' \
  --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
  --header "Content-Type: application/json" \
  --data @- <<EOF
{
  "model": "speech-biasing",
  "input": {
    "action": "query_vocabulary",
    "vocabulary_id": "$VOCABULARY_ID"
  }
}
EOF
  1. Reference the list during recognition Reference the list through parameters.vocabulary_id in the recognition request. You do not need to send its entries again.
cURL
# Singapore (ap-southeast-1). For another region, replace ap-southeast-1 in the URL.
# API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
curl --request POST 'https://ap-southeast-1.maas.qwencloudapi.com/api/v1/services/aigc/multimodal-generation/generation' \
  --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
  --header "Content-Type: application/json" \
  --header "X-DashScope-SSE: disable" \
  --data @- <<EOF
{
  "model": "qwen-audio-3.1-asr-flash",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "input_audio",
            "input_audio": {
              "data": "https://g-adoc.alcasset.com/media/maas_docs/sfm-cn/en/audios/6a4b3c2d1e0f9092.wav"
            }
          }
        ]
      }
    ]
  },
  "parameters": {
    "format": "wav",
    "sample_rate": 16000,
    "vocabulary_id": "$VOCABULARY_ID"
  }
}
EOF
  1. Reuse or delete the list Later requests can continue using the same ID. Run the following delete request only when the list is no longer needed, to release its quota.
cURL
# Singapore (ap-southeast-1). For another region, replace ap-southeast-1 in the URL.
# API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
curl --request POST 'https://ap-southeast-1.maas.qwencloudapi.com/api/v1/services/audio/asr/customization' \
  --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
  --header "Content-Type: application/json" \
  --data @- <<EOF
{
  "model": "speech-biasing",
  "input": {
    "action": "delete_vocabulary",
    "vocabulary_id": "$VOCABULARY_ID"
  }
}
EOF

Use context enhancement

Contextual biasing can use existing conversation history or domain text directly. Hotwords require terms and weights, whereas context is sent as text messages without first turning business material into individual entries. Both methods can improve recognition of proper names. Choose based on the information available to your application.

Prepare context

For the sample audio, existing messages that spell the recipient’s name as “Kelyra” can provide its correct spelling. Two common sources of context are shown below.
  • Business or domain text
  • Conversation history
Use relevant text from an existing project description or domain material in a message with role=user and type=input_text. You do not need to invent a conversation or add a reply. Pass the following array as context:
[
  {
    "role": "user",
    "content": [
      {
        "type": "input_text",
        "text": "My colleague is Kelyra. We are preparing the quarterly project report."
      }
    ]
  }
]
The assistant message is optional. Order conversation history by turn, placing each user message before its corresponding assistant message. For text-length and retained-turn limits, see Usage limits.

Configure and call

Recognize the same audio with the prepared context. Choose a calling example by model family.
  • Qwen-Audio-ASR
  • Qwen-Audio-ASR-Message / Qwen-Audio-ASR-Streaming
  • Qwen-Audio-ASR-Filetrans
This example uses qwen-audio-3.1-asr-flash. Place context messages in order in input.messages, followed by the current audio message containing input_audio.
cURL
# Singapore (ap-southeast-1). For another region, replace ap-southeast-1 in the URL.
# API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
curl --request POST 'https://ap-southeast-1.maas.qwencloudapi.com/api/v1/services/aigc/multimodal-generation/generation' \
  --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
  --header "Content-Type: application/json" \
  --header "X-DashScope-SSE: disable" \
  --data '
{
  "model": "qwen-audio-3.1-asr-flash",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "input_text",
            "text": "My colleague is Kelyra. We are preparing the quarterly project report."
          }
        ]
      },
      {
        "role": "assistant",
        "content": [
          {
            "type": "text",
            "text": "Understood. We will send the quarterly project report to Kelyra."
          }
        ]
      },
      {
        "role": "user",
        "content": [
          {
            "type": "input_audio",
            "input_audio": {
              "data": "https://g-adoc.alcasset.com/media/maas_docs/sfm-cn/en/audios/6a4b3c2d1e0f9092.wav"
            }
          }
        ]
      }
    ]
  },
  "parameters": {
    "format": "wav",
    "sample_rate": 16000
  }
}
'
Remove the context configuration from the example and recognize the same audio to compare the results before and after configuration. Example transcripts are shown below:
ConfigurationExample transcript
Without configurationPlease send the quarterly project report to Kellira before Friday.
With configurationPlease send the quarterly project report to Kelyra before Friday.

Tune and troubleshoot recognition

Compare the same audio before and after configuration, then adjust entries, weights, or context. Hotword tuning applies to both instant and precompiled hotwords.

Adjust hotword weights

Regular hotword weights range from 1 to 5. Start at weight=4. A higher weight increases preference for the word, but an excessive weight can replace similar-sounding words incorrectly.
WeightPreferenceWhen to use
1–2SlightThe term sounds like a common word and over-correction must be avoided
3–4ModerateRecommended starting configuration for most scenarios
5StrongTerms that appear frequently and are rarely confused with other words
Super hotwords: For both instant and precompiled hotwords, the Qwen-Audio-ASR-Message, Qwen-Audio-ASR-Streaming, Qwen-Audio-ASR-Filetrans, and Qwen-Audio-ASR series also support weight=50 to improve recall of target terms. Each vocabulary or request can contain at most 50 super hotwords.

Organize and maintain vocabularies

  • Group by scenario: Create separate precompiled lists for different business scenarios, such as medical terminology and product names, to reduce unrelated entries.
  • Distinguish entry language from audio language: A precompiled vocabulary can mix languages, identified by lang. The recognition parameter language_hints declares the audio language. When it is set, only hotwords in the matching language take effect; other languages are ignored.
  • Maintain regularly: Update entries as business needs change and delete unused lists to release quota.
Allow at least 5 minutes between hotword list updates; otherwise, updated hotwords might not take effect.

Troubleshoot recognition quality

First identify whether the issue is an ineffective configuration, excessive bias toward hotwords, or audio that is difficult to recognize. Then check the relevant items below.
SymptomChecks and actions
Hotwords are not recognized as expectedCheck Supported models and regions first. Instant hotwords belong in parameters.vocabulary. For precompiled hotwords, check the account, vocabulary_id, status=OK, and whether the list’s target_model matches the recognition model.
Increase the hotword weight within its supported range and compare results for the same audio to determine whether the weight was too low.
Other words are incorrectly replaced with hotwordsReduce the hotword weight within its supported range and remove terms unrelated to the scenario. Check that lang matches the recognition API’s language_hints so that entries belong to the intended language.
Context does not improve target termsCheck the correct spellings, message roles, types, order, and the input field required by the API. Text beyond the length or turn limit can be truncated or discarded. See Usage limits.
Many ordinary words are also incorrectCheck that the audio format and sample rate meet the model requirements, and reduce background noise. For single-language audio, declare the language through the recognition API’s language_hints. For model selection and audio requirements, see Speech recognition overview.

Supported models and regions

  • Precompiled hotwords
  • Instant hotwords
  • Contextual biasing
  • Singapore
  • China North 2 (Beijing)
Hotwords are supported only in the primary workspace, not in sub-workspaces.
  • Qwen-Audio-ASR: qwen-audio-3.1-asr-flash, qwen-audio-3.0-asr-flash
  • Qwen-Audio-ASR-Streaming: qwen-audio-3.1-asr-flash-streaming, qwen-audio-3.0-asr-flash-streaming
  • Qwen-Audio-ASR-Filetrans: qwen-audio-3.1-asr-flash-filetrans, qwen-audio-3.0-asr-flash-filetrans
  • Qwen-Audio-ASR-Message: qwen-audio-3.1-asr-flash-message
  • Fun-ASR-Realtime: fun-asr-realtime
  • Fun-ASR-Flash: fun-asr-flash-2026-06-15
  • Fun-ASR: fun-asr

Usage limits

  • Hotword limits
  • Hotword text rules
  • Context limits
LimitDescription
Number of hotword listsUp to 50 precompiled vocabularies per account, shared across all models. Each vocabulary has a vocabulary_id.
HotwordsQwen-Audio-ASR-Message, Qwen-Audio-ASR-Streaming, Qwen-Audio-ASR-Filetrans, and Qwen-Audio-ASR series: up to 2000.
Main-version models in the Fun-ASR-Realtime, Fun-ASR-Flash, and Fun-ASR series: up to 2000. Other models in these series and the Paraformer series: up to 500.
Counts apply per vocabulary for precompiled hotwords and per request for instant hotwords.
Super hotwordsA maximum of 50 entries can have a weight of 50.
For the Qwen-Audio-ASR-Message, Qwen-Audio-ASR-Streaming, Qwen-Audio-ASR-Filetrans, and Qwen-Audio-ASR series, when both precompiled and instant hotwords are configured, the service merges the two sets. If the merged set exceeds 2000 hotwords, it randomly selects 2000 to use.

Feature billing

Instant and precompiled hotword features are free. For model invocation charges when using hotwords or contextual biasing, see billing rules.