Skip to content

Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.

12.0 KB
Raw Blame
<!DOCTYPE html>

<html lang="en"><head><meta charset="utf-8"/><meta content="width=device-width,initial-scale=1" name="viewport"/>
<title>Hotwords not working? Check the request path and installed package | FunASR</title><meta content="Check hotword encoding, standalone package versions and batched timestamps, without confusing interface fixes with recognition accuracy guarantees." name="description"/>
<link href="/logo.png" rel="icon"/><meta content="Hotwords not working? Check the request path and installed package" property="og:title"/><meta content="Check hotword encoding, standalone package versions and batched timestamps, without confusing interface fixes with recognition accuracy guarantees." property="og:description"/>
<meta content="article" property="og:type"/><meta content="https://www.funasr.com/en/blog/hotwords-package-boundaries.html" property="og:url"/><meta content="https://www.funasr.com/logo.png" property="og:image"/>
<link href="https://www.funasr.com/en/blog/hotwords-package-boundaries.html" rel="canonical"/><link href="https://www.funasr.com/en/blog/hotwords-package-boundaries.html" hreflang="en" rel="alternate"/><link href="https://www.funasr.com/blog/hotwords-package-boundaries.html" hreflang="zh" rel="alternate"/><link href="https://www.funasr.com/en/blog/hotwords-package-boundaries.html" hreflang="x-default" rel="alternate"/>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&amp;display=swap" rel="stylesheet"/>
<script type="application/ld+json">{"@context":"https://schema.org","@type":"BlogPosting","headline":"Hotwords not working? Check the request path and installed package","description":"Check hotword encoding, standalone package versions and batched timestamps, without confusing interface fixes with recognition accuracy guarantees.","datePublished":"2026-11-13","dateModified":"2026-11-13","author":{"@type":"Organization","name":"FunASR / Tongyi Lab"},"publisher":{"@type":"Organization","name":"FunASR","logo":{"@type":"ImageObject","url":"https://www.funasr.com/logo.png"}},"mainEntityOfPage":{"@type":"WebPage","@id":"https://www.funasr.com/en/blog/hotwords-package-boundaries.html"},"image":"https://www.funasr.com/logo.png"}</script>
<style>:root{--primary:#2563eb;--primary-dark:#1d4ed8;--bg:#fff;--surface:#f8fafc;--border:#e2e8f0;--text:#0f172a;--text-soft:#475569;--text-muted:#94a3b8;--radius:12px}
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:'Inter',-apple-system,sans-serif;color:var(--text);line-height:1.7}
a{color:var(--primary);text-decoration:none}a:hover{text-decoration:underline}
.container{max-width:800px;margin:0 auto;padding:0 24px}
.nav{position:fixed;top:0;left:0;right:0;z-index:100;background:rgba(255,255,255,0.9);backdrop-filter:blur(12px);border-bottom:1px solid var(--border);padding:14px 0}
.nav .container{max-width:1120px;display:flex;align-items:center;gap:24px}
.nav-logo{font-size:1.2rem;font-weight:800;color:var(--text)}.nav-logo span{color:var(--primary)}
.nav-links{display:flex;gap:20px;margin-left:auto;flex-wrap:wrap}
.nav-links a{font-size:0.85rem;font-weight:500;color:var(--text-soft)}
.nav-btn{padding:7px 16px;background:var(--primary);color:#fff;border-radius:7px;font-size:0.83rem;font-weight:600}
article{padding:120px 0 80px}
h1{font-size:2rem;font-weight:800;line-height:1.3;margin-bottom:14px}
h2{font-size:1.3rem;font-weight:700;margin:36px 0 14px;padding-top:16px;border-top:1px solid var(--border)}
h3{font-size:1.05rem;font-weight:700;margin:22px 0 10px}
p{margin-bottom:14px;color:var(--text-soft)}
ul,ol{margin:0 0 14px 22px;color:var(--text-soft)}li{margin-bottom:6px}
table{width:100%;border-collapse:collapse;margin:16px 0;font-size:0.86rem}
th,td{padding:10px 12px;text-align:left;border-bottom:1px solid var(--border)}
th{font-weight:600;background:var(--surface);font-size:0.78rem;color:var(--text-muted)}
pre{background:#1e293b;color:#e2e8f0;padding:18px;border-radius:10px;overflow-x:auto;font-size:0.82rem;line-height:1.7;margin:14px 0}
code{font-family:ui-monospace,Menlo,monospace}
p code,li code{background:var(--surface);padding:2px 6px;border-radius:5px;font-size:0.85em;color:var(--primary-dark)}
.post-meta{color:var(--text-muted);font-size:0.85rem;margin-bottom:24px}
.cta{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:24px;margin:28px 0;text-align:center}
.cta a.btn{display:inline-block;padding:10px 24px;background:var(--primary);color:#fff;border-radius:8px;font-weight:600}
.post-list{list-style:none;margin:0;padding:0}
.post-list li{margin:0 0 8px}
.post-card{display:block;border:1px solid var(--border);border-radius:var(--radius);padding:20px 22px;margin-bottom:14px}
.post-card:hover{border-color:var(--primary);text-decoration:none}
.post-card h2{border:none;padding:0;margin:0 0 6px;font-size:1.15rem;color:var(--text)}
.post-card p{margin:0;color:var(--text-soft);font-size:0.9rem}
.post-card .date{color:var(--text-muted);font-size:0.8rem}
footer{background:#0f172a;color:#94a3b8;padding:28px 0;text-align:center;font-size:0.8rem}
footer a{color:#94a3b8}
@media(max-width:900px){.nav-links{display:none}.nav .container{gap:16px}.nav-logo{margin-right:auto}h1{font-size:1.75rem}table{table-layout:fixed;font-size:0.78rem}th,td{padding:8px 4px;overflow-wrap:anywhere}p code,li code{overflow-wrap:anywhere;word-break:break-word}}
article p a,article li a{color:#006a57;text-decoration:underline;text-underline-offset:.15em}
</style></head><body>
<nav class="nav"><div class="container"><a class="nav-logo" href="/">Fun<span>ASR</span></a><div class="nav-links"><a href="/en/#capabilities">Capabilities</a><a href="/en/#usage">How to Use</a><a href="/en/#benchmark">Benchmark</a><a href="/en/#demo">Demo</a><a href="https://modelscope.github.io/FunASR/" target="_blank">Docs</a><a href="/en/quickstart.html">Quickstart</a><a href="/en/models.html">Models</a><a href="/en/ecosystem.html">Ecosystem</a><a href="/en/blog/">Blog</a><a href="/en/vs-whisper.html">vs Whisper</a><a href="/en/donors.html">Donors</a></div><a href="https://www.funasr.com/blog/hotwords-package-boundaries.html" style="font-size:0.83rem;font-weight:600;color:var(--text-soft)">中文</a><a class="nav-btn" href="/go/github" target="_blank">GitHub ★</a></div></nav>
<article><div class="container"><h1>Hotwords not working? Check the request path and installed package</h1>
<p class="post-meta">FunASR Blog · 2026-11-13</p>
<p class="lead" data-editorial="opening">Your team may use hotwords for product names and personal names. Before expanding the vocabulary, check that the terms sent by the client actually reach the model in a supported form.</p>
<p data-editorial="example">A client may encode two weighted terms as a JSON object, then place that JSON string inside a WebSocket message. The server must not treat braces, quotes and numbers as the terms themselves. Here is how to check the message, server script and standalone runtime separately.</p>
<p data-editorial="boundary">Hotwords are hints, not forced replacements or accuracy guarantees. This article describes verified protocol and runtime boundaries, not a new recognition benchmark, speed ranking or production deployment guarantee.</p>
<h2>1. Identify the entry point you actually use</h2>
<table><thead><tr><th>Entry point</th><th>What to check</th></tr></thead><tbody>
<tr><td>Python WebSocket server</td><td>The actual source revision of <code>runtime/python/websocket/funasr_wss_server.py</code>.</td></tr>
<tr><td>Standalone Torch runtime</td><td><code>funasr-torch==0.1.7</code>, imported as <code>funasr_torch</code>.</td></tr>
<tr><td>Standalone ONNX runtime</td><td><code>funasr-onnx==0.4.11</code>, imported as <code>funasr_onnx</code>.</td></tr>
</tbody></table>
<p>These are separate deliverables. Updating the root <code>funasr</code> package does not update a copied server script or replace a standalone runtime installation. The WebSocket fix is tracked in <a href="https://github.com/modelscope/FunASR/pull/3892">#3892, preserving the original #3880 author history</a>. One version number is not proof that the entire service was upgraded.</p>
<h2>2. Turn JSON hotwords into model input</h2>
<p>This example only encodes a message. It does not start a server, download weights or transmit audio:</p>
<pre><code data-language="python">import json

hotwords = {"阿里巴巴": 20, "通义实验室": 30}
message = {"hotwords": json.dumps(hotwords, ensure_ascii=False)}
assert json.loads(message["hotwords"]) == hotwords
print(json.dumps(message, ensure_ascii=False))</code></pre>
<p>The fixed Python server joins JSON object keys with spaces and supplies them to both offline and online model parameters. An empty object becomes an empty string. Plain strings and strings that cannot be parsed as JSON retain their original text. This AutoModel interface does not accept numeric hotword weights, so <strong>20 and 30 do not become relative model bias strengths</strong>. Check the chosen model and deployment protocol separately if weighted biasing is required.</p>
<p>A complete client must also follow its audio and chunking protocol. The snippet is not a complete streaming client, nor proof that other message formats are compatible. Configure TLS, authentication and resource limits for deployment. Do not put private audio, transcripts or sensitive vocabulary into public logs.</p>
<h2>3. Verify the installed and imported Torch package</h2>
<p>Use a dedicated test environment, install the pinned version, then inspect package metadata and the import location. Do not modify a shared serving environment directly:</p>
<pre><code data-language="shell">python -m pip install "funasr-torch==0.1.7"
python -m pip check
python -c 'import importlib.metadata as m, funasr_torch; print(m.version("funasr-torch")); print(funasr_torch.__file__)'</code></pre>
<p>The exported embedding used by the Contextual and Seaco wrappers has a hotword width of ten. Version 0.1.7 removes empty whitespace entries, retains the first ten characters of longer terms, and keeps indexes within that embedding range. This fixes a runtime boundary; it does not preserve the truncated suffix as a hint. Prefer short, distinctive terms and check both useful matches and false triggers on recordings you are authorized to process.</p>
<h2>4. Compare individual and batched timestamps</h2>
<p>Run a short recording and a long recording individually, then together in a batch. Check output count, text and timestamps against each recording. The Paraformer change in 0.1.7 slices each peak sequence by its own feature length, preventing padded frames from extending the shorter recording's final timestamp. The package also includes terminal abbreviation grouping and word-boundary fixes for rich-transcription segments.</p>
<p>Installed behavior is tested separately for the wheel and source distribution. Existing real GPU evidence uses synthetic fixtures and is bound to the runtime source file by file. It is not a new pretrained-model accuracy evaluation or a full compatibility guarantee for every model and device. Your own languages, noise conditions and recording lengths still need acceptance testing.</p>
<h2>Release artifacts and your next step</h2>
<p>See the <a href="https://github.com/modelscope/FunASR/releases/tag/runtime-torch-v0.1.7">Torch 0.1.7 release and checksums</a>, <a href="https://pypi.org/project/funasr-torch/0.1.7/">PyPI package</a> and <a href="https://github.com/modelscope/FunASR/releases/tag/runtime-onnx-v0.4.11">ONNX 0.4.11 release</a>. Source changes are tracked in <a href="https://github.com/modelscope/FunASR/pull/3882">#3882</a>, <a href="https://github.com/modelscope/FunASR/pull/3871">#3871</a> and <a href="https://github.com/modelscope/FunASR/pull/3869">#3869</a>.</p>
<p data-editorial="next-step">Next, use a small set of authorized recordings and the <a href="/en/blog/meeting-transcript-acceptance.html">meeting-transcript acceptance checklist</a> to inspect terminology, omissions and timestamps before upgrading your service.</p>
</div></article>
<footer><div class="container">FunASR · Open-source speech recognition by Tongyi Lab · <a href="/go/github">GitHub</a></div></footer>
</body></html>