Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

Note: You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . transcribe ]

create-language-model

Description

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.

Synopsis

  create-language-model
--language-code <value>
--base-model-name <value>
--model-name <value>
--input-data-config <value>
[--tags <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--language-code (string)

The language of the input text you're using to train your custom language model.

Possible values:

  • en-US
  • hi-IN
  • es-US
  • en-GB
  • en-AU

--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,000 Hz 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,000 Hz, 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. ARNs have the format arn:partition:service:region:account-id:resource-type/resource-id .

Shorthand Syntax:

S3Uri=string,TuningDataS3Uri=string,DataAccessRoleArn=string

JSON Syntax:

{
  "S3Uri": "string",
  "TuningDataS3Uri": "string",
  "DataAccessRoleArn": "string"
}

--tags (list)

Adds one or more tags, each in the form of a key:value pair, to a new language model at the time you create this new model.

(structure)

A key:value pair that adds metadata to a resource used by Amazon Transcribe. For example, a tag with the key:value pair ‘Department’:’Sales’ might be added to a resource to indicate its use by your organization's sales department.

Key -> (string)

The first part of a key:value pair that forms a tag associated with a given resource. For example, in the tag ‘Department’:’Sales’, the key is 'Department'.

Value -> (string)

The second part of a key:value pair that forms a tag associated with a given resource. For example, in the tag ‘Department’:’Sales’, the value is 'Sales'.

Shorthand Syntax:

Key=string,Value=string ...

JSON Syntax:

[
  {
    "Key": "string",
    "Value": "string"
  }
  ...
]

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI 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.

--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. 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.

Examples

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.

Output

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. ARNs have the format arn:partition:service:region:account-id:resource-type/resource-id .

ModelStatus -> (string)

The status of the custom language model. When the status is COMPLETED the model is ready to use.