POST /v2/nc.ms.smart.entity.recognition

自然语言实体识别接口,支持识别的实体类型有:疾病、症状、药物、科室、身体部位、医学操作、组织机构、地区、检查检验、人群、年龄、人名、文献等。

请求参数

参数名称类型是否必须备注示例
textstring输入文本胃溃疡会肚子疼拉稀吗,是不是在消化内科挂号?

返回数据说明

参数名称类型备注
entity_extractionarray抽取的实体
entity_extraction.entity_idstring实体ID
entity_extraction.entity_typestring实体类型
entity_extraction.entity_namestring实体名称(知识图谱中的标准名称)
entity_extraction.ner_namestring识别出的实体文字(原句中的名称)
entity_extraction.ner_typestring识别出的类型
entity_extraction.positionsobject识别出的文字位置
entity_extraction.positions.start_indexinteger识别出的文字开始位置
entity_extraction.positions.end_indexinteger识别出的文字结束位置
entity_extraction.positions.probabilityfloat识别出的文字置信值

请求及返回示例

请求

POST https://medical.nocode.com/open/v2/nc.ms.smart.entity.recognition

{
  "text": "胃溃疡会肚子疼拉稀吗,是不是在浙一医院的消化内科挂号?"
}

返回结果

{
  "data": {
    "entity_extraction": [
      {
        "entity_id": "7z2hupccrXk",
        "entity_type": "disease",
        "entity_name": "胃溃疡",
        "ner_name": "胃溃疡",
        "ner_type": "disease",
        "positions": [
          {
            "end_index": 3,
            "probability": 0.9999810457229614,
            "start_index": 0
          }
        ]
      },
      {
        "entity_id": "7zThXgTubLO",
        "entity_type": "symptom",
        "entity_name": "腹痛",
        "ner_name": "肚子疼",
        "ner_type": "symptom",
        "positions": [
          {
            "end_index": 7,
            "probability": 0.9998244643211365,
            "start_index": 4
          }
        ]
      },
      {
        "entity_id": "7zThU0nLV68",
        "entity_type": "symptom",
        "entity_name": "腹泻",
        "ner_name": "拉稀",
        "ner_type": "symptom",
        "positions": [
          {
            "end_index": 9,
            "probability": 0.9998500347137451,
            "start_index": 7
          }
        ]
      },
      {
        "entity_id": "1103",
        "entity_type": "department",
        "entity_name": "消化内科",
        "ner_name": "消化内科",
        "ner_type": "department",
        "positions": [
          {
            "end_index": 24,
            "probability": 0.9999927282333374,
            "start_index": 20
          }
        ]
      },
      {
        "entity_id": "80hTLJcsiCf",
        "entity_type": "hospital",
        "entity_name": "浙江大学医学院附属第一医院",
        "ner_name": "浙一医院",
        "ner_type": "organization",
        "positions": [
          {
            "end_index": 19,
            "probability": 0.9999973773956299,
            "start_index": 15
          }
        ]
      }
    ]
  }
}
;