

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 使用醫學自訂詞彙提高轉錄準確性
<a name="vocabulary-med"></a>

若要改善 Amazon Transcribe Medical 中的轉錄準確性，請建立並使用一或多個醫療自訂詞彙。*自訂詞彙*是特定領域的單字或片語的集合。此集合有助於改善 Amazon Transcribe Medical 在轉錄這些字詞或片語時的效能。

當您使用 Amazon Transcribe Medical 時，您必須對自己的資料完整性負責。請勿在自訂詞彙中輸入機密資訊、個人資訊 (PII) 或受保護的健康資訊 (PHI)。

為了達到最佳效果，請建立獨立的小型自訂詞彙，每個詞彙都有助於轉錄特定的錄音。與建立用於所有錄音的大型自訂詞彙相較，您在轉錄準確性上感受到更大幅的改進。

根據預設，您的 中最多可以有 100 個自訂詞彙 AWS 帳戶。自訂詞彙的大小不得超過 50 KB。如需有關請求增加自訂詞彙數量的資訊 AWS 帳戶，請參閱 [AWS 服務配額](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html)。

自訂詞彙提供美式英文版本 (en-US)。

**Topics**
+ [為您的醫療自訂詞彙建立文字檔案](create-med-vocab-text.md)
+ [使用文字檔案建立醫學自訂詞彙](create-med-custom-vocabulary.md)
+ [使用醫學自訂詞彙轉錄音訊檔案](start-med-custom-vocab-job.md)
+ [使用醫學自訂詞彙轉錄即時串流](start-med-vocab-stream.md)
+ [Amazon Transcribe Medical 的字元集](charsets-med.md)

# 為您的醫療自訂詞彙建立文字檔案
<a name="create-med-vocab-text"></a>

若要建立自訂詞彙，您可以建立 UTF-8 格式的文字檔案。在此檔案中，您建立一個四欄表格，每欄指定一個欄位。每個欄位都會告訴 Amazon Transcribe Medical 網域特定詞彙的發音方式，或如何在轉錄中顯示這些詞彙。您可以將包含這些欄位的文字檔案存放在 Amazon S3 儲存貯體中。

## 了解如何格式化文字檔案
<a name="understand-vocab-formatting"></a>

若要建立醫療自訂詞彙，請將欄名稱輸入為標題列。您可以在標題列下方輸入每個欄的值。

以下是表格四欄的名稱：
+  `Phrase` – 必填欄，必填值 
+  `IPA` – 必填欄，可選填值 
+  `SoundsLike` – 必填欄，可選填值 
+  `DisplayAs` – 必填欄，可選填值 

建立自訂詞彙時，請確定：
+ 使用單一 Tab 字元分隔每個資料欄。如果您嘗試使用空格或多個 Tab 字元分隔資料欄，則 會 Amazon Transcribe 擲出錯誤訊息。
+ 確定欄中的每個值後沒有空格或空白格。

確定您為每一欄輸入的值：
+ 不超過 256 個字元，連字號包括在內
+ 僅使用允許字元集的字元，請參閱 [Amazon Transcribe Medical 的字元集](charsets-med.md)

## 輸入表格欄的值
<a name="entering-vocabulary-values-med"></a>

下列資訊顯示如何為表格的四個欄指定值：
+ `Phrase` – 應可辨識的單字或片語。您必須在此欄中輸入值。

  如果項目是詞組，請以連字號 (-) 區隔字組。例如，​輸入 **cerebral autosomal dominant arteriopathy with subcortical infarcts and leukoencephalopathy** 為 **cerebral-autosomal-dominant-arteriopathy-with-subcortical-infarcts-and-leukoencephalopathy**。

  首字母縮寫或其他單字的字母應單獨發音，請在單一字母後面接著輸入點，例如 **D.N.A.** 或 **S.T.E.M.I.**。若要輸入首字母縮寫的複數形式，例如「STEM」，請使用連字號分隔「s」與首字母縮寫：「**S.T.E.M.I-s**」您可以使用大寫或小寫字母作為首字母縮寫。

  `Phrase` 欄是必填欄。您可對輸入語言使用任何允許的字元。如需允許的字元，請參閱 [Amazon Transcribe Medical 的字元集](charsets-med.md)。如果您未指定資料`DisplayAs`欄， Amazon Transcribe Medical 會使用輸出檔案中資料`Phrase`欄的內容。
+ `IPA`(必填欄，可選填值) – 若要指定單字或片語的發音，您可以在此欄中包含[國際音標 (IPA)](https://en.wikipedia.org/wiki/International_Phonetic_Alphabet) 中的字元。`IPA` 欄不能包含前置或結尾空格，而且您必須使用單一空格以區隔輸入中的每個音節。例如，在英文中您可將片語 **acute-respiratory-distress-syndrome** 輸入為 **ə k j u t ɹ ɛ s p ɪ ɹ ə t ɔ ɹ i d ɪ s t ɹ ɛ s s ɪ n d ɹ oʊ m**。亦可將片語 **A.L.L.** 輸入為 **eɪ ɛ l ɛ l**。

  即使您未指定 `IPA` 欄的內容，也必須包含空白 `IPA` 欄。如果您在 `IPA` 欄中包含值，則無法提供 `SoundsLike` 欄的值。

  如需特定語言允許的 IPA 字元清單，請參閱 [Amazon Transcribe Medical 的字元集](charsets-med.md)。美式英文是 Amazon Transcribe Medical 中唯一可用的語言。
+ `SoundsLike`(必填欄，可選填值) – 您可以將單字或片語分成較小的區段，並使用語言的標準正字法，為每個區段提供發音，以模仿單字的發音。例如，在英文中您可以提供片語 **cerebral-autosomal-dominant-arteriopathy-with-subcortical-infarcts-and-leukoencephalopathy** 的發音提示，如下所示：**sir-e-brul-aut-o-som-ul-dah-mi-nant-ar-ter-ri-o-pa-thy-with-sub-cor-ti-cul-in-farcts-and-lewk-o-en-ce-phul-ah-pu-thy**。片語 **atrioventricular-nodal-reentrant-tachycardia** 的提示看起來像這樣：**ay-tree-o-ven-trick-u-lar-node-al-re-entr-ant-tack-ih-card-ia**。您可以使用連字號 (-) 區隔提示的每個部分。

  即使您未提供 `SoundsLike` 欄的值，也必須包含空白 `SoundsLike` 欄。如果您在 `SoundsLike` 欄中包含值，則無法提供 `IPA` 欄的值。

  您可對輸入語言使用任何允許的字元。針對允許使用的字元清單，請參閱 [Amazon Transcribe Medical 的字元集](charsets-med.md)。
+ `DisplayAs` (必填欄，可選填值)– 定義單字或片語輸出時的外觀。例如，如果單字或片語為 **cerebral-autosomal-dominant-arteriopathy-with-subcortical-infarcts-and-leukoencephalopathy**，則您可以將顯示形式指定為 `cerebral autosomal dominant arteriopathy with subcortical infarcts and leukoencephalopathy`，使連字號不會出現。如果您想要在輸出中顯示縮寫，而不是完整的術語，您也可以指定 `DisplayAs` 為 `CADASIL`。

  如果您未指定資料`DisplayAs`欄， Amazon Transcribe Medical 會使用輸出中輸入檔案的資料`Phrase`欄。

  您可以在 `DisplayAs` 欄中使用任何 UTF-8 字元。

您僅可在 `IPA` 和 `DisplayAs` 欄中的值納入空格。

若要建立自訂詞彙的文字檔案，請將文字檔案中的每個單字或片語放在不同的行上。請使用 Tab 字元分隔欄。僅在 `IPA` 和 `DisplayAs` 欄中包含值。將副檔名為 的檔案儲存在您使用 Amazon Transcribe Medical 建立自訂詞彙 AWS 區域 的相同 Amazon S3 儲存貯`.txt`體中。

如果您在 Windows 中編輯文字檔案，請確定您的檔案為 `LF` 格式，而非 `CRLF` 格式。否則，您將無法建立自訂詞彙。某些文字編輯器可讓您使用「尋找」和「取代」命令變更格式。

下列範例顯示可用來建立自訂詞彙的文字。若要從這些範例建立自訂詞彙，請將範例複製到文字編輯器中，以 Tab 字元取代 `[TAB]`，然後將儲存的文字檔案上傳到 Amazon S3。

```
Phrase[TAB]IPA[TAB]SoundsLike[TAB]DisplayAs
acute-respiratory-distress-syndrome[TAB][TAB][TAB]acute respiratory distress syndrome
A.L.L.[TAB]eɪ ɛ l ɛ l[TAB][TAB]ALL
atrioventricular-nodal-reentrant-tachycardia[TAB][TAB]ay-tree-o-ven-trick-u-lar-node-al-re-entr-ant-tack-ih-card-ia[TAB]
```

您可以按任何順序輸入欄。下列範例顯示自訂詞彙輸入檔案的其他有效結構。

```
Phrase[TAB]SoundsLike[TAB]IPA[TAB]DisplayAs
acute-respiratory-distress-syndrome[TAB][TAB][TAB]acute respiratory distress syndrome
A.L.L.[TAB][TAB]eɪ ɛ l ɛ l[TAB]ALL
atrioventricular-nodal-reentrant-tachycardia[TAB]ay-tree-o-ven-trick-u-lar-node-al-re-entr-ant-tack-ih-card-ia[TAB][TAB]
```

```
DisplayAs[TAB]SoundsLike[TAB]IPA[TAB]Phrase
acute respiratory distress syndrome[TAB][TAB][TAB]acute-respiratory-distress-syndrome
ALL[TAB][TAB]eɪ ɛ l ɛ l[TAB]A.L.L.
[TAB]ay-tree-o-ven-trick-u-lar-node-al-re-entr-ant-tack-ih-card-ia[TAB][TAB]atrioventricular-nodal-reentrant-tachycardia
```

為了便於閱讀，下表以 html 格式更清楚地顯示前面的例子。它們只是為了描述這些範例。


| 片語 | IPA | SoundsLike | DisplayAs | 
| --- | --- | --- | --- | 
| acute-respiratory-distress-syndrome |  |  | acute respiratory distress syndrome | 
| A.L.L. | eɪ ɛ l ɛ l |  | ALL | 
| atrioventricular-nodal-reentrant-tachycardia |  | ay-tree-o-ven-trick-u-lar-node-al-re-entr-ant-tack-ih-card-ia |  | 


| 片語 | SoundsLike | IPA | DisplayAs | 
| --- | --- | --- | --- | 
| acute-respiratory-distress-syndrome |  |  | acute respiratory distress syndrome | 
| atrioventricular-nodal-reentrant-tachycardia | ay-tree-o-ven-trick-u-lar-node-al-re-entr-ant-tack-ih-card-ia |  |  | 
| A.L.L. |  | eɪ ɛ l ɛ l | ALL | 


| DisplayAs | SoundsLike | IPA | 片語 | 
| --- | --- | --- | --- | 
| acute respiratory distress syndrome |  |  | acute-respiratory-distress-syndrome | 
| ALL |  | eɪ ɛ l ɛ l | A.L.L. | 
|  | ay-tree-o-ven-trick-u-lar-node-al-re-entr-ant-tack-ih-card-ia |  | atrioventricular-nodal-reentrant-tachycardia | 

# 使用文字檔案建立醫學自訂詞彙
<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。

以下是使用 適用於 Python (Boto3) 的 AWS SDK 建立自訂詞彙的範例請求。

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

# 使用醫學自訂詞彙轉錄音訊檔案
<a name="start-med-custom-vocab-job"></a>

使用 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html)或 AWS 管理主控台 啟動轉錄任務，該任務使用自訂詞彙來改善轉錄準確性。

## AWS 管理主控台
<a name="start-med-custom-vocab-job-console"></a>

1. 登入 [AWS 管理主控台](https://console.aws.amazon.com/transcribe/)。

1. 在導覽窗格的 Amazon Transcribe Medical 下，選擇**轉錄任務**。

1. 選擇**建立作業**。

1. 在**指定作業詳細資訊**頁面上，提供轉錄作業的相關資訊。

1. 選擇**下一步**。

1. 在**自訂**下，啟用**自訂詞彙**。

1. 在**詞彙選擇**下，選擇自訂詞彙。

1. 選擇**建立**。

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

**使用批次轉錄作業 (API) 在音訊檔案中啟用發言者分隔**
+ 對於 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html) API，請指定以下項目。

  1. 對於 `MedicalTranscriptionJobName`，請指定在 AWS 帳戶中唯一的名稱。

  1. 對於 `LanguageCode`，請指定與音訊檔案中所說的語言對應的語言代碼，以及詞彙篩選語言對應的語言。

  1. 對於 `Media` 物件的 `MediaFileUri` 參數中，指定您要轉錄的音訊檔案名稱。

  1. 對於 `Specialty`，請指定在音訊檔案中說話的臨床醫生的醫療專科。

  1. 對於 `Type`，指定音訊檔案是對話或聽寫。

  1. 對於 `OutputBucketName`，指定 Amazon S3 儲存貯體以存放轉錄結果。

  1. 對於 `Settings` 物件，請指定下列項目：

     1. `VocabularyName` — 您的自訂詞彙的名稱。

下列請求使用 適用於 Python (Boto3) 的 AWS SDK 啟動具有自訂詞彙的批次轉錄任務。

```
from __future__ import print_function
import time
import boto3
transcribe = boto3.client('transcribe', 'us-west-2')
job_name = "my-first-med-transcription-job"
job_uri = "s3://amzn-s3-demo-bucket/my-input-files/my-media-file.flac"
transcribe.start_medical_transcription_job(
   MedicalTranscriptionJobName = job_name,
   Media = {
       'MediaFileUri': job_uri
   },
   OutputBucketName = 'amzn-s3-demo-bucket',
   OutputKey = 'my-output-files/', 
   LanguageCode = 'en-US',
   Specialty = 'PRIMARYCARE',
   Type = 'CONVERSATION',
   Settings = {
       'VocabularyName': 'example-med-custom-vocab'
       }
 )

while True:
   status = transcribe.get_medical_transcription_job(MedicalTranscriptionJobName = job_name)
   if status['MedicalTranscriptionJob']['TranscriptionJobStatus'] in ['COMPLETED', 'FAILED']:
        break
    print("Not ready yet...")
    time.sleep(5)
print(status)
```

# 使用醫學自訂詞彙轉錄即時串流
<a name="start-med-vocab-stream"></a>

若要提高即時串流中的轉錄準確性，您可以使用 HTTP/2 或 WebSocket 串流以使用自訂詞彙。若要開始 HTTP/2 請求，請使用 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartMedicalStreamTranscription.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartMedicalStreamTranscription.html) API。您可以使用 AWS 管理主控台、 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartMedicalStreamTranscription.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartMedicalStreamTranscription.html) API 或使用 WebSocket 通訊協定，即時使用自訂詞彙。

## 轉錄您向麥克風口說話的聽寫 (AWS 管理主控台)
<a name="streaming-medical-vocabulary-console"></a>

若要使用 AWS 管理主控台 轉錄醫療口述的串流音訊，請選擇轉錄醫療口述、啟動串流，以及開始對麥克風說話的選項。

**轉錄醫療聽寫的串流音訊 (AWS 管理主控台)**

1. 登入 [AWS 管理主控台](https://console.aws.amazon.com/transcribe/)。

1. 在導覽窗格的 Amazon Transcribe Medical 下，選擇**即時轉錄**。

1. 對於**醫療專科**，請選擇在串流說話的臨床醫生的醫學專科。

1. 對於**音訊輸入類型**，選擇**對話**或**聽寫**。

1. 對於**其他設定**，請選擇**自訂詞彙**。

   1. 對於**詞彙選擇**，請選擇自訂詞彙。

1. 選擇**開始串流**。

1. 對著麥克風說話。

## 在 HTTP/2 串流中啟用發言者分隔
<a name="vocabulary-med-http2"></a>

以下是 HTTP/2 請求的參數語法。

```
POST /medical-stream-transcription HTTP/2
host: transcribestreaming.us-west-2.amazonaws.com
authorization: Generated value
x-amz-target: com.amazonaws.transcribe.Transcribe.StartMedicalStreamTranscription
x-amz-content-sha256: STREAMING-MED-AWS4-HMAC-SHA256-EVENTS
x-amz-date: 20220208T235959Z
x-amzn-transcribe-session-id: my-first-http2-med-stream
x-amzn-transcribe-language-code: en-US
x-amzn-transcribe-media-encoding: flac
x-amzn-transcribe-sample-rate: 16000
x-amzn-transcribe-vocabulary-name: my-first-med-vocab
x-amzn-transcribe-specialty: PRIMARYCARE
x-amzn-transcribe-type: CONVERSATION
x-amzn-transcribe-show-speaker-label: true
Content-type: application/vnd.amazon.eventstream
transfer-encoding: chunked
```

參數描述：
+ **主機**：使用 AWS 區域 您正在呼叫的 更新 AWS 區域 （上述範例中的「us-west-2」)。如需有效清單 AWS 區域，請參閱 [AWS 區域 和 端點](https://docs.aws.amazon.com/general/latest/gr/rande.html#transcribe_region)。
+ **授權**：這是自動產生的欄位。若要進一步了解如何建立簽章，請參閱[使用簽章第 4 版簽署 AWS 請求](https://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html)。
+ **x-amz-target**：請勿變更此欄位；請使用上述範例中顯示的內容。
+ **x-amz-content-sha256**：這是自動產生的欄位。若要進一步了解如何計算簽章，請參閱[使用簽章第 4 版簽署 AWS 請求](https://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html)。
+ **x-amz-date**：簽章的建立日期與時間。格式為 YYYYMMDDTHHMMSSZ，其中 YYYY = 年，MM = 月，DD = 日，HH = 小時，MM = 分鐘，SS = 秒，而「T」和「Z」為固定字元。如需詳細資訊，請參閱 [Signature 第 4 版的處理日期](https://docs.aws.amazon.com/general/latest/gr/sigv4-date-handling.html)。
+ **x-amzn-transcribe-session-id**：串流工作階段的名稱。
+ **x-amzn-transcribe-language-code**：用於輸入音訊的編碼。請參閱 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartMedicalStreamTranscription.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartMedicalStreamTranscription.html) 或 [支援的語言和特定語言功能](supported-languages.md)，了解有效值的清單。
+ **x-amzn-transcribe-media-encoding**：用於輸入音訊的編碼 有效值為 `pcm`、`ogg-opus` 和 `flac`。
+ **x-amzn-transcribe-sample-rate**：輸入音訊的範例速率 （以 Hertz 為單位）。 Amazon Transcribe 支援從 8，000 Hz 到 48，000 Hz 的範圍。劣質的音訊，例如電話音訊，通常約為 8,000 Hz。優質的音訊，通常介於 16,000 Hz 至 48,000 Hz 間。請注意，您指定的取樣率**必須**與音訊的取樣率相符。
+ **x-amzn-transcribe-vocabulary-name**：您要與轉錄搭配使用的詞彙名稱。
+ **x-amzn-transcribe-specialty**：正在轉錄的醫療專科。
+ **x-amzn-transcribe-type**：選擇是聽寫或對話。
+ **x-amzn-transcribe-show-speaker-label**：要啟用日記，此值必須是 `true`。
+ **content-type**：請勿變更此欄位；請使用上述範例中顯示的內容。

## 在 WebSocket 請求中啟用發言者分隔
<a name="vocabulary-websocket"></a>

若要使用 API 以分隔 WebSocket 串流中的發言者，請使用下列格式以建立預先簽署的 URI，開始 WebSocket請要求並設定 `vocabulary-name` 為自訂詞彙的名稱。

```
GET wss://transcribestreaming.us-west-2.amazonaws.com:8443/medical-stream-transcription-websocket
?language-code=en-US
&X-Amz-Algorithm=AWS4-HMAC-SHA256
&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20220208%2Fus-west-2%2Ftranscribe%2Faws4_request
&X-Amz-Date=20220208T235959Z
&X-Amz-Expires=300
&X-Amz-Security-Token=security-token
&X-Amz-Signature=Signature Version 4 signature 
&X-Amz-SignedHeaders=host
&media-encoding=flac
&sample-rate=16000
&session-id=sessionId
&specialty=medicalSpecialty
&type=CONVERSATION
&vocabulary-name=vocabularyName
&show-speaker-label=boolean
```

# Amazon Transcribe Medical 的字元集
<a name="charsets-med"></a>

若要在 Amazon Transcribe Medical 中使用自訂詞彙，請使用下列字元集。

## 英文字元集
<a name="char-english-med"></a>

若是英文自訂詞彙，您可以在 `Phrase` 和 `SoundsLike` 欄中使用下列字元：
+ a - z
+ A - Z
+ '(單引號)
+ -(連字號)
+ .(句點)

您可以在詞彙輸入檔案的 `IPA` 欄中，使用下列國際音標 (IPA) 字元。


| 字元 | Code | 字元 | Code | 
| --- | --- | --- | --- | 
| aʊ | 0061 028A | w | 0077 | 
| aɪ | 0061 026A | z | 007A | 
| b | 0062 | æ | 00E6 | 
| d | 0064 | ð | 00F0 | 
| eɪ | 0065 026A | ŋ | 014B | 
| f | 0066 | ɑ | 0251 | 
| g | 0067 | ɔ | 0254 | 
| h | 0068 | ɔɪ | 0254 026A | 
| i | 0069 | ə | 0259 | 
| j | 006A | ɛ | 025B | 
| k | 006B | ɝ | 025D | 
| l | 006C | ɡ | 0261 | 
| l̩ | 006C 0329 | ɪ | 026A | 
| m | 006D | ɹ | 0279 | 
| n | 006E | ʃ | 0283 | 
| n̩ | 006E 0329 | ʊ | 028A | 
| oʊ | 006F 028A | ʌ | 028C | 
| p | 0070 | ʍ | 028D | 
| s | 0073 | ʒ | 0292 | 
| t | 0074 | ʤ | 02A4 | 
| u | 0075 | ʧ | 02A7 | 
| v | 0076 | θ | 03B8 | 