Skip to main content

A package to extract relations between entities. this maybe helpful and a important link for constructing KG. base on DSNF(Dependency Semantic Normal Forms) for now.

Project description

EntityRelation

A package to extract relations between entities. this maybe helpful and a important link for constructing KG. base on DSNF(Dependency Semantic Normal Forms) for now.

为什么要封装这个包

在知识图谱的构建过程中很重要的一步是实体关系的提取,看了一些关于知识图谱的项目大都是全过程的(有些可能存在硬编码),导致想要进行其他领域的实体关系提取(知识图谱构建)时都不会十分顺畅。 所以看到lemonhu的开放领域实体关系提取项目(open-entity-relation-extraction)觉得很有意义。 但是原项目也有一些硬编码的地方,而且其他项目想要使用可能不是那么方便。 基于以上原因,动手在lemonhu项目的基础上封装了一个python包,便于插拔使用。 目前包的方法并不针对特定领域,一种比较简单的迁移到专有领域的方法是替换resource文件夹的user_dict.txt分词词典。 默认包含的词典只是一个比较基础的版本。

使用及效果示例

(第一次使用由于需要去下载ltp模型,所以实例化的时候可能会等待几分钟)

安装

可以直接通过pip安装

pip install EntityRelation

或者:

git clone https://github.com/LG-1/EntityRelation.git
cd EntityRelation
python setup.py install

其它

还有很多需要优化的地方,非常欢迎大家提供意见建议或者issue。

目前DSNF的效率还可以,但准确率还有待进一步的测试覆盖。

后续还考虑添加其他的关系提取实现,从而使得模型选择参数化。

Refrence

主要参考了: https://github.com/lemonhu/open-entity-relation-extraction 进行了封装组件化便于使用。

Jia S, Li M, Xiang Y. Chinese Open Relation Extraction and Knowledge Base Establishment[J]. ACM Transactions on Asian and Low-Resource Language Information Processing (TALLIP), 2018, 17(3): 15.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

EntityRelation-1.0.3.tar.gz (131.3 kB view details)

Uploaded Source

Built Distribution

EntityRelation-1.0.3-py3-none-any.whl (130.9 kB view details)

Uploaded Python 3

File details

Details for the file EntityRelation-1.0.3.tar.gz.

File metadata

  • Download URL: EntityRelation-1.0.3.tar.gz
  • Upload date:
  • Size: 131.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for EntityRelation-1.0.3.tar.gz
Algorithm Hash digest
SHA256 e6c5159afadb40e1b2b95b30b2fcec8df09bf1d8d7f228a358cef750a99c36d0
MD5 ce8d6718dd896c3ef951b796be6180ef
BLAKE2b-256 fcf8a440d8fe56944f44deac857a133220a838361e1fff016e74db330144b6a3

See more details on using hashes here.

File details

Details for the file EntityRelation-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: EntityRelation-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 130.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for EntityRelation-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cccaada7e8d03b25aff244b1460939e4e5ce032b2f70ed7dbf36ce6a8b20beb0
MD5 01c554882e966b28975e4f4b9e3f0ff4
BLAKE2b-256 d0495d0bf377833249a6ed43f4107f5ff5d03f8f868dfd122122cbd3e17ea5b5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page