forked from hellohaptik/multi-task-NLP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c07346
commit ebefeaf
Showing
9 changed files
with
242 additions
and
14 deletions.
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,97 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"!wget https://msmarco.blob.core.windows.net/msmarco/train_v2.1.json.gz -P msmarco_qna_data\n", | ||
"!wget https://msmarco.blob.core.windows.net/msmarco/dev_v2.1.json.gz -P msmarco_qna_data\n", | ||
"!wget https://msmarco.blob.core.windows.net/msmarco/eval_v2.1_public.json.gz -P msmarco_qna_data" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"!gunzip msmarco_qna_data/train_v2.1.json.gz\n", | ||
"!gunzip msmarco_qna_data/dev_v2.1.json.gz\n", | ||
"!gunzip msmarco_qna_data/eval_v2.1_public.json.gz" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"!python ../../data_transformations.py \\\n", | ||
" --transform_file 'transform_file_querytype.yml'" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"!python ../../data_preparation.py \\\n", | ||
" --task_file 'tasks_file_querytype.yml' \\\n", | ||
" --data_dir '../../data' \\\n", | ||
" --max_seq_len 60" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"!python ../../train.py \\\n", | ||
" --data_dir '../../data/bert-base-uncased_prepared_data' \\\n", | ||
" --task_file 'tasks_file_querytype.yml' \\\n", | ||
" --out_dir 'msmarco_querytype_bert_base' \\\n", | ||
" --epochs 3 \\\n", | ||
" --train_batch_size 64 \\\n", | ||
" --eval_batch_size 64 \\\n", | ||
" --grad_accumulation_steps 1 \\\n", | ||
" --log_per_updates 100 \\\n", | ||
" --eval_while_train True \\\n", | ||
" --test_while_train True \\\n", | ||
" --max_seq_len 60 \\\n", | ||
" --silent True" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.7.3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
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,18 @@ | ||
querytype: | ||
model_type: BERT | ||
config_name: bert-base-uncased | ||
dropout_prob: 0.2 | ||
label_map_or_file: | ||
- DESCRIPTION | ||
- ENTITY | ||
- LOCATION | ||
- NUMERIC | ||
- PERSON | ||
metrics: | ||
- classification_accuracy | ||
loss_type: CrossEntropyLoss | ||
task_type: SingleSenClassification | ||
file_names: | ||
- querytype_train_v2.1.tsv | ||
- querytype_dev_v2.1.tsv | ||
- querytype_eval_v2.1_public.tsv |
11 changes: 11 additions & 0 deletions
11
examples/query_type_detection/transform_file_querytype.yml
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,11 @@ | ||
transform1: | ||
transform_func: msmarco_query_type_to_tsv | ||
transform_params: | ||
data_frac : 0.2 | ||
read_file_names: | ||
- train_v2.1.json | ||
- dev_v2.1.json | ||
- eval_v2.1_public.json | ||
|
||
read_dir: msmarco_qna_data | ||
save_dir: ../../data |
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