DeepKE is a knowledge extraction toolkit that supports low-resource and document-level scenarios

DeepKE is a knowledge extraction toolkit that supports low-resource and document-level scenarios

2022-09-14 0 1,174
Resource Number 38498 Last Updated 2025-02-24
¥ 0USD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation

The recommended DeepKE in this issue is an open-source knowledge graph extraction toolset maintained by the knowledge graph team of Zhejiang University.

Project Introduction

DeepKE is a knowledge extraction toolkit that supports low-resource and document-level scenarios. It provides three PyTorch-based features, including named entity recognition, relationship extraction, and attribute extraction. DeepKE implements a variety of information extraction tasks, including named entity recognition, relationship extraction, and attribute extraction. With a unified framework, DeepKE allows developers and researchers to customize datasets and models to extract information from unstructured text according to their requirements. Specifically, DeepKE not only provides various functional modules and model implementations for different functions and scenarios, but also organizes all components through a consistent framework to maintain sufficient modularity and scalability.

DeepKE is a knowledge extraction toolkit that supports low-resource and document-level scenarios插图

Supports weight and deviation

To enable automatic hyperparameter fine-tuning, DeepKE employs Weight & Biases, a machine learning toolkit for developers to build better models faster. With this toolkit, DeepKE can better automate the visualization of results and adjust parameters. The toolkit is supported by sample runtimes for all functions in the repository, and researchers are able to modify the metric and hyperparameter configurations as needed.

Model architecture

DeepKE is a knowledge extraction toolkit that supports low-resource and document-level scenarios插图1

Architecture diagram

  • DeepKE has designed a unified framework for three knowledge extraction functions (named entity recognition, relationship extraction, and attribute extraction).
  • Different functions can be implemented in different scenarios. For example, relationship extraction can be performed in standard full supervision, low resources and few samples, and document-level settings
  • Each application scenario consists of three parts: the Data part contains the Tokenizer, Preprocessor, and Loader, the Model part contains the Module, Encoder, and Forwarder, and the Core part contains Training, Evaluation, and Prediction

Get started quickly

DeepKE supports pip installation and use, taking the conventional fully supervised setting relationship extraction as an example, a regular relationship extraction model can be realized through the following 6 steps

1. Download the code

git clone https://github.com/zjunlp/DeepKE.git

2. Use anaconda to create a virtual environment and enter the virtual environment (provide the Dockerfile source code to create an image by yourself, located in the docker folder)

conda create -n deepke python=3.8

conda activate deepke

//Provide a dockerfile to create a docker image
cd docker
docker build -t deepke .
conda activate deepke

1)Installed based on pip and used directly

pip install deepke

2) Installation based on source code

python setup.py install

python setup.py develop

3.Go to the task folder and take regular relationship extraction as an example

cd DeepKE/example/re/standard

4.Download the dataset

wget 120.27.214.45/Data/re/standard/data.tar.gz

tar -xzvf data.tar.gz

5.For model training, the parameters used in the training can be modified in the conf folder

DeepKE uses wandb to support visual parameter tuning

python run.py

6.Model prediction. The parameters used for prediction can be modified in the conf folder

Modify conf/predict.yaml to save the path of the trained model.

python predict.py

example

Standard renewables

The standard modules are implemented by common deep learning models, including CNNs, RNNs, Capsules, GCNs, Transformers, and pretrained models.

Step 1

enter

DeepKE/example/re/standard folder.

Step 2

Get the data:

wget 120.27.214.45/Data/re/standard/data.tar.gz

tar -xzvf data .tar.gz

dataYou can customize the dataset and the parameter conf in folders and folders separately.

The dataset needs to be imported as a CSV file.

The data format of the file must meet the following requirements:

sentence

relationship

head

Head_offset

tail

tail_offset

The file format of the relationship needs to meet the following requirements:

Head shape

Tail type

relationship

index

Step 3

Train:

Python runs .py

Step 4

Forecast:

Python predicts .py

cd example/re/standard

wget 120.27.214.45/Data/re/standard/data.tar.gz

tar -xzvf data.tar.gz

python run.py

python predict.py

remark

  • When using Anaconda, it is recommended to add a domestic image for faster downloads.
  • When using pip, we recommend that you use domestic images, such as Alibaba Cloud images, for faster downloads.
  • After installation, the ModuleNotFoundError: No module named ‘past’ message is displayed, and the pip install future command is used to solve the problem.
  • When using a language pretrained model, it is slow to install and download the model online, so it is recommended to download it in advance and store it in the pretrained folder. For specific file storage requirements, see the README.md in the folder.
  • The old version of DeepKE is located in the deepke-v1.0 branch, and users can switch branches to use the old version, and all the capabilities of the old version have been migrated to the standard setting relationship extraction (example/re/standard).
资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free source code DeepKE is a knowledge extraction toolkit that supports low-resource and document-level scenarios https://ictcoder.com/kyym/deepke-is-a-knowledge-extraction-toolkit-that-supports-low-resource-and-document-level-scenarios.html

Share free open-source source code

Q&A
  • 1, automatic: after taking the photo, click the (download) link to download; 2. Manual: After taking the photo, contact the seller to issue it or contact the official to find the developer to ship.
View details
  • 1, the default transaction cycle of the source code: manual delivery of goods for 1-3 days, and the user payment amount will enter the platform guarantee until the completion of the transaction or 3-7 days can be issued, in case of disputes indefinitely extend the collection amount until the dispute is resolved or refunded!
View details
  • 1. Heptalon will permanently archive the process of trading between the two parties and the snapshots of the traded goods to ensure that the transaction is true, effective and safe! 2, Seven PAWS can not guarantee such as "permanent package update", "permanent technical support" and other similar transactions after the merchant commitment, please identify the buyer; 3, in the source code at the same time there is a website demonstration and picture demonstration, and the site is inconsistent with the diagram, the default according to the diagram as the dispute evaluation basis (except for special statements or agreement); 4, in the absence of "no legitimate basis for refund", the commodity written "once sold, no support for refund" and other similar statements, shall be deemed invalid; 5, before the shooting, the transaction content agreed by the two parties on QQ can also be the basis for dispute judgment (agreement and description of the conflict, the agreement shall prevail); 6, because the chat record can be used as the basis for dispute judgment, so when the two sides contact, only communicate with the other party on the QQ and mobile phone number left on the systemhere, in case the other party does not recognize self-commitment. 7, although the probability of disputes is very small, but be sure to retain such important information as chat records, mobile phone messages, etc., in case of disputes, it is convenient for seven PAWS to intervene in rapid processing.
View details
  • 1. As a third-party intermediary platform, Qichou protects the security of the transaction and the rights and interests of both buyers and sellers according to the transaction contract (commodity description, content agreed before the transaction); 2, non-platform online trading projects, any consequences have nothing to do with mutual site; No matter the seller for any reason to require offline transactions, please contact the management report.
View details

Related Article

make a comment
No comments available at the moment
Official customer service team

To solve your worries - 24 hours online professional service