def trainSpeakerModelsScript():
 mtWin = 2.0
 mtStep = 2.0
 stWin = 0.02
 stStep = 0.02
 dirName = 'DIARIZATION_ALL/all'
 listOfDirs = [os.path.join(dirName, name) for name in os.listdir(dirName) if os.path.isdir(os.path.join(dirName, name))]
 featureAndTrain(listOfDirs, mtWin, mtStep, stWin, stStep, 'knn', 'data/knnSpeakerAll', computeBEAT=False, perTrain=0.5)
 dirName = 'DIARIZATION_ALL/female_male'
 listOfDirs = [os.path.join(dirName, name) for name in os.listdir(dirName) if os.path.isdir(os.path.join(dirName, name))]
 featureAndTrain(listOfDirs, mtWin, mtStep, stWin, stStep, 'knn', 'data/knnSpeakerFemaleMale', computeBEAT=False, perTrain=0.5)

def trainSpeakerModelsScript ( ) : mtWin = 2.0 mtStep = 2.0 stWin = 0.02 stStep = 0.02 dirName = 'DIARIZATION_ALL/all' listOfDirs = [ os . path . join ( dirName , name ) for name in os . listdir ( dirName ) if os . path . isdir ( os . path . join ( dirName , name ) ) ] featureAndTrain ( listOfDirs , mtWin , mtStep , stWin , stStep , 'knn' , 'data/knnSpeakerAll' , computeBEAT = False , perTrain = 0.5 ) dirName = 'DIARIZATION_ALL/female_male' listOfDirs = [ os . path . join ( dirName , name ) for name in os . listdir ( dirName ) if os . path . isdir ( os . path . join ( dirName , name ) ) ] featureAndTrain ( listOfDirs , mtWin , mtStep , stWin , stStep , 'knn' , 'data/knnSpeakerFemaleMale' , computeBEAT = False , perTrain = 0.5 )
this script is used to train the speaker-related models import audiotraintest as at at .