This function prints the cluster purity and speaker purity for
        each WAV file stored in a provided directory (.SEGMENT files
         are needed as ground-truth)
        ARGUMENTS:
            - folder_name:     the full path of the folder where the WAV and
                              SEGMENT (ground-truth) files are stored
            - ldas:           a list of LDA dimensions (0 for no LDA)

def speakerDiarizationEvaluateScript(folder_name, ldas):
    '''
        This function prints the cluster purity and speaker purity for
        each WAV file stored in a provided directory (.SEGMENT files
         are needed as ground-truth)
        ARGUMENTS:
            - folder_name:     the full path of the folder where the WAV and
                              SEGMENT (ground-truth) files are stored
            - ldas:           a list of LDA dimensions (0 for no LDA)
    '''
    types = ('*.wav',  )
    wavFilesList = []
    for files in types:
        wavFilesList.extend(glob.glob(os.path.join(folder_name, files)))    
    
    wavFilesList = sorted(wavFilesList)

    # get number of unique speakers per file (from ground-truth)    
    N = []
    for wav_file in wavFilesList:        
        gt_file = wav_file.replace('.wav', '.segments');
        if os.path.isfile(gt_file):
            [seg_start, seg_end, seg_labs] = readSegmentGT(gt_file)
            N.append(len(list(set(seg_labs))))
        else:
            N.append(-1)
    
    for l in ldas:
        print("LDA = {0:d}".format(l))
        for i, wav_file in enumerate(wavFilesList):
            speakerDiarization(wav_file, N[i], 2.0, 0.2, 0.05, l, plot_res=False)
        print