A Deep Learning Based Knowledge Extraction Toolkit for Knowledge Base Population

Overview

Documentation PyPI GitHub Documentation Open In Colab

English | 简体中文

A Deep Learning Based Knowledge Extraction Toolkit
for Knowledge Base Population

DeepKE is a knowledge extraction toolkit supporting low-resource and document-level scenarios for entity, relation and attribute extraction. We provide comprehensive documents, Google Colab tutorials, and online demo for beginners.


Table of Contents


What's New

Jan, 2022

Dec, 2021

  • We have added dockerfile to create the enviroment automatically.

Nov, 2021

  • The demo of DeepKE, supporting real-time extration without deploying and training, has been released.
  • The documentation of DeepKE, containing the details of DeepKE such as source codes and datasets, has been released.

Oct, 2021

  • pip install deepke
  • The codes of deepke-v2.0 have been released.

August, 2020

  • The codes of deepke-v1.0 have been released.

Prediction Demo

There is a demonstration of prediction.


Model Framework

  • DeepKE contains a unified framework for named entity recognition, relation extraction and attribute extraction, the three knowledge extraction functions.
  • Each task can be implemented in different scenarios. For example, we can achieve relation extraction in standard, low-resource (few-shot) and document-level settings.
  • Each application scenario comprises of three components: Data including Tokenizer, Preprocessor and Loader, Model including Module, Encoder and Forwarder, Core including Training, Evaluation and Prediction.

Quick Start

DeepKE supports pip install deepke.
Take the fully supervised relation extraction for example.

Step1 Download the basic code

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

Step2 Create a virtual environment using Anaconda and enter it.

We also provide dockerfile source code, which is located in the docker folder, to help users create their own mirrors.

conda create -n deepke python=3.8

conda activate deepke
  1. Install DeepKE with source code

    python setup.py install
    
    python setup.py develop
  2. Install DeepKE with pip

    pip install deepke

Step3 Enter the task directory

cd DeepKE/example/re/standard

Step4 Download the dataset

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

tar -xzvf data.tar.gz

Step5 Training (Parameters for training can be changed in the conf folder)

We support visual parameter tuning by using wandb.

python run.py

Step6 Prediction (Parameters for prediction can be changed in the conf folder)

Modify the path of the trained model in predict.yaml.

python predict.py

Requirements

python == 3.8

  • torch == 1.5
  • hydra-core == 1.0.6
  • tensorboard == 2.4.1
  • matplotlib == 3.4.1
  • transformers == 3.4.0
  • jieba == 0.42.1
  • scikit-learn == 0.24.1
  • pytorch-transformers == 1.2.0
  • seqeval == 1.2.2
  • tqdm == 4.60.0
  • opt-einsum==3.3.0
  • wandb==0.12.7
  • ujson

Introduction of Three Functions

1. Named Entity Recognition

  • Named entity recognition seeks to locate and classify named entities mentioned in unstructured text into pre-defined categories such as person names, organizations, locations, organizations, etc.

  • The data is stored in .txt files. Some instances as following:

    Sentence Person Location Organization
    本报北京9月4日讯记者杨涌报道:部分省区人民日报宣传发行工作座谈会9月3日在4日在京举行。 杨涌 北京 人民日报
    《红楼梦》是中央电视台和中国电视剧制作中心根据中国古典文学名著《红楼梦》摄制于1987年的一部古装连续剧,由王扶林导演,周汝昌、王蒙、周岭等多位红学家参与制作。 王扶林,周汝昌,王蒙,周岭 中国 中央电视台,中国电视剧制作中心
    秦始皇兵马俑位于陕西省西安市,1961年被国务院公布为第一批全国重点文物保护单位,是世界八大奇迹之一。 秦始皇 陕西省,西安市 国务院
  • Read the detailed process in specific README

    • STANDARD (Fully Supervised)

      Step1 Enter DeepKE/example/ner/standard. Download the dataset.

      wget 120.27.214.45/Data/ner/standard/data.tar.gz
      
      tar -xzvf data.tar.gz

      Step2 Training

      The dataset and parameters can be customized in the data folder and conf folder respectively.

      python run.py

      Step3 Prediction

      python predict.py
    • FEW-SHOT

      Step1 Enter DeepKE/example/ner/few-shot. Download the dataset.

      wget 120.27.214.45/Data/ner/few_shot/data.tar.gz
      
      tar -xzvf data.tar.gz

      Step2 Training in the low-resouce setting

      The directory where the model is loaded and saved and the configuration parameters can be cusomized in the conf folder.

      python run.py +train=few_shot

      Users can modify load_path in conf/train/few_shot.yaml to use existing loaded model.

      Step3 Add - predict to conf/config.yaml, modify loda_path as the model path and write_path as the path where the predicted results are saved in conf/predict.yaml, and then run python predict.py

      python predict.py

2. Relation Extraction

  • Relationship extraction is the task of extracting semantic relations between entities from a unstructured text.

  • The data is stored in .csv files. Some instances as following:

    Sentence Relation Head Head_offset Tail Tail_offset
    《岳父也是爹》是王军执导的电视剧,由马恩然、范明主演。 导演 岳父也是爹 1 王军 8
    《九玄珠》是在纵横中文网连载的一部小说,作者是龙马。 连载网站 九玄珠 1 纵横中文网 7
    提起杭州的美景,西湖总是第一个映入脑海的词语。 所在城市 西湖 8 杭州 2
  • Read the detailed process in specific README

    • STANDARD (Fully Supervised)

      Step1 Enter the DeepKE/example/re/standard folder. Download the dataset.

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

      Step2 Training

      The dataset and parameters can be customized in the data folder and conf folder respectively.

      python run.py

      Step3 Prediction

      python predict.py
    • FEW-SHOT

      Step1 Enter DeepKE/example/re/few-shot. Download the dataset.

      wget 120.27.214.45/Data/re/few_shot/data.tar.gz
      
      tar -xzvf data.tar.gz

      Step 2 Training

      • The dataset and parameters can be customized in the data folder and conf folder respectively.
      • Start with the model trained last time: modify train_from_saved_model in conf/train.yamlas the path where the model trained last time was saved. And the path saving logs generated in training can be customized by log_dir.
      python run.py

      Step3 Prediction

      python predict.py
    • DOCUMENT

      Step1 Enter DeepKE/example/re/document. Download the dataset.

      wget 120.27.214.45/Data/re/document/data.tar.gz
      
      tar -xzvf data.tar.gz

      Step2 Training

      • The dataset and parameters can be customized in the data folder and conf folder respectively.
      • Start with the model trained last time: modify train_from_saved_model in conf/train.yamlas the path where the model trained last time was saved. And the path saving logs generated in training can be customized by log_dir.
      python run.py

      Step3 Prediction

      python predict.py

3. Attribute Extraction

  • Attribute extraction is to extract attributes for entities in a unstructed text.

  • The data is stored in .csv files. Some instances as following:

    Sentence Att Ent Ent_offset Val Val_offset
    张冬梅,女,汉族,1968年2月生,河南淇县人 民族 张冬梅 0 汉族 6
    诸葛亮,字孔明,三国时期杰出的军事家、文学家、发明家。 朝代 诸葛亮 0 三国时期 8
    2014年10月1日许鞍华执导的电影《黄金时代》上映 上映时间 黄金时代 19 2014年10月1日 0
  • Read the detailed process in specific README

    • STANDARD (Fully Supervised)

      Step1 Enter the DeepKE/example/ae/standard folder. Download the dataset.

      wget 120.27.214.45/Data/ae/standard/data.tar.gz
      
      tar -xzvf data.tar.gz

      Step2 Training

      The dataset and parameters can be customized in the data folder and conf folder respectively.

      python run.py

      Step3 Prediction

      python predict.py

Notebook Tutorial

This toolkit provides many Jupyter Notebook and Google Colab tutorials. Users can study DeepKE with them.


Tips

  1. Using nearest mirror, like THU in China, will speed up the installation of Anaconda.
  2. Using nearest mirror, like aliyun in China, will speed up pip install XXX.
  3. When encountering ModuleNotFoundError: No module named 'past',run pip install future .
  4. It's slow to install the pretrained language models online. Recommend download pretrained models before use and save them in the pretrained folder. Read README.md in every task directory to check the specific requirement for saving pretrained models.
  5. The old version of DeepKE is in the deepke-v1.0 branch. Users can change the branch to use the old version. The old version has been totally transfered to the standard relation extraction (example/re/standard).
  6. It's recommended to install DeepKE with source codes. Because user may meet some problems in Windows system with 'pip'.

To do

In next version, we plan to add multi-modality knowledge extraction to the toolkit.

Meanwhile, we will offer long-term maintenance to fix bugs, solve issues and meet new requests. So if you have any problems, please put issues to us.


Citation

Please cite our paper if you use DeepKE in your work

@article{Zhang_DeepKE_A_Deep_2022,
author = {Zhang, Ningyu and Xu, Xin and Tao, Liankuan and Yu, Haiyang and Ye, Hongbin and Xie, Xin and Chen, Xiang and Li, Zhoubo and Li, Lei and Liang, Xiaozhuan and Yao, Yunzhi and Deng, Shumin and Zhang, Zhenru and Tan, Chuanqi and Huang, Fei and Zheng, Guozhou and Chen, Huajun},
journal = {http://arxiv.org/abs/2201.03335},
title = {{DeepKE: A Deep Learning Based Knowledge Extraction Toolkit for Knowledge Base Population}},
year = {2022}
}

Developers

Zhejiang University: Ningyu Zhang, Liankuan Tao, Haiyang Yu, Xiang Chen, Xin Xu, Xi Tian, Lei Li, Zhoubo Li, Shumin Deng, Yunzhi Yao, Hongbin Ye, Xin Xie, Guozhou Zheng, Huajun Chen

DAMO Academy: Zhenru Zhang, Chuanqi Tan, Fei Huang

Comments
  • NER 任务中出现KeyError报错

    NER 任务中出现KeyError报错

    Describe the question

    A clear and concise description of what the question is. NER 任务中,换成自己的标注数据集进行训练时会出现KeyError报错:KeyError: 'B-Disease'。 我已经在get_labels函数中添加了训练集中的标注标签,还是未能解决此问题,希望大佬给予帮助。

    Environment (please complete the following information):

    • OS: [e.g. mac / window]
    • Python Version [e.g. 3.6] Linux python 3.8

    Screenshots

    If applicable, add screenshots to help explain your problem. image

    Additional context

    Add any other context about the problem here.

    question 
    opened by ZZQ908268856 18
  • 运行/data/qinglong/knowledgeGraph/DeepKE/example/ner/standard中的run_bert.py对英文数据集conll2003进行实体识别出现错误

    运行/data/qinglong/knowledgeGraph/DeepKE/example/ner/standard中的run_bert.py对英文数据集conll2003进行实体识别出现错误

    报错信息如下 Traceback (most recent call last): File "/data/qinglong/knowledgeGraph/DeepKE/example/ner/standard/run_bert.py", line 135, in main train_features = convert_examples_to_features(train_examples, label_list, cfg.max_seq_length, tokenizer) File "/home/qinglong/.conda/envs/deepke/lib/python3.8/site-packages/deepke/name_entity_re/standard/tools/preprocess.py", line 92, in convert_examples_to_features label_ids.append(label_map[labels[i]]) KeyError: 'EU\tB-ORG' 经debug发现examples中的每一个样本数据中的 text_a = 'EU B-ORG rejects O German B-MISC call O to O boycott O British B-MISC lamb O . O ' labellist = ['EU\tB-ORG', 'rejects\tO', 'German\tB-MISC', 'call\tO', 'to\tO', 'boycott\tO', 'British\tB-MISC', 'lamb\tO', '.\tO'] textlist = ['EU\tB-ORG\n', 'rejects\tO\n', 'German\tB-MISC\n', 'call\tO\n', 'to\tO\n', 'boycott\tO\n', 'British\tB-MISC\n', 'lamb\tO\n', '.\tO\n'] 而中文数据集中的 examples 中的 text_a ='海 钓 比 赛 地 点 在 厦 门 与 金 门 之 间 的 海 域 。'

    bug 
    opened by qinglongheu 16
  • Cnschema自带的关系抽取模型报错

    Cnschema自带的关系抽取模型报错

    Traceback (most recent call last): File "D:/MyProject/python/DeepKE-main/example/re/standard/predict.py", line 120, in main model.load(cfg.fp, device=device) File "D:\MyProject\python\DeepKE-main\src\deepke\relation_extraction\standard\models\BasicModule.py", line 19, in load self.load_state_dict(torch.load(path, map_location=device)) File "F:\Anaconda3\envs\DeepKE-main\lib\site-packages\torch\nn\modules\module.py", line 1482, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(RuntimeError: Error(s) in loading state_dict for PCNN: Missing key(s) in state_dict: "embedding.wordEmbed.weight", "embedding.entityPosEmbed.weight", "embedding.attribute_keyPosEmbed.weight", "embedding.layer_norm.weight", "embedding.layer_norm.bias", "cnn.convs.0.weight", "cnn.convs.1.weight", "cnn.convs.2.weight", "cnn.activations.prelu.weight", "fc1.weight", "fc1.bias", "fc2.weight", "fc2.bias". Unexpected key(s) in state_dict: "bert.embeddings.position_ids", "bert.embeddings.word_embeddings.weight", "bert.embeddings.position_embeddings.weight", "bert.embeddings.token_type_embeddings.weight", "bert.embeddings.LayerNorm.weight", "bert.embeddings.LayerNorm.bias", "bert.encoder.layer.0.attention.self.query.weight", "bert.encoder.layer.0.attention.self.query.bias", "bert.encoder.layer.0.attention.self.key.weight", "bert.encoder.layer.0.attention.self.key.bias", "bert.encoder.layer.0.attention.self.value.weight", "bert.encoder.layer.0.attention.self.value.bias", "bert.encoder.layer.0.attention.output.dense.weight", "bert.encoder.layer.0.attention.output.dense.bias", "bert.encoder.layer.0.attention.output.LayerNorm.weight", "bert.encoder.layer.0.attention.output.LayerNorm.bias", "bert.encoder.layer.0.intermediate.dense.weight", "bert.encoder.layer.0.intermediate.dense.bias", "bert.encoder.layer.0.output.dense.weight", "bert.encoder.layer.0.output.dense.bias", "bert.encoder.layer.0.output.LayerNorm.weight", "bert.encoder.layer.0.output.LayerNorm.bias", "bert.pooler.dense.weight", "bert.pooler.dense.bias", "bilstm.rnn.weight_ih_l0", "bilstm.rnn.weight_hh_l0", "bilstm.rnn.bias_ih_l0", "bilstm.rnn.bias_hh_l0", "bilstm.rnn.weight_ih_l0_reverse", "bilstm.rnn.weight_hh_l0_reverse", "bilstm.rnn.bias_ih_l0_reverse", "bilstm.rnn.bias_hh_l0_reverse", "fc.weight", "fc.bias". Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.进程已结束,退出代码1

    bug 
    opened by HojaMuerta 14
  • windows10  python由3.8降级到3.6

    windows10 python由3.8降级到3.6

    Describe the bug

    A clear and concise description of what the bug is.

    各种bug,我刚开始创建了一个虚拟环境deepke,然后pip install deepke ,但是各种报错,我想问一下是不是windows下不行吖?有没有windows下的详细安装教程提供一下

    Environment (please complete the following information):

    • OS: [e.g. mac / window]
    • Python Version [e.g. 3.6]

    windows python3.6

    Screenshots

    If applicable, add screenshots to help explain your problem.

    Additional context

    Add any other context about the problem here.

    bug 
    opened by liuxiaobei727 12
  • 运行/data/qinglong/knowledgeGraph/DeepKE/example/ner/standard中的run_bert.py对英文数据集conll2003进行实体识别出现错误

    运行/data/qinglong/knowledgeGraph/DeepKE/example/ner/standard中的run_bert.py对英文数据集conll2003进行实体识别出现错误

    /home/qinglong/.conda/envs/deepke/lib/python3.8/site-packages/seqeval/metrics/sequence_labeling.py:171: UserWarning: [CLS] seems not to be NE tag. warnings.warn('{} seems not to be NE tag.'.format(chunk)) Traceback (most recent call last): File "/data/qinglong/knowledgegraph/DeepKE/example/ner/standard/run_bert.py", line 250, in main report = classification_report(y_true, y_pred,digits=4) File "/home/qinglong/.conda/envs/deepke/lib/python3.8/site-packages/seqeval/metrics/sequence_labeling.py", line 680, in classification_report target_names_pred = {type_name for type_name, _, _ in get_entities(y_pred, suffix)} File "/home/qinglong/.conda/envs/deepke/lib/python3.8/site-packages/seqeval/metrics/sequence_labeling.py", line 182, in get_entities _validate_chunk(chunk, suffix) File "/home/qinglong/.conda/envs/deepke/lib/python3.8/site-packages/seqeval/metrics/sequence_labeling.py", line 170, in _validate_chunk if not chunk.startswith(('B-', 'I-', 'E-', 'S-')): AttributeError: 'int' object has no attribute 'startswith' 经debug发现y_pred出现了标签中没有的标签0 y_pred =[['I-MISC', 'I-PER', 'I-MISC', 'B-MISC', 'I-LOC', 'I-ORG', '[CLS]', 'I-LOC', 'I-LOC', 'B-ORG', 'I-MISC', 'I-LOC', 'B-ORG', 0, 'I-MISC', 'I-ORG', 'B-ORG', 'I-MISC', 'B-MISC', 'I-MISC', 'I-MISC', 'I-MISC', 'I-MISC', 'I-LOC', '[CLS]', 'I-MISC', 'B-MISC', 'I-MISC', 'B-MISC', 'I-ORG', 'I-MISC', 'I-LOC', 'I-ORG', 'I-ORG', 'I-LOC', '[CLS]', 'I-MISC', '[CLS]', 'I-LOC', 'I-LOC', 'I-LOC', 'I-LOC', 'I-LOC', '[SEP]', '[SEP]', '[SEP]', '[SEP]', 'O', '[SEP]', '[CLS]', '[SEP]', '[CLS]', 'I-ORG', 'I-LOC', 'O', 'O', 'I-ORG', 'I-ORG', 'I-MISC', '[CLS]', '[CLS]', 'I-MISC', 'I-ORG', 'I-MISC', 'I-ORG', 'I-MISC', 'B-MISC', 'I-LOC', 'I-LOC', '[SEP]', '[SEP]', 'I-ORG', 'B-LOC', '[CLS]', '[CLS]', 'B-MISC', '[CLS]', '[SEP]', 'I-MISC', 'I-MISC', 'O', 'I-ORG', 'I-ORG', 'I-MISC', 'O', '[CLS]', 'I-ORG', 'I-MISC', 'I-ORG', 'I-ORG', 'I-ORG', 'I-ORG', 'I-ORG', 'B-ORG', 'B-ORG', 'I-ORG', 'I-ORG', 'I-ORG', 'I-ORG', 'I-MISC', 'I-ORG', 'I-MISC', '[CLS]', '[SEP]', '[CLS]', 'I-ORG', 'I-ORG', '[CLS]', 'I-ORG', 'I-ORG', 'I-ORG', 'I-ORG', 'I-ORG', '[CLS]', 'I-MISC', 'O', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]] 这个0是把‘o’认错了吗

    bug 
    opened by qinglongheu 10
  • ner-multimodal 模型无法训练

    ner-multimodal 模型无法训练

    Describe the question

    A clear and concise description of what the question is. 训练时一直出现这样的错误: OSError: Can't load config for 'openai/clip-vit-base-patch32'. Make sure that:

    • 'openai/clip-vit-base-patch32' is a correct model identifier listed on 'https://huggingface.co/models'

    • or 'openai/clip-vit-base-patch32' is the correct path to a directory containing a config.json file

    Environment (please complete the following information):

    • OS: [e.g. mac / window]
    • Python Version [e.g. 3.6]

    Screenshots

    If applicable, add screenshots to help explain your problem.

    Additional context

    Add any other context about the problem here.

    question 
    opened by 3525355094 10
  • BERT在大规模数据集上运行报错

    BERT在大规模数据集上运行报错

    你好,我重构了百度的数据集,重构后大概又30多w条。其中某些数据在其他模型预处理的时候会报错,但舍弃这些数据后最终跑通了,但是BERT模型遇到了如下问题,看上去应该是维度不太匹配,想请教一下问题可能会出在哪里,谢谢 >, TensorInfo<T, IndexType>, TensorInfo<long, IndexType>, int, int, IndexType, IndexType, long) [with T = float, IndexType = unsigned int, DstDim = 2, SrcDim = 2, IdxDim = -2, IndexIsMajor = true]: block: [195,0,0], thread: [31,0,0] AssertionsrcIndex < srcSelectDimSize failed. Traceback (most recent call last): File "main.py", line 82, in <module> macro_f1, micro_f1 = validate(test_dataloader, model, device, config) File "/home/***/deepke/deepke/trainer.py", line 53, in validate x = [i.to(device) for i in x] File "/home/***/deepke/deepke/trainer.py", line 53, in <listcomp> x = [i.to(device) for i in x] RuntimeError: CUDA error: device-side assert triggered

    question 
    opened by zhang-yunke 10
  • 在re中使用lm模型报错The size of tensor a (48) must match the size of tensor b (512) at non-singleton dimension 3

    在re中使用lm模型报错The size of tensor a (48) must match the size of tensor b (512) at non-singleton dimension 3

    Traceback (most recent call last): File "predict.py", line 141, in main y_pred = model(x) File "/home/WYF/.conda/envs/deepke/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/home/WYF/.conda/envs/deepke/lib/python3.8/site-packages/deepke/relation_extraction/standard/models/LM.py", line 22, in forward a = self.bert(word, attention_mask=mask) File "/home/WYF/.conda/envs/deepke/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/home/WYF/.conda/envs/deepke/lib/python3.8/site-packages/transformers/modeling_bert.py", line 833, in forward encoder_outputs = self.encoder( File "/home/WYF/.conda/envs/deepke/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/home/WYF/.conda/envs/deepke/lib/python3.8/site-packages/transformers/modeling_bert.py", line 476, in forward layer_outputs = layer_module( File "/home/WYF/.conda/envs/deepke/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/home/WYF/.conda/envs/deepke/lib/python3.8/site-packages/transformers/modeling_bert.py", line 398, in forward self_attention_outputs = self.attention( File "/home/WYF/.conda/envs/deepke/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/home/WYF/.conda/envs/deepke/lib/python3.8/site-packages/transformers/modeling_bert.py", line 333, in forward self_outputs = self.self( File "/home/WYF/.conda/envs/deepke/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/home/WYF/.conda/envs/deepke/lib/python3.8/site-packages/transformers/modeling_bert.py", line 262, in forward attention_scores = attention_scores + attention_mask RuntimeError: The size of tensor a (48) must match the size of tensor b (512) at non-singleton dimension 3

    question 
    opened by sayakawaiiyo 9
  • NER模型预测为空

    NER模型预测为空

    Describe the question

    我标注了一些数据,但是无论怎样,执行predict后,预测的实体都是空。甚至尝试预测了train data中的一条数据,结果同样为空。 我使用是 standard NER模型。 使用的预训练模型是在配置文件中是这样的,配置在文件夹的这里:\conf\hydra\model\bert.yaml,在这个文件中配置了我本地的pre model

    我不清楚是哪里出了问题。

    Environment (please complete the following information):

    • OS: [e.g. mac / window]
    • Python Version [e.g. 3.6]

    Screenshots

    If applicable, add screenshots to help explain your problem.

    Additional context

    Add any other context about the problem here.

    question 
    opened by ume-technology 8
  • when run ner, i got error : Key 'bert_model' is not in struct

    when run ner, i got error : Key 'bert_model' is not in struct

    Traceback (most recent call last): File "run_bert.py", line 93, in main tokenizer = BertTokenizer.from_pretrained(cfg.bert_model, do_lower_case=cfg.do_lower_case) omegaconf.errors.ConfigAttributeError: Key 'bert_model' is not in struct full_key: bert_model reference_type=Optional[Dict[Union[str, Enum], Any]] object_type=dict

    enhancement 
    opened by JxuHenry 8
  • Docker 环境下缓存工具版本错误

    Docker 环境下缓存工具版本错误

    Describe the question

    A clear and concise description of what the question is.

    在Docker环境下,python setup.py install过程中失败,提示是 cachetools 5.2.0 is installed but cachetools<5.0,>=2.0.0 is required by {'google-auth'}

    Environment (please complete the following information):

    • OS: window10、Dockers20.10。17
    • Python Version : 3.8.13

    Screenshots

    If applicable, add screenshots to help explain your problem. image

    Additional context

    • 我觉得README里应该添加如何使用Docker的说明,属实是走了不少的弯路
    help wanted question dependencies 
    opened by thredreams 6
Releases(2.1.2)
Owner
ZJUNLP
NLP Group of Knowledge Engine Lab at Zhejiang University
ZJUNLP
The InterScript dataset contains interactive user feedback on scripts generated by a T5-XXL model.

Interscript The Interscript dataset contains interactive user feedback on a T5-11B model generated scripts. Dataset data.json contains the data in an

AI2 8 Dec 01, 2022
A light weight data augmentation tool for training CNNs and Viola Jones detectors

hey-daug A light weight data augmentation tool for training CNNs and Viola Jones detectors (Haar Cascades). This tool inflates your data by up to six

Jaiyam Sharma 2 Nov 23, 2019
Official implementation of "Learning Not to Reconstruct" (BMVC 2021)

Official PyTorch implementation of "Learning Not to Reconstruct Anomalies" This is the implementation of the paper "Learning Not to Reconstruct Anomal

Marcella Astrid 13 Dec 04, 2022
This project uses Template Matching technique for object detecting by detection of template image over base image.

Object Detection Project Using OpenCV This project uses Template Matching technique for object detecting by detection the template image over base ima

Pratham Bhatnagar 7 May 29, 2022
This is an official implementation for "Video Swin Transformers".

Video Swin Transformer By Ze Liu*, Jia Ning*, Yue Cao, Yixuan Wei, Zheng Zhang, Stephen Lin and Han Hu. This repo is the official implementation of "V

Swin Transformer 981 Jan 03, 2023
Teaching end to end workflow of deep learning

Deep-Education This repository is now available for public use for teaching end to end workflow of deep learning. This implies that learners/researche

Data Lab at College of William and Mary 2 Sep 26, 2022
Official code for "Stereo Waterdrop Removal with Row-wise Dilated Attention (IROS2021)"

Stereo-Waterdrop-Removal-with-Row-wise-Dilated-Attention This repository includes official codes for "Stereo Waterdrop Removal with Row-wise Dilated A

29 Oct 01, 2022
PyTorch implementation of the paper Dynamic Token Normalization Improves Vision Transfromers.

Dynamic Token Normalization Improves Vision Transformers This is the PyTorch implementation of the paper Dynamic Token Normalization Improves Vision T

Wenqi Shao 20 Oct 09, 2022
Pytorch implementation of CoCon: A Self-Supervised Approach for Controlled Text Generation

COCON_ICLR2021 This is our Pytorch implementation of COCON. CoCon: A Self-Supervised Approach for Controlled Text Generation (ICLR 2021) Alvin Chan, Y

alvinchangw 79 Dec 18, 2022
FinEAS: Financial Embedding Analysis of Sentiment 📈

FinEAS: Financial Embedding Analysis of Sentiment 📈 (SentenceBERT for Financial News Sentiment Regression) This repository contains the code for gene

LHF Labs 31 Dec 13, 2022
Transformer part of 12th place solution in Riiid! Answer Correctness Prediction

kaggle_riiid Transformer part of 12th place solution in Riiid! Answer Correctness Prediction. Please see here for more information. Execution You need

Sakami Kosuke 2 Apr 23, 2022
Experiments on Flood Segmentation on Sentinel-1 SAR Imagery with Cyclical Pseudo Labeling and Noisy Student Training

Flood Detection Challenge This repository contains code for our submission to the ETCI 2021 Competition on Flood Detection (Winning Solution #2). Acco

Siddha Ganju 108 Dec 28, 2022
PyTorch implementation of DirectCLR from paper Understanding Dimensional Collapse in Contrastive Self-supervised Learning

DirectCLR DirectCLR is a simple contrastive learning model for visual representation learning. It does not require a trainable projector as SimCLR. It

Meta Research 49 Dec 21, 2022
Semantic Segmentation in Pytorch. Network include: FCN、FCN_ResNet、SegNet、UNet、BiSeNet、BiSeNetV2、PSPNet、DeepLabv3_plus、 HRNet、DDRNet

🚀 If it helps you, click a star! ⭐ Update log 2020.12.10 Project structure adjustment, the previous code has been deleted, the adjustment will be re-

Deeachain 269 Jan 04, 2023
Binary Passage Retriever (BPR) - an efficient passage retriever for open-domain question answering

BPR Binary Passage Retriever (BPR) is an efficient neural retrieval model for open-domain question answering. BPR integrates a learning-to-hash techni

Studio Ousia 147 Dec 07, 2022
Source code for CVPR 2020 paper "Learning to Forget for Meta-Learning"

L2F - Learning to Forget for Meta-Learning Sungyong Baik, Seokil Hong, Kyoung Mu Lee Source code for CVPR 2020 paper "Learning to Forget for Meta-Lear

Sungyong Baik 29 May 22, 2022
22 Oct 14, 2022
Code for "Localization with Sampling-Argmax", NeurIPS 2021

Localization with Sampling-Argmax [Paper] [arXiv] [Project Page] Localization with Sampling-Argmax Jiefeng Li, Tong Chen, Ruiqi Shi, Yujing Lou, Yong-

JeffLi 71 Dec 17, 2022
Jittor 64*64 implementation of StyleGAN

StyleGanJittor (Tsinghua university computer graphics course) Overview Jittor 64

Song Shengyu 3 Jan 20, 2022
El-Gamal on Elliptic Curve (Python)

El-Gamal-on-EC El-Gamal on Elliptic Curve (Python) References: https://docsdrive.com/pdfs/ansinet/itj/2005/299-306.pdf https://arxiv.org/ftp/arxiv/pap

3 May 04, 2022