| layout | integration | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | FunASR | |||||||||||
| description | Transcribe audio files to Documents using FunASR — an open-source, self-hosted speech recognition toolkit supporting 50+ languages. | |||||||||||
| authors |
|
|||||||||||
| pypi | https://pypi.org/project/funasr-haystack/ | |||||||||||
| repo | https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/funasr | |||||||||||
| type | Data Ingestion | |||||||||||
| report_issue | https://github.com/deepset-ai/haystack-core-integrations/issues | |||||||||||
| version | Haystack 2.0 | |||||||||||
| toc | true |
FunASR is an open-source speech recognition toolkit from Alibaba DAMO Academy that runs entirely locally — no API key required. It supports 50+ languages, speaker diarization, and timestamp extraction.
This integration provides:
FunASRTranscriber: Transcribes audio files to HaystackDocumentobjects. Accepts file paths,Pathobjects, andByteStreaminputs.
pip install funasr-haystackFunASRTranscriber transcribes audio files to Haystack Document objects using FunASR models. Models are downloaded from ModelScope on first use and cached in ~/.cache/modelscope.
from haystack_integrations.components.audio.funasr import FunASRTranscriber
transcriber = FunASRTranscriber()
result = transcriber.run(sources=["speech.wav", "interview.mp3"])
for doc in result["documents"]:
print(doc.content)from haystack import Pipeline
from haystack.components.fetchers import LinkContentFetcher
from haystack_integrations.components.audio.funasr import FunASRTranscriber
pipe = Pipeline()
pipe.add_component("fetcher", LinkContentFetcher())
pipe.add_component("transcriber", FunASRTranscriber())
pipe.connect("fetcher", "transcriber")
result = pipe.run(
data={
"fetcher": {
"urls": ["https://example.com/speech.wav"],
},
}
)
print(result["transcriber"]["documents"][0].content)from haystack.utils import ComponentDevice
from haystack_integrations.components.audio.funasr import FunASRTranscriber
transcriber = FunASRTranscriber(
model="paraformer-zh",
vad_model="fsmn-vad",
punc_model="ct-punc",
spk_model="cam++",
device=ComponentDevice.from_str("cuda"),
)
result = transcriber.run(sources=["meeting.wav"])
doc = result["documents"][0]
print(doc.content)
print("Speakers:", doc.meta.get("speakers"))funasr-haystack is distributed under the terms of the Apache-2.0 license.