Skip to main content

FASR: Fast Automatic Speech Recognition Pipeline

Project description

fasr logo

fasr

fasr 是一个面向生产场景的 Python 语音推理框架,专注于将语音处理能力以可组合、可扩展的方式落地到工程系统中。

它围绕 AudioPipeline 构建,支持将 VAD、ASR、标点恢复、语种识别等能力按组件自由编排,适用于离线转写、批处理任务和在线服务等场景。

核心特点:

  • 插件化模型生态:能力按模型插件解耦,安装即注册,按需组合。
  • 工程化流水线:统一数据结构与组件接口,便于维护和扩展。
  • 高性能推理:组件异步执行,充分利用多核 CPU / GPU 资源。
  • 面向生产:支持批量、流式与服务化部署,便于接入业务系统。

组件介绍

  • loader:音频加载组件,负责读取本地或远程音频并构建 Audio 对象。
  • detector:端点检测组件(VAD),将音频切分为语音片段(segments)。
  • recognizer:语音识别组件(ASR),对每个语音片段进行转写。
  • sentencizer:标点恢复与句子切分组件(Punc),将识别结果整理为可读文本。
  • identifier:语言识别组件(LID,可选),用于多语言场景下识别语种。
  • custom:支持通过 add_pipe() 注入自定义组件,扩展前后处理逻辑。

快速开始

fasr 的模型能力通过模型插件提供,需要先安装对应的插件包:

pip install fasr-vad-marblenet fasr-asr-qwen3
import fasr
from fasr import AudioPipeline

# 加载流水线(首次运行会自动下载模型权重)
asr = (
    AudioPipeline()
    .add_pipe("detector", model="marblenet")
    .add_pipe("recognizer", model="qwen3_0_6b")
)

# 单条识别
audio = asr("example.wav")
for channel in audio.channels:
    print(channel.text)

# 批次识别
audios = asr.run(["1.wav", "2.wav", "3.wav"])
for audio in audios:
    for channel in audio.channels:
        print(channel.text)

# 流式返回(大批量场景,逐条 yield)
for audio in asr.stream(["1.wav", "2.wav", "3.wav"]):
    for channel in audio.channels:
        print(channel.text)

模型插件

fasr 通过模型插件机制加载组件能力,按任务安装对应插件后可自由组合流水线:

任务 插件包 典型模型
VAD fasr-vad-marblenet / fasr-vad-fsmn / fasr-vad-firered marblenet / fsmn / firered
ASR fasr-asr-qwen3 / fasr-asr-paraformer / fasr-asr-firered / fasr-asr-fun qwen3_0_6b / paraformer / firered_aed / fun_asr_nano
Punc fasr-punc-ct-transformer ct_transformer
LID fasr-lid-firered firered

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fasr-0.4.2.tar.gz (9.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fasr-0.4.2-py3-none-any.whl (4.4 MB view details)

Uploaded Python 3

File details

Details for the file fasr-0.4.2.tar.gz.

File metadata

  • Download URL: fasr-0.4.2.tar.gz
  • Upload date:
  • Size: 9.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fasr-0.4.2.tar.gz
Algorithm Hash digest
SHA256 8068a20aee275bc599c493a7186cf633e1dbb89471c744a5e593cb3af92f364c
MD5 0c8e6d63271da4abf6b37fb3ec24890e
BLAKE2b-256 47cdcb733f603b742a3d3098a35fc4c9923a6501407450405c1c4d112d61a078

See more details on using hashes here.

File details

Details for the file fasr-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: fasr-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 4.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fasr-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ef7c1305168225a534cc0109d0cf7b2a16c5e814b12bb5b410459ced467c6a3c
MD5 93d0d3b889b031ea51ac981c8506bc0c
BLAKE2b-256 202ce3a9c49f8649ed6e133c9ecc0067ef752fce994c9ea9504bbdd1820e2aa4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page