| 项目 | 说明 |
|---|---|
| 模型名 | iic/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch |
| 任务类型 | Automatic Speech Recognition (ASR) |
| 模型架构 | SeACo-Paraformer (FunASR) |
| 语言 | 中文 |
| 采样率 | 16kHz |
| 词表大小 | 8404 |
| 来源 | ModelScope / 达摩院 FunASR |
| 特性 | 支持离线热词增强识别 |
| 项目 | 版本 |
|---|---|
| NPU | Ascend910 |
| CANN | 8.5.1 |
| Python | 3.11.14 |
| torch | 2.9.0+cpu |
| torch_npu | 2.9.0.post1 |
| funasr | 1.3.1 |
使用 ModelScope snapshot_download 下载模型到本地缓存:
from modelscope import snapshot_download
model_dir = snapshot_download("iic/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch")模型文件包括:model.pt(权重)、config.yaml(配置)、tokens.json(词表)、am.mvn(均值方差)、seg_dict(分词词典)。
example/asr_example.wavassets/hotword.txt(内容:魔搭)python inference.py推理使用 funasr.AutoModel 加载本地模型到 npu:0,执行 model.generate(input=audio) 完成语音识别。
NPU 转写文本:欢 迎 大 家 来 到 魔 搭 社 区 进 行 体 验
通过 register_forward_hook 捕获 encoder 中间输出 tensor 进行数值对比。
| 指标 | 值 |
|---|---|
| max_abs_error | 0.000080 |
| mean_abs_error | 0.000003 |
| relative_error | 0.0578% |
| cosine_similarity | 1.000000 |
| threshold | 1.0% |
| result | PASS |
| 指标 | 值 |
|---|---|
| avg_latency_ms | 560.30 |
| min_latency_ms | 514.03 |
| max_latency_ms | 944.71 |
| p50_latency_ms | 517.68 |
| p90_latency_ms | 564.96 |
| p95_latency_ms | 754.84 |
| audio_duration_sec | 4.52 |
| real_time_factor | 0.1239 |
iic-speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch-NPU/
├── assets/
│ ├── test.wav # 16kHz 单声道测试音频
│ └── hotword.txt # 热词文件
├── logs/
│ ├── env_check.log # 环境检查结果
│ ├── inference.log # NPU 推理日志
│ ├── eval_consistency.log # 一致性校验日志
│ └── benchmark.log # 性能测试日志
├── screenshots/
│ └── self_verification.txt # 自验证清单
├── models/ # 模型权重目录(.gitignore)
├── model_utils.py # 音频加载 + 模型加载封装
├── inference.py # NPU 推理入口
├── eval_consistency.py # CPU-NPU 数值一致性校验
├── benchmark.py # 性能测试
├── requirements.txt # 依赖列表
├── .gitignore # 排除 models/ 和权重文件
└── README.md # 本文件# 安装依赖
pip install -r requirements.txt
# 下载模型(首次运行)
python -c "from modelscope import snapshot_download; snapshot_download('iic/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch')"
# NPU 推理
python inference.py
# CPU-NPU 一致性验证
python eval_consistency.py
# 性能测试
python benchmark.py本模型为 SeACo-Paraformer,支持离线热词增强识别。热词通过 hotword.txt 文件传入,在推理时作为额外上下文提升特定词汇的识别准确率。热词能力为附加特性,基础 ASR 适配不依赖热词功能。
#NPU