Skip to content

Commit

Permalink
file location checker to check if all the files have been downloaded …
Browse files Browse the repository at this point in the history
…correctly
  • Loading branch information
saist1993 committed Jul 2, 2019
1 parent 4710bac commit 44000f5
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 6 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,11 @@ change embedding in configs to 300d

#### Once the dataset is prepared

Check for the following files
1. in /resources check for vectors_gl.npy and vocab_gl.npy
2. in /data/data/common check for rdf_type_lookup.json and relations.pickle
3. in /data/data/lcquad check for id_big_data.json (To reproduce experiments related to lcquad)
4. in /data/data/qald check for id_big_data.json (To reproduce experiments related to qald)
To check if all the files are in correct palce run the following command

@TODO: Write a script to automate the above task.
```
python file_location_check.py
```

Once the data is at appropriate place run the following command.

Expand Down
36 changes: 36 additions & 0 deletions file_location_check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import os.path

# Check for /resources check for vectors_gl.npy and vocab_gl.npy

catch_exception = False
if not os.path.isfile('resources/vectors_gl.npy'):
print("vectors_gl.npy file not found in resources. Please download the file and add it to the resources folder.")
catch_exception = True


if not os.path.isfile('resources/vocab_gl.pickle'):
print("vocab_gl.pickle file not found in resources. Please download the file and add it to the resources folder.")
catch_exception = True

if not os.path.isfile('data/data/common/rdf_type_lookup.json'):
print("rdf_type_lookup.json not found in data/data/common. Please download the file and add it to the "
"data/data/common folder.")
catch_exception = True

if not os.path.isfile('data/data/common/relations.pickle'):
print("relations.pickle not found in data/data/common. Please download the file and add it to the "
"data/data/common folder.")
catch_exception = True

if not os.path.isfile('data/data/lcquad/id_big_data.json'):
print("id_big_data.json file not found in data/data/lcquad. Please download the file and "
"add it to the data/data/lcquad folder to perform experiments on lcquad.")
catch_exception = True

if not os.path.isfile('data/data/qald/id_big_data.json'):
print("id_big_data.json file not found in data/data/qald. Please download the file and "
"add it to the data/data/lcquad folder to perform experiments on qald.")
catch_exception = True

if not catch_exception:
print("Found all required files")

0 comments on commit 44000f5

Please sign in to comment.