Transcribing with Custom Language Model (python API) in AWS - ModelSettings error

353 views Asked by At

I am trying to transcribe speech using Custom Language Model using Python API. I followed the example script available on the AWS webpage. However, it throws the following error, saying it doesn't support the 'LanguageModelName' parameter under ModelSettings.

ParamValidationError: Parameter validation failed: Unknown parameter in input: "ModelSettings", must be one of: TranscriptionJobName, LanguageCode, MediaSampleRateHertz, MediaFormat, Media, OutputBucketName, Settings

transcribe.start_transcription_job(
    TranscriptionJobName = job_name,
    Media = {'MediaFileUri': job_uri},
    MediaFormat = 'media-format',
    LanguageCode = 'language-code',
ModelSettings = {
    'LanguageModelName': 'language-model-name'
    }
)

Could anyone please help regarding this?

1

There are 1 answers

1
Christian Berkhoff On

I'm not sure what could be wrong on your request in particular, but I tried the following with no issue:

transcribe = boto3.client('transcribe', region_name='us-west-2')
transcribe.start_transcription_job(
    TranscriptionJobName = 'test-so-clm-1',
    Media = {'MediaFileUri': 's3://bucket/folder/audio.wav'},
    MediaFormat = 'wav',
    LanguageCode = 'en-US',
    ModelSettings = {
    'LanguageModelName': 'test1'
    }
)

In my case my Custom Language Model is named test1. Make sure your CLM name matches. Maybe the error is being raised like something is wrong with the "keys" under ModelSettings but in reality it's the actual value that's wrong. Let me know if this helps!