tools/utilities/pythonlibs/audio/training/make_dataset.py
def parse_list_file(list_file):
    """ 
    Load the list file which contains 'dir/filename' format on each line
    We sort these into one set per directory, the directory name then becomes the supervised
    training label we want the model to learn.
    """
    data_root = os.path.dirname(list_file)
    with open(list_file, "r") as fp:
        full_list = [e.strip() for e in fp.readlines()]
    # group the list by folders
    entries_to_visit = {}
    for e in full_list:
        label, file_name = os.path.split(e)
        folder = os.path.abspath(os.path.join(data_root, label))
        if folder in entries_to_visit:
            entries_to_visit[folder].append(file_name)
        else:
            entries_to_visit[folder] = [ file_name ]

    return entries_to_visit
 
    Load the list file which contains 'dir/filename' format on each line
    We sort these into one set per directory, the directory name then becomes the supervised
    training label we want the model to learn.
    
Load the list file which contains 'dir/filename' format on each line
We sort these into one set per directory, the directory name then becomes the supervised
training label we want the model to learn.
Load the list file which contains ' dir / filename ' format on each line We sort these into one set per directory the directory name then becomes the supervised training label we want the model to learn .
def parse_list_file(list_file):
    data_root = os.path.dirname(list_file)
    with open(list_file, "r") as fp:
        full_list = [e.strip() for e in fp.readlines()]
    entries_to_visit = {}
    for e in full_list:
        label, file_name = os.path.split(e)
        folder = os.path.abspath(os.path.join(data_root, label))
        if folder in entries_to_visit:
            entries_to_visit[folder].append(file_name)
        else:
            entries_to_visit[folder] = [ file_name ]
    return entries_to_visit
def parse_list_file ( list_file ) : data_root = os . path . dirname ( list_file ) with open ( list_file , "r" ) as fp : full_list = [ e . strip ( ) for e in fp . readlines ( ) ] entries_to_visit = { } for e in full_list : label , file_name = os . path . split ( e ) folder = os . path . abspath ( os . path . join ( data_root , label ) ) if folder in entries_to_visit : entries_to_visit [ folder ] . append ( file_name ) else : entries_to_visit [ folder ] = [ file_name ] return entries_to_visit
Load the list file which contains 'dir/filename' format on each line
We sort these into one set per directory, the directory name then becomes the supervised
training label we want the model to learn.
Load the list file which contains ' dir / filename ' format on each line We sort these into one set per directory the directory name then becomes the supervised training label we want the model to learn .
""" 
    Load the list file which contains 'dir/filename' format on each line
    We sort these into one set per directory, the directory name then becomes the supervised
    training label we want the model to learn.
    """ # group the list by folders
list_file