Skip to content

Commit 7570c3e

Browse files
author
Grégoire
committed
add download of evaluation perl script
1 parent 0c65cfc commit 7570c3e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

code/rnnslu.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,22 @@ def conlleval(p, g, w, filename):
8484
return get_perf(filename)
8585

8686

87+
def download(origin):
88+
'''
89+
download the corresponding atis file
90+
from http://www-etud.iro.umontreal.ca/~mesnilgr/atis/
91+
'''
92+
print 'Downloading data from %s' % origin
93+
name = origin.split('/')[-1]
94+
urllib.urlretrieve(origin, name)
95+
96+
8797
def get_perf(filename):
8898
''' run conlleval.pl perl script to obtain
8999
precision/recall and F1 score '''
90100
_conlleval = PREFIX + 'conlleval.pl'
91101
if not os.path.isfile(_conlleval):
92-
# url = 'http://www-etud.iro.umontreal.ca/
93-
# ~mesnilgr/atis/conlleval.pl'
102+
url = 'http://www-etud.iro.umontreal.ca/~mesnilgr/atis/conlleval.pl'
94103
download(url)
95104
chmod('conlleval.pl', stat.S_IRWXU) # give the execute permissions
96105

0 commit comments

Comments
 (0)