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.1.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.1-py3-none-any.whl (4.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fasr-0.4.1.tar.gz
  • Upload date:
  • Size: 9.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","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.1.tar.gz
Algorithm Hash digest
SHA256 0ac949bb2b243a3c6bcea3b5fa8ccea1910679f440c5e088d531913050f1bb7b
MD5 92d9645e58f66ece6c80342854d46043
BLAKE2b-256 64703136730727cd2cb7f8066b8571a2731515ad3278619a076ad70f0a9b5bfa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasr-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dfb27fe746991821c3404fe20e1ffafbc5a200ef5c315987b233fa11cc6bb632
MD5 a5d08324e15f95cb3d97c05e39d80fdd
BLAKE2b-256 daff06efa48f996eae0cd93535b20b784f707f1c5fcfb3ac7a221f2dd60c0d08

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