pengzhendong commited on
Commit
a1833f8
·
1 Parent(s): 1b10e1d

update images

Browse files
README.md CHANGED
@@ -1,3 +1,138 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ frameworks: PyTorch
3
+ license: Apache License 2.0
4
+ tags: []
5
+ tasks:
6
+ - auto-speech-recognition
7
+ ---
8
+
9
+ # Fun-ASR
10
+
11
+ 「[简体中文](README_zh.md)」|「English」
12
+
13
+ Fun-ASR is an end-to-end speech recognition large model launched by Tongyi Lab. It is trained on tens of millions of hours of real speech data, possessing powerful contextual understanding capabilities and industry adaptability. It supports low-latency real-time transcription and covers 31 languages. It excels in vertical domains such as education and finance, accurately recognizing professional terminology and industry expressions, effectively addressing challenges like "hallucination" generation and language confusion, achieving "clear hearing, understanding meaning, and accurate writing."
14
+
15
+ <div align="center">
16
+ <img src="images/funasr-v2.png">
17
+ </div>
18
+
19
+ <div align="center">
20
+ <h4>
21
+ <a href="https://funaudiollm.github.io/Fun-ASR/"> Homepage </a>
22
+ |<a href="#core-features"> Core Features </a>
23
+ |<a href="#performance-evaluation"> Performance Evaluation </a>
24
+ |<a href="#environment-setup"> Environment Setup </a>
25
+ |<a href="#usage-tutorial"> Usage Tutorial </a>
26
+
27
+ </h4>
28
+
29
+ Model Repository: [modelscope](https://www.modelscope.cn/models/FunAudioLLM/Fun-ASR-Nano-2512), [huggingface](https://huggingface.co/FunAudioLLM/FunASR)
30
+
31
+ Online Experience:
32
+ [ModelScope Community Space](https://modelscope.cn/studios/FunAudioLLM/Fun-ASR-Nano), [huggingface space](https://huggingface.co/spaces/FunAudioLLM/FunASR)
33
+
34
+ </div>
35
+
36
+ # Core Features 🎯
37
+
38
+ **Fun-ASR** focuses on high-precision speech recognition, multi-language support, and industry customization capabilities
39
+
40
+ - **Far-field High-noise Recognition:** Deeply optimized for far-distance sound pickup and high-noise scenarios (such as conference rooms, in-vehicle environments, industrial sites, etc.), improving recognition accuracy to **93%**.
41
+ - **Chinese Dialects and Regional Accents:**
42
+ - Supports **7 major dialects**: Wu, Cantonese, Min, Hakka, Gan, Xiang, Jin
43
+ - Covers **26 regional accents**: including Henan, Shaanxi, Hubei, Sichuan, Chongqing, Yunnan, Guizhou, Guangdong, Guangxi and more than 20 other regions
44
+ - **Multi-language Free Speech:** Supports recognition of **31 languages**, with focused optimization on East and Southeast Asian languages, supporting free language switching and mixed recognition.
45
+ - **Music Background Lyric Recognition:** Enhanced speech recognition performance under music background interference, supporting accurate recognition of lyric content in songs.
46
+
47
+ # Environment Setup 🐍
48
+
49
+ ```shell
50
+ pip install -r requirements.txt
51
+ ```
52
+
53
+ <a name="usage-tutorial"></a>
54
+
55
+ # TODO
56
+
57
+ - [ ] Support returning timestamps
58
+ - [ ] Support speaker diarization
59
+ - [ ] Support model training
60
+
61
+ # Usage 🛠️
62
+
63
+ ## Inference
64
+
65
+ ### Using funasr for inference
66
+
67
+ ```python
68
+ from funasr import AutoModel
69
+
70
+
71
+ def main():
72
+ model_dir = "FunAudioLLM/fun-asr-nano"
73
+ model = AutoModel(
74
+ model=model_dir,
75
+ trust_remote_code=True,
76
+ remote_code="./model.py",
77
+ device="cuda:0",
78
+ )
79
+
80
+ wav_path = f"{model.model_path}/example/zh.mp3"
81
+ res = model.generate(input=[wav_path], cache={}, batch_size=1)
82
+ text = res[0]["text"]
83
+ print(text)
84
+
85
+ model = AutoModel(
86
+ model=model_dir,
87
+ trust_remote_code=True,
88
+ vad_model="fsmn-vad",
89
+ vad_kwargs={"max_single_segment_time": 30000},
90
+ remote_code="./model.py",
91
+ device="cuda:0",
92
+ )
93
+ res = model.generate(input=[wav_path], cache={}, batch_size=1)
94
+ text = res[0]["text"]
95
+ print(text)
96
+
97
+
98
+ if __name__ == "__main__":
99
+ main()
100
+ ```
101
+
102
+ ### Direct Inference
103
+
104
+ ```python
105
+ from model import FunASRNano
106
+
107
+
108
+ def main():
109
+ model_dir = "FunAudioLLM/fun-asr-nano"
110
+ m, kwargs = FunASRNano.from_pretrained(model=model_dir, device="cuda:0")
111
+ m.eval()
112
+
113
+ wav_path = f"{kwargs['model_path']}/example/zh.mp3"
114
+ res = m.inference(data_in=[wav_path], **kwargs)
115
+ text = res[0][0]["text"]
116
+ print(text)
117
+
118
+
119
+ if __name__ == "__main__":
120
+ main()
121
+ ```
122
+
123
+ <details><summary> Parameter Description (click to expand) </summary>
124
+
125
+ - `model_dir`: Model name or local disk model path.
126
+ - `trust_remote_code`: Whether to trust remote code for loading custom model implementations.
127
+ - `remote_code`: Specify the location of specific model code (e.g., `model.py` in the current directory), supporting both absolute and relative paths.
128
+ - `device`: Specify the device to use, such as "cuda:0" or "cpu".
129
+
130
+ </details>
131
+
132
+ # Performance Evaluation 📝
133
+
134
+ We compared the multi-language speech recognition performance of Fun-ASR with other models on open-source benchmark datasets (including AISHELL-1, AISHELL-2, Wenetspeech, Librispeech, and Common Voice).
135
+
136
+ <div align="center">
137
+ <img src="images/compare_en.png" width="800" />
138
+ </div>
README_zh.md ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ frameworks: PyTorch
3
+ license: Apache License 2.0
4
+ tags: []
5
+ tasks:
6
+ - auto-speech-recognition
7
+ ---
8
+
9
+ # Fun-ASR
10
+
11
+ 「简体中文」|「[English](README.md)」
12
+
13
+ Fun-ASR 是通义实验室推出的端到端语音识别大模型,是基于数千万小时真实语音数据训练而成,具备强大的上下文理解能力与行业适应性,支持低延迟实时听写,并且覆盖 31 个语种。在教育、金融等垂直领域表现出色,能准确识别专业术语与行业表达,有效应对"幻觉"生成和语种混淆等挑战,实现"听得清、懂其意、写得准"。
14
+
15
+ <div align="center">
16
+ <img src="images/funasr-v2.png">
17
+ </div>
18
+
19
+ <div align="center">
20
+ <h4>
21
+ <a href="https://funaudiollm.github.io/Fun-ASR/"> Homepage </a>
22
+ |<a href="#核心特性"> 核心特性 </a>
23
+ |<a href="#性能评测"> 性能评测 </a>
24
+ |<a href="#环境安装"> 环境安装 </a>
25
+ |<a href="#用法教程"> 用法教程 </a>
26
+
27
+ </h4>
28
+
29
+ 模型仓库:[modelscope](https://www.modelscope.cn/models/FunAudioLLM/Fun-ASR-Nano-2512),[huggingface(coming)](https://huggingface.co/FunAudioLLM/FunASR)
30
+
31
+ 在线体验:
32
+ [魔搭社区创空间](https://modelscope.cn/studios/FunAudioLLM/Fun-ASR-Nano),[huggingface space(coming)](https://huggingface.co/spaces/FunAudioLLM/FunASR)
33
+
34
+ </div>
35
+
36
+ # 核心特性 🎯
37
+
38
+ **Fun-ASR** 专注于高精度语音识别、多语言支持和行业定制化能力
39
+
40
+ - **远场高噪声识别:** 针对远距离拾音及高噪声场景(如会议室、车载环境、工业现场等)进行深度优化,识别准确率提升至 **93%**。
41
+ - **中文方言与地方口音:**
42
+ - 支持 **7 大方言**:吴语、粤语、闽语、客家话、赣语、湘语、晋语
43
+ - 覆盖 **26 个地区口音**:包括河南、陕西、湖北、四川、重庆、云南、贵州、广东、广西等 20 多个地区
44
+ - **多语言自由说:** 支持 **31 种语言**识别,重点优化东亚与东南亚语种,支持语种自由切换和混合识别。
45
+ - **音乐背景歌词识别:** 强化在音乐背景干扰下的语音识别性能,支持对歌曲中歌词内容的精准识别。
46
+
47
+ # 环境安装 🐍
48
+
49
+ ```shell
50
+ pip install -r requirements.txt
51
+ ```
52
+
53
+ <a name="用法教程"></a>
54
+
55
+ # TODO
56
+
57
+ - [ ] 支持返回时间戳
58
+ - [ ] 支持区分说话人识别
59
+ - [ ] 支持模型训练
60
+
61
+ # 用法 🛠️
62
+
63
+ ## 推理
64
+
65
+ ### 使用 funasr 推理
66
+
67
+ ```python
68
+ from funasr import AutoModel
69
+
70
+
71
+ def main():
72
+ model_dir = "FunAudioLLM/fun-asr-nano"
73
+ model = AutoModel(
74
+ model=model_dir,
75
+ trust_remote_code=True,
76
+ remote_code="./model.py",
77
+ device="cuda:0",
78
+ )
79
+
80
+ wav_path = f"{model.model_path}/example/zh.mp3"
81
+ res = model.generate(input=[wav_path], cache={}, batch_size=1)
82
+ text = res[0]["text"]
83
+ print(text)
84
+
85
+ model = AutoModel(
86
+ model=model_dir,
87
+ trust_remote_code=True,
88
+ vad_model="fsmn-vad",
89
+ vad_kwargs={"max_single_segment_time": 30000},
90
+ remote_code="./model.py",
91
+ device="cuda:0",
92
+ )
93
+ res = model.generate(input=[wav_path], cache={}, batch_size=1)
94
+ text = res[0]["text"]
95
+ print(text)
96
+
97
+
98
+ if __name__ == "__main__":
99
+ main()
100
+ ```
101
+
102
+ ### 直接推理
103
+
104
+ ```python
105
+ from model import FunASRNano
106
+
107
+
108
+ def main():
109
+ model_dir = "FunAudioLLM/fun-asr-nano"
110
+ m, kwargs = FunASRNano.from_pretrained(model=model_dir, device="cuda:0")
111
+ m.eval()
112
+
113
+ wav_path = f"{kwargs['model_path']}/example/zh.mp3"
114
+ res = m.inference(data_in=[wav_path], **kwargs)
115
+ text = res[0][0]["text"]
116
+ print(text)
117
+
118
+
119
+ if __name__ == "__main__":
120
+ main()
121
+ ```
122
+
123
+ <details><summary> 参数说明(点击展开)</summary>
124
+
125
+ - `model_dir`:模型名称,或本地磁盘中的模型路径。
126
+ - `trust_remote_code`:是否信任远程代码,用于加载自定义模型实现。
127
+ - `remote_code`:指定模型具体代码的位置(例如,当前目录下的 `model.py`),支持绝对路径与相对路径。
128
+ - `device`:指定使用的设备,如 "cuda:0" 或 "cpu"。
129
+
130
+ </details>
131
+
132
+ # 性能评测 📝
133
+
134
+ 我们在开源基准数据集、中文方言测试集和工业测试集上,比较了 Fun-ASR 与其他模型的多语言语音识别性能。Fun-ASR 模型均具有明显的效果优势。
135
+
136
+ <div align="center">
137
+ <img src="images/compare_zh.png" width="800" />
138
+ </div>
images/compare_en.png ADDED

Git LFS Details

  • SHA256: 9c30014920ba46df9dca1030acdc4ca15311e75b3b26e5a00ea6ae80a019c451
  • Pointer size: 131 Bytes
  • Size of remote file: 214 kB
images/compare_zh.png ADDED

Git LFS Details

  • SHA256: 8c56704ba4aed9756884251e3a499e44784b4dac2bb5252afe118e37498ea728
  • Pointer size: 131 Bytes
  • Size of remote file: 162 kB
images/funasr-v2.png ADDED

Git LFS Details

  • SHA256: 0663f9c2fd384ac840df8045e76a52cccd3eb963fe3d351c63ae7fbbf686cd99
  • Pointer size: 131 Bytes
  • Size of remote file: 252 kB