def speakerDiarizationEvaluateScript(folderName, LDAs):
 types = ('*.wav',)
 wavFilesList = []
 for files in types:
  wavFilesList.extend(glob.glob(os.path.join(folderName, files)))
 wavFilesList = sorted(wavFilesList)
 N = []
 for wavFile in wavFilesList:
  gtFile = wavFile.replace('.wav', '.segments')
  if os.path.isfile(gtFile):
   [segStart, segEnd, segLabels] = readSegmentGT(gtFile)
   N.append(len(list(set(segLabels))))
  else:
   N.append((-1))
 for l in LDAs:
  print 'LDA = {0:d}'.format(l)
  for (i, wavFile) in enumerate(wavFilesList):
   speakerDiarization(wavFile, N[i], 2.0, 0.2, 0.05, l, PLOT=False)
  print

def speakerDiarizationEvaluateScript ( folderName , LDAs ) : types = ( '*.wav' , ) wavFilesList = [ ] for files in types : wavFilesList . extend ( glob . glob ( os . path . join ( folderName , files ) ) ) wavFilesList = sorted ( wavFilesList ) N = [ ] for wavFile in wavFilesList : gtFile = wavFile . replace ( '.wav' , '.segments' ) if os . path . isfile ( gtFile ) : [ segStart , segEnd , segLabels ] = readSegmentGT ( gtFile ) N . append ( len ( list ( set ( segLabels ) ) ) ) else : N . append ( ( - 1 ) ) for l in LDAs : print 'LDA = {0:d}' . format ( l ) for ( i , wavFile ) in enumerate ( wavFilesList ) : speakerDiarization ( wavFile , N [ i ] , 2.0 , 0.2 , 0.05 , l , PLOT = False ) print
this function prints the cluster purity and speaker purity for each wav file stored in a provided directory arguments: - foldername: the full path of the folder where the wav and segment files are stored - ldas: a list of lda dimensions .