speechtotext.model.assemblyAIWrapper.AssemblyAIAPIWrapper
- class AssemblyAIAPIWrapper(model_version)[source]
Bases:
ModelWrapperWrapper for assemblyAi API. ASSEMBLY_AI_API_KEY needs to be in the ‘.env’ file in current directory.
Wrapper for assemblyAi model.
- Parameters:
model_version (assemblyAiAPIVersion) – Model version of assemblyAi STT API to use.
Methods
Benchmark n samples with model.
Benchmark sample with model.
Benchmark samples with model.
Convert sample to correct format.
Get model.
get_transcript_of_fileAttributes
Connection url for the API.
Code for the language to transcribe.
path to temp file that will be created to convert the audio files to an accepted audio format.
Polling endpoint url.
Time to sleep after each polling.
Transcribe endpoint url.
Upload endpoint url.
-
LANGUAGE_CODE:
str= 'nl' Code for the language to transcribe.
See supported languages for assemblyAi
- Type:
-
PATH_OF_TEMP_CONVERTED_AUDIO_FILE:
str= 'converted_audio_file.wav' path to temp file that will be created to convert the audio files to an accepted audio format.
- Type:
PATH_OF_TEMP_CONVERTED_AUDIO_FILE
-
TRANSCRIPT_ENDPOINT:
str= 'https://api.assemblyai.com/v2/transcript' Transcribe endpoint url.
- Type:
- _append_error(samples, audio_id, error)
Append error to model_errors.
- Parameters:
samples (SampleDataset) – Dataset of audio.
id (str) – Id of failed sample.
error (str) – Error message.
- _benchmark_sample_with_time(dataset, audio_id, with_cleaning=True)
Benchmark sample for model with timer.
- benchmark_n_samples(dataset, number_of_samples, with_cleaning=True)
Benchmark n samples with model.
- benchmark_sample(dataset, audio_id, with_cleaning=True)
Benchmark sample with model.
- benchmark_samples(samples, with_cleaning=True)
Benchmark samples with model.
- convert_sample(path_to_sample)
Convert sample to correct format.