Add end to end test and improve the train_clas params

This commit is contained in:
Piotr Czapla
2018-11-16 19:51:29 +01:00
parent 977a506cfd
commit 23b17da61e
5 changed files with 89 additions and 20 deletions
+14 -2
View File
@@ -43,14 +43,26 @@ def get_texts(path):
return np.array(texts), np.array(labels)
def ensure_paths_exists(*paths):
def ensure_paths_exists(*paths, message="One or more required files cannot be found."):
error = False
for path in paths:
if not path.exists():
print(f'Error: {path} does not exist.')
error = True
if error:
raise FileNotFoundError("One or more required files cannot be found.")
raise FileNotFoundError(message)
def get_data_folder():
"""
return data folder to use for future processing
"""
return (pathlib.Path(__file__).parent.parent / "data")
def get_scripts_folder():
"""
return data folder to use for future processing
"""
return (pathlib.Path(__file__).parent.parent)
def prepare_imdb(file_path: str, prepare_lm = False):
"""