Coder Social home page Coder Social logo

pyunits / pyunit-ner Goto Github PK

View Code? Open in Web Editor NEW
33.0 1.0 7.0 202 KB

NER实体识别模型,快速高效简单一键部署docker部署调用模型。能识别:地址、人名、机构名实体。

Home Page: https://pypi.org/project/pyunit-ner/

Python 99.79% Dockerfile 0.21%
nlp python3 docker

pyunit-ner's Introduction

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"
}

pyunit-ner's People

Contributors

jtyoui avatar

Stargazers

Li Tong avatar  avatar Kevin Chan avatar DroLuo avatar Nydaym avatar  avatar  avatar 小子欠扁 avatar 李森林 avatar  avatar Joey Meng avatar  avatar JohnLL avatar  avatar Meway avatar  avatar  avatar  avatar  avatar oli_s avatar  avatar  avatar  avatar  avatar yoxih avatar alwayrun avatar Rita XU avatar CurisZhou avatar Rain avatar  avatar  avatar  avatar lktoken avatar

Watchers

James Cloos avatar

pyunit-ner's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.