Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pyunits/pyunit-ner
NER实体识别模型,快速高效简单一键部署docker部署调用模型。能识别:地址、人名、机构名实体。
https://github.com/pyunits/pyunit-ner
docker nlp python3
Last synced: 4 days ago
JSON representation
NER实体识别模型,快速高效简单一键部署docker部署调用模型。能识别:地址、人名、机构名实体。
- Host: GitHub
- URL: https://github.com/pyunits/pyunit-ner
- Owner: pyunits
- Created: 2020-02-06T13:30:49.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-26T22:30:56.000Z (over 1 year ago)
- Last Synced: 2024-10-11T12:48:44.777Z (about 1 month ago)
- Topics: docker, nlp, python3
- Language: Python
- Homepage: https://pypi.org/project/pyunit-ner/
- Size: 197 KB
- Stars: 33
- Watchers: 1
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **pyUnit-NER** [![](https://gitee.com/tyoui/logo/raw/master/logo/photolog.png)][1]
## NER模块集合
[![](https://img.shields.io/badge/Python-3.8-green.svg)](https://pypi.org/project/pyunit-ner/)
[![](https://img.shields.io/badge/[email protected])]()### 安装
pip install pyunit-ner
### 推荐使用Docker部署
```shell
docker pull jtyoui/pyunit-ner
docker run -d -P jtyoui/pyunit-ner
```### 默认官方数据集训练的模型(只能识别:人名、地名、机构名)
[点击下载模型](https://github.com/PyUnit/pyunit-ner/releases/download/v1.0/model.tar.gz)
### 默认的参数和映射表
```python
import pprint
from pyunit_ner import ernie_st, ernie_match, parseNERdef test():
# 默认的模型参数和映射表
model = '/home/jtyoui/Documents/model'
s = ernie_st(new_model_path=model)
data = ernie_match('刘万光对李伟说:在贵阳市南明村永乐乡发生了一件恐怖的事情', s)
result = parseNER(data)
return resultif __name__ == '__main__':
pprint.pprint(test())
```## 抽取实体接口文档
http://ip:port/docs
![接口文档](./exec.png)
### 请求报文
| **参数名** | **类型** | **NULL** | **说明** |
|:----:|:----:|:----:|:----:|
|data| string |Yes| 数据 |### 请求示例
```python
import requestsurl = "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| 机构名 |```json
{
"code": 200,
"entity": {
"address": [
"贵州贵阳观山湖"
],
"number": [
"6",
"6",
"4",
"5",
"4",
"5",
"4",
"5",
"5"
],
"organization": [],
"person": [],
"word": [
"我",
"在",
"贵",
"州",
"贵",
"阳",
"观",
"山",
"湖"
]
},
"msg": "success"
}
```***
[1]: https://blog.jtyoui.com