|
and Register
Home
Contact Us

AI Agent [AI11]News Entity Recognition(NER)

[AI11]News Entity Recognition(NER)PublicV1
News Entity Recognition helps you recognize entity type in Chinese/English news text, it supported entity types include companies, personal names, addresses, academic institutions, government institutions, and more.
Note: Note: 1.If you need to recognize other types of texts (non-news-texts), the interface can also support it, such as paper texts. However, the recognition effectiveness may be lower compared to news texts.

Basic Information

Resource URL: /ai/ner/news-ner

Request Mode: post

Return Format: application/json

The API can only be called after logging in, click to log in

API Description Document Download

Request Parameters

body
NewsNerRequest
ParameterTypeRequiredDescriptionSample
langstringtrue
Choose the language of the input text: CN:Chinese EN:English
cn
textstringtrue
News text content. Chinese text is required to be no more than 500 characters or English text no more than 500 words
药鼎记:生物医药新生力量 7964682698844491.jpg 2018年3月以来,国家药品监督管理局采取了各种措施加快全球创新药进入中国的速度,通过参与全球同步开发引进新药的模式也正在逐步实现;同时,中国创新药产业进入收获期,国产IND(新药临床研究申请)被受理的数量持续升高,且中国创新药Licence-out在数量和金额上都呈现快速增长态势。

Request Sample

  • Curl
  • NodeJs
  • Python
  • Java
curl -X POST "https://connect.patsnap.com/ai/ner/news-ner?apikey="
-H "Content-Type:application/json"
-H "authorization:Bearer {token}"
-d '{"lang":"cn","text":"药鼎记:生物医药新生力量\n\n\n\n\n\n7964682698844491.jpg\n\n2018年3月以来,国家药品监督管理局采取了各种措施加快全球创新药进入中国的速度,通过参与全球同步开发引进新药的模式也正在逐步实现;同时,中国创新药产业进入收获期,国产IND(新药临床研究申请)被受理的数量持续升高,且中国创新药Licence-out在数量和金额上都呈现快速增长态势。"}'
const axios = require('axios');
const options = {
    url: "https://connect.patsnap.com/ai/ner/news-ner",
    method: "POST",
    headers: {
        'Content-Type': 'application/json',
        'authorization': 'Bearer {token}',
    },
    params: {
        'apikey': '',
    },
    data: {
        "lang": "cn",
        "text": "药鼎记:生物医药新生力量\n\n\n\n\n\n7964682698844491.jpg\n\n2018年3月以来,国家药品监督管理局采取了各种措施加快全球创新药进入中国的速度,通过参与全球同步开发引进新药的模式也正在逐步实现;同时,中国创新药产业进入收获期,国产IND(新药临床研究申请)被受理的数量持续升高,且中国创新药Licence-out在数量和金额上都呈现快速增长态势。"
    }
};
axios(options).then(res => {
    console.log(res.data)
}).catch(err => {
    console.log(err)
})
import requests
url = "https://connect.patsnap.com/ai/ner/news-ner"

params = {
    "apikey": ""
}

payload = {
    "lang": "cn",
    "text": "药鼎记:生物医药新生力量\n\n\n\n\n\n7964682698844491.jpg\n\n2018年3月以来,国家药品监督管理局采取了各种措施加快全球创新药进入中国的速度,通过参与全球同步开发引进新药的模式也正在逐步实现;同时,中国创新药产业进入收获期,国产IND(新药临床研究申请)被受理的数量持续升高,且中国创新药Licence-out在数量和金额上都呈现快速增长态势。"
}

headers = {
    "Content-Type": "application/json",
    "authorization": "Bearer {token}"
}

response = requests.request("POST", url, params=params, json=payload, headers=headers)

print(response.text)
public static void main(String[] args) {
    String host = "https://connect.patsnap.com";
    String path = "/ai/ner/news-ner";

    Map headers = new HashMap();
    headers.put("Content-Type", "application/json");
    headers.put("authorization", "Bearer {token}");

    Map querys = new HashMap();
    querys.put("apikey", "");
    JSONObject dataBody = (JSONObject)JSON.parse("{\"lang\":\"cn\",\"text\":\"药鼎记:生物医药新生力量\n\n\n\n\n\n7964682698844491.jpg\n\n2018年3月以来,国家药品监督管理局采取了各种措施加快全球创新药进入中国的速度,通过参与全球同步开发引进新药的模式也正在逐步实现;同时,中国创新药产业进入收获期,国产IND(新药临床研究申请)被受理的数量持续升高,且中国创新药Licence-out在数量和金额上都呈现快速增长态势。\"}");

    try {
        /**
        * Important Tips:
        * Please Download HttpUtils From
        * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtils.java
        *
        * Please refer to the corresponding dependence:
        * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml
        */
        HttpResponse response = HttpUtils.doPost(host, path, null, headers, querys, dataBody.toJSONString());
        System.out.println(EntityUtils.toString(response.getEntity()));
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Copy

Response Parameters

CommonResponse
ParameterTypeRequiredDescriptionSample
data
arrayfalse
response data
no sample
status
booleantrue
Status
false
error_msg
stringfalse
Error Message
The request parameter format is incorrect!
error_code
integertrue
Error Code
0
NerNewsResult
ParameterTypeRequiredDescriptionSample
end
integerfalse
NER end position
59
type
stringfalse
entity type: COM:company GOV:government GPE:address ACA:academic PPL:personal name NPO:non-profit CDO:hospital
GOV
start
integerfalse
NER start position
50
entity
stringfalse
entity name
国家药品监督管理局

Response Error Details

error_codeDescription
0Success
201Created
401Unauthorized
403Forbidden
404Not Found
68300004Invalid parameter!
68300005Search api failure!
68300006Analytic basic access error!
68300007Bad request!
68300008Service error, please try again later!
68300010The file does not comply with upload specifications!
67200001API call exceeds the total limit set by the platform!
67200002Quota exceeds the limit!
67200003Access token expired or authentication error!
67200004No permission or API package quota has exceeded the limit!
67200005Insufficient balance, call failed!
67200006This client has expired and call failed!
67200007Exceeded the call limit, call failed!

Response Body

  • json
{
    "data": [
        {
            "end": 59,
            "type": "GOV",
            "start": 50,
            "entity": "国家药品监督管理局"
        }
    ],
    "status": true,
    "error_code": 0
}
Copy
[AI10]Query and export OCR recognition results