

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# テキストファイルを使用して医療用カスタム語彙を作成する
<a name="create-med-custom-vocabulary"></a>

カスタム語彙を作成するには、単語またはフレーズのコレクションを含むテキストファイルを準備しておく必要があります。 Amazon Transcribe Medical はこのテキストファイルを使用して、それらの単語またはフレーズの文字起こし精度を向上させるために使用できるカスタム語彙を作成します。[https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CreateMedicalVocabulary.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CreateMedicalVocabulary.html) API または Amazon Transcribe Medical コンソールを使用してカスタム語彙を作成できます。

## AWS マネジメントコンソール
<a name="create-med-custom-vocab-console"></a>

を使用してカスタム語 AWS マネジメントコンソール 彙を作成するには、単語またはフレーズを含むテキストファイルの Amazon S3 URI を指定します。

1. [AWS マネジメントコンソール](https://console.aws.amazon.com/transcribe/) にサインインします。

1. ナビゲーションペインの Amazon Transcribe Medical で、**カスタム語**彙を選択します。

1. **名前** を使用する場合、**語彙の設定**で、カスタム語彙の名前を選択します。

1.  Amazon S3で音声ファイルまたはビデオファイルの場所を指定します。
   + **語彙の設定** の **S3 の語彙入力ファイルの場所**で、カスタムボキャブラリーの作成に使用するテキストファイルを識別する Amazon S3 URI を指定します。
   + **S3 の語彙入力ファイルの場所**については、**S3 の参照** を選択してテキストファイルを参照し、それを選択します。

1. [**語彙の作成**] を選択します。

カスタム語彙の処理ステータスが AWS マネジメントコンソールで確認できます。

## API
<a name="create-med-custom-vocab-api"></a>

**医療用カスタム語彙を作成 (API)するには**
+ [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html) API では、以下のものを指定します。

  1. `LanguageCode` の場合、`en-US` を指定します。

  1. では`VocabularyFileUri`、カスタム語彙の定義に使用するテキストファイル Amazon S3 の場所を指定します。

  1. `VocabularyName` の場合、カスタム語彙の名前を指定します。指定する名前は、 内で一意である必要があります AWS アカウント。

カスタム語彙の処理状況を表示する場合、[https://docs.aws.amazon.com/transcribe/latest/APIReference/API_GetMedicalVocabulary.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_GetMedicalVocabulary.html) API を使用します。

以下は、 AWS SDK for Python (Boto3) を使用してカスタム語彙を作成するリクエストの例です。

```
from __future__ import print_function
import time
import boto3  
transcribe = boto3.client('transcribe', '{{us-west-2}}')
vocab_name = "{{my-first-vocabulary}}"
response = transcribe.create_medical_vocabulary(
    VocabularyName = job_name,
    VocabularyFileUri = 's3://{{amzn-s3-demo-bucket}}/{{my-vocabularies}}/{{my-vocabulary-table}}.txt'
    LanguageCode = 'en-US',
  )
  
while True:
    status = transcribe.get_medical_vocabulary(VocabularyName = vocab_name)
    if status['VocabularyState'] in ['READY', 'FAILED']:
        break
    print("Not ready yet...")
    time.sleep(5)
print(status)
```

## AWS CLI
<a name="create-med-custom-vocab-cli"></a>

**バッチ文字起こしジョブ (AWS CLI) で、スピーカーパーティショニングを有効にする**
+ 以下のコードを実行します。

  ```
  aws transcribe create-medical-vocabulary \
  --vocabulary-name {{my-first-vocabulary}} \ 
  --vocabulary-file-uri s3://{{amzn-s3-demo-bucket}}/{{my-vocabularies}}/{{my-vocabulary-file}}.txt \
  --language-code {{en-US}}
  ```