医学实体识别
医学实体识别领域(行业版)
调用须知
该服务为行业版的能力,需要开通行业版才能免费调用。点击这里确认开通状态:https://common-buy.aliyun.com/?commodityCode=nlp_alinlpIndustryPost_public_cn
支持语言:中文
支持行业:医学行业
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | GetNerChMedical | 系统规定参数。取值:GetNerChMedical。 |
ServiceCode | String | 是 | alinlp | 固定值,只支持alinlp |
Text | String | 是 | 在当地医院行胸部CT检查,回报为“左肺下叶高密度阴影有一空洞” | 待识别文本,文本长度小于256 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Data | String | FA53D08F-37D1-4D81-BEE7-41F24E825F60 | 唯一请求id,排查问题的依据 |
RequestId | String | {“result”:{“ner”:[{“attr_probability”:[],”attributes”:[],”begin_char”:6,”children”:[],”end_char”:7,”id”:0,”parent”:[1],”probability”:[0.5993586778640747],”text”:”胸部”,”type”:[“Anatomy”]},{“attr_probability”:[0.8909370303153992],”attributes”:[“PAST”],”begin_char”:6,”children”:[0],”end_char”:11,”id”:1,”parent”:[],”probability”:[0.6000467538833618],”text”:”胸部CT检查”,”type”:[“Test-name”]},{“attr_probability”:[0.9525512456893921],”attributes”:[“PAST”],”begin_char”:17,”children”:[3,4],”end_char”:20,”id”:2,”parent”:[],”probability”:[0.847745418548584],”text”:”左肺下叶”,”type”:[“Anatomy”]},{“attr_probability”:[],”attributes”:[],”begin_char”:17,”children”:[],”end_char”:17,”id”:3,”parent”:[2],”probability”:[0.7],”text”:”左”,”type”:[“Location”]},{“attr_probability”:[],”attributes”:[],”begin_char”:19,”children”:[],”end_char”:19,”id”:4,”parent”:[2],”probability”:[0.7],”text”:”下”,”type”:[“Location”]}],”text”:”在当地医院行胸部CT检查,回报为“左肺下叶高密度阴影有一空洞””},”success”:true } | ‘result’中包含一个dictionary,有如下key(二级字段):ner:类似为list,list中每一个元素是一个识别出的实体text:类型为str,输入文本list中包含一个dictionary,有如下key(三级字段):attr_probability:类型为list(double),各属性对应的概率,顺序与attributes一致attributes:类型为list(string),识别出的属性,顺序与attr_probability一致begin_char:类型为int,实体开始位置(闭区间children:类型为list(int),children实体id (child实体嵌套在该实体中)end_char:类型为int,实体结束位置(闭区间)id:类型为int,实体序号parent:类型为list(int),parent实体id (该实体嵌套在parent实体中)probability:类型为list(double),各实体对应概率,顺序与type一致text:类型为str,实体文本type:类型为list(str),识别出的实体,顺序与probability一致 |
示例
请求示例
http(s)://alinlp.cn-hangzhou.aliyuncs.com/?Action=GetNerChMedical
&ServiceCode=alinlp
&Text=待识别文本
&<公共请求参数>
正常返回示例
XML
格式
<RequestId>{"result":{"ner":[{"attr_probability":[],"attributes":[],"begin_char":6,"children":[],"end_char":7,"id":0,"parent":[1],"probability":[0.5993586778640747],"text":"胸部","type":["Anatomy"]},{"attr_probability":[0.8909370303153992],"attributes":["PAST"],"begin_char":6,"children":[0],"end_char":11,"id":1,"parent":[],"probability":[0.6000467538833618],"text":"胸部CT检查","type":["Test-name"]},{"attr_probability":[0.9525512456893921],"attributes":["PAST"],"begin_char":17,"children":[3,4],"end_char":20,"id":2,"parent":[],"probability":[0.847745418548584],"text":"左肺下叶","type":["Anatomy"]},{"attr_probability":[],"attributes":[],"begin_char":17,"children":[],"end_char":17,"id":3,"parent":[2],"probability":[0.7],"text":"左","type":["Location"]},{"attr_probability":[],"attributes":[],"begin_char":19,"children":[],"end_char":19,"id":4,"parent":[2],"probability":[0.7],"text":"下","type":["Location"]}],"text":"在当地医院行胸部CT检查,回报为“左肺下叶高密度阴影有一空洞”"},"success":true }</RequestId>
<Data>FA53D08F-37D1-4D81-BEE7-41F24E825F60</Data>
JSON
格式
{"RequestId":"{\"result\":{\"ner\":[{\"attr_probability\":[],\"attributes\":[],\"begin_char\":6,\"children\":[],\"end_char\":7,\"id\":0,\"parent\":[1],\"probability\":[0.5993586778640747],\"text\":\"胸部\",\"type\":[\"Anatomy\"]},{\"attr_probability\":[0.8909370303153992],\"attributes\":[\"PAST\"],\"begin_char\":6,\"children\":[0],\"end_char\":11,\"id\":1,\"parent\":[],\"probability\":[0.6000467538833618],\"text\":\"胸部CT检查\",\"type\":[\"Test-name\"]},{\"attr_probability\":[0.9525512456893921],\"attributes\":[\"PAST\"],\"begin_char\":17,\"children\":[3,4],\"end_char\":20,\"id\":2,\"parent\":[],\"probability\":[0.847745418548584],\"text\":\"左肺下叶\",\"type\":[\"Anatomy\"]},{\"attr_probability\":[],\"attributes\":[],\"begin_char\":17,\"children\":[],\"end_char\":17,\"id\":3,\"parent\":[2],\"probability\":[0.7],\"text\":\"左\",\"type\":[\"Location\"]},{\"attr_probability\":[],\"attributes\":[],\"begin_char\":19,\"children\":[],\"end_char\":19,\"id\":4,\"parent\":[2],\"probability\":[0.7],\"text\":\"下\",\"type\":[\"Location\"]}],\"text\":\"在当地医院行胸部CT检查,回报为“左肺下叶高密度阴影有一空洞”\"},\"success\":true }","Data":"FA53D08F-37D1-4D81-BEE7-41F24E825F60"}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | UserStatusInvalid | The user status is invalid. | 用户状态无效,未开通服务 |
403 | Forbidden.NoAuth | Failed to perform user authentication. | 用户鉴权失败 |
411 | FrameworkApiError | Framework API error. | 框架API错误 |
410 | FrameworkError | Framework internal server error. | 框架错误 |
412 | FrameworkFormatError | Framework request format error. | 框架请求格式错误 |
413 | FrameworkReturnError | Framework return type format error. | 框架返回格式错误 |
406 | TextCodingError | An encoding error occurred to the input text. | 输入文本编码错误 |
405 | TextLimitExceeded | The maximum length of the text is exceeded. | 文本长度超过限制 |
429 | Throttling.User | Flow control has been triggered. | 触发流控 |
500 | InternalError | A service error occurred. | 服务内部异常 |
401 | InvalidParameter | The parameter is invalid. | 参数无效 |
访问错误中心查看更多错误码。