pyUnit-NER 
NER模块集合
安装
pip install pyunit-ner
推荐使用Docker部署
docker pull jtyoui/pyunit-ner
docker run -d -P jtyoui/pyunit-ner
默认官方数据集训练的模型(只能识别:人名、地名、机构名)
默认的参数和映射表
import pprint
from pyunit_ner import ernie_st, ernie_match, parseNER
def test():
# 默认的模型参数和映射表
model = '/home/jtyoui/Documents/model'
s = ernie_st(new_model_path=model)
data = ernie_match('刘万光对李伟说:在贵阳市南明村永乐乡发生了一件恐怖的事情', s)
result = parseNER(data)
return result
if __name__ == '__main__':
pprint.pprint(test())
抽取实体接口文档
http://ip:port/docs
请求报文
| 参数名 | 类型 | NULL | 说明 |
|---|---|---|---|
| data | string | Yes | 数据 |
请求示例
import requests
url = "http://127.0.0.1:9000/pyunit/ner?data=我在贵州贵阳观山湖"
headers = {'Content-Type': "application/x-www-form-urlencoded"}
response = requests.get(url).json()
print(response)
返回报文
| 参数名 | 类型 | NULL | 说明 |
|---|---|---|---|
| msg | string | Yes | 返回消息 |
| data | list | Yes | 标注数据类型 |
| address | list | Yes | 地址 |
| person | list | Yes | 人名 |
| org | list | Yes | 机构名 |
{
"code": 200,
"entity": {
"address": [
"贵州贵阳观山湖"
],
"number": [
"6",
"6",
"4",
"5",
"4",
"5",
"4",
"5",
"5"
],
"organization": [],
"person": [],
"word": [
"我",
"在",
"贵",
"州",
"贵",
"阳",
"观",
"山",
"湖"
]
},
"msg": "success"
}
Metadata
Release files for pyunit-ner 2021.8.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyunit_ner-2021.8.2.tar.gz | 101.9 kB | Without provenance | Details for pyunit_ner-2021.8.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyunit_ner-2021.8.2-py3-none-any.whl | Python 3 | none | any | Details for pyunit_ner-2021.8.2-py3-none-any.whl |
Total release size: 202.4 kB
Release files / pyunit_ner-2021.8.2.tar.gz
| Download URL | pyunit_ner-2021.8.2.tar.gz |
|---|---|
| Size | 101.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a470d846150d8c2133cd03d47c4ec74c493f8e12db2b104119883b55b5d767c6
|
|
BLAKE2b-256 checksum How to use checksums |
525ddc0c9bf91a5ca4fa51eb0d6ceaef613f394004a100e1abc519f584a51280
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11
|
Release files / pyunit_ner-2021.8.2-py3-none-any.whl
| Download URL | pyunit_ner-2021.8.2-py3-none-any.whl |
|---|---|
| Size | 100.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d8ec843dd18f4447d13bc592d033b9a4788654f8ad7da95ed7d01e5d20917486
|
|
BLAKE2b-256 checksum How to use checksums |
f7d99d168027678b7cee02850e0e8896aee8bd5df70d87fc22d4b762b2f57c54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11
|
Security for pyunit-ner 2021.8.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.