voxseg_/evaluate.py
def score_2(wav_scp: pd.DataFrame, sys_segs: pd.DataFrame, ref_segs: pd.DataFrame, wav_segs: pd.DataFrame, winlen: float):
    '''Function for calculating the syllable scores
    
    Args:
        wav_scp: A pd.DataFrame containing information about the wavefiles that have been segmented.
        sys_segs: A pd.DataFrame containing the endpoints produced by a VAD system.
        ref_segs: A pd.DataFrame containing the ground truth reference endpoints. 
        winlen: The time interval covered by a column in the spectrogram -- not used right now   
    '''

    (t_labels, p_labels) = getLabels(wav_scp, ref_segs, sys_segs, winlen)
        
    cm = confusion_matrix(t_labels, p_labels)
    prec = precision_score(t_labels, p_labels)
    rec = recall_score(t_labels, p_labels)
    f1 = f1_score(t_labels, p_labels)
    acc = accuracy_score(t_labels, p_labels) 
            
    logging.info("\n\nConfusion matrix new (0 -> non speech. 1 -> speech):\n{}\n".format(pd.DataFrame(cm)))
    logging.info("Column labels (all): Speech: {}, Non-speech: {}, All: {}".format(np.sum(cm[1]), np.sum(cm[0]), np.sum(cm)))
    
    logging.info('Column scores new:\tP = {}\tR = {}\tF1 = {}\tAccuracy = {}\n'.format(round(prec, 3), round(rec, 3), round(f1, 3), round(acc, 3)))
Function for calculating the syllable scores
    
    Args:
        wav_scp: A pd.DataFrame containing information about the wavefiles that have been segmented.
        sys_segs: A pd.DataFrame containing the endpoints produced by a VAD system.
        ref_segs: A pd.DataFrame containing the ground truth reference endpoints. 
        winlen: The time interval covered by a column in the spectrogram -- not used right now   
    
Function for calculating the syllable scores
Function for calculating the syllable scores
def score_2(wav_scp: pd.DataFrame, sys_segs: pd.DataFrame, ref_segs: pd.DataFrame, wav_segs: pd.DataFrame, winlen: float):
    (t_labels, p_labels) = getLabels(wav_scp, ref_segs, sys_segs, winlen)
    cm = confusion_matrix(t_labels, p_labels)
    prec = precision_score(t_labels, p_labels)
    rec = recall_score(t_labels, p_labels)
    f1 = f1_score(t_labels, p_labels)
    acc = accuracy_score(t_labels, p_labels) 
    logging.info("\n\nConfusion matrix new (0 -> non speech. 1 -> speech):\n{}\n".format(pd.DataFrame(cm)))
    logging.info("Column labels (all): Speech: {}, Non-speech: {}, All: {}".format(np.sum(cm[1]), np.sum(cm[0]), np.sum(cm)))
    logging.info('Column scores new:\tP = {}\tR = {}\tF1 = {}\tAccuracy = {}\n'.format(round(prec, 3), round(rec, 3), round(f1, 3), round(acc, 3)))
def score_2 ( wav_scp : pd . DataFrame , sys_segs : pd . DataFrame , ref_segs : pd . DataFrame , wav_segs : pd . DataFrame , winlen : float ) : ( t_labels , p_labels ) = getLabels ( wav_scp , ref_segs , sys_segs , winlen ) cm = confusion_matrix ( t_labels , p_labels ) prec = precision_score ( t_labels , p_labels ) rec = recall_score ( t_labels , p_labels ) f1 = f1_score ( t_labels , p_labels ) acc = accuracy_score ( t_labels , p_labels ) logging . info ( "\n\nConfusion matrix new (0 -> non speech. 1 -> speech):\n{}\n" . format ( pd . DataFrame ( cm ) ) ) logging . info ( "Column labels (all): Speech: {}, Non-speech: {}, All: {}" . format ( np . sum ( cm [ 1 ] ) , np . sum ( cm [ 0 ] ) , np . sum ( cm ) ) ) logging . info ( 'Column scores new:\tP = {}\tR = {}\tF1 = {}\tAccuracy = {}\n' . format ( round ( prec , 3 ) , round ( rec , 3 ) , round ( f1 , 3 ) , round ( acc , 3 ) ) )
Function for calculating the syllable scores
Function for calculating the syllable scores
'''Function for calculating the syllable scores
    
    Args:
        wav_scp: A pd.DataFrame containing information about the wavefiles that have been segmented.
        sys_segs: A pd.DataFrame containing the endpoints produced by a VAD system.
        ref_segs: A pd.DataFrame containing the ground truth reference endpoints. 
        winlen: The time interval covered by a column in the spectrogram -- not used right now   
    '''
wav_scp
pd.DataFrame
A pd.DataFrame containing information about the wavefiles that have been segmented.
A pd . DataFrame containing information about the wavefiles that have been segmented .
sys_segs
pd.DataFrame
A pd.DataFrame containing the endpoints produced by a VAD system.
A pd . DataFrame containing the endpoints produced by a VAD system .
ref_segs
pd.DataFrame
A pd.DataFrame containing the ground truth reference endpoints.
A pd . DataFrame containing the ground truth reference endpoints .
wav_segs
pd.DataFrame
winlen
float
The time interval covered by a column in the spectrogram -- not used right now
The time interval covered by a column in the spectrogram -- not used right now