[ aws . transcribe ]
Creates a new custom language model. Use Amazon S3 prefixes to provide the location of your input files. The time it takes to create your model depends on the size of your training data.
See also: AWS API Documentation
See ‘aws help’ for descriptions of global parameters.
create-language-model
--language-code <value>
--base-model-name <value>
--model-name <value>
--input-data-config <value>
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
--language-code
(string)
The language of the input text you’re using to train your custom language model.
Possible values:
en-US
--base-model-name
(string)
The Amazon Transcribe standard language model, or base model used to create your custom language model.
If you want to use your custom language model to transcribe audio with a sample rate of 16 kHz or greater, choose
Wideband
.If you want to use your custom language model to transcribe audio with a sample rate that is less than 16 kHz, choose
Narrowband
.Possible values:
NarrowBand
WideBand
--model-name
(string)
The name you choose for your custom language model when you create it.
--input-data-config
(structure)
Contains the data access role and the Amazon S3 prefixes to read the required input files to create a custom language model.
S3Uri -> (string)
The Amazon S3 prefix you specify to access the plain text files that you use to train your custom language model.
TuningDataS3Uri -> (string)
The Amazon S3 prefix you specify to access the plain text files that you use to tune your custom language model.
DataAccessRoleArn -> (string)
The Amazon Resource Name (ARN) that uniquely identifies the permissions you’ve given Amazon Transcribe to access your Amazon S3 buckets containing your media files or text data.
Shorthand Syntax:
S3Uri=string,TuningDataS3Uri=string,DataAccessRoleArn=string
JSON Syntax:
{
"S3Uri": "string",
"TuningDataS3Uri": "string",
"DataAccessRoleArn": "string"
}
--cli-input-json
| --cli-input-yaml
(string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton
. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml
.
--generate-cli-skeleton
(string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input
, prints a sample input JSON that can be used as an argument for --cli-input-json
. Similarly, if provided yaml-input
it will print a sample input YAML that can be used with --cli-input-yaml
. If provided with the value output
, it validates the command inputs and returns a sample output JSON for that command.
See ‘aws help’ for descriptions of global parameters.
Example 1: To create a custom language model using both training and tuning data.
The following create-language-model
example creates a custom language model. You can use a custom language model to improve transcription performance for domains such as legal, hospitality, finance, and insurance. For language-code, enter a valid language code. For base-model-name, specify a base model that is best suited for the sample rate of the audio that you want to transcribe with your custom language model. For model-name, specify the name that you want to call the custom language model.
aws transcribe create-language-model \
--language-code language-code \
--base-model-name base-model-name \
--model-name cli-clm-example \
--input-data-config S3Uri="s3://DOC-EXAMPLE-BUCKET/Amazon-S3-Prefix-for-training-data",TuningDataS3Uri="s3://DOC-EXAMPLE-BUCKET/Amazon-S3-Prefix-for-tuning-data",DataAccessRoleArn="arn:aws:iam::AWS-account-number:role/IAM-role-with-permissions-to-create-a-custom-language-model"
Output:
{
"LanguageCode": "language-code",
"BaseModelName": "base-model-name",
"ModelName": "cli-clm-example",
"InputDataConfig": {
"S3Uri": "s3://DOC-EXAMPLE-BUCKET/Amazon-S3-Prefix/",
"TuningDataS3Uri": "s3://DOC-EXAMPLE-BUCKET/Amazon-S3-Prefix/",
"DataAccessRoleArn": "arn:aws:iam::AWS-account-number:role/IAM-role-with-permissions-create-a-custom-language-model"
},
"ModelStatus": "IN_PROGRESS"
}
For more information, see Improving Domain-Specific Transcription Accuracy with Custom Language Models in the Amazon Transcribe Developer Guide.
Example 2: To create a custom language model using only training data.
The following create-language-model
example transcribes your audio file. You can use a custom language model to improve transcription performance for domains such as legal, hospitality, finance, and insurance. For language-code, enter a valid language code. For base-model-name, specify a base model that is best suited for the sample rate of the audio that you want to transcribe with your custom language model. For model-name, specify the name that you want to call the custom language model.
aws transcribe create-language-model \
--language-code en-US \
--base-model-name base-model-name \
--model-name cli-clm-example \
--input-data-config S3Uri="s3://DOC-EXAMPLE-BUCKET/Amazon-S3-Prefix-For-Training-Data",DataAccessRoleArn="arn:aws:iam::AWS-account-number:role/IAM-role-with-permissions-to-create-a-custom-language-model"
Output:
{
"LanguageCode": "en-US",
"BaseModelName": "base-model-name",
"ModelName": "cli-clm-example",
"InputDataConfig": {
"S3Uri": "s3://DOC-EXAMPLE-BUCKET/Amazon-S3-Prefix-For-Training-Data/",
"DataAccessRoleArn": "arn:aws:iam::your-AWS-account-number:role/IAM-role-with-permissions-to-create-a-custom-language-model"
},
"ModelStatus": "IN_PROGRESS"
}
For more information, see Improving Domain-Specific Transcription Accuracy with Custom Language Models in the Amazon Transcribe Developer Guide.
LanguageCode -> (string)
The language code of the text you’ve used to create a custom language model.
BaseModelName -> (string)
The Amazon Transcribe standard language model, or base model you’ve used to create a custom language model.
ModelName -> (string)
The name you’ve chosen for your custom language model.
InputDataConfig -> (structure)
The data access role and Amazon S3 prefixes you’ve chosen to create your custom language model.
S3Uri -> (string)
The Amazon S3 prefix you specify to access the plain text files that you use to train your custom language model.
TuningDataS3Uri -> (string)
The Amazon S3 prefix you specify to access the plain text files that you use to tune your custom language model.
DataAccessRoleArn -> (string)
The Amazon Resource Name (ARN) that uniquely identifies the permissions you’ve given Amazon Transcribe to access your Amazon S3 buckets containing your media files or text data.
ModelStatus -> (string)
The status of the custom language model. When the status is
COMPLETED
the model is ready to use.