montreal_forced_aligner/transcription/transcriber.py
def fmllr_rescore(self):
        """
        Rescore lattices with final fMLLR transforms

        See Also
        -------
        :class:`~montreal_forced_aligner.transcription.multiprocessing.FmllrRescoreFunction`
            Multiprocessing function
        :meth:`.Transcriber.fmllr_rescore_arguments`
            Arguments for function
        """
        self.logger.info("Rescoring fMLLR lattices with final transform...")
        sum_errors = 0
        with tqdm.tqdm(total=self.num_utterances) as pbar:
            if self.use_mp:
                manager = mp.Manager()
                error_dict = manager.dict()
                return_queue = manager.Queue()
                stopped = Stopped()
                procs = []
                for i, args in enumerate(self.fmllr_rescore_arguments()):
                    function = FmllrRescoreFunction(args)
                    p = KaldiProcessWorker(i, return_queue, function, error_dict, stopped)
                    procs.append(p)
                    p.start()
                while True:
                    try:
                        done, errors = return_queue.get(timeout=1)
                        sum_errors += errors
                        if stopped.stop_check():
                            continue
                    except Empty:
                        for proc in procs:
                            if not proc.finished.stop_check():
                                break
                        else:
                            break
                        continue
                    pbar.update(done + errors)
                for p in procs:
                    p.join()
                if error_dict:
                    for v in error_dict.values():
                        raise v
            else:
                for args in self.fmllr_rescore_arguments():
                    function = FmllrRescoreFunction(args)
                    for done, errors in function.run():
                        sum_errors += errors
                        pbar.update(done + errors)
            if sum_errors:
                self.logger.warning(f"{errors} utterances had errors on calculating fMLLR.")

        Rescore lattices with final fMLLR transforms

        See Also
        -------
        :class:`~montreal_forced_aligner.transcription.multiprocessing.FmllrRescoreFunction`
            Multiprocessing function
        :meth:`.Transcriber.fmllr_rescore_arguments`
            Arguments for function
        
Rescore lattices with final fMLLR transforms
See Also
Rescore lattices with final fMLLR transforms See Also
def fmllr_rescore(self):
        self.logger.info("Rescoring fMLLR lattices with final transform...")
        sum_errors = 0
        with tqdm.tqdm(total=self.num_utterances) as pbar:
            if self.use_mp:
                manager = mp.Manager()
                error_dict = manager.dict()
                return_queue = manager.Queue()
                stopped = Stopped()
                procs = []
                for i, args in enumerate(self.fmllr_rescore_arguments()):
                    function = FmllrRescoreFunction(args)
                    p = KaldiProcessWorker(i, return_queue, function, error_dict, stopped)
                    procs.append(p)
                    p.start()
                while True:
                    try:
                        done, errors = return_queue.get(timeout=1)
                        sum_errors += errors
                        if stopped.stop_check():
                            continue
                    except Empty:
                        for proc in procs:
                            if not proc.finished.stop_check():
                                break
                        else:
                            break
                        continue
                    pbar.update(done + errors)
                for p in procs:
                    p.join()
                if error_dict:
                    for v in error_dict.values():
                        raise v
            else:
                for args in self.fmllr_rescore_arguments():
                    function = FmllrRescoreFunction(args)
                    for done, errors in function.run():
                        sum_errors += errors
                        pbar.update(done + errors)
            if sum_errors:
                self.logger.warning(f"{errors} utterances had errors on calculating fMLLR.")
def fmllr_rescore ( self ) : self . logger . info ( "Rescoring fMLLR lattices with final transform..." ) sum_errors = 0 with tqdm . tqdm ( total = self . num_utterances ) as pbar : if self . use_mp : manager = mp . Manager ( ) error_dict = manager . dict ( ) return_queue = manager . Queue ( ) stopped = Stopped ( ) procs = [ ] for i , args in enumerate ( self . fmllr_rescore_arguments ( ) ) : function = FmllrRescoreFunction ( args ) p = KaldiProcessWorker ( i , return_queue , function , error_dict , stopped ) procs . append ( p ) p . start ( ) while True : try : done , errors = return_queue . get ( timeout = 1 ) sum_errors += errors if stopped . stop_check ( ) : continue except Empty : for proc in procs : if not proc . finished . stop_check ( ) : break else : break continue pbar . update ( done + errors ) for p in procs : p . join ( ) if error_dict : for v in error_dict . values ( ) : raise v else : for args in self . fmllr_rescore_arguments ( ) : function = FmllrRescoreFunction ( args ) for done , errors in function . run ( ) : sum_errors += errors pbar . update ( done + errors ) if sum_errors : self . logger . warning ( f"{errors} utterances had errors on calculating fMLLR." )
Rescore lattices with final fMLLR transforms
See Also
Rescore lattices with final fMLLR transforms See Also
"""
        Rescore lattices with final fMLLR transforms

        See Also
        -------
        :class:`~montreal_forced_aligner.transcription.multiprocessing.FmllrRescoreFunction`
            Multiprocessing function
        :meth:`.Transcriber.fmllr_rescore_arguments`
            Arguments for function
        """
self
class
`~montreal_forced_aligner.transcription.multiprocessing.FmllrRescoreFunction`
Multiprocessing function
` ~montreal_forced_aligner . transcription . multiprocessing . FmllrRescoreFunction ` Multiprocessing function
meth
`.Transcriber.fmllr_rescore_arguments`
Arguments for function
` . Transcriber . fmllr_rescore_arguments ` Arguments for function