

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

# Amazon Transcribe 醫療
<a name="transcribe-medical"></a>

Amazon Transcribe Medical 是一種自動語音辨識 (ASR) 服務，專為想要轉錄醫療相關語音的醫療專業人員而設計，例如醫生口述筆記、藥物安全監控、遠距醫療預約或醫生與患者對話。 Amazon Transcribe 醫療可透過即時串流 （透過麥克風） 或上傳檔案 （批次） 的文字記錄來提供。

**重要**  
Amazon Transcribe 醫療不能取代專業醫療建議、診斷或治療。確認使用案例的相關可信度閾值，並在需要高準確性的情況下使用高可信度閾值。對於某些使用案例，應由經過適當訓練的人工審核人員審核和驗證結果。 Amazon Transcribe 醫療轉錄只有在經過訓練的醫療專業人員審核準確性和良好的醫療判斷後，才應用於病患照護案例。

Amazon Transcribe Medical 以共同的責任模型運作，因此 AWS 負責保護執行 Amazon Transcribe Medical 的基礎設施，而且您負責管理您的資料。如需詳細資訊，請參閱[共同責任模型](https://aws.amazon.com/compliance/shared-responsibility-model/)。

Amazon Transcribe 醫療提供美國英文 (en-US) 版本。

為了獲得最佳結果，使用不失真的音訊格式，例如 FLAC 或以 PCM 16 位元編碼的 WAV。 Amazon Transcribe Medical 支援 16,000 Hz 或更高的取樣率。

若要分析您的文字記錄，您可以使用其他 AWS 服務，例如 [Amazon Comprehend Medical](https://docs.aws.amazon.com/comprehend/latest/dg/comprehend-medical.html)。


**支援的專科**  

| 專科 | 子專科 | 音訊輸入 | 
| --- | --- | --- | 
| 心臟科 | 無 | 僅串流 | 
| 神經病學 | 無 | 僅串流 | 
| 腫瘤學 | 無 | 僅串流 | 
| 初級護理 | 家庭醫學 | 批次，串流 | 
| 初級護理 | 內科 | 批次，串流 | 
| 初級護理 | 婦產科 (OB-GYN) | 批次，串流 | 
| 初級護理 | 小兒科 | 批次，串流 | 
| 放射學 | 無 | 僅串流 | 
| 泌尿外科 | 無 | 僅串流 | 

## 區域可用性和配額
<a name="med-regions"></a>

下列支援呼叫分析 AWS 區域：


| **區域** | **轉錄類型** | 
| --- | --- | 
| af-south-1(開普敦) | 批次 | 
| ap-east-1(香港) | 批次 | 
| ap-northeast-1(東京) | 批次，串流 | 
| ap-northeast-2(首爾) | 批次，串流 | 
| ap-south-1(孟買) | 批次 | 
| ap-southeast-1(新加坡) | 批次 | 
| ap-southeast-2(雪梨) | 批次，串流 | 
| ca-central-1(加拿大中部) | 批次，串流 | 
| eu-central-1(法蘭克福) | 批次，串流 | 
| eu-north-1(斯德哥爾摩) | 批次 | 
| eu-west-1(愛爾蘭) | 批次，串流 | 
| eu-west-2(倫敦) | 批次，串流 | 
| eu-west-3(巴黎) | 批次 | 
| me-south-1(巴林) | 批次 | 
| sa-east-1(聖保羅) | 批次，串流 | 
| us-east-1(維吉尼亞北部) | 批次，串流 | 
| us-east-2(俄亥俄) | 批次，串流 | 
| us-gov-east-1(GovCloud，美國東部) | 批次，串流 | 
| us-gov-west-1(GovCloud，美國西部) | 批次，串流 | 
| us-west-1(舊金山) | 批次 | 
| us-west-2(奧勒岡) | 批次，串流 | 

請注意， [Amazon Transcribe](what-is.md#tsc-regions)、 Amazon Transcribe Medical和[通話分析](call-analytics.md#tca-regions)的區域支援不同。

如需每個服務區域的端點，請參閱《AWS 一般參考》**中的[服務端點](https://docs.aws.amazon.com/general/latest/gr/transcribe.html#transcribe_region)。

如需與轉錄相關的配額清單，請參閱《AWS 一般參考》**中的 [Service Quotas](https://docs.aws.amazon.com/general/latest/gr/transcribe.html#limits-amazon-transcribe)。有些配額可以按請求變更。如果**可調整**欄包含「**是**」，您可以要求增加。若要執行此作業，請選擇提供的連結。

# 醫療專業與術語
<a name="how-it-works-med"></a>

建立醫學轉錄任務時，請指定來源檔案的語言、醫療專業和音訊類型。輸入美式英文 (en-US) 作為語言，及 `PRIMARYCARE` 做為醫療專業。輸入初級醫療做為值，可讓您從下列醫療專業的來源音訊產生轉錄：
+ 家庭醫學
+ 內科
+ 婦產科 (OB-GYN)
+ 小兒科

您可以在口述和對話之間選擇您的音訊類型。為音訊檔案選擇口述，在此檔案中醫師提供了關於病患探訪或程序的報告。選擇對話的音訊檔案，這些檔案涉及醫生與病患之間的對話，或是醫生之間的對話。

若要儲存轉錄任務的輸出，請選取您已建立的儲存 Amazon S3 貯體。如需儲存 Amazon S3 貯體的詳細資訊，請參閱 [入門 Amazon Simple Storage Service](https://docs.aws.amazon.com/AmazonS3/latest/gsg/GetStartedWithS3.html)。

以下是在 JSON 中輸入的請求參數最小數量：

```
{
   "MedicalTranscriptionJobName": "my-first-transcription-job",
   "LanguageCode": "en-US",
   "Media": {
       "MediaFileUri": "s3://path to your audio file"
   },
   "OutputBucketName": “your output bucket name",
   "Specialty": "PRIMARYCARE",
   "Type": "CONVERSATION"
}
```

Amazon Transcribe Medical 可讓您產生替代轉錄。如需詳細資訊，請參閱[產生替代轉錄](alternative-med-transcriptions.md)。

您也可以啟用發言者分隔或識別音訊中的聲道。如需詳細資訊，請參閱 [啟用發言者分隔](conversation-diarization-med.md) 及 [轉錄多聲道音訊](conversation-channel-id-med.md)。

# 轉錄醫療術語及衡量值
<a name="how-measurements-med"></a>

Amazon Transcribe Medical 可以轉錄醫療術語和測量。 Amazon Transcribe 醫療輸出口語術語的縮寫。例如，「血壓」會轉錄成 BP。您可以在此頁面的表格中找到 Amazon Transcribe Medical 用於醫療術語和測量的慣例清單。*口述術語*欄位是指來源音訊中所說的術語。*輸出*欄位是指您在轉錄結果中看到的縮寫。

您可以在這裡看到來源音訊中所說的術語與轉錄輸出如何對應。


| 來源音訊中所說的術語 | 輸出中使用的縮寫 | 範例輸出 | 
| --- | --- | --- | 
| 攝氏度 | C | 病患的體溫為 37.4 C。 | 
| 攝氏度 | C | 病患的體溫為 37.4 C。 | 
| 華氏度 | F | 病患的體溫為 101 F。 | 
| 公克 | g | 從病患抽取了 100 g 的質量。 | 
| 公尺 | m | 病患身高 1.8 m。 | 
| 英尺 | ft | 病患身高 6 ft。 | 
| 公斤 | kg | 病患的體重為 80 kg。 | 
| 公斤 | kg | 病患的體重為 80 kg。 | 
| c c | cc | 病患接受了 100 cc 的生理食鹽水。 | 
| 立方公分 | cc | 病患接受了 100 cc 的生理食鹽水。 | 
| 毫升 | mL | 病患排出了 100 mL 的尿液。 | 
| 血壓 | BP | 病患的 BP 升高了 | 
| b p | BP | 病患的 BP 升高了 | 
| 收縮壓/舒張壓 | X/Y | 病患的 BP 是 120/80。 | 
| 每分鐘心跳次數 | BPM | 病患心房顫動，心率為 160 BPM。 | 
| 每分鐘心跳次數 | BPM | 病患心房顫動，心率為 160 BPM。 | 
| 氧氣 | O2 | 患者的 O2 飽和度 (含氧量) 為 98%。 | 
| 二氧化碳 | 二氧化碳 | 患者需要呼吸輔助以增加二氧化碳。 | 
| 術後 | POSTOP | 病患前來接受術後評估。 | 
| 術後 | POSTOP | 病患前來接受術後評估。 | 
| 電腦斷層掃描 | CT 掃描 | 顯示腦出血的病患，需要使用 CT 掃描。 | 
| 脈搏 80 | P 80 | 病患生命徵象為 P 80，R 17，... | 
| 呼吸 17 | R 17 | 病患生命徵象為 P 80，R 17，... | 
| 進出 | 輸入/輸出 | 病患為 I/O 竇性心律 | 
| 第五腰椎 | L5 | 在 L4 和 L5 之間進行腰椎穿刺 | 

# 轉錄數字
<a name="how-numbers-med"></a>

Amazon Transcribe Medical 會將數字轉錄為數字，而不是單字。例如，口述「一千兩百四十二」會轉錄為 `1242`。

數字轉錄將依下列規則進行：


| 規則 | 描述 | 
| --- | --- | 
| 將大於 10 的基數轉換成數字。 |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/transcribe/latest/dg/how-numbers-med.html)  | 
| 當「百萬」或「億」後面沒有數字時，將基數後面接著「百萬」或「億」的數字轉換為數字後接著字詞。 |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/transcribe/latest/dg/how-numbers-med.html)  | 
|  將大於 10 的序數轉換成數字。  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/transcribe/latest/dg/how-numbers-med.html)  | 
|  將分數轉換成數字形式。  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/transcribe/latest/dg/how-numbers-med.html)  | 
| 將一行中超過一位但不到十位的數值轉換成數字。 |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/transcribe/latest/dg/how-numbers-med.html)  | 
| 小數點以「點」表示。 |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/transcribe/latest/dg/how-numbers-med.html)  | 
|  將數字後的「百分比」轉換成百分比符號。  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/transcribe/latest/dg/how-numbers-med.html)  | 
|  將數字後的字詞「元」、「美元」、「澳幣」、「AUD」或「USD」轉換成數字前的美元符號。  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/transcribe/latest/dg/how-numbers-med.html)  | 
|  將字詞「磅」或「毫克」轉換為「lbs」或「mg」。  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/transcribe/latest/dg/how-numbers-med.html)  | 
|  將數字後的字詞「盧比」、「印度盧比」或「INR」轉換為數字前的盧比符號 (₹)。  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/transcribe/latest/dg/how-numbers-med.html)  | 
|  將時間轉換成數字。  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/transcribe/latest/dg/how-numbers-med.html)  | 
|  將兩位數表示的年份合併為四位數。 僅適用於 20、21 和 22 世紀。  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/transcribe/latest/dg/how-numbers-med.html)  | 
| 轉換日期成為數字。 |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/transcribe/latest/dg/how-numbers-med.html)  | 
|  使用「到」表達連續範圍數字。  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/transcribe/latest/dg/how-numbers-med.html)  | 

# 轉錄醫療對話
<a name="transcribe-medical-conversation"></a>

您可以使用 Amazon Transcribe Medical，使用批次轉錄任務或即時串流來轉錄臨床醫生和患者之間的醫療對話。批次轉錄作業可讓您轉錄音訊檔案。為了確保 Amazon Transcribe Medical 以最高的準確性產生轉錄結果，您必須在轉錄任務或串流中指定臨床醫生的醫療專科。

您可以透過以下醫療專業，轉錄臨床醫生和患者問診：
+ 心臟科 — 僅適用於串流轉錄
+ 神經病學 — 僅適用於串流轉錄
+ 腫瘤學 — 僅適用於串流轉錄
+ 初級護理 — 包括以下類型的醫療實務：
  + 家庭醫學
  + 內科
  + 婦產科 (OB-GYN)
  + 小兒科
+ 泌尿外科 — 僅適用於串流轉錄

您可以使用醫學自訂詞彙以提高轉錄準確性。如需醫療自訂詞彙運作方式的資訊，請參閱 [使用醫學自訂詞彙提高轉錄準確性](vocabulary-med.md)。

根據預設， Amazon Transcribe Medical 會傳回可信度最高的轉錄。如果您想要設定為傳回替代轉錄，請參閱 [產生替代轉錄](alternative-med-transcriptions.md)。

有關數字和醫療測量如何在轉錄輸出顯示的資訊，請參閱 [轉錄數字](how-numbers-med.md) 和 [轉錄醫療術語及衡量值](how-measurements-med.md)。

**Topics**
+ [轉錄醫療對話的音訊檔案](batch-medical-conversation.md)
+ [在即時串流中轉錄醫療對話](streaming-medical-conversation.md)
+ [啟用發言者分隔](conversation-diarization-med.md)
+ [轉錄多聲道音訊](conversation-channel-id-med.md)

# 轉錄醫療對話的音訊檔案
<a name="batch-medical-conversation"></a>

使用批次轉錄作業以轉錄醫療對話的音訊檔案。您可以使用此以轉錄臨床醫生與患者的對話。您可以使用 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html) API 或 AWS 管理主控台開始批次轉錄作業。

您使用 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html) API 開始醫學轉錄作業時，請指定 `PRIMARYCARE` 為`Specialty` 參數的值。

## AWS 管理主控台
<a name="batch-med-conversation-console"></a>

**轉錄臨床醫生與患者的對話 (AWS 管理主控台)**

若要使用 AWS 管理主控台 轉錄臨床醫生-患者對話，請建立轉錄任務，然後選擇**音訊輸入類型的****對話**。

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

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

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

1. 在**指定作業詳細資訊‭**頁面的**工作設定**下，指定下列項目。

   1. **名稱** — 轉錄作業的名稱。

   1. **音訊輸入類型** — **對話**

1. 針對其餘欄位，指定音訊檔案 Amazon S3 的位置，以及您要存放轉錄任務輸出的位置。

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

1. 選擇**建立**。

## API
<a name="batch-med-conversation-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`，請指定在音訊檔案 `PRIMARYCARE` 中說話的臨床醫生的醫療專科。

  1. 對於 `Type`，請指定 `CONVERSATION`。

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

  以下是使用 適用於 Python (Boto3) 的 AWS SDK 轉錄臨床醫生在`PRIMARYCARE`專科和患者醫療對話的範例請求。

  ```
  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-audio-file.flac"
  transcribe.start_medical_transcription_job(
        MedicalTranscriptionJobName = job_name,
        Media = {
          'MediaFileUri': job_uri
        },
        OutputBucketName = 'amzn-s3-demo-bucket',
        OutputKey = 'output-files/',
        LanguageCode = 'en-US',
        Specialty = 'PRIMARYCARE',
        Type = 'CONVERSATION'
    )
  
  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)
  ```

以下範例代碼顯示臨床醫生和患者對話的轉錄結果。

```
{
    "jobName": "conversation-medical-transcription-job",
    "accountId": "111122223333",
    "results": {
        "transcripts": [
            {
                "transcript": "... come for a follow up visit today..."
            }
        ],
        "items": [
            {
            ...
                "start_time": "4.85",
                "end_time": "5.12",
                "alternatives": [
                    {
                        "confidence": "1.0",
                        "content": "come"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "start_time": "5.12",
                "end_time": "5.29",
                "alternatives": [
                    {
                        "confidence": "1.0",
                        "content": "for"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "start_time": "5.29",
                "end_time": "5.33",
                "alternatives": [
                    {
                        "confidence": "0.9955",
                        "content": "a"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "start_time": "5.33",
                "end_time": "5.66",
                "alternatives": [
                    {
                        "confidence": "0.9754",
                        "content": "follow"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "start_time": "5.66",
                "end_time": "5.75",
                "alternatives": [
                    {
                        "confidence": "0.9754",
                        "content": "up"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "start_time": "5.75",
                "end_time": "6.02",
                "alternatives": [
                    {
                        "confidence": "1.0",
                        "content": "visit"
                    }
                ]
                ...
    },
    "status": "COMPLETED"
}
```

## AWS CLI
<a name="batch-med-conversation-cli"></a>

**使用批次轉錄作業轉錄醫療對話 (AWS CLI)**
+ 執行下列程式碼。

  ```
                      
  aws transcribe start-medical-transcription-job \
  --region us-west-2 \
  --cli-input-json file://example-start-command.json
  ```

  下列程式碼顯示 `example-start-command.json` 的內容。

  ```
  {
        "MedicalTranscriptionJobName": "my-first-med-transcription-job",        
        "Media": {
            "MediaFileUri": "s3://amzn-s3-demo-bucket/my-input-files/my-audio-file.flac"
        },
        "OutputBucketName": "amzn-s3-demo-bucket",
        "OutputKey": "my-output-files/", 
        "LanguageCode": "en-US",
        "Specialty": "PRIMARYCARE",
        "Type": "CONVERSATION"
    }
  ```

# 在即時串流中轉錄醫療對話
<a name="streaming-medical-conversation"></a>

您可以使用 HTTP/2 或 [WebSocket](https://tools.ietf.org/html/rfc6455)通訊協定以轉錄醫療對話的音訊串流。如需如何使用 WebSocket 通訊協定以開始串流的資訊，請參閱 [設定 WebSocket 串流](streaming-setting-up.md#streaming-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。

您可以使用下列醫療專科，轉錄串流音訊：
+ 心臟科
+ 神經病學
+ 腫瘤學
+ 初級護理
+ 泌尿外科

每個醫療專業包括多種類型的程序和預約。因此，臨床醫生會決定許多不同類型的筆記。請使用下列範例作為準則，協助您指定 WebSocket 請求的 `specialty` URI 參數值，或 [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 的 `Specialty` 參數：
+ 對於電生理學或超音波心電圖諮詢，請選擇 `CARDIOLOGY`。
+ 對於腫瘤內科、腫瘤外科或腫瘤放射學諮詢，請選擇 `ONCOLOGY`。
+ 對於提供中風 (暫時性缺血性或腦血管性) 的患者諮詢的醫生，請選擇 `NEUROLOGY`。
+ 對於尿失禁的諮詢，請選擇 `UROLOGY`。
+ 對於每年檢查或緊急護理問診，請選擇 `PRIMARYCARE`。
+ 對於住院者住院問診，請選擇 `PRIMARYCARE`。
+ 對於生產、輸卵管結紮、IUD 插入或墮胎的諮詢，請選擇 `PRIMARYCARE`。

## AWS 管理主控台
<a name="streaming-medical-conversation-console"></a>

**轉錄串流醫療對話 (AWS 管理主控台)**

若要使用 AWS 管理主控台 在即時串流中轉錄臨床醫生與患者對話，請選擇轉錄醫療對話、啟動串流，以及開始對麥克風說話的選項。

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

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

1. 搜尋**對話**。

1. 對於**醫療專科**，請選擇臨床醫生的專科。

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

1. 對著麥克風說話。

## 在 HTTP/2 串流轉錄醫療對話
<a name="http2-med-conversation-streaming"></a>

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

若要轉錄醫療對話的 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 並指定以下項目：
+ `LanguageCode` — 語言代碼。有效值為 `en-US`。
+ `MediaEncoding` — 輸入音訊使用的編碼。有效值為 `pcm`、`ogg-opus` 和 `flac`。
+ `Specialty` — 醫療專業人員的專科。
+ `Type` – `CONVERSATION`

若要提高即時串流中特定詞彙的轉錄準確性，請使用自訂詞彙。若要啟用自訂字彙，請將 `VocabularyName` 參數值設定為您要使用的自訂字彙的名稱。如需詳細資訊，請參閱 [使用醫學自訂詞彙提高轉錄準確性](vocabulary-med.md)。

若要標示來自不同發言者的語音，請將 `ShowSpeakerLabel` 參數設定為 `true`。如需詳細資訊，請參閱 [啟用發言者分隔](conversation-diarization-med.md)。

如需設定 HTTP/2 串流以轉錄醫療對話的詳細資訊，請參閱 [設定 HTTP/2 串流](streaming-setting-up.md#streaming-http2)。

## 在 WebSocket 串流轉錄醫療對話
<a name="transcribe-medical-conversation-websocket"></a>

您可以使用 WebSocket 請求以轉錄醫療對話。您提出 WebSocket 請求時，您會建立預先簽署的 URI。此 URI 包含在您的應用程式和 Amazon Transcribe Medical 之間建立音訊串流時所需的資訊。如需建立 WebSocket 請求的詳細資訊，請參閱 [設定 WebSocket 串流](streaming-setting-up.md#streaming-websocket)。

使用下列範本以建立您的預先簽署 URI。

```
GET wss://transcribestreaming.us-west-2.amazonaws.com:8443/medical-stream-transcription-websocket
?language-code=languageCode
&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
```

若要提高即時串流中特定詞彙的轉錄準確性，請使用自訂詞彙。若要啟用自訂字彙，請 `vocabulary-name` 將的值設定為您要使用的自訂詞彙的名稱。如需詳細資訊，請參閱 [使用醫學自訂詞彙提高轉錄準確性](vocabulary-med.md)。

若要標示來自不同發言者的語音，請將 `show-speaker-label` 參數設定為 `true`。如需詳細資訊，請參閱 [啟用發言者分隔](conversation-diarization-med.md)。

如需建立預先簽署 URI 的詳細資訊，請參閱 [設定 WebSocket 串流](streaming-setting-up.md#streaming-websocket)。

# 啟用發言者分隔
<a name="conversation-diarization-med"></a>

若要在 Amazon Transcribe Medical 中啟用發言者分割，請使用*發言者日記*。這讓您可以查看在轉錄輸出中患者說的內容以及臨床醫生說的內容。

當您啟用發言者日記時， Amazon Transcribe Medical 會使用每個發言者的唯一識別符來標記每個發言者*表達用語*。*表達用語*是語音單位，通常會以靜音區分其他表達用語。在批次轉錄中，臨床醫生的表達用語會收到 `spk_0` 的標示而患者會收到 `spk_1` 的標示。

如果一個發言者的表達用語與另一位發言者的表達用語重疊， Amazon Transcribe Medical 會按照開始時間在轉錄中排序。輸入音訊中重疊的表達用語在轉錄輸出中不會重疊。

您使用批次轉錄作業或即時串流轉錄音訊檔案時，您可以啟用發言者日記功能。

**Topics**
+ [在批次轉錄中啟用發言者分隔](conversation-diarization-batch-med.md)
+ [在即時串流中啟用發言者分隔](conversation-diarization-streaming-med.md)

# 在批次轉錄中啟用發言者分隔
<a name="conversation-diarization-batch-med"></a>

您可以在批次轉錄作業中使用 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html) API 或 AWS 管理主控台。這讓您可以在臨床醫生和患者對話中，進行每個發言者的分隔，並確定在轉錄輸出中發言者說的內容。

## AWS 管理主控台
<a name="conversation-diarization-batch-med-console"></a>

若要使用 AWS 管理主控台 在轉錄任務中啟用發言者日記，您可以啟用音訊識別，然後啟用發言者分割。

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

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

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

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

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

1. 啟用**音訊識別**。

1. 對於**音訊識別類型**，請選擇**發言者分隔**。

1. 對於**最大發言者數量**，請輸入您認為在音訊檔案中說話的最大發言者數量。

1. 選擇**建立**。

## API
<a name="conversation-diarization-batch-med-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`，請指定 `CONVERSATION`。

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

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

     1. `ShowSpeakerLabels` – `true`.

     1. `MaxSpeakerLabels`— 介於 2 和 10 之間的整數，表示您認為在音訊中說話的發言者數量。

下列請求使用 適用於 Python (Boto3) 的 AWS SDK 啟動已啟用發言者分割之主要照護臨床醫生患者對話的批次轉錄任務。

```
from __future__ import print_function
import time
import boto3
transcribe = boto3.client('transcribe', 'us-west-2')
job_name = "my-first-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',
    OutputBucketName = 'amzn-s3-demo-bucket',
Settings = {'ShowSpeakerLabels': True,
         'MaxSpeakerLabels': 2
         }
         )
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)
```

下列範例程式碼示範啟用發言者分隔的轉錄作業的轉錄結果。

```
{
    "jobName": "job ID",
    "accountId": "111122223333",
    "results": {
        "transcripts": [
            {
                "transcript": "Professional answer."
            }
        ],
        "speaker_labels": {
            "speakers": 1,
            "segments": [
                {
                    "start_time": "0.000000",
                    "speaker_label": "spk_0",
                    "end_time": "1.430",
                    "items": [
                        {
                            "start_time": "0.100",
                            "speaker_label": "spk_0",
                            "end_time": "0.690"
                        },
                        {
                            "start_time": "0.690",
                            "speaker_label": "spk_0",
                            "end_time": "1.210"
                        }
                    ]
                }
            ]
        },
        "items": [
            {
                "start_time": "0.100",
                "end_time": "0.690",
                "alternatives": [
                    {
                        "confidence": "0.8162",
                        "content": "Professional"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "start_time": "0.690",
                "end_time": "1.210",
                "alternatives": [
                    {
                        "confidence": "0.9939",
                        "content": "answer"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "alternatives": [
                    {
                        "content": "."
                    }
                ],
                "type": "punctuation"
            }
        ]
    },
    "status": "COMPLETED"
}
```

## AWS CLI
<a name="diarization-batch-cli"></a>

**轉錄執行初級護理的臨床醫生與患者對話的音訊檔案 (AWS CLI)**
+ 執行下列程式碼。

  ```
                      
  aws transcribe start-transcription-job \
  --region us-west-2 \
  --cli-input-json file://example-start-command.json
  ```

  下列程式碼顯示 `example-start-command.json` 的內容。

  ```
  {
      "MedicalTranscriptionJobName": "my-first-med-transcription-job",       
       "Media": {
            "MediaFileUri": "s3://amzn-s3-demo-bucket/my-input-files/my-audio-file.flac"
        },
        "OutputBucketName": "amzn-s3-demo-bucket",
        "OutputKey": "my-output-files/", 
        "LanguageCode": "en-US",
        "Specialty": "PRIMARYCARE",
        "Type": "CONVERSATION",
        "Settings":{
            "ShowSpeakerLabels": true,
            "MaxSpeakerLabels": 2
          }
  }
  ```

# 在即時串流中啟用發言者分隔
<a name="conversation-diarization-streaming-med"></a>

若要在即時串流中分割發言者並標記其語音，請使用 AWS 管理主控台 或串流請求。發言者分隔最適合兩個至五個發言者的串流。雖然 Amazon Transcribe Medical 可以在串流中分割超過五個發言者，但如果超過該數字，則分割區的準確性會降低。

若要開始 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。若要開始 WebSocket 請求，請使用預先簽署的 URI。URI 包含設定應用程式與 Amazon Transcribe Medical 設定雙向通訊所需的資訊。

## 在麥克風語音中啟用發言者分隔 (AWS 管理主控台)
<a name="conversation-diarization-console"></a>

您可以使用 AWS 管理主控台 來啟動臨床醫生與患者對話的即時串流，或即時對麥克風說話的口述。

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

1. 在導覽窗格中，針對 Amazon Transcribe 醫療選擇**即時轉錄**。

1. 對於**音訊輸入類型**，選擇您要轉錄的醫療語音類型。

1. 對於**其他設定**，選擇**發言者分隔**。

1. 選擇**開始串流**以開始轉錄您的即時音訊。

1. 對著麥克風說話。

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

若要在醫療對話的 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 並指定下列項目：
+ 對於 `LanguageCode`，指定與串流中的語言相對應的語言代碼。有效值為 `en-US`。
+ 對於 `MediaSampleHertz`，指定音訊的取樣率。
+ 對於 `Specialty`，指定提供者的醫療專科。
+ `ShowSpeakerLabel` – `true`

如需設定 HTTP/2 串流以轉錄醫療對話的詳細資訊，請參閱 [設定 HTTP/2 串流](streaming-setting-up.md#streaming-http2)。

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

若要使用 API 以分隔 WebSocket 串流中的發言者，請使用下列格式以建立預先簽署的 URI，開始 WebSocket 請求並設定 `show-speaker-label` 為 `true`。

```
GET wss://transcribestreaming.us-west-2.amazonaws.com:8443/medical-stream-transcription-websocket
?language-code=languageCode
&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
```

下列程式碼示範串流請求的截斷範例回應。

```
{
  "Transcript": {
    "Results": [
      {
        "Alternatives": [
          {
            "Items": [
              {
                "Confidence": 0.97,
                "Content": "From",
                "EndTime": 18.98,
                "Speaker": "0",
                "StartTime": 18.74,
                "Type": "pronunciation",
                "VocabularyFilterMatch": false
              },
              {
                "Confidence": 1,
                "Content": "the",
                "EndTime": 19.31,
                "Speaker": "0",
                "StartTime": 19,
                "Type": "pronunciation",
                "VocabularyFilterMatch": false
              },
              {
                "Confidence": 1,
                "Content": "last",
                "EndTime": 19.86,
                "Speaker": "0",
                "StartTime": 19.32,
                "Type": "pronunciation",
                "VocabularyFilterMatch": false
              },
             ...
              {
                "Confidence": 1,
                "Content": "chronic",
                "EndTime": 22.55,
                "Speaker": "0",
                "StartTime": 21.97,
                "Type": "pronunciation",
                "VocabularyFilterMatch": false
              },
              ...
                "Confidence": 1,
                "Content": "fatigue",
                "EndTime": 24.42,
                "Speaker": "0",
                "StartTime": 23.95,
                "Type": "pronunciation",
                "VocabularyFilterMatch": false
              },
              {
                "EndTime": 25.22,
                "StartTime": 25.22,
                "Type": "speaker-change",
                "VocabularyFilterMatch": false
              },
              {
                "Confidence": 0.99,
                "Content": "True",
                "EndTime": 25.63,
                "Speaker": "1",
                "StartTime": 25.22,
                "Type": "pronunciation",
                "VocabularyFilterMatch": false
              },
              {
                "Content": ".",
                "EndTime": 25.63,
                "StartTime": 25.63,
                "Type": "punctuation",
                "VocabularyFilterMatch": false
              }
            ],
            "Transcript": "From the last note she still has mild sleep deprivation and chronic fatigue True."
          }
        ],
        "EndTime": 25.63,
        "IsPartial": false,
        "ResultId": "XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX",
        "StartTime": 18.74
      }
    ]
  }
}
```

Amazon Transcribe Medical 會根據自然語音區段來中斷傳入的音訊串流，例如喇叭變更或音訊暫停。系統會漸進式地將轉錄傳回您的應用程式，每次回應皆會包含更多轉錄的語音，直到整個區段轉錄完成。上述程式碼是完全轉錄語音區段的截斷範例。只有完全轉錄的區段會顯示發言者標籤。

下列清單顯示串流轉錄輸出中物件和參數的組織。

**`Transcript`**  
每個語音區段都有自己的 `Transcript` 物件。

**`Results`**  
每個 `Transcript` 物件都有自己的 `Results` 物件。此物件包含 `isPartial` 欄位。其值為 `false` 時，傳回的結果會針對整個語音區段。

**`Alternatives`**  
每個 `Results` 物件都有一個 `Alternatives` 物件。

**`Items`**  
每個 `Alternatives` 物件都有自己的 `Items` 物件，其中包含轉錄輸出中每個單字和標點符號的相關資訊。當您啟用發言者分割時，每個單字都有完整轉錄語音區段的`Speaker`標籤。 Amazon Transcribe Medical 使用此標籤為串流中的每個發言者指派唯一的整數。值為 `speaker-change` 的 `Type` 參數代表使用者已經停止說話，而另一個使用者即將開始。

**`Transcript`**  
每個項目物件都包含轉錄的語音區段作為 `Transcript` 欄位的值。

如需 WebSocket 請求的詳細資訊，請參閱 [設定 WebSocket 串流](streaming-setting-up.md#streaming-websocket)。

# 轉錄多聲道音訊
<a name="conversation-channel-id-med"></a>

如果您的音訊檔案或串流有多個頻道，您可以使用*頻道識別*來轉錄每個頻道的語音。 Amazon Transcribe Medical 會分別轉錄每個頻道的語音。它將每個聲道的獨立轉錄與單一轉錄輸出結合。

使用聲道識別以識別音訊中不同的聲道，並從每個聲道轉錄語音。在通話者和客服人員案例等情況下啟用此功能。使用此功能可區分通話者與執行藥物安全監控的聯絡中心的錄音或串流中的客服人員。

您可以為批次處理和即時串流，啟用聲道識別。下列清單描述如何為每個方法啟用。
+ 批次轉錄 – AWS 管理主控台 和 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html) API
+ 串流轉錄 — WebSocket 串流和 [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

## 轉錄多聲道音訊檔案
<a name="conversation-channel-id-med-batch"></a>

當您轉錄音訊檔案時， Amazon Transcribe Medical 會傳回每個頻道*的項目*清單。項目是轉錄的單字或標點符號。每個單字都有開始時間和結束時間。如果聲道上的使用者與不同聲道上的某個人說話，則每個聲道項目的開始時間和結束時間會重疊，且個人彼此交談時間也會重疊。

依預設，您可以轉錄有兩個聲道的音訊檔案。如果您需要轉錄有兩個以上聲道的檔案，可以要求提高配額。如需請求提高配額的詳細資訊，請參閱 [AWS 服務 配額](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html)。

若要在批次轉錄任務中轉錄多聲道音訊，請使用 AWS 管理主控台 或 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html) API。

### AWS 管理主控台
<a name="channel-id-batch-med-console"></a>

若要使用 AWS 管理主控台 在批次轉錄任務中啟用頻道識別，您可以啟用音訊識別，然後啟用頻道識別。頻道識別是 中音訊識別的子集 AWS 管理主控台。

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

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

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

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

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

1. 啟用**音訊識別**。

1. 對於**音訊識別類型**，請選擇**聲道識別**。

1. 選擇**建立**。

### API
<a name="channel-id-batch-med-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. 對於 `TranscriptionJobName`，指定 AWS 帳戶的唯一名稱。

  1. 對於 `LanguageCode`，請指定與音訊檔案中所說語言相對應的語言代碼。有效值為 `en-US`。

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

  1. 對於 `Settings` 物件，設定 `ChannelIdentification` 為 `true`。

以下是使用 適用於 Python (Boto3) 的 AWS SDK的範例請求。

```
from __future__ import print_function
import time
import boto3
transcribe = boto3.client('transcribe', 'us-west-2')
job_name = "my-first-transcription-job"
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 = 'output-files/',
      LanguageCode = 'en-US',
      Specialty = 'PRIMARYCARE',
      Type = 'CONVERSATION',
      Settings = {
        'ChannelIdentification': True
      }
)
while True:
    status = transcribe.get_transcription_job(MedicalTranscriptionJobName = job_name)
    if status['MedicalTranscriptionJob']['TranscriptionJobStatus'] in ['COMPLETED', 'FAILED']:
        break
    print("Not ready yet...")
    time.sleep(5)
print(status)
```

### AWS CLI
<a name="channel-id-med-cli"></a>

**使用批次轉錄作業轉錄多聲道音訊檔案 (AWS CLI)**
+ 執行下列程式碼。

  ```
                      
  aws transcribe start-medical-transcription-job \
  --region us-west-2 \
  --cli-input-json file://example-start-command.json
  ```

  以下是 `example-start-command.json` 的程式碼。

  ```
  {
        "MedicalTranscriptionJobName": "my-first-med-transcription-job",        
        "Media": {
            "MediaFileUri": "s3://amzn-s3-demo-bucket/my-input-files/my-audio-file.flac"
        },
        "OutputBucketName": "amzn-s3-demo-bucket",
        "OutputKey": "my-output-files/", 
        "LanguageCode": "en-US",
        "Specialty": "PRIMARYCARE",
        "Type": "CONVERSATION",
  
          "Settings":{
            "ChannelIdentification": true
          }
  }
  ```

下列程式碼示範在兩個聲道有對話的音訊檔案的轉錄輸出。

```
{
  "jobName": "job id",
  "accountId": "111122223333",
  "results": {
    "transcripts": [
      {
        "transcript": "When you try ... It seems to ..."
      }
    ],
    "channel_labels": {
      "channels": [
        {
          "channel_label": "ch_0",
          "items": [
            {
              "start_time": "12.282",
              "end_time": "12.592",
              "alternatives": [
                {
                  "confidence": "1.0000",
                  "content": "When"
                }
              ],
              "type": "pronunciation"
            },
            {
              "start_time": "12.592",
              "end_time": "12.692",
              "alternatives": [
                {
                  "confidence": "0.8787",
                  "content": "you"
                }
              ],
              "type": "pronunciation"
            },
            {
              "start_time": "12.702",
              "end_time": "13.252",
              "alternatives": [
                {
                  "confidence": "0.8318",
                  "content": "try"
                }
              ],
              "type": "pronunciation"
            },
            ...
         ]
      },
      {
          "channel_label": "ch_1",
          "items": [
            {
              "start_time": "12.379",
              "end_time": "12.589",
              "alternatives": [
                {
                  "confidence": "0.5645",
                  "content": "It"
                }
              ],
              "type": "pronunciation"
            },
            {
              "start_time": "12.599",
              "end_time": "12.659",
              "alternatives": [
                {
                  "confidence": "0.2907",
                  "content": "seems"
                }
              ],
              "type": "pronunciation"
            },
            {
              "start_time": "12.669",
              "end_time": "13.029",
              "alternatives": [
                {
                  "confidence": "0.2497",
                  "content": "to"
                }
              ],
              "type": "pronunciation"
            },
            ...
        ]
    }
}
```

## 轉錄多聲道音訊串流
<a name="conversation-channel-id-med-stream"></a>

您可以使用 [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 從 HTTP/2 或 WebSocket 串流中的不同聲道轉錄音訊。

依預設，您可以使用兩個聲道轉錄串流。如果您需要轉錄有兩個以上聲道的串流，可以要求提高配額。如需請求提高配額的詳細資訊，請參閱 [AWS Service Quotas](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html)。

### 在 HTTP/2 串流中轉錄多聲道音訊
<a name="conversation-channel-id-http2"></a>

若要轉錄 HTTP/2 串流中的多聲道音訊，請使用 [StartMedicalStreamTranscription](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartMedicalStreamTranscription.html) API 並指定下列項目：
+ `LanguageCode` — 音訊的語言代碼。有效值為 `en-US`。
+ `MediaEncoding` — 音訊的編碼。有效值為 `ogg-opus`、`flac` 和 `pcm`。
+ `EnableChannelIdentification` – `true`
+ `NumberOfChannels` — 您串流音訊中聲道的數量。

如需設定 HTTP/2 串流以轉錄醫療對話的詳細資訊，請參閱 [設定 HTTP/2 串流](streaming-setting-up.md#streaming-http2)。

### 轉錄 WebSocket 串流中的多聲道音訊
<a name="channel-id-med-websocket"></a>

若要分隔 WebSocket 串流中的發言者，請使用下列格式以建立預先簽署的 URI 並開始 WebSocket 請求。指定 `enable-channel-identification` 為 `true` 和 `number-of-channels` 串流中的聲道數量。預先簽章的 URI 包含設定應用程式與 Amazon Transcribe Medical 之間的雙向通訊所需的資訊。

```
GET wss://transcribestreaming.us-west-2.amazonaws.com:8443/medical-stream-transcription-websocket
?language-code=languageCode
&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
&enable-channel-identification=true
&number-of-channels=2
```

您可以在 [API 參考](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_Reference.html)中找到參數定義；所有 AWS API 操作常見的參數都列在[通用參數](https://docs.aws.amazon.com/transcribe/latest/APIReference/CommonParameters.html)區段中。

如需 WebSocket 請求的詳細資訊，請參閱 [設定 WebSocket 串流](streaming-setting-up.md#streaming-websocket)。

### 多聲道串流輸出
<a name="streaming-med-output"></a>

對於 HTTP/2 和 WebSocket 請求，串流轉錄的輸出相同。以下為範例輸出。

```
{
    "resultId": "XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX",
    "startTime": 0.11,
    "endTime": 0.66,
    "isPartial": false,
    "alternatives": [
        {
            "transcript": "Left.",
            "items": [
                {
                    "startTime": 0.11,
                    "endTime": 0.45,
                    "type": "pronunciation",
                    "content": "Left",
                    "vocabularyFilterMatch": false
                },
                {
                    "startTime": 0.45,
                    "endTime": 0.45,
                    "type": "punctuation",
                    "content": ".",
                    "vocabularyFilterMatch": false
                }
            ]
        }
    ],
    "channelId": "ch_0"
}
```

對於每個語音區段，都有一個 `channelId` 標記，指出該語音所屬的聲道。

# 轉錄醫療聽寫
<a name="transcribe-medical-dictation"></a>

您可以使用 Amazon Transcribe Medical，使用批次轉錄任務或即時串流轉錄臨床醫生指定的醫療備註。批次轉錄作業可讓您轉錄音訊檔案。您可以在轉錄任務或串流中指定臨床醫生的醫療專科，以確保 Amazon Transcribe Medical 以最高的準確性產生轉錄結果。

您可以轉錄以下專業的醫療聽寫：
+ 心臟科 — 僅適用於串流轉錄
+ 神經病學 — 僅適用於串流轉錄
+ 腫瘤學 — 僅適用於串流轉錄
+ 初級護理 — 包括以下類型的醫療實務：
  + 家庭醫學
  + 內科
  + 婦產科 (OB-GYN)
  + 小兒科
+ 放射學 — 僅適用於串流轉錄
+ 泌尿外科 — 僅適用於串流轉錄

您可以使用自訂詞彙提高轉錄準確性。如需醫療自訂詞彙運作方式的資訊，請參閱 [使用醫學自訂詞彙提高轉錄準確性](vocabulary-med.md)。

根據預設， Amazon Transcribe Medical 會傳回可信度最高的轉錄。如果您想要設定為傳回替代轉錄，請參閱 [產生替代轉錄](alternative-med-transcriptions.md)。

有關數字和醫療測量如何在轉錄輸出顯示的資訊，請參閱 [轉錄數字](how-numbers-med.md) 和 [轉錄醫療術語及衡量值](how-measurements-med.md)。

**Topics**
+ [轉錄醫療聽寫的音訊檔案](batch-medical-dictation.md)
+ [在即時串流中轉錄醫療聽寫](streaming-medical-dictation.md)

# 轉錄醫療聽寫的音訊檔案
<a name="batch-medical-dictation"></a>

使用批次轉錄作業以轉錄醫療對話的音訊檔案。您可以使用此以轉錄臨床醫生與患者的對話。您可以使用 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html) API 或 AWS 管理主控台開始批次轉錄作業。

您使用 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html) API 開始醫學轉錄作業時，請指定 `PRIMARYCARE` 為`Specialty` 參數的值。

## AWS 管理主控台
<a name="batch-med-dictation-console"></a>

**轉錄臨床醫生與患者的對話 (AWS 管理主控台)**

若要使用 AWS 管理主控台 轉錄臨床醫生-患者對話，請建立轉錄任務，然後選擇**音訊輸入類型的****對話**。

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

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

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

1. 在**指定作業詳細資訊‭**頁面的**工作設定**下，指定下列項目。

   1. **名稱** — 轉錄作業的名稱。

   1. **音訊輸入類型** — **聽寫**

1. 針對其餘欄位，指定音訊檔案 Amazon S3 的位置，以及您要存放轉錄任務輸出的位置。

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

1. 選擇**建立**。

## API
<a name="batch-med-dictation-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`，請指定 `DICTATION`。

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

  以下是使用 適用於 Python (Boto3) 的 AWS SDK 轉錄`PRIMARYCARE`專科臨床醫生醫療聽寫的範例請求。

  ```
   from __future__ import print_function
   import time
   import boto3
   transcribe = boto3.client('transcribe')
   job_name = "my-first-med-transcription-job"
   job_uri = "s3://amzn-s3-demo-bucket/my-input-files/my-audio-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 = 'DICTATION'
   )
  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)
  ```

下列範例程式碼顯示醫療聽寫的轉錄結果。

```
{
    "jobName": "dictation-medical-transcription-job",
    "accountId": "111122223333",
    "results": {
        "transcripts": [
            {
                "transcript": "... came for a follow up visit today..."
            }
        ],
        "items": [
            {
            ...
                "start_time": "4.85",
                "end_time": "5.12",
                "alternatives": [
                    {
                        "confidence": "1.0",
                        "content": "came"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "start_time": "5.12",
                "end_time": "5.29",
                "alternatives": [
                    {
                        "confidence": "1.0",
                        "content": "for"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "start_time": "5.29",
                "end_time": "5.33",
                "alternatives": [
                    {
                        "confidence": "0.9955",
                        "content": "a"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "start_time": "5.33",
                "end_time": "5.66",
                "alternatives": [
                    {
                        "confidence": "0.9754",
                        "content": "follow"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "start_time": "5.66",
                "end_time": "5.75",
                "alternatives": [
                    {
                        "confidence": "0.9754",
                        "content": "up"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "start_time": "5.75",
                "end_time": "6.02",
                "alternatives": [
                    {
                        "confidence": "1.0",
                        "content": "visit"
                    }
                ]
                ...
    },
    "status": "COMPLETED"
}
```

## AWS CLI
<a name="batch-med-dictation-cli"></a>

**在批次轉錄作業中啟用發言者分隔 (AWS CLI)**
+ 執行下列程式碼。

  ```
                      
  aws transcribe start-medical-transcription-job \
  --region us-west-2 \
  --cli-input-json file://example-start-command.json
  ```

  下列程式碼顯示 `example-start-command.json` 的內容。

  ```
  {
        "MedicalTranscriptionJobName": "my-first-med-transcription-job",        
        "Media": {
        "MediaFileUri": "s3://amzn-s3-demo-bucket/my-input-files/my-audio-file.flac"
        },
        "OutputBucketName": "amzn-s3-demo-bucket",
        "OutputKey": "my-output-files/", 
        "LanguageCode": "en-US",  
        "Specialty": "PRIMARYCARE",
        "Type": "DICTATION"
  }
  ```

# 在即時串流中轉錄醫療聽寫
<a name="streaming-medical-dictation"></a>

使用 WebSocket 串流，將醫療聽寫轉錄為音訊串流。您也可以使用 AWS 管理主控台 轉錄您或其他人直接對麥克風說話的語音。

 對於 HTTP/2 或 WebSocket 串流，您可以轉錄以下醫療專科的音訊：
+ 心臟科
+ 腫瘤學
+ 神經病學
+ 初級護理
+ 放射學
+ 泌尿外科

每個醫療專業包括多種類型的程序和預約。因此，臨床醫生會決定許多不同類型的筆記。請使用下列範例作為準則，協助您指定 WebSocket 請求的 `specialty` URI 參數值，或 [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 的 `Specialty` 參數：
+ 對於電生理或超音波心電圖程序後的聽寫，請選擇 `CARDIOLOGY`。
+ 對於外科腫瘤學或放射腫瘤學程序後的聽寫，請選擇 `ONCOLOGY`。
+ 對於醫生口述顯示腦炎診斷的筆記，請選擇 `NEUROLOGY`。
+ 對於程序筆記的聽寫以分解膀胱結石，請選擇 `UROLOGY`。
+ 對於內科諮詢後臨床醫生筆記的聽寫，請選擇 `PRIMARYCARE`。
+ 對於醫生傳達 CT 掃描、PET 掃描、MRI 或 X 光影像的結果的聽寫，請選擇 `RADIOLOGY`。
+ 對於婦科諮詢後醫生筆記的聽寫，請選擇 `PRIMARYCARE`。

若要提高即時串流中特定詞彙的轉錄準確性，請使用自訂詞彙。若要啟用自訂詞彙，請將 `vocabulary-name` 的值設定為您要使用的自訂詞彙的名稱。

## 使用 轉錄口述到麥克風的口述 AWS 管理主控台
<a name="streaming-medical-dictation-console"></a>

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

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

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

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

1. 選擇**聽寫**。

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

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

1. 對著麥克風說話。

## 在 HTTP/2 串流中轉錄聽寫
<a name="http2-med-dictation-streaming"></a>

要轉錄醫療聽寫的 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 並指定以下項目：
+ `LanguageCode` — 語言代碼。有效值為 `en-US`。
+ `MediaEncoding` — 輸入音訊使用的編碼。有效值為 `pcm`、`ogg-opus` 和 `flac`。
+ `Specialty` — 醫療專業人員的專科。
+ `Type` – `DICTATION`

如需設定 HTTP/2 串流以轉錄醫療聽寫的詳細資訊，請參閱 [設定 HTTP/2 串流](streaming-setting-up.md#streaming-http2)。

## 使用 WebSocket 串流媒體請求以轉錄醫療聽寫
<a name="transcribe-medical-dictation-websocket"></a>

若要使用 WebSocket 請求在即時串流中轉錄醫療聽寫，您需要建立預先簽署的 URI。此 URI 包含設定應用程式與 Amazon Transcribe Medical 之間的音訊串流所需的資訊。如需建立 WebSocket 請求的詳細資訊，請參閱 [設定 WebSocket 串流](streaming-setting-up.md#streaming-websocket)。

使用下列範本以建立您的預先簽署 URI。

```
GET wss://transcribestreaming.us-west-2.amazonaws.com:8443/medical-stream-transcription-websocket
?language-code=languageCode
&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=DICTATION
&vocabulary-name=vocabularyName
&show-speaker-label=boolean
```

如需建立預先簽署 URI 的詳細資訊，請參閱 [設定 WebSocket 串流](streaming-setting-up.md#streaming-websocket)。

# 使用醫學自訂詞彙提高轉錄準確性
<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 | 

# 識別轉錄中的個人健康資訊 (PHI)
<a name="phi-id"></a>

使用*個人健康資訊識別*，在轉錄結果中標記個人健康資訊 (PHI)。透過查看標籤，您可以找到可用於識別患者的 PHI。

您可以使用即時串流或批次轉錄作業以識別 PHI。

您可以使用自己的後處理以修訂轉錄輸出中識別出的 PHI。

使用個人健康資訊識別以識別以下類型的 PHI：
+ 個人 PHI：
  + 名稱 — 全名或姓氏和首字母
  + Gender
  + 年齡
  + 電話號碼
  + 與患者直接相關的日期 (不包括年份)
  + 電子郵件位址
+ 地理位置 PHI：
  + 實體地址
  + 郵遞區號
  + 醫療中心或診所的名稱
+ 帳戶 PHI：
  + 傳真號碼
  + 社會安全號碼 (SSN)
  + 健康保險受益人編號
  + 帳號：
  + 證書或許可證號碼
+ 車輛 PHI:
  + 車輛識別碼 (VIN)
  + 車牌號碼
+ 其他 PHI：
  + 網路統一資源位置 (URL)
  + 網際網路通訊協定 (IP) 地址編號

Amazon Transcribe Medical 是符合 1996 年健康保險流通與責任法案 (HIPAA) 資格的服務。如需詳細資訊，請參閱[Amazon Transcribe 醫療](transcribe-medical.md)。如需識別音訊檔案中 PHI 的資訊，請參閱 [識別音訊檔案中的 PHI](phi-id-batch.md)。如需識別串流中 PHI 的詳細資訊，請參閱 [識別即時串流中的 PHI](phi-id-stream.md)。

**Topics**
+ [識別音訊檔案中的 PHI](phi-id-batch.md)
+ [識別即時串流中的 PHI](phi-id-stream.md)

# 識別音訊檔案中的 PHI
<a name="phi-id-batch"></a>

使用批次轉錄作業以轉錄音訊檔案，並識別其中的個人健康資訊 (PHI)。當您啟用個人健康資訊 (PHI) 識別時， Amazon Transcribe 醫療會標記在轉錄結果中識別的 PHI。如需 Amazon Transcribe Medical 可以識別之 PHI 的相關資訊，請參閱 [識別轉錄中的個人健康資訊 (PHI)](phi-id.md)。

您可以使用 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html) API 或 AWS 管理主控台，開始批次轉錄作業。

## AWS 管理主控台
<a name="batch-med-phi-console"></a>

若要使用 AWS 管理主控台 轉錄臨床醫生-患者對話，請建立轉錄任務，然後選擇**音訊輸入類型的****對話**。

**轉錄音訊檔案並識別 PHI (AWS 管理主控台)**

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

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

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

1. 在**指定作業詳細資訊‭**頁面的**工作設定**下，指定下列項目。

   1. **名稱** – 您的唯一轉錄任務的名稱 AWS 帳戶。

   1. **音訊輸入類型** — **對話**或**聽寫**。

1. 針對其餘欄位，指定音訊檔案 Amazon S3 的位置，以及您要存放轉錄任務輸出的位置。

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

1. 在**音訊設定**下，選擇 **PHI 識別**。

1. 選擇**建立**。

## API
<a name="batch-med-phi-api"></a>

**使用批次轉錄作業 (API) 轉錄音訊檔案並識別 PHI**
+ 對於 [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`，請指定在音訊檔案 `PRIMARYCARE` 中說話的臨床醫生的醫療專科。

  1. 對於 `Type`，指定 `CONVERSATION` 或 `DICTATION`。

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

  以下是使用 適用於 Python (Boto3) 的 AWS SDK 轉錄音訊檔案並識別病患 PHI 的範例請求。

  ```
  from __future__ import print_function
  import time
  import boto3
  transcribe = boto3.client('transcribe')
  job_name = "my-first-transcription-job"
  job_uri = "s3://amzn-s3-demo-bucket/my-input-files/my-audio-file.flac"
  transcribe.start_medical_transcription_job(
        MedicalTranscriptionJobName = job_name,
        Media = {'MediaFileUri': job_uri},
        LanguageCode = 'en-US',
        ContentIdentificationType = 'PHI',
        Specialty = 'PRIMARYCARE',
        Type = 'type', # Specify 'CONVERSATION' for a medical conversation. Specify 'DICTATION' for a medical dictation.
        OutputBucketName = 'amzn-s3-demo-bucket'
    )
  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)
  ```

以下範例代碼顯示識別 PHI 患者的轉錄結果。

```
{
    "jobName": "my-medical-transcription-job-name",
    "accountId": "111122223333",
    "results": {
        "transcripts": [{
            "transcript": "The patient's name is Bertrand."
        }],
        "items": [{
                "id": 0,
            "start_time": "0.0",
            "end_time": "0.37",
            "alternatives": [{
                "confidence": "0.9993",
                "content": "The"
            }],
            "type": "pronunciation"
        }, {
                "id": 1,
            "start_time": "0.37",
            "end_time": "0.44",
            "alternatives": [{
                "confidence": "0.9981",
                "content": "patient's"
            }],
            "type": "pronunciation"
        }, {
                "id": 2,
            "start_time": "0.44",
            "end_time": "0.52",
            "alternatives": [{
                "confidence": "1.0",
                "content": "name"
            }],
            "type": "pronunciation"
        }, {
                "id": 3,
            "start_time": "0.52",
            "end_time": "0.92",
            "alternatives": [{
                "confidence": "1.0",
                "content": "is"
            }],
            "type": "pronunciation"
        }, {
                "id": 4,
            "start_time": "0.92",
            "end_time": "0.9989",
            "alternatives": [{
                "confidence": "1.0",
                "content": "Bertrand"
            }],
            "type": "pronunciation"
        }, {
                "id": 5,
            "alternatives": [{
                "confidence": "0.0",
                "content": "."
            }],
            "type": "punctuation"
        }],
        "entities": [{
            "content": "Bertrand",
            "category": "PHI*-Personal*",
            "startTime": 0.92,
            "endTime": 1.2,
            "confidence": 0.9989
        }],
        "audio_segments": [
            {
                "id": 0,
                "transcript": "The patient's name is Bertrand.",
                "start_time": "0.0",
                "end_time": "0.9989",
                "items": [
                    0,
                    1,
                    2,
                    3,
                    4,
                    5
                ]
            }
        ]
    },
    "status": "COMPLETED"
}
```

## AWS CLI
<a name="batch-med-conversation-cli"></a>

**使用批次轉錄作業，轉錄音訊檔案並識別 PHI (AWS CLI)**
+ 執行下列程式碼。

  ```
  aws transcribe start-medical-transcription-job \
  --medical-transcription-job-name my-medical-transcription-job-name\
  --language-code en-US \
  --media MediaFileUri="s3://amzn-s3-demo-bucket/my-input-files/my-audio-file.flac" \
  --output-bucket-name amzn-s3-demo-bucket \
  --specialty PRIMARYCARE \
  --type type \ # Choose CONVERSATION to transcribe a medical conversation. Choose DICTATION to transcribe a medical dictation.
  --content-identification-type PHI
  ```

# 識別即時串流中的 PHI
<a name="phi-id-stream"></a>

您可以在 HTTP/2 或 WebSocket 串流中識別個人健康資訊 (PHI)。當您啟用 PHI 識別時， Amazon Transcribe 醫療會標記其在轉錄結果中識別的 PHI。如需 Amazon Transcribe Medical 可以識別之 PHI 的相關資訊，請參閱 [識別轉錄中的個人健康資訊 (PHI)](phi-id.md)。



## 識別向麥克風說話時聽寫的 PHI
<a name="console-stream-phi"></a>

若要使用 AWS 管理主控台 轉錄麥克風挑選的語音並識別任何 PHI，請選擇**口述**做為音訊輸入類型、啟動串流，然後開始對電腦上的麥克風說話。

**使用 識別口述中的 PHI AWS 管理主控台**

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

1. 在導覽窗格中，選擇**即時轉錄**。

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

1. 對於**其他設定**，選擇 **PHI 識別**。

1. 選擇**開始串流**並對著麥克風說話。

1. 選擇**停止串流**以結束聽寫。

## 識別 HTTP/2 串流中的 PHI
<a name="http2-stream-phi"></a>

若要在啟動 PHI 識別的情況下啟動 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 並指定下列項目：
+ 對於 `LanguageCode`，指定串流中所說語言的語言代碼。對於美式英文，指定 `en-US`。
+ 對於 `MediaSampleHertz`，指定音訊的取樣率。
+ 對於 `content-identification-type`，請指定 `PHI`。

## 識別 WebSocket 串流中的 PHI
<a name="websocket-phi-id"></a>

 若要在啟動 PHI 識別的情況下啟動 WebSocket 串流，請使用下列格式以建立預先簽署的 URL。

```
GET wss://transcribestreaming.us-west-2.amazonaws.com:8443/medical-stream-transcription-websocket?
&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 
&language-code=en-US
&media-encoding=flac 
&sample-rate=16000 
&specialty=medical-specialty
&content-identification-type=PHI
```

您可以在 [API 參考](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_Reference.html)中找到參數定義；所有 AWS API 操作通用的參數都列在[通用參數](https://docs.aws.amazon.com/transcribe/latest/APIReference/CommonParameters.html)區段中。

# 產生替代轉錄
<a name="alternative-med-transcriptions"></a>

當您使用 Amazon Transcribe Medical 時，您會取得可信度最高的轉錄。不過，您可以設定 Amazon Transcribe Medical 以傳回其他可信度較低的轉錄。

使用替代轉錄以查看所轉錄音訊的不同解釋。例如，在使用人員能夠審核轉錄的應用程式中，您可以提供可供人員選擇的替代轉錄。

您可以使用 AWS 管理主控台 或 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartMedicalTranscriptionJob.html) API 產生替代轉錄。

## AWS 管理主控台
<a name="alternative-med-transcriptions-console"></a>

若要使用 AWS 管理主控台 產生替代轉錄，請在設定任務時啟用替代結果。

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

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

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

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

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

1. 啟用**替代結果**。

1. 對於**最大替代**，輸入介於 2 到 10 之間的整數值，以取得您要在輸出中顯示的替代轉錄數量上限。

1. 選擇**建立**。

## API
<a name="alternative-med-transcriptions-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. `ShowAlternatives` – `true`.

     1. `MaxAlternatives` - 介於 2 到 10 之間的整數，指示轉錄輸出中所需的替代轉錄數量。

下列請求使用 適用於 Python (Boto3) 的 AWS SDK 啟動轉錄任務，該任務最多會產生兩個替代轉錄。

```
from __future__ import print_function
import time
import boto3
transcribe = boto3.client('transcribe', 'us-west-2')
job_name = "my-first-transcription-job"
job_uri = s3://amzn-s3-demo-bucket/my-input-files/my-audio-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 = {
        'ShowAlternatives': True,
        'MaxAlternatives': 2
    }
)

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

## AWS CLI
<a name="alternative-med-transcriptions-cli"></a>

**在音訊檔案中轉錄初級護理臨床醫生和患者間對話的音訊檔案 (AWS CLI)**
+ 執行下列程式碼。

  ```
                      
  aws transcribe start-transcription-job \
  --cli-input-json file://filepath/example-start-command.json
  ```

  下列程式碼顯示 `example-start-command.json` 的內容。

  ```
  {
        "MedicalTranscriptionJobName": "my-first-transcription-job",
        "LanguageCode": "en-US",
        "Specialty": "PRIMARYCARE",
        "Type": "CONVERSATION",
        "OutputBucketName":"amzn-s3-demo-bucket",
        "Media": {
            "MediaFileUri": "s3://amzn-s3-demo-bucket/my-input-files/my-audio-file.flac"
          },
        "Settings":{
            "ShowAlternatives": true,
            "MaxAlternatives": 2
          }
  }
  ```

# Amazon Transcribe 醫療和界面 VPC 端點 (AWS PrivateLink)
<a name="med-vpc-interface-endpoints"></a>

您可以建立介面 VPC *端點*，在 VPC 和 Amazon Transcribe Medical 之間建立私有連線。介面端點採用 [AWS PrivateLink](https://aws.amazon.com/privatelink)技術，可讓您在沒有網際網路閘道、NAT 裝置、VPN 連線或 Direct Connect 連線的情況下私密存取 Amazon Transcribe Medical APIs。VPC 中的執行個體不需要公有 IP 地址，即可與 Amazon Transcribe Medical APIs通訊。VPC 和 Amazon Transcribe Medical 之間的流量不會離開 Amazon 網路。

每個介面端點都是由您子網路中的一或多個[彈性網路介面](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html)表示。

如需詳細資訊，請參閱《Amazon VPC 使用者指南》**中的[介面 VPC 端點 (AWS PrivateLink)](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html)。

## Amazon Transcribe Medical VPC 端點的考量事項
<a name="med-vpc-endpoint-considerations"></a>

在您設定 Amazon Transcribe Medical 的介面 VPC 端點之前，請務必檢閱*Amazon VPC 《 使用者指南*》中的[介面端點屬性和限制](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html#vpce-interface-limitations)。

Amazon Transcribe Medical 支援從您的 VPC 呼叫其所有 API 動作。

## 建立 Amazon Transcribe Medical 的介面 VPC 端點
<a name="med-vpc-endpoint-create"></a>

您可以使用 AWS 管理主控台 或 為 Amazon Transcribe Medical 服務建立 VPC 端點 AWS CLI。如需詳細資訊，請參閱 《Amazon VPC 使用者指南》**中的[建立介面端點](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html#create-interface-endpoint)。

對於 Amazon Transcribe Medical 中的批次轉錄，請使用下列服務名稱建立 VPC 端點：
+ com.amazonaws.*us-west-2*.transcribe 

對於 Amazon Transcribe Medical 中的串流轉錄，請使用下列服務名稱建立 VPC 端點：
+ com.amazonaws.*us-west-2*.transcribestreaming 

如果您為端點啟用私有 DNS，您可以使用其預設 DNS 名稱向 Amazon Transcribe Medical 提出 API 請求 AWS 區域，例如 `transcribestreaming.us-east-2.amazonaws.com`。

如需詳細資訊，請參閱《Amazon VPC 使用者指南》**中的[透過介面端點存取服務](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html#access-service-though-endpoint)。

## 為 Amazon Transcribe Medical 串流建立 VPC 端點政策
<a name="med-vpc-endpoint-policy"></a>

您可以將端點政策連接至控制 Amazon Transcribe Medical 存取的 VPC 端點。此政策會指定下列資訊：
+ 可執行動作的主體。
+ 可執行的動作。
+ 可供執行動作的資源。

如需詳細資訊，請參閱 *Amazon VPC 使用者指南*中的[使用 VPC 端點控制對服務的存取](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-access.html)。

**範例： Amazon Transcribe 醫療串流轉錄動作的 VPC 端點政策**  
以下是 Medical 中串流轉錄的端點政策範例 Amazon Transcribe 。連接到 端點時，此政策會授予所有資源上所有委託人的所列 Amazon Transcribe Medical 動作的存取權。

```
{
   "Statement":[
      {
         "Principal":"*",
         "Effect":"Allow",
         "Action":[
            "transcribe:StartMedicalStreamTranscription",
         ],
         "Resource":"*"
      }
   ]
}
```

**範例： Amazon Transcribe 醫療批次轉錄動作的 VPC 端點政策**  
以下是 Amazon Transcribe Medical 中批次轉錄的端點政策範例。連接到 端點時，此政策會授予所有資源上所有委託人的所列 Amazon Transcribe Medical 動作的存取權。

```
{
   "Statement":[
      {
         "Principal":"*",
         "Effect":"Allow",
         "Action":[
            "transcribe:StartMedicalTranscriptionJob"
         ],
         "Resource":"*"
      }
   ]
}
```

## 共用子網路
<a name="med-vpc-shared-subnets"></a>

無法在與您共用的子網路中建立、描述、修改或刪除 VPC 端點。不過，可以在與您共用的子網路中使用 VPC 端點。如需 VPC 共用的相關資訊，請參閱 Amazon Virtual Private Cloud 指南中的[與其他帳戶共用您的 VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-sharing.html#vpc-sharing-service-behavior)。