-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
property extraction annotator #202
Merged
Merged
Changes from 20 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
f38010e
property extraction
dmitrijeuseew edcd39d
fixes
dmitrijeuseew ce37842
fixes
dmitrijeuseew 766d852
Merge remote-tracking branch 'origin/dev' into feat/property_extraction
dilyararimovna 26eee51
fixes
dmitrijeuseew 44ddf46
add finegrained_types to property extraction
dmitrijeuseew 17c7534
update
dmitrijeuseew db192c9
fixes
dmitrijeuseew 5c0e407
fixes
dmitrijeuseew f6cbead
fix plural nouns
dmitrijeuseew e389411
add triplets
dmitrijeuseew 436a075
add to yml files
dmitrijeuseew a4906aa
fix tests
dmitrijeuseew 9648507
entity linking input from property extraction
dmitrijeuseew e1f03ae
Merge branch 'dev' into feat/property_extraction
dmitrijeuseew 55e3c73
fixes
dmitrijeuseew 6df8689
change gpu number
dmitrijeuseew b235720
model on cpu
dmitrijeuseew 16f7f6d
add entity linking to proxy.yml
dmitrijeuseew ef744a2
fix tests
dmitrijeuseew ce11678
fix dp version and property extraction to cpu
dmitrijeuseew 1bbc1e9
remove env variables
dmitrijeuseew 6f36573
annotatate bot utterances
dmitrijeuseew c604088
add timeout
dmitrijeuseew 9c98d35
add property extraction to readme
dmitrijeuseew 9b559f6
Merge remote-tracking branch 'origin/dev' into feat/property_extraction
dmitrijeuseew c778559
update
dmitrijeuseew 8b7b92f
codestyle
dmitrijeuseew da6efd2
fix state formatter
dmitrijeuseew e590473
Merge remote-tracking branch 'origin/dev' into feat/property_extraction
dmitrijeuseew 02c4dd2
update requirements
dmitrijeuseew d697c5d
fix requirements
dmitrijeuseew def0c71
fix requirements
dmitrijeuseew 401df87
update el requirements
dmitrijeuseew be2711c
Merge branch 'dev' into feat/property_extraction
dilyararimovna 6a85675
fix: revert entity detection
dilyararimovna 0e3e533
Merge branch 'dev' into feat/property_extraction
dilyararimovna bf5ee59
Merge branch 'dev' into feat/property_extraction
dilyararimovna b3caa34
sentence rewrite
dmitrijeuseew 54d61a0
update
dmitrijeuseew b72d641
Merge branch 'dev' into feat/property_extraction
dmitrijeuseew dbc1604
fix typo
dmitrijeuseew 05fe4af
fix requirements
dmitrijeuseew 617e719
Merge branch 'dev' into feat/property_extraction
dmitrijeuseew 896b153
fix typo
dmitrijeuseew 01c0222
change port
dmitrijeuseew 7e8e68e
update el
dmitrijeuseew f58f7ea
fix tests
dmitrijeuseew 8c8fa95
Merge branch 'dev' into feat/property_extraction
dilyararimovna 1db56ba
fix: readme and paths
dilyararimovna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM deeppavlov/base-gpu | ||
|
||
RUN apt-get update && apt-get install git -y | ||
|
||
ARG CONFIG | ||
ARG PORT | ||
ARG SRC_DIR | ||
ARG SED_ARG=" | " | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. неиспользуемые |
||
|
||
ENV CONFIG=$CONFIG | ||
ENV PORT=$PORT | ||
|
||
COPY ./annotators/property_extraction/requirements.txt /src/requirements.txt | ||
RUN pip install -r /src/requirements.txt | ||
|
||
COPY $SRC_DIR /src | ||
|
||
WORKDIR /src | ||
|
||
CMD gunicorn --workers=1 --timeout 500 server:app -b 0.0.0.0:8129 |
100 changes: 100 additions & 0 deletions
100
annotators/property_extraction/property_classification_distilbert.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
{ | ||
"dataset_reader": { | ||
"class_name": "sq_reader", | ||
"data_path": "{DOWNLOADS_PATH}/dialogue_nli/dialogue_nli_cls.json" | ||
}, | ||
"dataset_iterator": { | ||
"class_name": "basic_classification_iterator", | ||
"seed": 42 | ||
}, | ||
"chainer": { | ||
"in": ["x"], | ||
"in_y": ["y"], | ||
"pipe": [ | ||
{ | ||
"class_name": "torch_transformers_preprocessor", | ||
"vocab_file": "{TRANSFORMER}", | ||
"do_lower_case": false, | ||
"max_seq_length": 64, | ||
"in": ["x"], | ||
"out": ["bert_features"] | ||
}, | ||
{ | ||
"id": "classes_vocab", | ||
"class_name": "simple_vocab", | ||
"fit_on": ["y"], | ||
"save_path": "{MODEL_PATH}/classes.dict", | ||
"load_path": "{MODEL_PATH}/classes.dict", | ||
"in": ["y"], | ||
"out": ["y_ids"] | ||
}, | ||
{ | ||
"in": ["y_ids"], | ||
"out": ["y_onehot"], | ||
"class_name": "one_hotter", | ||
"depth": "#classes_vocab.len", | ||
"single_vector": true | ||
}, | ||
{ | ||
"class_name": "torch_transformers_classifier", | ||
"n_classes": "#classes_vocab.len", | ||
"return_probas": true, | ||
"pretrained_bert": "{TRANSFORMER}", | ||
"save_path": "{MODEL_PATH}/model", | ||
"load_path": "{MODEL_PATH}/model", | ||
"optimizer": "AdamW", | ||
"optimizer_parameters": {"lr": 1e-05}, | ||
"learning_rate_drop_patience": 5, | ||
"learning_rate_drop_div": 2.0, | ||
"in": ["bert_features"], | ||
"in_y": ["y_ids"], | ||
"out": ["y_pred_probas"] | ||
}, | ||
{ | ||
"in": ["y_pred_probas"], | ||
"out": ["y_pred_ids"], | ||
"class_name": "proba2labels", | ||
"max_proba": true | ||
}, | ||
{ | ||
"in": ["y_pred_ids"], | ||
"out": ["y_pred_labels"], | ||
"ref": "classes_vocab" | ||
} | ||
], | ||
"out": ["y_pred_labels"] | ||
}, | ||
"train": { | ||
"epochs": 100, | ||
"batch_size": 64, | ||
"metrics": [ | ||
"f1_macro", | ||
"accuracy" | ||
], | ||
"validation_patience": 10, | ||
"val_every_n_batches": 100, | ||
"log_every_n_batches": 100, | ||
"show_examples": false, | ||
"evaluation_targets": ["valid", "test"], | ||
"class_name": "torch_trainer" | ||
}, | ||
"metadata": { | ||
"variables": { | ||
"TRANSFORMER": "distilbert-base-uncased", | ||
"ROOT_PATH": "~/.deeppavlov", | ||
"DOWNLOADS_PATH": "{ROOT_PATH}/downloads", | ||
"MODELS_PATH": "{ROOT_PATH}/models", | ||
"MODEL_PATH": "{MODELS_PATH}/classifiers/property_classification" | ||
}, | ||
"download": [ | ||
{ | ||
"url": "http://files.deeppavlov.ai/deeppavlov_data/generative_ie/property_classification.tar.gz", | ||
"subdir": "{MODEL_PATH}" | ||
}, | ||
{ | ||
"url": "http://files.deeppavlov.ai/deeppavlov_data/generative_ie/dialogue_nli_cls.tar.gz", | ||
"subdir": "{DOWNLOADS_PATH}/dialogue_nli" | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а версию зафиксировать?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зафиксировал