命名实体识别(ner)的python模块。

ner-d的Python项目详细描述


内耗d

https://img.shields.io/pypi/v/ner-d.svghttps://img.shields.io/pypi/pyversions/ner-d.svghttps://travis-ci.org/verifid/ner-d.svg?branch=masterhttps://codecov.io/gh/verifid/ner-d/branch/master/graph/badge.svghttps://readthedocs.org/projects/ner-d/badge/?version=latest

ner-d是用于命名实体识别(ner)的python模块。命名实体识别(ner)(也称为实体识别、实体分块和实体提取) 是信息提取的一个子任务,它试图定位非结构化文本中提到的命名实体并将其分类为预定义的类别,如person 名称、组织、地点、医疗代码、时间表达式、数量、货币值、百分比等。

简单地使用单一的主函数和选择语言模型的灵活性。如果之前没有下载,它会自动下载模型并在系统上链接 从给定的文本块中查找实体。

先决条件

  • 一个列在requirements.txt上的依赖项,将在使用pip安装时安装。

安装

  • 使用pip

    安装模块
    $ pip install ner-d
    
  • https://github.com/verifid/ner-d下载最新的ner-d库,并使用pip

    安装模块
    $ pip install -e .
    
  • 提取源分发并运行:

    $ python setup.py build
    $ python setup.py install
    

用法

  • ner
fromnerdimportnerdoc=ner.name("""GitHub launched April 10, 2008, a subsidiary of Microsoft, is an American web-based hosting service for version control using Git.
                   It is mostly used for computer code. It offers all of the distributed version control and source code management (SCM) functionality
                   of Git as well as adding its own features.""",language='en_core_web_sm')text_label=[(X.text,X.label_)forXindoc]print(text_label)//[(u'GitHub',u'ORG'),(u'April 10, 2008',u'DATE'),(u'Microsoft',u'ORG'),(u'American',u'NORP'),(u'Git',u'PERSON'),(u'SCM',u'ORG'),(u'Git',u'PERSON')]

cli

// Downloads language model
python -m nerd -d en_core_web_sm

// Load language model
python -m nerd -l en_core_web_sm

// Find entities from text
python -m nerd -n "GitHub launched April 10, 2008, a subsidiary of Microsoft, is an American web-based hosting service for version control using Git.
                   It is mostly used for computer code. It offers all of the distributed version control and source code management (SCM) functionality
                   of Git as well as adding its own features."

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Spring freemarker多模板加载程序路径   在java插件中从控制台获取输入   java在包中创建继承类   网页抓取Java Jsoup网页抓取   java在线程内创建一个对象,而true条件具有相同的引用   java如何根据空格数拆分字符串   java新的安卓 studio更新中的配置文件“app”是什么?   java在将ArrayList写入/读取到文件时出现奇怪的问题   java Reg替换文本块第一次出现+最后一次出现   java当我单击任何RecyclerView列表项时,如何在MainActivity的EditText中显示特定的单击项?   JAVA XML删除节点仅删除第一个外观   java如何在数组中查找特定值   java SVG/矢量图形对象布尔运算(并集、交集、减法)   java在Android中创建线程需要多长时间   尝试从JBOSS联系Oracle LDAP服务器时发生java连接重置异常   java基于参数获取特定的实现实例   使用java就地修改文件内容   java MonetaryException:未加载MonetaryAmountsSingletonSpi   java接受用户的不同输入并使其触发完全相同的代码段的最短方法是什么   Spring 3.2.8应用程序中未找到java HTTP 404错误