Skip to main content
R

dsh-asr-fusion

ramwin/dsh-asr-fusion

Runs two or more speech-recognition engines on the same recording and merges them into one transcript, with a per-engine confidence and an overall agreement score.

Install

dsh plugin --profile web add github:ramwin/dsh-asr-fusion

README

dsh-asr-fusion

Multiple speech-recognition engines, one transcript — with per-engine confidence.

npm license

把一个录音同时交给两个以上 ASR 引擎(本地 whisper.cpp、本地 SenseVoice、任意 OpenAI 兼容的云端端点),融合成一条转写,并给出每个引擎的置信度与整体一致性。

它注册成一个 speech-to-text Provider,所以 DSH 现有语音输入界面(麦克风、 语言选择、准备状态)直接可用。

安装

dsh plugin --profile web add dsh-asr-fusion

或在 Plugins 页面按包名安装。装完刷新页面,在语音输入的识别器里会多出 Fused ASR(id fused)。

为什么值得多跑一个引擎

同一批真人录音(中文夹技术英文,10 句 / 23 个术语点 / 147 个中文字)实测:

方案英文术语保留中文 CER
Whisper large-v3-turbo 裸14/23 (61%)24.5%
SenseVoice 裸10/23 (43%)10.2%
Whisper + 润色21/23 (91%)13.6%
SenseVoice + 润色19/23 (83%)6.8%
两引擎融合20/23 (87%)6.8%

两个引擎错的地方不一样;融合同时拿到术语保留率和中文准确率。

配置与契约

摘要:

- id: asr-fusion
  config:
    engines:
      - { id: whisper, kind: whisper, modelPath: /path/to/ggml-large-v3-turbo.bin }
      - { id: sensevoice, kind: sensevoice, modelPath: /path/to/model.onnx, tokensPath: /path/to/tokens.txt }
      - { id: cloud, kind: openai, endpoint: https://…/v1/audio/transcriptions, model: …, apiKey: … }
    fusion: { strategy: llm-merge }   # 或 weighted-best

引擎数量不设上限;openai 可以写多次。

置信度

confidence(0..1)默认来自跨引擎一致性(归一化编辑相似度的加权组合),而不是 伪造的声学概率;confidenceSource 字段标明来源。算法与性质见 FUSION-SCHEMA.md。

完整融合记录写进 ~/.dsh/asr-fusion/fusions.jsonl(保留最近 50 条),Agent 也可以用 asr_fusion_last 工具查询。

依赖

插件本身零运行时依赖:引擎包(@fugood/whisper.node、sherpa-onnx-node)按需从 profile 或 dsh 安装目录加载,缺失的引擎会被标为不可用,不影响其余引擎。

License

MIT

Related plugins