pcyin / tranX

A general-purpose neural semantic parser for mapping natural language queries into machine executable code
Apache License 2.0
460 stars 111 forks source link

Upgrade to modern PyTorch #15

Closed neubig closed 4 years ago

neubig commented 4 years ago

This is a first draft of an upgrade that doesn't specify version numbers in the conda file, allowing users to use the most recent version of the libraries. Changes in PyTorch broke some things, but I think I fixed them.

This should help address this: https://github.com/pcyin/tranX/issues/10, and should be checked after this: https://github.com/pcyin/tranX/pull/12

neubig commented 4 years ago

I think this should basically be complete (including upgrade of the environment, and conversion of all deprecated PyTorch functions). I've confirmed that the accuracy seems to be fine on geoquery, getting 89.6 for a single run, which is higher than the TranX paper:

{'accuracy': 0.8964285714285715, 'oracle_accuracy': 0.9214285714285714}

I'm running CoNaLa now and will report, but I think this is ready for a check if you have time @pcyin

neubig commented 4 years ago

It seems to also be working on CoNaLa as well, where accuracy is within error of the reported results in the ACL 2019 paper (https://www.aclweb.org/anthology/P19-1447):

{'corpus_bleu': 0.24097779142849596, 'oracle_corpus_bleu': 0.3697198327631323, 'avg_sent_bleu': 0.20894283286460824, 'oracle_avg_sent_bleu': 0.34892593973337316, 'exact_      match': 0.02, 'oracle_exact_match': 0.052}