badripatro / pqg Goto Github PK
View Code? Open in Web Editor NEWCode for paper title "Learning Semantic Sentence Embeddings using Pair-wise Discriminator" COLING-2018
License: MIT License
Code for paper title "Learning Semantic Sentence Embeddings using Pair-wise Discriminator" COLING-2018
License: MIT License
Could you please provide the steps to obtain your sentiment accuracy numbers in your paper?
Thank you.
ub16c9@ub16c9-gpu:/media/ub16c9/fcd84300-9270-4bbd-896a-5e04e79203b7/ub16_prj/PQG/prepro$ python quora_prepro.py
Traceback (most recent call last):
File "quora_prepro.py", line 80, in
main()
File "quora_prepro.py", line 16, in main
if row[5]=='0' and row[4][-1:]=='?':#the 6th entry in every row has value 0 or 1 and it represents paraphrases if that value is 1
IndexError: list index out of range
ub16c9@ub16c9-gpu:/media/ub16c9/fcd84300-9270-4bbd-896a-5e04e79203b7/ub16_prj/PQG/prepro$
ub16c9@ub16c9-gpu:/media/ub16c9/fcd84300-9270-4bbd-896a-5e04e79203b7/ub16_prj/PQG$ th eval.lua -input_ques_h5 data/quora_data_prepro.h5 -input_json data/quora_data_prepro.json
{
batch_size : 150
val_images_use : 24800
txtSize : 512
optim_epsilon : 1e-08
att_size : 512
input_encoding_size : 512
learning_rate_decay_start : 5
id : "1"
emb_size : 512
optim_beta : 0.999
rnn_size : 512
cnn_dim : 512
language_eval : 1
learning_rate_decay_every : 5
optim : "rmsprop"
gpuid : 0
drop_prob_lm : 0.5
input_ques_h5 : "data/quora_data_prepro.h5"
checkpoint_dir : "Results/checkpoints"
rnn_layers : 1
seed : 1234
input_json : "data/quora_data_prepro.json"
backend : "cudnn"
save : "Results"
iterPerEpoch : 1250
start_from : "pretrained/model_epoch7.t7"
max_iters : -1
momentum : 0.9
save_checkpoint_every : 2500
learning_rate : 0.0008
nGPU : 3
feature_type : "VGG"
losses_log_every : 200
optim_alpha : 0.8
}
[program started on Thu Jun 20 11:43:51 2019]
[command line arguments]
batch_size 150
val_images_use 24800
txtSize 512
optim_epsilon 1e-08
att_size 512
input_encoding_size 512
learning_rate_decay_start 5
id 1
emb_size 512
optim_beta 0.999
rnn_size 512
cnn_dim 512
language_eval 1
learning_rate_decay_every 5
optim rmsprop
gpuid 0
drop_prob_lm 0.5
input_ques_h5 data/quora_data_prepro.h5
checkpoint_dir Results/checkpoints
rnn_layers 1
seed 1234
input_json data/quora_data_prepro.json
backend cudnn
save Results
iterPerEpoch 1250
start_from pretrained/model_epoch7.t7
max_iters -1
momentum 0.9
save_checkpoint_every 2500
learning_rate 0.0008
nGPU 3
feature_type VGG
losses_log_every 200
optim_alpha 0.8
[----------------------]
Reading data/quora_data_prepro.json
DataLoader loading h5 question file: data/quora_data_prepro.h5
self[ques_train]:size(1) 100000
self[ques_test]:size(1) 30000
initializing weights from pretrained/model_epoch7.t7
Building the model from scratch...
total number of parameters in protos.netE embedding net: nn.gModule
total number of parameters in netT embedding net: nn.gModule
vocab_size 27695
seq_length 26
ship everything to GPU...
Load the weight...
total number of parameters in Question embedding net: 9060608
total number of parameters of language Generating model 30489648
Checkpointing. Calculating validation accuracy..
constructing clones inside the LanguageModel
loading annotations into memory...======== 24900/30000 =================>...............] ETA: 1m20s | Step: 15ms
0:00:00.439605
creating index...
index created! imgtoanns
using 24900/24900 predictions
Loading and preparing results...
DONE (t=0.31s)
creating index...
index created! imgtoanns_res
tokenization...
Jun 20, 2019 11:50:20 AM edu.stanford.nlp.process.PTBLexer next
WARNING: Untokenizable: ₹ (U+20B9, decimal: 8377)
PTBTokenizer tokenized 288748 tokens at 233329.29 tokens per second.
Jun 20, 2019 11:50:22 AM edu.stanford.nlp.process.PTBLexer next
WARNING: Untokenizable: ₹ (U+20B9, decimal: 8377)
PTBTokenizer tokenized 285685 tokens at 377473.80 tokens per second.
setting up scorers...
computing Bleu score...
{'reflen': 236658, 'guess': [233367, 208489, 183672, 158979], 'testlen': 233367, 'correct': [107828, 48228, 23845, 12067]}
ratio: 0.986093856958
Bleu_1: 0.456
Bleu_2: 0.322
Bleu_3: 0.237
Bleu_4: 0.178
computing METEOR score...
Traceback (most recent call last):
File "myeval.py", line 32, in
cocoEval.evaluate()
File "/media/ub16c9/fcd84300-9270-4bbd-896a-5e04e79203b7/ub16_prj/PQG/coco-caption/pycocoevalcap/eval.py", line 79, in evaluate
score, scores = scorer.compute_score(gts, res)
File "/media/ub16c9/fcd84300-9270-4bbd-896a-5e04e79203b7/ub16_prj/PQG/coco-caption/pycocoevalcap/meteor/meteor.py", line 39, in compute_score
stat = self._stat(res[i][0], gts[i])
File "/media/ub16c9/fcd84300-9270-4bbd-896a-5e04e79203b7/ub16_prj/PQG/coco-caption/pycocoevalcap/meteor/meteor.py", line 57, in _stat
self.meteor_p.stdin.write('{}\n'.format(score_line))
IOError: [Errno 32] Broken pipe
Hello!
I truly appreciate the well documented code and pre-trained model - I was wondering, how would I use the pretrained model to generate paraphrases based on new data? As in, how should I input sentences to the model? Thanks!
Hi,
I'm reading your paper and find that the BLEU scores you compared with state-of-the-art models in Table 2 are based on BLEU1. But it seems that they calculate BLEU scores based on BLEU4, which is suggested in the original BLEU paper "Bleu: a method for automatic evaluation of machine translation".
Another paper published in ACL 2019 seems to use BLEU4 too. "Generating Sentences from Disentangled Syntactic and Semantic Spaces". As shown in their published codes.
So I'm wondering whether the BLEU scores are the same.
HI!
I'm using a CPU config for the eval (I'm using the pre-trained model). However, I get this error
{
batch_size : 150
val_images_use : 24800
txtSize : 512
optim_epsilon : 1e-08
att_size : 512
input_encoding_size : 512
learning_rate_decay_start : 5
id : "1"
emb_size : 512
optim_beta : 0.999
rnn_size : 512
cnn_dim : 512
language_eval : 1
learning_rate_decay_every : 5
optim : "rmsprop"
gpuid : -1
drop_prob_lm : 0.5
input_ques_h5 : "data/quora_data_prepro.h5"
checkpoint_dir : "Results/checkpoints"
rnn_layers : 1
seed : 1234
input_json : "data/quora_data_prepro.json"
backend : "nn"
save : "Results"
iterPerEpoch : 1250
start_from : "pretrained/model_epoch7.t7"
max_iters : -1
momentum : 0.9
save_checkpoint_every : 2500
when I run it by changing the gpuid to -1 and backend to nn.
What could be a solution. The torch.load does not allow for map_location=torch.device('cpu')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.