def shuffle_examples(featdir):
'''
shuffle the utterances and put them in feats_shuffled.scp
Args:
featdir: the directory containing the features in feats.scp
'''
#read feats.scp
featsfile = open(featdir + '/feats.scp', 'r')
feats = featsfile.readlines()
#shuffle feats randomly
shuffle(feats)
#wite them to feats_shuffled.scp
feats_shuffledfile = open(featdir + '/feats_shuffled.scp', 'w')
feats_shuffledfile.writelines(feats)
评论列表
文章目录