Archived
52 lines
1.8 KiB
Python
52 lines
1.8 KiB
Python
import os
|
|
import warnings
|
|
import sys
|
|
|
|
|
|
def expe_options(options):
|
|
# options["result_path"] = "./results/gender"
|
|
options["result_path"] = "./results/" + options["subject_name"]
|
|
|
|
options["sound_path"] = "./stimuli/gender/{}".format(
|
|
options["language"].lower())
|
|
options["sound_path_store"] = "./stimuli_store/gender/{}".format(
|
|
options["language"].lower())
|
|
if not os.path.exists(options["sound_path_store"]):
|
|
os.makedirs(options["sound_path_store"])
|
|
if not os.path.exists(options["sound_path"]):
|
|
os.makedirs(options["sound_path"])
|
|
|
|
if not "Bert" in options:
|
|
options["Bert"] = False
|
|
|
|
if options["Bert"]:
|
|
options["tmp_path"] = "./stimuli/gender/{}/processed/Bert".format(
|
|
options["language"].lower())
|
|
else:
|
|
options["tmp_path"] = "./stimuli/gender/{}/processed".format(
|
|
options["language"].lower())
|
|
|
|
options["result_prefix"] = "gen_"
|
|
|
|
if not os.listdir(options["sound_path"]):
|
|
raise ValueError("Sound path cannot be empty")
|
|
|
|
if not os.path.exists(options["tmp_path"]):
|
|
os.makedirs(options["tmp_path"])
|
|
|
|
# if not os.listdir(options["tmp_path"]) and options["phase"] != "generation":
|
|
# opt = raw_input(
|
|
# "Running experiment without preprocessing sounds? (Y/n)")
|
|
# if opt.lower() == "y":
|
|
# warnings.warn(
|
|
# "This will slow down the experiment substantially. Press ctrl+c to cancel if unhappy")
|
|
# elif opt.lower() == "n":
|
|
# warnings.warn(
|
|
# "Recommended to preprocess stimuli files before running the experiment.")
|
|
# sys.exit()
|
|
# else:
|
|
# raise ValueError("That is not a valid option")
|
|
options["experiment_begin"] = 1
|
|
|
|
return options
|