Skip to content

Instantly share code, notes, and snippets.

@seanie12
Created June 4, 2019 07:05
Show Gist options
  • Save seanie12/1684b13ec48095c96045881c383f0b83 to your computer and use it in GitHub Desktop.
Save seanie12/1684b13ec48095c96045881c383f0b83 to your computer and use it in GitHub Desktop.
# old files
train_src_file = "./squad/para-train.txt"
train_trg_file = "./squad/tgt-train.txt"
dev_src_file = "./squad/para-dev.txt"
dev_trg_file = "./squad/tgt-dev.txt"
test_src_file = "./squad/para-test.txt"
test_trg_file = "./squad/tgt-test.txt"
embedding = "./data/embedding.pkl"
word2idx_file = "./data/word2idx.pkl"
# files
squad_train_file = "./squad/train-v1.1.json"
squad_dev_file = "./squad/new_dev-v1.1.json"
squad_test_file = "./squad/new_test-v1.1.json"
new_squad_file = "./squad/bert-gumbel-generated_test-v1.1.json"
qa_path = "./save/siamese_qa/best/78_324.ckpt"
qg_path = "./save/bert-qg/best/8_2.39"
c2q_path = "./save/c2q/qg_no_ans/16_3.0"
c2a_path = "./save/c2a/gumbel/1_3.4"
# model_path = "./save/dual/train_506144932/1_2.890"
model_path = "./save/dual/train_604105405/1000_2.39"
train = False
device = "cuda"
use_gpu = True
debug = False
reduce_size = False
augment = False
ratio = 1.0
vocab_size = 30522
num_epochs = 20
max_length = 400
max_seq_len = 384
max_query_len = 64
num_layers = 2
hidden_size = 300
embedding_size = 768
# bert config
bert_model = "bert-base-uncased"
bert_layers = [-1]
freeze_bert = False
# QA config
qa_lr = 5e-5
gradient_accumulation_steps = 1
warmup_proportion = 0.1
qa_lambda = 0.8
qg_lambda = 1.0
tau = 1.0
lr = 0.1
meta_lr = 5e-5
batch_size = 4
dropout = 0.3
max_grad_norm = 5.0
use_tag = False
use_pointer = True
beam_size = 10
min_decode_step = 8
max_decode_step = 40
output_dir = "./result/dual"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment