Skip to content

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

docs: add detailed docstrings to ct_transformer_streaming, e_paraformer, fsmn_kws_mt, scama, llm_asr (class + inference methods)

游雁dac02a0c5354
diff --git a/funasr/models/ct_transformer_streaming/model.py b/funasr/models/ct_transformer_streaming/model.py
index f3c63d5af..c646e2484 100644
--- a/funasr/models/ct_transformer_streaming/model.py
+++ b/funasr/models/ct_transformer_streaming/model.py
@@ -31,10 +31,18 @@ else:
@tables.register("model_classes", "CTTransformerStreaming")
class CTTransformerStreaming(CTTransformer):
- """
+ """CT-Transformer Streaming: Online punctuation restoration.
+
+ Processes text incrementally with a sliding window, maintaining cache
+ of previous context for consistent punctuation decisions across chunks.
+ Used as punc_model in streaming ASR pipelines.
+
+ Supports VAD-aware punctuation: uses VAD boundaries to improve sentence segmentation.
+
+ Reference: https://arxiv.org/pdf/2003.01309.pdf
+ Output: {"key": str, "text": str, "punc_array": Tensor}
+
Author: Speech Lab of DAMO Academy, Alibaba Group
- CT-Transformer: Controllable time-delay transformer for real-time punctuation prediction and disfluency detection
- https://arxiv.org/pdf/2003.01309.pdf
"""
def __init__(
diff --git a/funasr/models/e_paraformer/model.py b/funasr/models/e_paraformer/model.py
index 34ab3e375..d59e1f887 100644
--- a/funasr/models/e_paraformer/model.py
+++ b/funasr/models/e_paraformer/model.py
@@ -29,7 +29,14 @@ from funasr.utils.load_utils import load_audio_text_image_video, extract_fbank
@tables.register("model_classes", "EParaformer")
class EParaformer(torch.nn.Module):
- """
+ """E-Paraformer: Enhanced Paraformer with streaming support.
+
+ Extended Paraformer supporting both offline and streaming modes
+ through dynamic masking in the encoder. Used for 2-pass decoding
+ where first pass provides streaming results and second pass refines.
+
+ Output: {"key": str, "text": str, "timestamp": [[start_ms, end_ms], ...]}
+
Author: Speech Lab of DAMO Academy, Alibaba Group
Paraformer: Fast and Accurate Parallel Transformer for Non-autoregressive End-to-End Speech Recognition
https://arxiv.org/abs/2206.08317
diff --git a/funasr/models/fsmn_kws_mt/model.py b/funasr/models/fsmn_kws_mt/model.py
index c8ca992c0..3ea002c34 100644
--- a/funasr/models/fsmn_kws_mt/model.py
+++ b/funasr/models/fsmn_kws_mt/model.py
@@ -25,7 +25,14 @@ from funasr.utils.load_utils import load_audio_text_image_video, extract_fbank
@tables.register("model_classes", "FsmnKWSMT")
class FsmnKWSMT(torch.nn.Module):
- """
+ """FSMN-KWS-MT: Multi-Task FSMN Keyword Spotting.
+
+ Keyword spotting with multi-task learning: simultaneously
+ detects keywords and performs filler token classification.
+ Improves keyword detection robustness through auxiliary tasks.
+
+ Output: {"key": str, "value": keyword_detection_result}
+
Author: Speech Lab of DAMO Academy, Alibaba Group
Deep-FSMN for Large Vocabulary Continuous Speech Recognition
https://arxiv.org/abs/1803.05030
diff --git a/funasr/models/llm_asr/model.py b/funasr/models/llm_asr/model.py
index 3bc77299b..798ee103e 100644
--- a/funasr/models/llm_asr/model.py
+++ b/funasr/models/llm_asr/model.py
@@ -26,7 +26,11 @@ dtype_map = {"bf16": torch.bfloat16, "fp16": torch.float16, "fp32": torch.float3
@tables.register("model_classes", "LLMASR")
class LLMASR(nn.Module):
- """ """
+ """LLM-ASR: Large Language Model based Speech Recognition.
+
+ Combines audio encoder with LLM decoder for speech-to-text.
+ Output: {"key": str, "text": str}
+ """
def __init__(
self,
diff --git a/funasr/models/scama/model.py b/funasr/models/scama/model.py
index 28be561ba..76887e5b9 100644
--- a/funasr/models/scama/model.py
+++ b/funasr/models/scama/model.py
@@ -43,7 +43,13 @@ else:
@tables.register("model_classes", "SCAMA")
class SCAMA(nn.Module):
- """
+ """SCAMA: Streaming Chunk-Aware Multi-head Attention ASR.
+
+ Streaming ASR using chunk-based encoder with configurable latency.
+ Supports 2-pass decoding for accuracy refinement.
+
+ Output: {"key": str, "text": str}
+
Author: Shiliang Zhang, Zhifu Gao, Haoneng Luo, Ming Lei, Jie Gao, Zhijie Yan, Lei Xie
SCAMA: Streaming chunk-aware multihead attention for online end-to-end speech recognition
https://arxiv.org/abs/2006.01712