Amazon Comprehend Medical 示例使用 AWS CLI - AWS Command Line Interface

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

Amazon Comprehend Medical 示例使用 AWS CLI

下列程式碼範例說明如何透過 AWS Command Line Interface 搭配 Amazon Comprehend Medical 使用,來執行動作和實作常見案例。

Actions 是大型程式的程式碼摘錄,必須在內容中執行。雖然動作會告訴您如何呼叫個別服務函數,但您可以在其相關情境和跨服務範例中查看內容中的動作。

Scenarios (案例) 是向您展示如何呼叫相同服務中的多個函數來完成特定任務的程式碼範例。

每個範例都包含一個連結 GitHub,您可以在其中找到如何在內容中設定和執行程式碼的指示。

主題

動作

下列程式碼範例會示範如何使用describe-entities-detection-v2-job

AWS CLI

描述實體偵測工作

下列describe-entities-detection-v2-job範例會顯示與非同步實體偵測工作相關聯的屬性。

aws comprehendmedical describe-entities-detection-v2-job \ --job-id "ab9887877365fe70299089371c043b96"

輸出:

{ "ComprehendMedicalAsyncJobProperties": { "JobId": "ab9887877365fe70299089371c043b96", "JobStatus": "COMPLETED", "SubmitTime": "2020-03-18T21:20:15.614000+00:00", "EndTime": "2020-03-18T21:27:07.350000+00:00", "ExpirationTime": "2020-07-16T21:20:15+00:00", "InputDataConfig": { "S3Bucket": "comp-med-input", "S3Key": "" }, "OutputDataConfig": { "S3Bucket": "comp-med-output", "S3Key": "867139942017-EntitiesDetection-ab9887877365fe70299089371c043b96/" }, "LanguageCode": "en", "DataAccessRoleArn": "arn:aws:iam::867139942017:role/ComprehendMedicalBatchProcessingRole", "ModelVersion": "DetectEntitiesModelV20190930" } }

如需詳細資訊,請參閱亞馬遜醫學開發人員指南中的 Batch API

下列程式碼範例會示範如何使用describe-icd10-cm-inference-job

AWS CLI

若要描述 ICD-10-CM 推論工作

下列describe-icd10-cm-inference-job範例會說明具有指定工作 ID 的要求推論工作的屬性。

aws comprehendmedical describe-icd10-cm-inference-job \ --job-id "5780034166536cdb52ffa3295a1b00a7"

輸出:

{ "ComprehendMedicalAsyncJobProperties": { "JobId": "5780034166536cdb52ffa3295a1b00a7", "JobStatus": "COMPLETED", "SubmitTime": "2020-05-18T21:20:15.614000+00:00", "EndTime": "2020-05-18T21:27:07.350000+00:00", "ExpirationTime": "2020-09-16T21:20:15+00:00", "InputDataConfig": { "S3Bucket": "comp-med-input", "S3Key": "AKIAIOSFODNN7EXAMPLE" }, "OutputDataConfig": { "S3Bucket": "comp-med-output", "S3Key": "AKIAIOSFODNN7EXAMPLE" }, "LanguageCode": "en", "DataAccessRoleArn": "arn:aws:iam::867139942017:role/ComprehendMedicalBatchProcessingRole", "ModelVersion": "0.1.0" } }

如需詳細資訊,請參閱 Amazon Comprehend Medical 學開發人員指南中的本體論連結批次分析

  • 如需 API 詳細資訊,請參閱AWS CLI 命令參考CmInferenceJob中的 DescribeIcd10

下列程式碼範例會示範如何使用describe-phi-detection-job

AWS CLI

描述 PHI 偵測工作

下列describe-phi-detection-job範例會顯示與非同步保護健康資訊 (PHI) 偵測工作相關聯的屬性。

aws comprehendmedical describe-phi-detection-job \ --job-id "4750034166536cdb52ffa3295a1b00a3"

輸出:

{ "ComprehendMedicalAsyncJobProperties": { "JobId": "4750034166536cdb52ffa3295a1b00a3", "JobStatus": "COMPLETED", "SubmitTime": "2020-03-19T20:38:37.594000+00:00", "EndTime": "2020-03-19T20:45:07.894000+00:00", "ExpirationTime": "2020-07-17T20:38:37+00:00", "InputDataConfig": { "S3Bucket": "comp-med-input", "S3Key": "" }, "OutputDataConfig": { "S3Bucket": "comp-med-output", "S3Key": "867139942017-PHIDetection-4750034166536cdb52ffa3295a1b00a3/" }, "LanguageCode": "en", "DataAccessRoleArn": "arn:aws:iam::867139942017:role/ComprehendMedicalBatchProcessingRole", "ModelVersion": "PHIModelV20190903" } }

如需詳細資訊,請參閱亞馬遜醫學開發人員指南中的 Batch API

下列程式碼範例會示範如何使用describe-rx-norm-inference-job

AWS CLI

描述 RxNorm 推論工作

下列describe-rx-norm-inference-job範例會說明具有指定工作 ID 的要求推論工作的屬性。

aws comprehendmedical describe-rx-norm-inference-job \ --job-id "eg8199877365fc70299089371c043b96"

輸出:

{ "ComprehendMedicalAsyncJobProperties": { "JobId": "g8199877365fc70299089371c043b96", "JobStatus": "COMPLETED", "SubmitTime": "2020-05-18T21:20:15.614000+00:00", "EndTime": "2020-05-18T21:27:07.350000+00:00", "ExpirationTime": "2020-09-16T21:20:15+00:00", "InputDataConfig": { "S3Bucket": "comp-med-input", "S3Key": "AKIAIOSFODNN7EXAMPLE" }, "OutputDataConfig": { "S3Bucket": "comp-med-output", "S3Key": "AKIAIOSFODNN7EXAMPLE" }, "LanguageCode": "en", "DataAccessRoleArn": "arn:aws:iam::867139942017:role/ComprehendMedicalBatchProcessingRole", "ModelVersion": "0.0.0" } }

如需詳細資訊,請參閱 Amazon Comprehend Medical 學開發人員指南中的本體論連結批次分析

下列程式碼範例會示範如何使用describe-snomedct-inference-job

AWS CLI

描述 SNOMED CT 推論工作

下列describe-snomedct-inference-job範例會說明具有指定工作 ID 的要求推論工作的屬性。

aws comprehendmedical describe-snomedct-inference-job \ --job-id "2630034166536cdb52ffa3295a1b00a7"

輸出:

{ "ComprehendMedicalAsyncJobProperties": { "JobId": "2630034166536cdb52ffa3295a1b00a7", "JobStatus": "COMPLETED", "SubmitTime": "2021-12-18T21:20:15.614000+00:00", "EndTime": "2021-12-18T21:27:07.350000+00:00", "ExpirationTime": "2022-05-16T21:20:15+00:00", "InputDataConfig": { "S3Bucket": "comp-med-input", "S3Key": "AKIAIOSFODNN7EXAMPLE" }, "OutputDataConfig": { "S3Bucket": "comp-med-output", "S3Key": "AKIAIOSFODNN7EXAMPLE" }, "LanguageCode": "en", "DataAccessRoleArn": "arn:aws:iam::867139942017:role/ComprehendMedicalBatchProcessingRole", "ModelVersion": "0.1.0" } }

如需詳細資訊,請參閱 Amazon Comprehend Medical 學開發人員指南中的本體論連結批次分析

下列程式碼範例會示範如何使用detect-entities-v2

AWS CLI

範例 1:直接從文字偵測圖元

下列detect-entities-v2範例會直接從輸入文字顯示偵測到的圖元,並根據類型標示它們。

aws comprehendmedical detect-entities-v2 \ --text "Sleeping trouble on present dosage of Clonidine. Severe rash on face and leg, slightly itchy."

輸出:

{ "Id": 0, "BeginOffset": 38, "EndOffset": 47, "Score": 0.9942955374717712, "Text": "Clonidine", "Category": "MEDICATION", "Type": "GENERIC_NAME", "Traits": [] }

如需詳細資訊,請參閱 Amazon Comprehend Medical 開發人員指南中的偵測實體第 2 版

範例 2:從檔案路徑偵測圖元

下列detect-entities-v2範例顯示偵測到的圖元,並根據檔案路徑中的類型來標示它們。

aws comprehendmedical detect-entities-v2 \ --text file://medical_entities.txt

medical_entities.txt 的內容:

{ "Sleeping trouble on present dosage of Clonidine. Severe rash on face and leg, slightly itchy." }

輸出:

{ "Id": 0, "BeginOffset": 38, "EndOffset": 47, "Score": 0.9942955374717712, "Text": "Clonidine", "Category": "MEDICATION", "Type": "GENERIC_NAME", "Traits": [] }

如需詳細資訊,請參閱 Amazon Comprehend Medical 開發人員指南中的偵測實體第 2 版

  • 如需 API 詳細資訊,請參閱AWS CLI 命令參考中的 DetectEntitiesV2

下列程式碼範例會示範如何使用detect-phi

AWS CLI

範例 1:直接從文字偵測受保護的健康資訊 (PHI)

下列detect-phi範例會直接從輸入文字顯示偵測到的受保護健康資訊 (PHI) 實體。

aws comprehendmedical detect-phi \ --text "Patient Carlos Salazar presented with rash on his upper extremities and dry cough. He lives at 100 Main Street, Anytown, USA where he works from his home as a carpenter."

輸出:

{ "Entities": [ { "Id": 0, "BeginOffset": 8, "EndOffset": 21, "Score": 0.9914507269859314, "Text": "Carlos Salazar", "Category": "PROTECTED_HEALTH_INFORMATION", "Type": "NAME", "Traits": [] }, { "Id": 1, "BeginOffset": 94, "EndOffset": 109, "Score": 0.871849775314331, "Text": "100 Main Street, Anytown, USA", "Category": "PROTECTED_HEALTH_INFORMATION", "Type": "ADDRESS", "Traits": [] }, { "Id": 2, "BeginOffset": 145, "EndOffset": 154, "Score": 0.8302185535430908, "Text": "carpenter", "Category": "PROTECTED_HEALTH_INFORMATION", "Type": "PROFESSION", "Traits": [] } ], "ModelVersion": "0.0.0" }

如需詳細資訊,請參閱亞馬遜醫學開發人員指南中的偵測 PHI

範例 2:直接從檔案路徑偵測保護健康資訊 (PHI)

下列detect-phi範例顯示從檔案路徑偵測到的受保護健康資訊 (PHI) 實體。

aws comprehendmedical detect-phi \ --text file://phi.txt

phi.txt 的內容:

"Patient Carlos Salazar presented with a rash on his upper extremities and a dry cough. He lives at 100 Main Street, Anytown, USA, where he works from his home as a carpenter."

輸出:

{ "Entities": [ { "Id": 0, "BeginOffset": 8, "EndOffset": 21, "Score": 0.9914507269859314, "Text": "Carlos Salazar", "Category": "PROTECTED_HEALTH_INFORMATION", "Type": "NAME", "Traits": [] }, { "Id": 1, "BeginOffset": 94, "EndOffset": 109, "Score": 0.871849775314331, "Text": "100 Main Street, Anytown, USA", "Category": "PROTECTED_HEALTH_INFORMATION", "Type": "ADDRESS", "Traits": [] }, { "Id": 2, "BeginOffset": 145, "EndOffset": 154, "Score": 0.8302185535430908, "Text": "carpenter", "Category": "PROTECTED_HEALTH_INFORMATION", "Type": "PROFESSION", "Traits": [] } ], "ModelVersion": "0.0.0" }

如需詳細資訊,請參閱亞馬遜醫學開發人員指南中的偵測 PHI

  • 如需 API 詳細資訊,請參閱AWS CLI 命令參考DetectPhi中的。

下列程式碼範例會示範如何使用infer-icd10-cm

AWS CLI

示例 1:檢測醫療狀況實體並直接從文本鏈接到 ICD-10-CM 本體

下列infer-icd10-cm範例會標示偵測到的醫療狀況實體,並將這些實體與 2019 年版「國際疾病臨床修改」(ICD-10-CM) 版中的代碼連結起來。

aws comprehendmedical infer-icd10-cm \ --text "The patient complains of abdominal pain, has a long-standing history of diabetes treated with Micronase daily."

輸出:

{ "Entities": [ { "Id": 0, "Text": "abdominal pain", "Category": "MEDICAL_CONDITION", "Type": "DX_NAME", "Score": 0.9475538730621338, "BeginOffset": 28, "EndOffset": 42, "Attributes": [], "Traits": [ { "Name": "SYMPTOM", "Score": 0.6724207401275635 } ], "ICD10CMConcepts": [ { "Description": "Unspecified abdominal pain", "Code": "R10.9", "Score": 0.6904221177101135 }, { "Description": "Epigastric pain", "Code": "R10.13", "Score": 0.1364113688468933 }, { "Description": "Generalized abdominal pain", "Code": "R10.84", "Score": 0.12508003413677216 }, { "Description": "Left lower quadrant pain", "Code": "R10.32", "Score": 0.10063883662223816 }, { "Description": "Lower abdominal pain, unspecified", "Code": "R10.30", "Score": 0.09933677315711975 } ] }, { "Id": 1, "Text": "diabetes", "Category": "MEDICAL_CONDITION", "Type": "DX_NAME", "Score": 0.9899052977561951, "BeginOffset": 75, "EndOffset": 83, "Attributes": [], "Traits": [ { "Name": "DIAGNOSIS", "Score": 0.9258432388305664 } ], "ICD10CMConcepts": [ { "Description": "Type 2 diabetes mellitus without complications", "Code": "E11.9", "Score": 0.7158446311950684 }, { "Description": "Family history of diabetes mellitus", "Code": "Z83.3", "Score": 0.5704703330993652 }, { "Description": "Family history of other endocrine, nutritional and metabolic diseases", "Code": "Z83.49", "Score": 0.19856023788452148 }, { "Description": "Type 1 diabetes mellitus with ketoacidosis without coma", "Code": "E10.10", "Score": 0.13285516202449799 }, { "Description": "Type 2 diabetes mellitus with hyperglycemia", "Code": "E11.65", "Score": 0.0993388369679451 } ] } ], "ModelVersion": "0.1.0" }

如需詳細資訊,請參閱亞馬遜醫學開發人員指南中的推論 ICD10-CM

範例 2:偵測醫療狀況實體並從檔案路徑連結至 ICD-10-CM 本體

下列infer-icd-10-cm範例會標示偵測到的醫療狀況實體,並將這些實體與 2019 年版「國際疾病臨床修改」(ICD-10-CM) 版中的代碼連結起來。

aws comprehendmedical infer-icd10-cm \ --text file://icd10cm.txt

icd10cm.txt 的內容:

{ "The patient complains of abdominal pain, has a long-standing history of diabetes treated with Micronase daily." }

輸出:

{ "Entities": [ { "Id": 0, "Text": "abdominal pain", "Category": "MEDICAL_CONDITION", "Type": "DX_NAME", "Score": 0.9475538730621338, "BeginOffset": 28, "EndOffset": 42, "Attributes": [], "Traits": [ { "Name": "SYMPTOM", "Score": 0.6724207401275635 } ], "ICD10CMConcepts": [ { "Description": "Unspecified abdominal pain", "Code": "R10.9", "Score": 0.6904221177101135 }, { "Description": "Epigastric pain", "Code": "R10.13", "Score": 0.1364113688468933 }, { "Description": "Generalized abdominal pain", "Code": "R10.84", "Score": 0.12508003413677216 }, { "Description": "Left lower quadrant pain", "Code": "R10.32", "Score": 0.10063883662223816 }, { "Description": "Lower abdominal pain, unspecified", "Code": "R10.30", "Score": 0.09933677315711975 } ] }, { "Id": 1, "Text": "diabetes", "Category": "MEDICAL_CONDITION", "Type": "DX_NAME", "Score": 0.9899052977561951, "BeginOffset": 75, "EndOffset": 83, "Attributes": [], "Traits": [ { "Name": "DIAGNOSIS", "Score": 0.9258432388305664 } ], "ICD10CMConcepts": [ { "Description": "Type 2 diabetes mellitus without complications", "Code": "E11.9", "Score": 0.7158446311950684 }, { "Description": "Family history of diabetes mellitus", "Code": "Z83.3", "Score": 0.5704703330993652 }, { "Description": "Family history of other endocrine, nutritional and metabolic diseases", "Code": "Z83.49", "Score": 0.19856023788452148 }, { "Description": "Type 1 diabetes mellitus with ketoacidosis without coma", "Code": "E10.10", "Score": 0.13285516202449799 }, { "Description": "Type 2 diabetes mellitus with hyperglycemia", "Code": "E11.65", "Score": 0.0993388369679451 } ] } ], "ModelVersion": "0.1.0" }

如需詳細資訊,請參閱亞馬遜醫學開發人員指南中的推論 ICD10 公分

  • 如需 API 詳細資訊,請參閱AWS CLI 命令參考中的 InferIcd10cm

下列程式碼範例會示範如何使用infer-rx-norm

AWS CLI

範例 1:偵測藥物實體並 RxNorm 直接從文字連結

下列infer-rx-norm範例顯示並標示偵測到的藥物實體,並將這些實體連結至美國國家醫學 RxNorm 圖書館資料庫中的概念識別碼 (RXCUI)。

aws comprehendmedical infer-rx-norm \ --text "Patient reports taking Levothyroxine 125 micrograms p.o. once daily, but denies taking Synthroid."

輸出:

{ "Entities": [ { "Id": 0, "Text": "Levothyroxine", "Category": "MEDICATION", "Type": "GENERIC_NAME", "Score": 0.9996285438537598, "BeginOffset": 23, "EndOffset": 36, "Attributes": [ { "Type": "DOSAGE", "Score": 0.9892290830612183, "RelationshipScore": 0.9997978806495667, "Id": 1, "BeginOffset": 37, "EndOffset": 51, "Text": "125 micrograms", "Traits": [] }, { "Type": "ROUTE_OR_MODE", "Score": 0.9988924860954285, "RelationshipScore": 0.998291552066803, "Id": 2, "BeginOffset": 52, "EndOffset": 56, "Text": "p.o.", "Traits": [] }, { "Type": "FREQUENCY", "Score": 0.9953463673591614, "RelationshipScore": 0.9999889135360718, "Id": 3, "BeginOffset": 57, "EndOffset": 67, "Text": "once daily", "Traits": [] } ], "Traits": [], "RxNormConcepts": [ { "Description": "Levothyroxine Sodium 0.125 MG Oral Tablet", "Code": "966224", "Score": 0.9912070631980896 }, { "Description": "Levothyroxine Sodium 0.125 MG Oral Capsule", "Code": "966405", "Score": 0.8698278665542603 }, { "Description": "Levothyroxine Sodium 0.125 MG Oral Tablet [Synthroid]", "Code": "966191", "Score": 0.7448257803916931 }, { "Description": "levothyroxine", "Code": "10582", "Score": 0.7050482630729675 }, { "Description": "Levothyroxine Sodium 0.125 MG Oral Tablet [Levoxyl]", "Code": "966190", "Score": 0.6921631693840027 } ] }, { "Id": 4, "Text": "Synthroid", "Category": "MEDICATION", "Type": "BRAND_NAME", "Score": 0.9946461319923401, "BeginOffset": 86, "EndOffset": 95, "Attributes": [], "Traits": [ { "Name": "NEGATION", "Score": 0.5167351961135864 } ], "RxNormConcepts": [ { "Description": "Synthroid", "Code": "224920", "Score": 0.9462039470672607 }, { "Description": "Levothyroxine Sodium 0.088 MG Oral Tablet [Synthroid]", "Code": "966282", "Score": 0.8309829235076904 }, { "Description": "Levothyroxine Sodium 0.125 MG Oral Tablet [Synthroid]", "Code": "966191", "Score": 0.4945160448551178 }, { "Description": "Levothyroxine Sodium 0.05 MG Oral Tablet [Synthroid]", "Code": "966247", "Score": 0.3674522042274475 }, { "Description": "Levothyroxine Sodium 0.025 MG Oral Tablet [Synthroid]", "Code": "966158", "Score": 0.2588822841644287 } ] } ], "ModelVersion": "0.0.0" }

如需詳細資訊,請參閱 Amazon Comprehend Medical 開發人員指南 RxNorm中的推論。

範例 2:偵測藥物實體並 RxNorm 從檔案路徑連結至。

下列infer-rx-norm範例顯示並標示偵測到的藥物實體,並將這些實體連結至美國國家醫學 RxNorm 圖書館資料庫中的概念識別碼 (RXCUI)。

aws comprehendmedical infer-rx-norm \ --text file://rxnorm.txt

rxnorm.txt 的內容:

{ "Patient reports taking Levothyroxine 125 micrograms p.o. once daily, but denies taking Synthroid." }

輸出:

{ "Entities": [ { "Id": 0, "Text": "Levothyroxine", "Category": "MEDICATION", "Type": "GENERIC_NAME", "Score": 0.9996285438537598, "BeginOffset": 23, "EndOffset": 36, "Attributes": [ { "Type": "DOSAGE", "Score": 0.9892290830612183, "RelationshipScore": 0.9997978806495667, "Id": 1, "BeginOffset": 37, "EndOffset": 51, "Text": "125 micrograms", "Traits": [] }, { "Type": "ROUTE_OR_MODE", "Score": 0.9988924860954285, "RelationshipScore": 0.998291552066803, "Id": 2, "BeginOffset": 52, "EndOffset": 56, "Text": "p.o.", "Traits": [] }, { "Type": "FREQUENCY", "Score": 0.9953463673591614, "RelationshipScore": 0.9999889135360718, "Id": 3, "BeginOffset": 57, "EndOffset": 67, "Text": "once daily", "Traits": [] } ], "Traits": [], "RxNormConcepts": [ { "Description": "Levothyroxine Sodium 0.125 MG Oral Tablet", "Code": "966224", "Score": 0.9912070631980896 }, { "Description": "Levothyroxine Sodium 0.125 MG Oral Capsule", "Code": "966405", "Score": 0.8698278665542603 }, { "Description": "Levothyroxine Sodium 0.125 MG Oral Tablet [Synthroid]", "Code": "966191", "Score": 0.7448257803916931 }, { "Description": "levothyroxine", "Code": "10582", "Score": 0.7050482630729675 }, { "Description": "Levothyroxine Sodium 0.125 MG Oral Tablet [Levoxyl]", "Code": "966190", "Score": 0.6921631693840027 } ] }, { "Id": 4, "Text": "Synthroid", "Category": "MEDICATION", "Type": "BRAND_NAME", "Score": 0.9946461319923401, "BeginOffset": 86, "EndOffset": 95, "Attributes": [], "Traits": [ { "Name": "NEGATION", "Score": 0.5167351961135864 } ], "RxNormConcepts": [ { "Description": "Synthroid", "Code": "224920", "Score": 0.9462039470672607 }, { "Description": "Levothyroxine Sodium 0.088 MG Oral Tablet [Synthroid]", "Code": "966282", "Score": 0.8309829235076904 }, { "Description": "Levothyroxine Sodium 0.125 MG Oral Tablet [Synthroid]", "Code": "966191", "Score": 0.4945160448551178 }, { "Description": "Levothyroxine Sodium 0.05 MG Oral Tablet [Synthroid]", "Code": "966247", "Score": 0.3674522042274475 }, { "Description": "Levothyroxine Sodium 0.025 MG Oral Tablet [Synthroid]", "Code": "966158", "Score": 0.2588822841644287 } ] } ], "ModelVersion": "0.0.0" }

如需詳細資訊,請參閱 Amazon Comprehend Medical 開發人員指南 RxNorm中的推論。

  • 如需 API 詳細資訊,請參閱AWS CLI 命令參考InferRxNorm中的。

下列程式碼範例會示範如何使用infer-snomedct

AWS CLI

範例:偵測實體並直接從文字連結至 SNOMED CT 本體

以下示infer-snomedct例演示瞭如何檢測醫療實體並將其鏈接到 2021-03 版本的醫學系統化命名法,臨床術語(SNOMED CT)中的概念。

aws comprehendmedical infer-snomedct \ --text "The patient complains of abdominal pain, has a long-standing history of diabetes treated with Micronase daily."

輸出:

{ "Entities": [ { "Id": 3, "BeginOffset": 26, "EndOffset": 40, "Score": 0.9598260521888733, "Text": "abdominal pain", "Category": "MEDICAL_CONDITION", "Type": "DX_NAME", "Traits": [ { "Name": "SYMPTOM", "Score": 0.6819021701812744 } ] }, { "Id": 4, "BeginOffset": 73, "EndOffset": 81, "Score": 0.9905840158462524, "Text": "diabetes", "Category": "MEDICAL_CONDITION", "Type": "DX_NAME", "Traits": [ { "Name": "DIAGNOSIS", "Score": 0.9255214333534241 } ] }, { "Id": 1, "BeginOffset": 95, "EndOffset": 104, "Score": 0.6371926665306091, "Text": "Micronase", "Category": "MEDICATION", "Type": "BRAND_NAME", "Traits": [], "Attributes": [ { "Type": "FREQUENCY", "Score": 0.9761165380477905, "RelationshipScore": 0.9984188079833984, "RelationshipType": "FREQUENCY", "Id": 2, "BeginOffset": 105, "EndOffset": 110, "Text": "daily", "Category": "MEDICATION", "Traits": [] } ] } ], "UnmappedAttributes": [], "ModelVersion": "1.0.0" }

如需詳細資訊,請參閱亞馬遜醫學開發人員指南中的《InferSnomEct》。

  • 如需 API 詳細資訊,請參閱AWS CLI 命令參考InferSnomedct中的。

下列程式碼範例會示範如何使用list-entities-detection-v2-jobs

AWS CLI

列出實體偵測工作

下列list-entities-detection-v2-jobs範例會列出目前的非同步偵測工作。

aws comprehendmedical list-entities-detection-v2-jobs

輸出:

{ "ComprehendMedicalAsyncJobPropertiesList": [ { "JobId": "ab9887877365fe70299089371c043b96", "JobStatus": "COMPLETED", "SubmitTime": "2020-03-19T20:38:37.594000+00:00", "EndTime": "2020-03-19T20:45:07.894000+00:00", "ExpirationTime": "2020-07-17T20:38:37+00:00", "InputDataConfig": { "S3Bucket": "comp-med-input", "S3Key": "" }, "OutputDataConfig": { "S3Bucket": "comp-med-output", "S3Key": "867139942017-EntitiesDetection-ab9887877365fe70299089371c043b96/" }, "LanguageCode": "en", "DataAccessRoleArn": "arn:aws:iam::867139942017:role/ComprehendMedicalBatchProcessingRole", "ModelVersion": "DetectEntitiesModelV20190930" } ] }

如需詳細資訊,請參閱亞馬遜醫學開發人員指南中的 Batch API

下列程式碼範例會示範如何使用list-icd10-cm-inference-jobs

AWS CLI

若要列出目前所有的 ICD-10-CM 推論工作

下列範例顯示list-icd10-cm-inference-jobs作業如何傳回目前非同步 ICD-10-CM 批次推論工作的清單。

aws comprehendmedical list-icd10-cm-inference-jobs

輸出:

{ "ComprehendMedicalAsyncJobPropertiesList": [ { "JobId": "5780034166536cdb52ffa3295a1b00a7", "JobStatus": "COMPLETED", "SubmitTime": "2020-05-19T20:38:37.594000+00:00", "EndTime": "2020-05-19T20:45:07.894000+00:00", "ExpirationTime": "2020-09-17T20:38:37+00:00", "InputDataConfig": { "S3Bucket": "comp-med-input", "S3Key": "AKIAIOSFODNN7EXAMPLE" }, "OutputDataConfig": { "S3Bucket": "comp-med-output", "S3Key": "AKIAIOSFODNN7EXAMPLE" }, "LanguageCode": "en", "DataAccessRoleArn": "arn:aws:iam::867139942017:role/ComprehendMedicalBatchProcessingRole", "ModelVersion": "0.1.0" } ] }

如需詳細資訊,請參閱 Amazon Comprehend Medical 學開發人員指南中的本體論連結批次分析

  • 如需 API 詳細資訊,請參閱AWS CLI 命令參考CmInferenceJobs中的 ListIcd10

下列程式碼範例會示範如何使用list-phi-detection-jobs

AWS CLI

列出受保護的健康資訊 (PHI) 偵測工作

下列list-phi-detection-jobs範例會列出目前受保護的健康資訊 (PHI) 偵測工作

aws comprehendmedical list-phi-detection-jobs

輸出:

{ "ComprehendMedicalAsyncJobPropertiesList": [ { "JobId": "4750034166536cdb52ffa3295a1b00a3", "JobStatus": "COMPLETED", "SubmitTime": "2020-03-19T20:38:37.594000+00:00", "EndTime": "2020-03-19T20:45:07.894000+00:00", "ExpirationTime": "2020-07-17T20:38:37+00:00", "InputDataConfig": { "S3Bucket": "comp-med-input", "S3Key": "" }, "OutputDataConfig": { "S3Bucket": "comp-med-output", "S3Key": "867139942017-PHIDetection-4750034166536cdb52ffa3295a1b00a3/" }, "LanguageCode": "en", "DataAccessRoleArn": "arn:aws:iam::867139942017:role/ComprehendMedicalBatchProcessingRole", "ModelVersion": "PHIModelV20190903" } ] }

如需詳細資訊,請參閱亞馬遜醫學開發人員指南中的 Batch API

下列程式碼範例會示範如何使用list-rx-norm-inference-jobs

AWS CLI

若要列出所有目前的 Rx 規範推論工作

下列範例顯示如何list-rx-norm-inference-jobs傳回目前非同步 Rx-Norm 批次推論工作的清單。

aws comprehendmedical list-rx-norm-inference-jobs

輸出:

{ "ComprehendMedicalAsyncJobPropertiesList": [ { "JobId": "4980034166536cfb52gga3295a1b00a3", "JobStatus": "COMPLETED", "SubmitTime": "2020-05-19T20:38:37.594000+00:00", "EndTime": "2020-05-19T20:45:07.894000+00:00", "ExpirationTime": "2020-09-17T20:38:37+00:00", "InputDataConfig": { "S3Bucket": "comp-med-input", "S3Key": "AKIAIOSFODNN7EXAMPLE" }, "OutputDataConfig": { "S3Bucket": "comp-med-output", "S3Key": "AKIAIOSFODNN7EXAMPLE" }, "LanguageCode": "en", "DataAccessRoleArn": "arn:aws:iam::867139942017:role/ComprehendMedicalBatchProcessingRole", "ModelVersion": "0.0.0" } ] }

如需詳細資訊,請參閱 Amazon Comprehend Medical 學開發人員指南中的本體論連結批次分析

下列程式碼範例會示範如何使用list-snomedct-inference-jobs

AWS CLI

列出所有 SNOMED CT 推論工作

下列範例顯示list-snomedct-inference-jobs作業如何傳回目前非同步 SNOMED CT 批次推論工作的清單。

aws comprehendmedical list-snomedct-inference-jobs

輸出:

{ "ComprehendMedicalAsyncJobPropertiesList": [ { "JobId": "5780034166536cdb52ffa3295a1b00a7", "JobStatus": "COMPLETED", "SubmitTime": "2020-05-19T20:38:37.594000+00:00", "EndTime": "2020-05-19T20:45:07.894000+00:00", "ExpirationTime": "2020-09-17T20:38:37+00:00", "InputDataConfig": { "S3Bucket": "comp-med-input", "S3Key": "AKIAIOSFODNN7EXAMPLE" }, "OutputDataConfig": { "S3Bucket": "comp-med-output", "S3Key": "AKIAIOSFODNN7EXAMPLE" }, "LanguageCode": "en", "DataAccessRoleArn": "arn:aws:iam::867139942017:role/ComprehendMedicalBatchProcessingRole", "ModelVersion": "0.1.0" } ] }

如需詳細資訊,請參閱 Amazon Comprehend Medical 學開發人員指南中的本體論連結批次分析

下列程式碼範例會示範如何使用start-entities-detection-v2-job

AWS CLI

啟動實體偵測工作

下列start-entities-detection-v2-job範例會啟動非同步實體偵測工作。

aws comprehendmedical start-entities-detection-v2-job \ --input-data-config "S3Bucket=comp-med-input" \ --output-data-config "S3Bucket=comp-med-output" \ --data-access-role-arn arn:aws:iam::867139942017:role/ComprehendMedicalBatchProcessingRole \ --language-code en

輸出:

{ "JobId": "ab9887877365fe70299089371c043b96" }

如需詳細資訊,請參閱亞馬遜醫學開發人員指南中的 Batch API

下列程式碼範例會示範如何使用start-icd10-cm-inference-job

AWS CLI

若要啟動 ICD-10-CM 推論工作

下列start-icd10-cm-inference-job範例會啟動 ICD-10-CM 推論批次分析工作。

aws comprehendmedical start-icd10-cm-inference-job \ --input-data-config "S3Bucket=comp-med-input" \ --output-data-config "S3Bucket=comp-med-output" \ --data-access-role-arn arn:aws:iam::867139942017:role/ComprehendMedicalBatchProcessingRole \ --language-code en

輸出:

{ "JobId": "ef7289877365fc70299089371c043b96" }

如需詳細資訊,請參閱 Amazon Comprehend Medical 學開發人員指南中的本體論連結批次分析

  • 如需 API 詳細資訊,請參閱AWS CLI 命令參考CmInferenceJob中的 StartIcd10

下列程式碼範例會示範如何使用start-phi-detection-job

AWS CLI

啟動 PHI 偵測工作

下列start-phi-detection-job範例會啟動非同步 PHI 實體偵測工作。

aws comprehendmedical start-phi-detection-job \ --input-data-config "S3Bucket=comp-med-input" \ --output-data-config "S3Bucket=comp-med-output" \ --data-access-role-arn arn:aws:iam::867139942017:role/ComprehendMedicalBatchProcessingRole \ --language-code en

輸出:

{ "JobId": "ab9887877365fe70299089371c043b96" }

如需詳細資訊,請參閱亞馬遜醫學開發人員指南中的 Batch API

下列程式碼範例會示範如何使用start-rx-norm-inference-job

AWS CLI

開始 RxNorm 推論工作

下列start-rx-norm-inference-job範例會啟動 RxNorm 推論批次分析工作。

aws comprehendmedical start-rx-norm-inference-job \ --input-data-config "S3Bucket=comp-med-input" \ --output-data-config "S3Bucket=comp-med-output" \ --data-access-role-arn arn:aws:iam::867139942017:role/ComprehendMedicalBatchProcessingRole \ --language-code en

輸出:

{ "JobId": "eg8199877365fc70299089371c043b96" }

如需詳細資訊,請參閱 Amazon Comprehend Medical 學開發人員指南中的本體論連結批次分析

下列程式碼範例會示範如何使用start-snomedct-inference-job

AWS CLI

開始測試 CT 推論工作

下列start-snomedct-inference-job範例會啟動 SNOMED CT 推論批次分析工作。

aws comprehendmedical start-snomedct-inference-job \ --input-data-config "S3Bucket=comp-med-input" \ --output-data-config "S3Bucket=comp-med-output" \ --data-access-role-arn arn:aws:iam::867139942017:role/ComprehendMedicalBatchProcessingRole \ --language-code en

輸出:

{ "JobId": "dg7289877365fc70299089371c043b96" }

如需詳細資訊,請參閱 Amazon Comprehend Medical 學開發人員指南中的本體論連結批次分析

下列程式碼範例會示範如何使用stop-entities-detection-v2-job

AWS CLI

停止實體偵測工作

下列stop-entities-detection-v2-job範例會停止非同步實體偵測工作。

aws comprehendmedical stop-entities-detection-v2-job \ --job-id "ab9887877365fe70299089371c043b96"

輸出:

{ "JobId": "ab9887877365fe70299089371c043b96" }

如需詳細資訊,請參閱亞馬遜醫學開發人員指南中的 Batch API

下列程式碼範例會示範如何使用stop-icd10-cm-inference-job

AWS CLI

若要停止 ICD-10-CM 推論工作

下列stop-icd10-cm-inference-job範例會停止 ICD-10-CM 推論批次分析工作。

aws comprehendmedical stop-icd10-cm-inference-job \ --job-id "4750034166536cdb52ffa3295a1b00a3"

輸出:

{ "JobId": "ef7289877365fc70299089371c043b96", }

如需詳細資訊,請參閱 Amazon Comprehend Medical 學開發人員指南中的本體論連結批次分析

  • 如需 API 詳細資訊,請參閱AWS CLI 命令參考CmInferenceJob中的 StopIcd10

下列程式碼範例會示範如何使用stop-phi-detection-job

AWS CLI

停止受保護的健康資訊 (PHI) 偵測工作

下列stop-phi-detection-job範例會停止非同步保護健康資訊 (PHI) 偵測工作。

aws comprehendmedical stop-phi-detection-job \ --job-id "4750034166536cdb52ffa3295a1b00a3"

輸出:

{ "JobId": "ab9887877365fe70299089371c043b96" }

如需詳細資訊,請參閱亞馬遜醫學開發人員指南中的 Batch API

下列程式碼範例會示範如何使用stop-rx-norm-inference-job

AWS CLI

若要停止 RxNorm 推論工作

下列stop-rx-norm-inference-job範例會停止 ICD-10-CM 推論批次分析工作。

aws comprehendmedical stop-rx-norm-inference-job \ --job-id "eg8199877365fc70299089371c043b96"

輸出:

{ "JobId": "eg8199877365fc70299089371c043b96", }

如需詳細資訊,請參閱 Amazon Comprehend Medical 學開發人員指南中的本體論連結批次分析

下列程式碼範例會示範如何使用stop-snomedct-inference-job

AWS CLI

停止測試 CT 推論工作

下列stop-snomedct-inference-job範例會停止 SNOMED CT 推論批次分析工作。

aws comprehendmedical stop-snomedct-inference-job \ --job-id "8750034166436cdb52ffa3295a1b00a1"

輸出:

{ "JobId": "8750034166436cdb52ffa3295a1b00a1", }

如需詳細資訊,請參閱 Amazon Comprehend Medical 學開發人員指南中的本體論連結批次分析