根据最近的更新,AWS 医学理解服务现在应该返回 snomed 类别以及其他医学术语。
我在 Python 3.9 Lambda 中运行它:
import json
def lambda_handler(event, context):
clinical_note = "Patient X was diagnosed with insomnia."
import boto3
cm_client = boto3.client("comprehendmedical")
response = cm_client.infer_snomedct(Text=clinical_note)
print (response)
我得到以下回复:
{
"errorMessage": "'ComprehendMedical' object has no attribute 'infer_snomedct'",
"errorType": "AttributeError",
"requestId": "560f1d3c-800a-46b6-a674-e0c3c3cc719f",
"stackTrace": [
" File \"/var/task/lambda_function.py\", line 7, in lambda_handler\n response = cm_client.infer_snomedct(Text=clinical_note)\n",
" File \"/var/runtime/botocore/client.py\", line 643, in __getattr__\n raise AttributeError(\n"
]
}
所以要么我遗漏了一些东西(可能是一些明显的东西),要么该方法实际上还不可用?任何能让我走上正确道路的事情都会受到欢迎。