Skip to content

Feature Request: Add FunASR Speech-to-Text component for audio document processing #3375

@LauraGPT

Description

@LauraGPT

Feature Request

Haystack is excellent for building NLP/RAG pipelines. A Speech-to-Text component powered by FunASR would enable audio document processing in Haystack pipelines.

Use case: Audio/video files → FunASR transcription → text preprocessing → indexing → retrieval

Why FunASR?

  • OpenAI-compatible API: /v1/audio/transcriptions endpoint — easy to wrap as a Haystack component
  • SenseVoice: Ultra-fast ASR (234M params), 50+ languages, 5-10x faster than Whisper
  • Complete pipeline: VAD + ASR + punctuation + speaker diarization + timestamps
  • Self-hosted: No API key, runs locally

Potential Haystack component:

from funasr import AutoModel

class FunASRTranscriber:
    def __init__(self):
        self.model = AutoModel(
            model="paraformer-zh",
            vad_model="fsmn-vad",
            punc_model="ct-punc",
            spk_model="cam++",
        )
    
    def run(self, audio_path: str):
        result = self.model.generate(input=audio_path)
        return {"documents": [Document(content=r["text"]) for r in result]}

Tasks

  • The code is documented with docstrings and was merged in the main branch
  • Docs are published at https://docs.haystack.deepset.ai/
  • There is a Github workflow running the tests for the integration nightly and at every PR
  • A new label named like integration:<your integration name> has been added to the list of labels for this repository
  • The labeler.yml file has been updated
  • The package has been released on PyPI
  • An integration tile with a usage example has been added to https://github.com/deepset-ai/haystack-integrations
  • The integration has been listed in the Inventory section of this repo README
  • The feature was announced through social media

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3contributions wanted!Looking for external contributionsnew integrationDiscuss the creation of a new integration in Core

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions