luxasr_speech2text#

class baf.nlp.speech2text.luxasr_speech2text.LuxASRSpeech2Text(agent, language=None)[source]#

Bases: Speech2Text

Makes use of the LuxASR API (Note: This only works with Luxembourgish speech)

It calls the LuxASR API provided by the University of Luxembourg: https://luxasr.uni.lu/

Parameters:
  • agent (Agent) – The agent instance using this speech-to-text service.

  • language (str, optional) – The language code for recognition (default: None).

_mime_type#

MIME type for the audio file sent to the API (default: ‘application/octet-stream’).

Type:

str

_abc_impl = <_abc._abc_data object>#
speech2text(speech, mime_type='application/octet-stream', diarization='Enabled', output_format='text')[source]#

Transcribe a voice audio into its corresponding text representation.

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

  • mime_type (str) – the mime_type of the file send to the LuxASR API. For a spoken user message, this defaults to

  • application/octet-stream

  • diarization (str) – Diarization setting for the API request (default: ‘Enabled’).

  • output_format (str) – Output format for the API response (default: ‘text’).

Returns:

the speech transcription

Return type:

str