Skip to content

Commit 36791ed

Browse files
committed
Update: ensure root data directory exists
1 parent a1110cd commit 36791ed

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

AMICorpusHandler.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,17 @@ def download_corpus(self):
4040
download_link = 'http://groups.inf.ed.ac.uk/ami/AMICorpusAnnotations/ami_public_manual_1.6.2.zip'
4141
# directory = os.path.dirname(self.ami_dir)
4242
if not os.path.exists(self.ami_dir):
43+
# 1. Ensure data directory exists
44+
utils.ensure_dir(self.args.ami_xml_dir)
45+
# 2. Download AMI Corpus
4346
print("Downloading AMI Corpus to: {}".format(self.ami_dir))
4447
zipped_ami_filename = self.ami_dir + '.zip'
4548
urllib.request.urlretrieve(download_link, zipped_ami_filename)
46-
# Unzip zip file
49+
# 3. Unzip zip file
4750
zip_ref = zipfile.ZipFile(zipped_ami_filename, 'r')
4851
zip_ref.extractall(self.ami_dir)
4952
zip_ref.close()
50-
# Delete zip file
53+
# 4. Delete zip file
5154
os.remove(zipped_ami_filename)
5255
else:
5356
print("AMI Corpus has already been downloaded in: {}".format(self.ami_dir))

0 commit comments

Comments
 (0)