INNER CODE UNIT · Python
create_limited_sup
flashlight/wav2letter · data/ami/utils.py:138
def create_limited_sup(list_dir):
random.seed(0)
train_file = os.path.join(list_dir, "train.lst")
assert os.path.exists(train_file)
speakers = get_speakers(train_file)
print("Found speakers", len(speakers))
write_records = {}
chosen_records = {}
fid2length = get_fid2length(train_file)
all_records = full_records(speakers, fid2length)
for gender in ["M", "F"]:
print(f"Selecting from gender {gender}")
records = [rec for rec in all_records if rec.speaker.gender == gender]