def load_tag(corpus, path):
        """
        Iterate over all speakers on load them.
        Collect all utterance-idx and create a subset of them.
        """
        tag_idx = os.path.basename(path)
        data_path = os.path.join(path, 'by_book')
        tag_utt_ids = []

        for gender_path in MailabsReader.get_folders(data_path):
            # IN MIX FOLDERS THERE ARE NO SPEAKERS
            # HANDLE EVERY UTT AS DIFFERENT ISSUER
            if os.path.basename(gender_path) == 'mix':
                utt_ids = MailabsReader.load_books_of_speaker(corpus,
                                                              gender_path,
                                                              None)

                tag_utt_ids.extend(utt_ids)

            else:
                for speaker_path in MailabsReader.get_folders(gender_path):
                    speaker = MailabsReader.load_speaker(corpus, speaker_path)
                    utt_ids = MailabsReader.load_books_of_speaker(corpus,
                                                                  speaker_path,
                                                                  speaker)

                    tag_utt_ids.extend(utt_ids)

        filter = subset.MatchingUtteranceIdxFilter(
            utterance_idxs=set(tag_utt_ids)
        )
        subview = subset.Subview(corpus, filter_criteria=[filter])
        corpus.import_subview(tag_idx, subview)
def load_tag ( corpus , path ) : tag_idx = os . path . basename ( path ) data_path = os . path . join ( path , 'by_book' ) tag_utt_ids = [ ] for gender_path in MailabsReader . get_folders ( data_path ) : if os . path . basename ( gender_path ) == 'mix' : utt_ids = MailabsReader . load_books_of_speaker ( corpus , gender_path , None ) tag_utt_ids . extend ( utt_ids ) else : for speaker_path in MailabsReader . get_folders ( gender_path ) : speaker = MailabsReader . load_speaker ( corpus , speaker_path ) utt_ids = MailabsReader . load_books_of_speaker ( corpus , speaker_path , speaker ) tag_utt_ids . extend ( utt_ids ) filter = subset . MatchingUtteranceIdxFilter ( utterance_idxs = set ( tag_utt_ids ) ) subview = subset . Subview ( corpus , filter_criteria = [ filter ] ) corpus . import_subview ( tag_idx , subview )
Iterate over all speakers on load them.
        Collect all utterance-idx and create a subset of them.