From a0115485cbd9e0ac91b6d1bcf077ce1cfb6e5066 Mon Sep 17 00:00:00 2001 From: tlk-dsg <467460833@qq.com> Date: Sun, 10 Oct 2021 20:51:09 +0800 Subject: [PATCH] test --- example/re/document/predict.py | 2 +- example/re/document/run.py | 2 +- example/re/few-shot/predict.py | 2 +- example/re/few-shot/run.py | 2 +- setup.py | 8 +++++--- src/deepke/relation_extraction/__init__.py | 2 ++ .../relation_extraction/few-shot/lit_models/__init__.py | 2 -- .../{few-shot => few_shot}/__init__.py | 0 .../{few-shot => few_shot}/dataset/__init__.py | 0 .../{few-shot => few_shot}/dataset/base_data_module.py | 0 .../{few-shot => few_shot}/dataset/dialogue.py | 0 .../{few-shot => few_shot}/dataset/processor.py | 0 .../{few-shot => few_shot}/generate_k_shot.py | 0 .../{few-shot => few_shot}/get_label_word.py | 0 .../relation_extraction/few_shot/lit_models/__init__.py | 3 +++ .../{few-shot => few_shot}/lit_models/base.py | 0 .../{few-shot => few_shot}/lit_models/transformer.py | 0 .../{few-shot => few_shot}/lit_models/util.py | 0 18 files changed, 14 insertions(+), 9 deletions(-) delete mode 100644 src/deepke/relation_extraction/few-shot/lit_models/__init__.py rename src/deepke/relation_extraction/{few-shot => few_shot}/__init__.py (100%) rename src/deepke/relation_extraction/{few-shot => few_shot}/dataset/__init__.py (100%) rename src/deepke/relation_extraction/{few-shot => few_shot}/dataset/base_data_module.py (100%) rename src/deepke/relation_extraction/{few-shot => few_shot}/dataset/dialogue.py (100%) rename src/deepke/relation_extraction/{few-shot => few_shot}/dataset/processor.py (100%) rename src/deepke/relation_extraction/{few-shot => few_shot}/generate_k_shot.py (100%) rename src/deepke/relation_extraction/{few-shot => few_shot}/get_label_word.py (100%) create mode 100644 src/deepke/relation_extraction/few_shot/lit_models/__init__.py rename src/deepke/relation_extraction/{few-shot => few_shot}/lit_models/base.py (100%) rename src/deepke/relation_extraction/{few-shot => few_shot}/lit_models/transformer.py (100%) rename src/deepke/relation_extraction/{few-shot => few_shot}/lit_models/util.py (100%) diff --git a/example/re/document/predict.py b/example/re/document/predict.py index e05b2c0..1c60d20 100644 --- a/example/re/document/predict.py +++ b/example/re/document/predict.py @@ -10,7 +10,7 @@ from torch.utils.data import DataLoader from transformers import AutoConfig, AutoModel, AutoTokenizer from transformers.optimization import AdamW, get_linear_schedule_with_warmup -from deepkeredoc import * +from deepke.relation_extraction.document import * def report(args, model, features): diff --git a/example/re/document/run.py b/example/re/document/run.py index cef660d..fc2c620 100644 --- a/example/re/document/run.py +++ b/example/re/document/run.py @@ -10,7 +10,7 @@ from torch.utils.data import DataLoader from transformers import AutoConfig, AutoModel, AutoTokenizer from transformers.optimization import AdamW, get_linear_schedule_with_warmup -from deepkeredoc import * +from deepke.relation_extraction.document import * def train(args, model, train_features, dev_features, test_features): diff --git a/example/re/few-shot/predict.py b/example/re/few-shot/predict.py index 9268f7f..f9f2427 100644 --- a/example/re/few-shot/predict.py +++ b/example/re/few-shot/predict.py @@ -13,7 +13,7 @@ from transformers.optimization import get_linear_schedule_with_warmup import os from tqdm import tqdm -from deepkerefew import * +from deepke.relation_extraction.few_shot import * os.environ["TOKENIZERS_PARALLELISM"] = "false" diff --git a/example/re/few-shot/run.py b/example/re/few-shot/run.py index 4383e51..c497db3 100644 --- a/example/re/few-shot/run.py +++ b/example/re/few-shot/run.py @@ -13,7 +13,7 @@ from transformers.optimization import get_linear_schedule_with_warmup import os from tqdm import tqdm -from deepkerefew import * +from deepke.relation_extraction.few_shot import * os.environ["TOKENIZERS_PARALLELISM"] = "false" diff --git a/setup.py b/setup.py index a534972..dacd99e 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,11 @@ from setuptools import setup, find_packages setup( name='deepke', # 打包后的包文件名 - version='0.2.79', #版本号 + version='0.2.82', #版本号 keywords=["pip", "RE","NER","AE"], # 关键字 description='DeepKE 是基于 Pytorch 的深度学习中文关系抽取处理套件。', # 说明 long_description="client", #详细说明 - license="Apache-2.0 License", # 许可 + license="MIT", # 许可 url='https://github.com/zjunlp/deepke', author='ZJUNLP', author_email='xx2020@zju.edu.cn', @@ -25,7 +25,9 @@ setup( 'pytorch-transformers==1.2.0', 'seqeval==1.2.2', 'tqdm==4.60.0', - 'nltk==3.6.3' + 'nltk==3.6.3', + 'opt-einsum==3.3.0', + "ujson" ], classifiers=[ "Programming Language :: Python :: 3", diff --git a/src/deepke/relation_extraction/__init__.py b/src/deepke/relation_extraction/__init__.py index eb66653..1218313 100644 --- a/src/deepke/relation_extraction/__init__.py +++ b/src/deepke/relation_extraction/__init__.py @@ -1 +1,3 @@ from .standard import * +from .document import * +from .few_shot import * \ No newline at end of file diff --git a/src/deepke/relation_extraction/few-shot/lit_models/__init__.py b/src/deepke/relation_extraction/few-shot/lit_models/__init__.py deleted file mode 100644 index a7b6389..0000000 --- a/src/deepke/relation_extraction/few-shot/lit_models/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .transformer import * -from .base import BaseLitModel \ No newline at end of file diff --git a/src/deepke/relation_extraction/few-shot/__init__.py b/src/deepke/relation_extraction/few_shot/__init__.py similarity index 100% rename from src/deepke/relation_extraction/few-shot/__init__.py rename to src/deepke/relation_extraction/few_shot/__init__.py diff --git a/src/deepke/relation_extraction/few-shot/dataset/__init__.py b/src/deepke/relation_extraction/few_shot/dataset/__init__.py similarity index 100% rename from src/deepke/relation_extraction/few-shot/dataset/__init__.py rename to src/deepke/relation_extraction/few_shot/dataset/__init__.py diff --git a/src/deepke/relation_extraction/few-shot/dataset/base_data_module.py b/src/deepke/relation_extraction/few_shot/dataset/base_data_module.py similarity index 100% rename from src/deepke/relation_extraction/few-shot/dataset/base_data_module.py rename to src/deepke/relation_extraction/few_shot/dataset/base_data_module.py diff --git a/src/deepke/relation_extraction/few-shot/dataset/dialogue.py b/src/deepke/relation_extraction/few_shot/dataset/dialogue.py similarity index 100% rename from src/deepke/relation_extraction/few-shot/dataset/dialogue.py rename to src/deepke/relation_extraction/few_shot/dataset/dialogue.py diff --git a/src/deepke/relation_extraction/few-shot/dataset/processor.py b/src/deepke/relation_extraction/few_shot/dataset/processor.py similarity index 100% rename from src/deepke/relation_extraction/few-shot/dataset/processor.py rename to src/deepke/relation_extraction/few_shot/dataset/processor.py diff --git a/src/deepke/relation_extraction/few-shot/generate_k_shot.py b/src/deepke/relation_extraction/few_shot/generate_k_shot.py similarity index 100% rename from src/deepke/relation_extraction/few-shot/generate_k_shot.py rename to src/deepke/relation_extraction/few_shot/generate_k_shot.py diff --git a/src/deepke/relation_extraction/few-shot/get_label_word.py b/src/deepke/relation_extraction/few_shot/get_label_word.py similarity index 100% rename from src/deepke/relation_extraction/few-shot/get_label_word.py rename to src/deepke/relation_extraction/few_shot/get_label_word.py diff --git a/src/deepke/relation_extraction/few_shot/lit_models/__init__.py b/src/deepke/relation_extraction/few_shot/lit_models/__init__.py new file mode 100644 index 0000000..0005bb7 --- /dev/null +++ b/src/deepke/relation_extraction/few_shot/lit_models/__init__.py @@ -0,0 +1,3 @@ +from .transformer import * +from .base import BaseLitModel +from .util import * \ No newline at end of file diff --git a/src/deepke/relation_extraction/few-shot/lit_models/base.py b/src/deepke/relation_extraction/few_shot/lit_models/base.py similarity index 100% rename from src/deepke/relation_extraction/few-shot/lit_models/base.py rename to src/deepke/relation_extraction/few_shot/lit_models/base.py diff --git a/src/deepke/relation_extraction/few-shot/lit_models/transformer.py b/src/deepke/relation_extraction/few_shot/lit_models/transformer.py similarity index 100% rename from src/deepke/relation_extraction/few-shot/lit_models/transformer.py rename to src/deepke/relation_extraction/few_shot/lit_models/transformer.py diff --git a/src/deepke/relation_extraction/few-shot/lit_models/util.py b/src/deepke/relation_extraction/few_shot/lit_models/util.py similarity index 100% rename from src/deepke/relation_extraction/few-shot/lit_models/util.py rename to src/deepke/relation_extraction/few_shot/lit_models/util.py