Skip to main content

LangChain integration for FunASR (SenseVoice / Paraformer / Fun-ASR-Nano) speech-to-text

Project description

🦜🔗 langchain-funasr

FunASR integration for LangChain — transcribe audio to LangChain Documents with self-hosted speech-to-text.

Powered by SenseVoice / Paraformer / Fun-ASR-Nano: runs locally, no cloud API, strong on Chinese and 50+ languages.

Install

pip install langchain-funasr

Usage

from langchain_funasr import FunASRLoader

loader = FunASRLoader("meeting.wav", model="iic/SenseVoiceSmall", device="cuda")
docs = loader.load()
print(docs[0].page_content)

Use the parser directly with blob pipelines:

from langchain_core.document_loaders import Blob
from langchain_funasr import FunASRParser

parser = FunASRParser(model="FunAudioLLM/SenseVoiceSmall", hub="hf", device="cuda")
docs = list(parser.lazy_parse(Blob.from_path("audio.wav")))

Options

Arg Default Notes
model iic/SenseVoiceSmall Any FunASR model (SenseVoice / Paraformer / Fun-ASR-Nano)
hub ms ms (ModelScope) or hf (HuggingFace)
device cpu e.g. cuda, cuda:0
language auto SenseVoice: auto/zh/en/yue/ja/ko
vad_model fsmn-vad Built-in VAD handles long audio of any length

Why FunASR

  • Self-hosted — no API keys, no data leaving your machine.
  • Fast — SenseVoice is non-autoregressive, far faster than Whisper.
  • Strong on Chinese + 50+ languages.

⭐ If this helps, star FunASR and SenseVoice.

License

Apache-2.0

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

langchain_funasr-0.1.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

langchain_funasr-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file langchain_funasr-0.1.0.tar.gz.

File metadata

  • Download URL: langchain_funasr-0.1.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for langchain_funasr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ca971aaa491c1ee7be8c8446cbc44fd3638e468c00cc343e9fca8b2f0c11e9a1
MD5 0923e9278bd163d7a813b6cb197a8933
BLAKE2b-256 de63f45c4dcf442c1538b2fa93475b13d66e62d810a89732b4e8f9bc6f130287

See more details on using hashes here.

File details

Details for the file langchain_funasr-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_funasr-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 153efa7e59c7101a40119db3ebbefa0780548f1ea2a0d12e009207a18c23d0e8
MD5 17a27d271d9b410e2d0dabe9f1217816
BLAKE2b-256 d7d57c0072275a225c939580c8c2049764fe3eba082a96dbacc4c0077b4b766d

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