Skip to content

Latest commit

 

History

History
 
 

text2speech

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

text2speech

PyPI - Version PyPI - Python Version


Table of Contents

Installation

Only for Debian-based systems: first install the audio system dependencies:

sudo apt-get install libsndfile1 ffmpeg

Install the text2speech package:

pip install farm-haystack-text2speech

Usage

For a full example of how to use the AnswerToSpeech Node, you may try out our "Make Your QA Pipelines Talk Tutorial"

For example, in a simple Extractive QA Pipeline:

from haystack.nodes import BM25Retriever, FARMReader
from text2speech import AnswerToSpeech

retriever = BM25Retriever(document_store=document_store)
reader = FARMReader(model_name_or_path="deepset/roberta-base-squad2", use_gpu=True)
answer2speech = AnswerToSpeech(
    model_name_or_path="espnet/kan-bayashi_ljspeech_vits", generated_audio_dir=Path("./audio_answers")
)

audio_pipeline = Pipeline()
audio_pipeline.add_node(retriever, name="Retriever", inputs=["Query"])
audio_pipeline.add_node(reader, name="Reader", inputs=["Retriever"])
audio_pipeline.add_node(answer2speech, name="AnswerToSpeech", inputs=["Reader"])

License

haystack-text2speech is distributed under the terms of the Apache-2.0 license.