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 进行了封装组件化便于使用。
Release files for EntityRelation 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| EntityRelation-1.0.3.tar.gz | 131.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| EntityRelation-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 262.3 kB
Release files / EntityRelation-1.0.3.tar.gz
| Download URL | EntityRelation-1.0.3.tar.gz |
|---|---|
| Size | 131.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6c5159afadb40e1b2b95b30b2fcec8df09bf1d8d7f228a358cef750a99c36d0
|
|
BLAKE2b-256 checksum How to use checksums |
fcf8a440d8fe56944f44deac857a133220a838361e1fff016e74db330144b6a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / EntityRelation-1.0.3-py3-none-any.whl
| Download URL | EntityRelation-1.0.3-py3-none-any.whl |
|---|---|
| Size | 130.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cccaada7e8d03b25aff244b1460939e4e5ce032b2f70ed7dbf36ce6a8b20beb0
|
|
BLAKE2b-256 checksum How to use checksums |
d0495d0bf377833249a6ed43f4107f5ff5d03f8f868dfd122122cbd3e17ea5b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|