Add PIT2015 dataset (#141)

* add prediction/qrel files dump option

* fix comment

* upgrade to torchtext 0.3

* remove ngram

* update device

* minor update

* add pit2015

* revert update torchtext

* revert update torchtext

* revert update torchtext
This commit is contained in:
Victor Yang
2018-08-12 18:56:08 -04:00
committed by GitHub
parent 8a00f9cdcd
commit 5afb845a4b
9 changed files with 199 additions and 5 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ def get_map_mrr(qids, predictions, labels, device=0, keep_results=False):
qrel_fname = 'trecqa_{}_{}.qrel'.format(time.time(), device)
results_fname = 'trecqa_{}_{}.results'.format(time.time(), device)
qrel_template = '{qid} 0 {docno} {rel}\n'
results_template = '{qid} 0 {docno} 0 {sim} mpcnn\n'
results_template = '{qid} 0 {docno} 0 {sim} castor-model\n'
with open(qrel_fname, 'w') as f1, open(results_fname, 'w') as f2:
docnos = range(len(qids))
for qid, docno, predicted, actual in zip(qids, docnos, predictions, labels):