Add pipeline tag, paper link and sample usage to model card

#1
by nielsr HF Staff - opened
Files changed (1) hide show
  1. README.md +24 -439
README.md CHANGED
@@ -1,8 +1,9 @@
1
  ---
2
- license: apache-2.0
3
  language:
4
- - en
5
- - zh
 
 
6
  tags:
7
  - Language Identification
8
  - LID
@@ -15,376 +16,42 @@ tags:
15
 
16
  <div align="center">
17
  <h1>
18
- FireRedASR2S
19
  <br>
20
- A SOTA Industrial-Grade All-in-One ASR System
21
  </h1>
22
 
23
  </div>
24
 
25
- [[Paper]](https://arxiv.org/pdf/2501.14350)
26
- [[Model]](https://huggingface.co/FireRedTeam)
27
  [[Blog]](https://fireredteam.github.io/demos/firered_asr/)
28
  [[Demo]](https://huggingface.co/spaces/FireRedTeam/FireRedASR)
29
 
30
 
31
- FireRedASR2S is a state-of-the-art (SOTA), industrial-grade, all-in-one ASR system with ASR, VAD, LID, and Punc modules. All modules achieve SOTA performance:
32
- - **FireRedASR2**: Automatic Speech Recognition (ASR) supporting Chinese (Mandarin, 20+ dialects/accents), English, code-switching, and singing lyrics recognition. 2.89% average CER on Mandarin (4 test sets), 11.55% on Chinese dialects (19 test sets), outperforming Doubao-ASR, Qwen3-ASR-1.7B, Fun-ASR, and Fun-ASR-Nano-2512. FireRedASR2-AED also supports word-level timestamps and confidence scores.
33
- - **FireRedVAD**: Voice Activity Detection (VAD) supporting speech/singing/music in 100+ languages. 97.57% F1, outperforming Silero-VAD, TEN-VAD, and FunASR-VAD. Supports non-streaming/streaming VAD and Audio Event Detection.
34
- - **FireRedLID**: Spoken Language Identification (LID) supporting 100+ languages and 20+ Chinese dialects/accents. 97.18% accuracy, outperforming Whisper and SpeechBrain-LID.
35
- - **FireRedPunc**: Punctuation Prediction (Punc) for Chinese and English. 78.90% average F1, outperforming FunASR-Punc (62.77%).
36
-
37
- *`2S`: `2`nd-generation FireRedASR, now expanded to an all-in-one ASR `S`ystem*
38
 
 
39
 
40
  ## 🔥 News
41
- - [2026.02.12] We release FireRedASR2S (FireRedASR2-AED, FireRedVAD, FireRedLID, and FireRedPunc) with model weights and inference code. Download links below. Technical report and finetuning code coming soon.
42
-
43
-
44
-
45
- ## Available Models and Languages
46
-
47
- |Model|Supported Languages & Dialects|Download|
48
- |:-------------:|:---------------------------------:|:----------:|
49
- |FireRedASR2| Chinese (Mandarin and 20+ dialects/accents<sup>*</sup>), English, Code-Switching | [🤗](https://huggingface.co/FireRedTeam/FireRedASR2-AED) \| [🤖](https://modelscope.cn/collections/FireRedTeam/FireRedASR2S)|
50
- |FireRedVAD | 100+ languages, 20+ Chinese dialects/accents<sup>*</sup> | [🤗](https://huggingface.co/FireRedTeam/FireRedVAD) \| [🤖](https://modelscope.cn/collections/FireRedTeam/FireRedVAD)|
51
- |FireRedLID | 100+ languages, 20+ Chinese dialects/accents<sup>*</sup> | [🤗](https://huggingface.co/FireRedTeam/FireRedLID) \| [🤖](https://modelscope.cn/collections/FireRedTeam/FireRedLID)|
52
- |FireRedPunc| Chinese, English | [🤗](https://huggingface.co/FireRedTeam/FireRedPunc) \| [🤖](https://modelscope.cn/collections/FireRedTeam/FireRedPunc)|
53
-
54
- <sup>*</sup>Supported Chinese dialects/accents: Cantonese (Hong Kong & Guangdong), Sichuan, Shanghai, Wu, Minnan, Anhui, Fujian, Gansu, Guizhou, Hebei, Henan, Hubei, Hunan, Jiangxi, Liaoning, Ningxia, Shaanxi, Shanxi, Shandong, Tianjin, Yunnan, etc.
55
-
56
-
57
-
58
- ## Method
59
- ### FireRedASR2
60
- FireRedASR2 builds upon [FireRedASR](https://github.com/FireRedTeam/FireRedASR) with improved accuracy, designed to meet diverse requirements in superior performance and optimal efficiency across various applications. It comprises two variants:
61
- - **FireRedASR2-LLM**: Designed to achieve state-of-the-art performance and to enable seamless end-to-end speech interaction. It adopts an Encoder-Adapter-LLM framework leveraging large language model (LLM) capabilities.
62
- - **FireRedASR2-AED**: Designed to balance high performance and computational efficiency and to serve as an effective speech representation module in LLM-based speech models. It utilizes an Attention-based Encoder-Decoder (AED) architecture.
63
-
64
-
65
- ### Other Modules
66
- - **FireRedVAD**: DFSMN-based non-streaming/streaming Voice Activity Detection and Audio Event Detection.
67
- - **FireRedLID**: FireRedASR2-based Spoken Language Identification. See [FireRedLID README](./fireredasr2s/fireredlid/README.md) for language details.
68
- - **FireRedPunc**: BERT-based Punctuation Prediction.
69
-
70
 
71
  ## Evaluation
72
- ### FireRedASR2
73
- Metrics: Character Error Rate (CER%) for Chinese and Word Error Rate (WER%) for English. Lower is better.
74
-
75
- We evaluate FireRedASR2 on 24 public test sets covering Mandarin, 20+ Chinese dialects/accents, and singing.
76
-
77
- - **Mandarin (4 test sets)**: 2.89% (LLM) / 3.05% (AED) average CER, outperforming Doubao-ASR (3.69%), Qwen3-ASR-1.7B (3.76%), Fun-ASR (4.16%) and Fun-ASR-Nano-2512 (4.55%).
78
- - **Dialects (19 test sets)**: 11.55% (LLM) / 11.67% (AED) average CER, outperforming Doubao-ASR (15.39%), Qwen3-ASR-1.7B (11.85%), Fun-ASR (12.76%) and Fun-ASR-Nano-2512 (15.07%).
79
-
80
- *Note: ws=WenetSpeech, md=MagicData, conv=Conversational, daily=Daily-use.*
81
-
82
- |ID|Testset\Model|FireRedASR2-LLM|FireRedASR2-AED|Doubao-ASR|Qwen3-ASR|Fun-ASR|Fun-ASR-Nano|
83
- |:--:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|
84
- | |**Average CER<br>(All, 1-24)** |**9.67** |**9.80** |12.98 |10.12 |10.92 |12.81 |
85
- | |**Average CER<br>(Mandarin, 1-4)** |**2.89** |**3.05** |3.69 |3.76 |4.16 |4.55 |
86
- | |**Average CER<br>(Dialects, 5-23)** |**11.55**|**11.67**|15.39|11.85|12.76|15.07|
87
- |1 |aishell1 |0.64 |0.57 |1.52 |1.48 |1.64 |1.96 |
88
- |2 |aishell2 |2.15 |2.51 |2.77 |2.71 |2.38 |3.02 |
89
- |3 |ws-net |4.44 |4.57 |5.73 |4.97 |6.85 |6.93 |
90
- |4 |ws-meeting |4.32 |4.53 |4.74 |5.88 |5.78 |6.29 |
91
- |5 |kespeech |3.08 |3.60 |5.38 |5.10 |5.36 |7.66 |
92
- |6 |ws-yue-short |5.14 |5.15 |10.51|5.82 |7.34 |8.82 |
93
- |7 |ws-yue-long |8.71 |8.54 |11.39|8.85 |10.14|11.36|
94
- |8 |ws-chuan-easy |10.90|10.60|11.33|11.99|12.46|14.05|
95
- |9 |ws-chuan-hard |20.71|21.35|20.77|21.63|22.49|25.32|
96
- |10|md-heavy |7.42 |7.43 |7.69 |8.02 |9.13 |9.97 |
97
- |11|md-yue-conv |12.23|11.66|26.25|9.76 |33.71|15.68|
98
- |12|md-yue-daily |3.61 |3.35 |12.82|3.66 |2.69 |5.67 |
99
- |13|md-yue-vehicle |4.50 |4.83 |8.66 |4.28 |6.00 |7.04 |
100
- |14|md-chuan-conv |13.18|13.07|11.77|14.35|14.01|17.11|
101
- |15|md-chuan-daily |4.90 |5.17 |3.90 |4.93 |3.98 |5.95 |
102
- |16|md-shanghai-conv |28.70|27.02|45.15|29.77|25.49|37.08|
103
- |17|md-shanghai-daily |24.94|24.18|44.06|23.93|12.55|28.77|
104
- |18|md-wu |7.15 |7.14 |7.70 |7.57 |10.63|10.56|
105
- |19|md-zhengzhou-conv |10.20|10.65|9.83 |9.55 |10.85|13.09|
106
- |20|md-zhengzhou-daily|5.80 |6.26 |5.77 |5.88 |6.29 |8.18 |
107
- |21|md-wuhan |9.60 |10.81|9.94 |10.22|4.34 |8.70 |
108
- |22|md-tianjin |15.45|15.30|15.79|16.16|19.27|22.03|
109
- |23|md-changsha |23.18|25.64|23.76|23.70|25.66|29.23|
110
- |24|opencpop |1.12 |1.17 |4.36 |2.57 |3.05 |2.95 |
111
-
112
- Doubao-ASR (volc.seedasr.auc) tested in early February 2026, and Fun-ASR tested in late November 2025. Our ASR training data does not include any Chinese dialect or accented speech data from MagicData.
113
- - Doubao-ASR (API): https://www.volcengine.com/docs/6561/1354868
114
- - Qwen3-ASR (1.7B): https://github.com/QwenLM/Qwen3-ASR
115
- - Fun-ASR (API): https://help.aliyun.com/zh/model-studio/recording-file-recognition
116
- - Fun-ASR-Nano-2512: https://huggingface.co/FunAudioLLM/Fun-ASR-Nano-2512
117
-
118
-
119
- ### FireRedVAD
120
- We evaluate FireRedVAD on FLEURS-VAD-102, a multilingual VAD benchmark covering 102 languages.
121
-
122
- FireRedVAD achieves SOTA performance, outperforming Silero-VAD, TEN-VAD, FunASR-VAD, and WebRTC-VAD.
123
-
124
- |Metric\Model|FireRedVAD|[Silero-VAD](https://github.com/snakers4/silero-vad)|[TEN-VAD](https://github.com/TEN-framework/ten-vad)|[FunASR-VAD](https://modelscope.cn/models/iic/speech_fsmn_vad_zh-cn-16k-common-pytorch)|[WebRTC-VAD](https://github.com/wiseman/py-webrtcvad)|
125
- |:-------:|:-----:|:------:|:------:|:------:|:------:|
126
- |AUC-ROC↑ |**99.60**|97.99|97.81|- |- |
127
- |F1 score↑ |**97.57**|95.95|95.19|90.91|52.30|
128
- |False Alarm Rate↓ |**2.69** |9.41 |15.47|44.03|2.83 |
129
- |Miss Rate↓|3.62 |3.95 |2.95 |0.42 |64.15|
130
-
131
- <sup>*</sup>FLEURS-VAD-102: We randomly selected ~100 audio files per language from [FLEURS test set](https://huggingface.co/datasets/google/fleurs), resulting in 9,443 audio files with manually annotated binary VAD labels (speech=1, silence=0). This VAD testset will be open sourced (coming soon).
132
-
133
- Note: FunASR-VAD achieves low Miss Rate but at the cost of high False Alarm Rate (44.03%), indicating over-prediction of speech segments.
134
-
135
-
136
  ### FireRedLID
137
  Metric: Utterance-level LID Accuracy (%). Higher is better.
138
 
139
- We evaluate FireRedLID on multilingual and Chinese dialect benchmarks.
140
-
141
- FireRedLID achieves SOTA performance, outperforming Whisper, SpeechBrain-LID, and Dolphin.
142
-
143
- |Testset\Model|Languages|FireRedLID|[Whisper](https://github.com/openai/whisper)|[SpeechBrain](https://huggingface.co/speechbrain/lang-id-voxlingua107-ecapa)|[Dolphin](https://github.com/DataoceanAI/Dolphin)|
144
  |:-----------------:|:---------:|:---------:|:-----:|:---------:|:-----:|
145
  |FLEURS test |82 languages |**97.18** |79.41 |92.91 |-|
146
  |CommonVoice test |74 languages |**92.07** |80.81 |78.75 |-|
147
  |KeSpeech + MagicData|20+ Chinese dialects/accents |**88.47** |-|-|69.01|
148
 
149
 
150
- ### FireRedPunc
151
- Metric: Precision/Recall/F1 Score (%). Higher is better.
152
-
153
- We evaluate FireRedPunc on multi-domain Chinese and English benchmarks.
154
-
155
- FireRedPunc achieves SOTA performance, outperforming FunASR-Punc (CT-Transformer).
156
-
157
- |Testset\Model|#Sentences|FireRedPunc|[FunASR-Punc](https://www.modelscope.cn/models/iic/punc_ct-transformer_zh-cn-common-vocab272727-pytorch)|
158
- |:------------------:|:---------:|:--------------:|:-----------------:|
159
- |Multi-domain Chinese| 88,644 |**82.84 / 83.08 / 82.96** | 77.27 / 74.03 / 75.62 |
160
- |Multi-domain English| 28,641 |**78.40 / 71.57 / 74.83** | 55.79 / 45.15 / 49.91 |
161
- |Average F1 Score | - |**78.90** | 62.77 |
162
-
163
-
164
-
165
-
166
- ## Quick Start
167
- ### Setup
168
- 1. Create a clean Python environment:
169
- ```bash
170
- $ conda create --name fireredasr2s python=3.10
171
- $ conda activate fireredasr2s
172
- $ git clone https://github.com/FireRedTeam/FireRedASR2S.git
173
- $ cd FireRedASR2S # or fireredasr2s
174
- ```
175
-
176
- 2. Install dependencies and set up PATH and PYTHONPATH:
177
- ```bash
178
- $ pip install -r requirements.txt
179
- $ export PATH=$PWD/fireredasr2s/:$PATH
180
- $ export PYTHONPATH=$PWD/:$PYTHONPATH
181
- ```
182
-
183
- 3. Download models:
184
- ```bash
185
- # Download via ModelScope (recommended for users in China)
186
- pip install -U modelscope
187
- modelscope download --model FireRedTeam/FireRedASR2-AED --local_dir ./pretrained_models/FireRedASR2-AED
188
- modelscope download --model FireRedTeam/FireRedVAD --local_dir ./pretrained_models/FireRedVAD
189
- modelscope download --model FireRedTeam/FireRedLID --local_dir ./pretrained_models/FireRedLID
190
- modelscope download --model FireRedTeam/FireRedPunc --local_dir ./pretrained_models/FireRedPunc
191
-
192
- # Download via Hugging Face
193
- pip install -U "huggingface_hub[cli]"
194
- huggingface-cli download FireRedTeam/FireRedASR2-AED --local-dir ./pretrained_models/FireRedASR2-AED
195
- huggingface-cli download FireRedTeam/FireRedVAD --local-dir ./pretrained_models/FireRedVAD
196
- huggingface-cli download FireRedTeam/FireRedLID --local-dir ./pretrained_models/FireRedLID
197
- huggingface-cli download FireRedTeam/FireRedPunc --local-dir ./pretrained_models/FireRedPunc
198
- ```
199
-
200
- 4. Convert your audio to **16kHz 16-bit mono PCM** format if needed:
201
- ```bash
202
- $ ffmpeg -i <input_audio_path> -ar 16000 -ac 1 -acodec pcm_s16le -f wav <output_wav_path>
203
- ```
204
-
205
- ### Script Usage
206
- ```bash
207
- $ cd examples_infer/asr_system
208
- $ bash inference_asr_system.sh
209
- ```
210
-
211
- ### Command-line Usage
212
- ```bash
213
- $ fireredasr2s-cli --help
214
- $ fireredasr2s-cli --wav_paths "assets/hello_zh.wav" "assets/hello_en.wav" --outdir output
215
- $ cat output/result.jsonl
216
- # {"uttid": "hello_zh", "text": "你好世界。", "sentences": [{"start_ms": 310, "end_ms": 1840, "text": "你好世界。", "asr_confidence": 0.875, "lang": "zh mandarin", "lang_confidence": 0.999}], "vad_segments_ms": [[310, 1840]], "dur_s": 2.32, "words": [{"start_ms": 490, "end_ms": 690, "text": "你"}, {"start_ms": 690, "end_ms": 1090, "text": "好"}, {"start_ms": 1090, "end_ms": 1330, "text": "世"}, {"start_ms": 1330, "end_ms": 1795, "text": "界"}], "wav_path": "assets/hello_zh.wav"}
217
- # {"uttid": "hello_en", "text": "Hello speech.", "sentences": [{"start_ms": 120, "end_ms": 1840, "text": "Hello speech.", "asr_confidence": 0.833, "lang": "en", "lang_confidence": 0.998}], "vad_segments_ms": [[120, 1840]], "dur_s": 2.24, "words": [{"start_ms": 340, "end_ms": 1020, "text": "hello"}, {"start_ms": 1020, "end_ms": 1666, "text": "speech"}], "wav_path": "assets/hello_en.wav"}
218
- ```
219
-
220
- ### Python API Usage
221
- ```python
222
- from fireredasr2s import FireRedAsr2System, FireRedAsr2SystemConfig
223
-
224
- asr_system_config = FireRedAsr2SystemConfig() # Use default config
225
- asr_system = FireRedAsr2System(asr_system_config)
226
-
227
- result = asr_system.process("assets/hello_zh.wav")
228
- print(result)
229
- # {'uttid': 'tmpid', 'text': '你好世界。', 'sentences': [{'start_ms': 440, 'end_ms': 1820, 'text': '你好世界。', 'asr_confidence': 0.868, 'lang': 'zh mandarin', 'lang_confidence': 0.999}], 'vad_segments_ms': [(440, 1820)], 'dur_s': 2.32, 'words': [], 'wav_path': 'assets/hello_zh.wav'}
230
-
231
- result = asr_system.process("assets/hello_en.wav")
232
- print(result)
233
- # {'uttid': 'tmpid', 'text': 'Hello speech.', 'sentences': [{'start_ms': 260, 'end_ms': 1820, 'text': 'Hello speech.', 'asr_confidence': 0.933, 'lang': 'en', 'lang_confidence': 0.993}], 'vad_segments_ms': [(260, 1820)], 'dur_s': 2.24, 'words': [], 'wav_path': 'assets/hello_en.wav'}
234
- ```
235
-
236
-
237
-
238
- ## Usage of Each Module
239
- The four components under `fireredasr2s`, i.e. `fireredasr2`, `fireredvad`, `fireredlid`, and `fireredpunc` are self-contained and designed to work as a standalone modules. You can use any of them independently without depending on the others. `FireRedVAD` and `FireRedLID` will also be open-sourced as standalone libraries in separate repositories.
240
-
241
- ### Script Usage
242
- ```bash
243
- # ASR
244
- $ cd examples_infer/asr
245
- $ bash inference_asr_aed.sh
246
- $ bash inference_asr_llm.sh
247
-
248
- # VAD & AED (Audio Event Detection)
249
- $ cd examples_infer/vad
250
- $ bash inference_vad.sh
251
- $ bash inference_streamvad.sh
252
- $ bash inference_aed.sh
253
-
254
- # LID
255
- $ cd examples_infer/lid
256
- $ bash inference_lid.sh
257
-
258
- # Punc
259
- $ cd examples_infer/punc
260
- $ bash inference_punc.sh
261
- ```
262
 
 
263
 
264
  ### Python API Usage
265
- Set up `PYTHONPATH` first: `export PYTHONPATH=$PWD/:$PYTHONPATH`
266
-
267
- #### ASR
268
- ```python
269
- from fireredasr2s.fireredasr2 import FireRedAsr2, FireRedAsr2Config
270
-
271
- batch_uttid = ["hello_zh", "hello_en"]
272
- batch_wav_path = ["assets/hello_zh.wav", "assets/hello_en.wav"]
273
-
274
- # FireRedASR2-AED
275
- asr_config = FireRedAsr2Config(
276
- use_gpu=True,
277
- use_half=False,
278
- beam_size=3,
279
- nbest=1,
280
- decode_max_len=0,
281
- softmax_smoothing=1.25,
282
- aed_length_penalty=0.6,
283
- eos_penalty=1.0,
284
- return_timestamp=True
285
- )
286
- model = FireRedAsr2.from_pretrained("aed", "pretrained_models/FireRedASR2-AED", asr_config)
287
- results = model.transcribe(batch_uttid, batch_wav_path)
288
- print(results)
289
- # [{'uttid': 'hello_zh', 'text': '你好世界', 'confidence': 0.971, 'dur_s': 2.32, 'rtf': '0.0870', 'wav': 'assets/hello_zh.wav', 'timestamp': [('你', 0.42, 0.66), ('好', 0.66, 1.1), ('世', 1.1, 1.34), ('界', 1.34, 2.039)]}, {'uttid': 'hello_en', 'text': 'hello speech', 'confidence': 0.943, 'dur_s': 2.24, 'rtf': '0.0870', 'wav': 'assets/hello_en.wav', 'timestamp': [('hello', 0.34, 0.98), ('speech', 0.98, 1.766)]}]
290
-
291
- # FireRedASR2-LLM
292
- asr_config = FireRedAsr2Config(
293
- use_gpu=True,
294
- decode_min_len=0,
295
- repetition_penalty=1.0,
296
- llm_length_penalty=0.0,
297
- temperature=1.0
298
- )
299
- model = FireRedAsr2.from_pretrained("llm", "pretrained_models/FireRedASR2-LLM", asr_config)
300
- results = model.transcribe(batch_uttid, batch_wav_path)
301
- print(results)
302
- # [{'uttid': 'hello_zh', 'text': '你好世界', 'rtf': '0.0681', 'wav': 'assets/hello_zh.wav'}, {'uttid': 'hello_en', 'text': 'hello speech', 'rtf': '0.0681', 'wav': 'assets/hello_en.wav'}]
303
- ```
304
-
305
-
306
- #### VAD
307
- ```python
308
- from fireredasr2s.fireredvad import FireRedVad, FireRedVadConfig
309
-
310
- vad_config = FireRedVadConfig(
311
- use_gpu=False,
312
- smooth_window_size=5,
313
- speech_threshold=0.4,
314
- min_speech_frame=20,
315
- max_speech_frame=2000,
316
- min_silence_frame=20,
317
- merge_silence_frame=0,
318
- extend_speech_frame=0,
319
- chunk_max_frame=30000)
320
- vad = FireRedVad.from_pretrained("pretrained_models/FireRedVAD/VAD", vad_config)
321
-
322
- result, probs = vad.detect("assets/hello_zh.wav")
323
-
324
- print(result)
325
- # {'dur': 2.32, 'timestamps': [(0.44, 1.82)], 'wav_path': 'assets/hello_zh.wav'}
326
- ```
327
-
328
-
329
- #### Stream VAD
330
- <details>
331
- <summary>Click to expand</summary>
332
-
333
- ```python
334
- from fireredasr2s.fireredvad import FireRedStreamVad, FireRedStreamVadConfig
335
-
336
- vad_config=FireRedStreamVadConfig(
337
- use_gpu=False,
338
- smooth_window_size=5,
339
- speech_threshold=0.4,
340
- pad_start_frame=5,
341
- min_speech_frame=8,
342
- max_speech_frame=2000,
343
- min_silence_frame=20,
344
- chunk_max_frame=30000)
345
- stream_vad = FireRedStreamVad.from_pretrained("pretrained_models/FireRedVAD/Stream-VAD", vad_config)
346
-
347
- frame_results, result = stream_vad.detect_full("assets/hello_zh.wav")
348
-
349
- print(result)
350
- # {'dur': 2.32, 'timestamps': [(0.46, 1.84)], 'wav_path': 'assets/hello_zh.wav'}
351
- ```
352
- </details>
353
-
354
-
355
- #### Audio Event Detection (AED)
356
- <details>
357
- <summary>Click to expand</summary>
358
-
359
- ```python
360
- from fireredasr2s.fireredvad import FireRedAed, FireRedAedConfig
361
-
362
- aed_config=FireRedAedConfig(
363
- use_gpu=False,
364
- smooth_window_size=5,
365
- speech_threshold=0.4,
366
- singing_threshold=0.5,
367
- music_threshold=0.5,
368
- min_event_frame=20,
369
- max_event_frame=2000,
370
- min_silence_frame=20,
371
- merge_silence_frame=0,
372
- extend_speech_frame=0,
373
- chunk_max_frame=30000)
374
- aed = FireRedAed.from_pretrained("pretrained_models/FireRedVAD/AED", aed_config)
375
-
376
- result, probs = aed.detect("assets/event.wav")
377
-
378
- print(result)
379
- # {'dur': 22.016, 'event2timestamps': {'speech': [(0.4, 3.56), (3.66, 9.08), (9.27, 9.77), (10.78, 21.76)], 'singing': [(1.79, 19.96), (19.97, 22.016)], 'music': [(0.09, 12.32), (12.33, 22.016)]}, 'event2ratio': {'speech': 0.848, 'singing': 0.905, 'music': 0.991}, 'wav_path': 'assets/event.wav'}
380
- ```
381
- </details>
382
-
383
-
384
- #### LID
385
- <details>
386
- <summary>Click to expand</summary>
387
-
388
  ```python
389
  from fireredasr2s.fireredlid import FireRedLid, FireRedLidConfig
390
 
@@ -392,101 +59,19 @@ batch_uttid = ["hello_zh", "hello_en"]
392
  batch_wav_path = ["assets/hello_zh.wav", "assets/hello_en.wav"]
393
 
394
  config = FireRedLidConfig(use_gpu=True, use_half=False)
395
- model = FireRedLid.from_pretrained("pretrained_models/FireRedLID", config)
396
 
397
  results = model.process(batch_uttid, batch_wav_path)
398
  print(results)
399
  # [{'uttid': 'hello_zh', 'lang': 'zh mandarin', 'confidence': 0.996, 'dur_s': 2.32, 'rtf': '0.0741', 'wav': 'assets/hello_zh.wav'}, {'uttid': 'hello_en', 'lang': 'en', 'confidence': 0.996, 'dur_s': 2.24, 'rtf': '0.0741', 'wav': 'assets/hello_en.wav'}]
400
  ```
401
- </details>
402
-
403
-
404
- #### Punc
405
- <details>
406
- <summary>Click to expand</summary>
407
-
408
- ```python
409
- from fireredasr2s.fireredpunc.punc import FireRedPunc, FireRedPuncConfig
410
-
411
- config = FireRedPuncConfig(use_gpu=True)
412
- model = FireRedPunc.from_pretrained("pretrained_models/FireRedPunc", config)
413
-
414
- batch_text = ["你好世界", "Hello world"]
415
- results = model.process(batch_text)
416
-
417
- print(results)
418
- # [{'punc_text': '你好世界。', 'origin_text': '你好世界'}, {'punc_text': 'Hello world!', 'origin_text': 'Hello world'}]
419
- ```
420
- </details>
421
-
422
-
423
- #### ASR System
424
- ```python
425
- from fireredasr2s.fireredasr2 import FireRedAsr2Config
426
- from fireredasr2s.fireredlid import FireRedLidConfig
427
- from fireredasr2s.fireredpunc import FireRedPuncConfig
428
- from fireredasr2s.fireredvad import FireRedVadConfig
429
- from fireredasr2s import FireRedAsr2System, FireRedAsr2SystemConfig
430
-
431
- vad_config = FireRedVadConfig(
432
- use_gpu=False,
433
- smooth_window_size=5,
434
- speech_threshold=0.4,
435
- min_speech_frame=20,
436
- max_speech_frame=2000,
437
- min_silence_frame=20,
438
- merge_silence_frame=0,
439
- extend_speech_frame=0,
440
- chunk_max_frame=30000
441
- )
442
- lid_config = FireRedLidConfig(use_gpu=True, use_half=False)
443
- asr_config = FireRedAsr2Config(
444
- use_gpu=True,
445
- use_half=False,
446
- beam_size=3,
447
- nbest=1,
448
- decode_max_len=0,
449
- softmax_smoothing=1.25,
450
- aed_length_penalty=0.6,
451
- eos_penalty=1.0,
452
- return_timestamp=True
453
- )
454
- punc_config = FireRedPuncConfig(use_gpu=True)
455
-
456
- asr_system_config = FireRedAsr2SystemConfig(
457
- "pretrained_models/FireRedVAD/VAD",
458
- "pretrained_models/FireRedLID",
459
- "aed", "pretrained_models/FireRedASR2-AED",
460
- "pretrained_models/FireRedPunc",
461
- vad_config, lid_config, asr_config, punc_config,
462
- enable_vad=1, enable_lid=1, enable_punc=1
463
- )
464
- asr_system = FireRedAsr2System(asr_system_config)
465
-
466
- batch_uttid = ["hello_zh", "hello_en"]
467
- batch_wav_path = ["assets/hello_zh.wav", "assets/hello_en.wav"]
468
- for wav_path, uttid in zip(batch_wav_path, batch_uttid):
469
- result = asr_system.process(wav_path, uttid)
470
- print(result)
471
- # {'uttid': 'hello_zh', 'text': '你好世界。', 'sentences': [{'start_ms': 440, 'end_ms': 1820, 'text': '你好世界。', 'asr_confidence': 0.868, 'lang': 'zh mandarin', 'lang_confidence': 0.999}], 'vad_segments_ms': [(440, 1820)], 'dur_s': 2.32, 'words': [{'start_ms': 540, 'end_ms': 700, 'text': '你'}, {'start_ms': 700, 'end_ms': 1100, 'text': '好'}, {'start_ms': 1100, 'end_ms': 1300, 'text': '世'}, {'start_ms': 1300, 'end_ms': 1765, 'text': '界'}], 'wav_path': 'assets/hello_zh.wav'}
472
- # {'uttid': 'hello_en', 'text': 'Hello speech.', 'sentences': [{'start_ms': 260, 'end_ms': 1820, 'text': 'Hello speech.', 'asr_confidence': 0.933, 'lang': 'en', 'lang_confidence': 0.993}], 'vad_segments_ms': [(260, 1820)], 'dur_s': 2.24, 'words': [{'start_ms': 400, 'end_ms': 960, 'text': 'hello'}, {'start_ms': 960, 'end_ms': 1666, 'text': 'speech'}], 'wav_path': 'assets/hello_en.wav'}
473
- ```
474
-
475
-
476
-
477
- ## FAQ
478
- **Q: What audio format is supported?**
479
-
480
- 16kHz 16-bit mono PCM wav. Use ffmpeg to convert other formats: `ffmpeg -i <input_audio_path> -ar 16000 -ac 1 -acodec pcm_s16le -f wav <output_wav_path>`
481
-
482
- **Q: What are the input length limitations of ASR models?**
483
-
484
- - FireRedASR2-AED supports audio input up to 60s. Input longer than 60s may cause hallucination issues, and input exceeding 200s will trigger positional encoding errors.
485
- - FireRedASR2-LLM supports audio input up to 30s. The behavior for longer input is untested.
486
-
487
 
488
- ## Acknowledgements
489
- Thanks to the following open-source works:
490
- - [Qwen](https://huggingface.co/Qwen)
491
- - [WenetSpeech-Yue](https://github.com/ASLP-lab/WenetSpeech-Yue)
492
- - [WenetSpeech-Chuan](https://github.com/ASLP-lab/WenetSpeech-Chuan)
 
 
 
 
 
1
  ---
 
2
  language:
3
+ - en
4
+ - zh
5
+ license: apache-2.0
6
+ pipeline_tag: audio-classification
7
  tags:
8
  - Language Identification
9
  - LID
 
16
 
17
  <div align="center">
18
  <h1>
19
+ FireRedASR2S - FireRedLID
20
  <br>
21
+ A SOTA Industrial-Grade Spoken Language Identification System
22
  </h1>
23
 
24
  </div>
25
 
26
+ [[Paper]](https://huggingface.co/papers/2603.10420)
27
+ [[Code]](https://github.com/FireRedTeam/FireRedASR2S)
28
  [[Blog]](https://fireredteam.github.io/demos/firered_asr/)
29
  [[Demo]](https://huggingface.co/spaces/FireRedTeam/FireRedASR)
30
 
31
 
32
+ FireRedLID is the Spoken Language Identification (LID) module of **FireRedASR2S**, a state-of-the-art (SOTA), industrial-grade, all-in-one ASR system. It supports 100+ languages and 20+ Chinese dialects/accents, achieving 97.18% accuracy on the FLEURS benchmark, outperforming Whisper and SpeechBrain-LID.
 
 
 
 
 
 
33
 
34
+ This model was introduced in the paper [FireRedASR2S: A State-of-the-Art Industrial-Grade All-in-One Automatic Speech Recognition System](https://huggingface.co/papers/2603.10420).
35
 
36
  ## 🔥 News
37
+ - [2026.02.12] We release FireRedASR2S (FireRedASR2-AED, FireRedVAD, FireRedLID, and FireRedPunc) with model weights and inference code.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
  ## Evaluation
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  ### FireRedLID
41
  Metric: Utterance-level LID Accuracy (%). Higher is better.
42
 
43
+ |Testset\Model|Languages|FireRedLID|Whisper|SpeechBrain|Dolphin|
 
 
 
 
44
  |:-----------------:|:---------:|:---------:|:-----:|:---------:|:-----:|
45
  |FLEURS test |82 languages |**97.18** |79.41 |92.91 |-|
46
  |CommonVoice test |74 languages |**92.07** |80.81 |78.75 |-|
47
  |KeSpeech + MagicData|20+ Chinese dialects/accents |**88.47** |-|-|69.01|
48
 
49
 
50
+ ## Sample Usage
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
+ To use this module independently, first clone the [GitHub repository](https://github.com/FireRedTeam/FireRedASR2S) and install the dependencies.
53
 
54
  ### Python API Usage
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  ```python
56
  from fireredasr2s.fireredlid import FireRedLid, FireRedLidConfig
57
 
 
59
  batch_wav_path = ["assets/hello_zh.wav", "assets/hello_en.wav"]
60
 
61
  config = FireRedLidConfig(use_gpu=True, use_half=False)
62
+ model = FireRedLid.from_pretrained("FireRedTeam/FireRedLID", config)
63
 
64
  results = model.process(batch_uttid, batch_wav_path)
65
  print(results)
66
  # [{'uttid': 'hello_zh', 'lang': 'zh mandarin', 'confidence': 0.996, 'dur_s': 2.32, 'rtf': '0.0741', 'wav': 'assets/hello_zh.wav'}, {'uttid': 'hello_en', 'lang': 'en', 'confidence': 0.996, 'dur_s': 2.24, 'rtf': '0.0741', 'wav': 'assets/hello_en.wav'}]
67
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
 
69
+ ## Citation
70
+ ```bibtex
71
+ @article{xu2026fireredasr2s,
72
+ title={FireRedASR2S: A State-of-the-Art Industrial-Grade All-in-One Automatic Speech Recognition System},
73
+ author={Xu, Kaituo and Jia, Yan and Huang, Kai and Chen, Junjie and Li, Wenpeng and Liu, Kun and Xie, Feng-Long and Tang, Xu and Hu, Yao},
74
+ journal={arXiv preprint arXiv:2603.10420},
75
+ year={2026}
76
+ }
77
+ ```