---
title: 高级·智能实体识别
sidebar_position: 1
---


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

### 请求方式

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

### 请求参数

| 参数名称 | 类型     | 是否必须 | 备注   | 示例                     |
|:-----|:-------|:-----|:-----|:-----------------------|
| text | string | 是    | 输入文本 | 胃溃疡会肚子疼拉稀吗，是不是在消化内科挂号？ |

### 返回数据说明

| 参数名称                                    | 类型      | 备注               |
|:----------------------------------------|:--------|:-----------------|
| entity_extraction                       | array   | 抽取的实体            |
| entity_extraction.entity_id             | string  | 实体 ID             |
| entity_extraction.entity_type           | string  | 实体类型             |
| entity_extraction.entity_name           | string  | 实体名称（知识图谱中的标准名称） |
| entity_extraction.ner_name              | string  | 识别出的实体文字（原句中的名称） |
| entity_extraction.ner_type              | string  | 识别出的类型           |
| entity_extraction.positions             | object  | 识别出的文字位置         |
| entity_extraction.positions.start_index | integer | 识别出的文字开始位置       |
| entity_extraction.positions.end_index   | integer | 识别出的文字结束位置       |
| entity_extraction.positions.probability | float   | 识别出的文字置信值        |

### 请求及返回示例

**请求**

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

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

**返回结果**

```json
{
  "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
          }
        ]
      }
    ]
  }
}
```
