-
Notifications
You must be signed in to change notification settings - Fork 6
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
8e8d613
commit 9b3be83
Showing
31 changed files
with
1,145 additions
and
253 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
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 |
---|---|---|
@@ -1,13 +1,17 @@ | ||
#!/bin/bash | ||
|
||
EXP_NAME='baseline' | ||
EXP_NAME='dssm_loss' | ||
DATA_DIR=${PWD}/data | ||
TRAIN_FILENAME=$DATA_DIR/only_TA_sample8.jsonl | ||
TRAIN_FILENAME=$DATA_DIR/only_TA_sample10_aggregate.jsonl | ||
TEST_FILENAME=$DATA_DIR/test_vectorization.jsonl | ||
DEST_DIR=$DATA_DIR/vectorization/${EXP_NAME} | ||
DEST_DIR=$DATA_DIR/vectorization/${EXP_NAME}/ | ||
|
||
PLM_MODEL_NAME='scibert-scivocab-uncased' | ||
|
||
export CUDA_VISIBLE_DEVICES=0 | ||
|
||
python3 wsdm_digg/vectorization/trainer.py -train_filename $TRAIN_FILENAME \ | ||
-test_filename $TEST_FILENAME -exp_name $EXP_NAME -dest_base_dir $DEST_DIR \ | ||
-mode train -plm_model_name $PLM_MODEL_NAME -embed_mode USE | ||
-mode train -plm_model_name $PLM_MODEL_NAME -embed_mode USE -batch_size 1 \ | ||
-scheduler_lr -gradient_accumulate_step 8 -query_field 'description_text' \ | ||
-learning_rate 1e-5 |
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 |
---|---|---|
@@ -1 +1,23 @@ | ||
# -*- coding: UTF-8 -*- | ||
from munch import Munch | ||
from wsdm_digg.constants import * | ||
from wsdm_digg.reranking.dataloader import RerankDataLoader | ||
|
||
|
||
def test_data_loader(): | ||
args = Munch({ | ||
'batch_size': 4, | ||
'max_len': 512 | ||
}) | ||
mode_name = 'bert-base-uncased' | ||
tokenizer = MODEL_DICT[mode_name]['tokenizer_class'].from_pretrained(mode_name) | ||
loader = RerankDataLoader(DATA_DIR + 'baseline_rerank.jsonl', | ||
tokenizer, | ||
args, 'eval') | ||
step = 0 | ||
for _ in range(10): | ||
for batch in loader: | ||
if step == 0: | ||
print(batch) | ||
print(step) | ||
step += 1 |
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
Oops, something went wrong.