/AWS1/IF_TNB=>CREATEVOCABULARY()¶
About CreateVocabulary¶
Creates a new custom vocabulary.
When creating a new custom vocabulary, you can either upload a text file that contains
your new entries, phrases, and terms into an Amazon S3 bucket and include the
URI in your request. Or you can include a list of terms directly in your request using
the Phrases flag.
Each language has a character set that contains all allowed characters for that specific language. If you use unsupported characters, your custom vocabulary request fails. Refer to Character Sets for Custom Vocabularies to get the character set for your language.
For more information, see Custom vocabularies.
Method Signature¶
METHODS /AWS1/IF_TNB~CREATEVOCABULARY
IMPORTING
!IV_VOCABULARYNAME TYPE /AWS1/TNBVOCABULARYNAME OPTIONAL
!IV_LANGUAGECODE TYPE /AWS1/TNBLANGUAGECODE OPTIONAL
!IT_PHRASES TYPE /AWS1/CL_TNBPHRASES_W=>TT_PHRASES OPTIONAL
!IV_VOCABULARYFILEURI TYPE /AWS1/TNBURI OPTIONAL
!IT_TAGS TYPE /AWS1/CL_TNBTAG=>TT_TAGLIST OPTIONAL
!IV_DATAACCESSROLEARN TYPE /AWS1/TNBDATAACCESSROLEARN OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_tnbcrevocabularyrsp
RAISING
/AWS1/CX_TNBBADREQUESTEX
/AWS1/CX_TNBCONFLICTEXCEPTION
/AWS1/CX_TNBINTERNALFAILUREEX
/AWS1/CX_TNBLIMITEXCEEDEDEX
/AWS1/CX_TNBCLIENTEXC
/AWS1/CX_TNBSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_vocabularyname TYPE /AWS1/TNBVOCABULARYNAME /AWS1/TNBVOCABULARYNAME¶
A unique name, chosen by you, for your new custom vocabulary.
This name is case sensitive, cannot contain spaces, and must be unique within an Amazon Web Services account. If you try to create a new custom vocabulary with the same name as an existing custom vocabulary, you get a
ConflictExceptionerror.
iv_languagecode TYPE /AWS1/TNBLANGUAGECODE /AWS1/TNBLANGUAGECODE¶
The language code that represents the language of the entries in your custom vocabulary. Each custom vocabulary must contain terms in only one language.
A custom vocabulary can only be used to transcribe files in the same language as the custom vocabulary. For example, if you create a custom vocabulary using US English (
en-US), you can only apply this custom vocabulary to files that contain English audio.For a list of supported languages and their associated language codes, refer to the Supported languages table.
Optional arguments:¶
it_phrases TYPE /AWS1/CL_TNBPHRASES_W=>TT_PHRASES TT_PHRASES¶
Use this parameter if you want to create your custom vocabulary by including all desired terms, as comma-separated values, within your request. The other option for creating your custom vocabulary is to save your entries in a text file and upload them to an Amazon S3 bucket, then specify the location of your file using the
VocabularyFileUriparameter.Note that if you include
Phrasesin your request, you cannot useVocabularyFileUri; you must choose one or the other.Each language has a character set that contains all allowed characters for that specific language. If you use unsupported characters, your custom vocabulary filter request fails. Refer to Character Sets for Custom Vocabularies to get the character set for your language.
iv_vocabularyfileuri TYPE /AWS1/TNBURI /AWS1/TNBURI¶
The Amazon S3 location of the text file that contains your custom vocabulary. The URI must be located in the same Amazon Web Services Region as the resource you're calling.
Here's an example URI path:
s3://DOC-EXAMPLE-BUCKET/my-vocab-file.txtNote that if you include
VocabularyFileUriin your request, you cannot use thePhrasesflag; you must choose one or the other.
it_tags TYPE /AWS1/CL_TNBTAG=>TT_TAGLIST TT_TAGLIST¶
Adds one or more custom tags, each in the form of a key:value pair, to a new custom vocabulary at the time you create this new custom vocabulary.
To learn more about using tags with Amazon Transcribe, refer to Tagging resources.
iv_dataaccessrolearn TYPE /AWS1/TNBDATAACCESSROLEARN /AWS1/TNBDATAACCESSROLEARN¶
The Amazon Resource Name (ARN) of an IAM role that has permissions to access the Amazon S3 bucket that contains your input files (in this case, your custom vocabulary). If the role that you specify doesn’t have the appropriate permissions to access the specified Amazon S3 location, your request fails.
IAM role ARNs have the format
arn:partition:iam::account:role/role-name-with-path. For example:arn:aws:iam::111122223333:role/Admin.For more information, see IAM ARNs.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_tnbcrevocabularyrsp /AWS1/CL_TNBCREVOCABULARYRSP¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->createvocabulary(
it_phrases = VALUE /aws1/cl_tnbphrases_w=>tt_phrases(
( new /aws1/cl_tnbphrases_w( |string| ) )
)
it_tags = VALUE /aws1/cl_tnbtag=>tt_taglist(
(
new /aws1/cl_tnbtag(
iv_key = |string|
iv_value = |string|
)
)
)
iv_dataaccessrolearn = |string|
iv_languagecode = |string|
iv_vocabularyfileuri = |string|
iv_vocabularyname = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_vocabularyname = lo_result->get_vocabularyname( ).
lv_languagecode = lo_result->get_languagecode( ).
lv_vocabularystate = lo_result->get_vocabularystate( ).
lv_datetime = lo_result->get_lastmodifiedtime( ).
lv_failurereason = lo_result->get_failurereason( ).
ENDIF.