speech2text#

class besser.bot.nlp.speech2text.speech2text.Speech2Text(nlp_engine)[source]#

Bases: ABC

The Speech2Text abstract class.

The Speech2Text component, also known as STT, Automatic Speech Recognition or ASR, is in charge of converting spoken language or audio speech signals into written text. This task is called transcribing.

We can use it in a chatbot to allow the users to send voice messages and transcribe them to written text so the bot can process them like regular text messages.

Parameters:

nlp_engine (NLPEngine) – the NLPEngine that handles the NLP processes of the bot

_nlp_engine#

The NLPEngine that handles the NLP processes of the bot

_abc_impl = <_abc._abc_data object>#
abstract speech2text(speech)[source]#

Transcribe a voice audio into its corresponding text representation.

Parameters:

speech (bytes) – the recorded voice that wants to be transcribed

Returns:

the speech transcription

Return type:

str