montreal_forced_aligner/transcription/transcriber.py
def lat_gen_fmllr(self):
        """
        Generate lattice with fMLLR transforms

        See Also
        -------
        :class:`~montreal_forced_aligner.transcription.multiprocessing.LatGenFmllrFunction`
            Multiprocessing function
        :meth:`.Transcriber.lat_gen_fmllr_arguments`
            Arguments for function
        """
        self.logger.info("Regenerating lattices with fMLLR transforms...")
        with tqdm.tqdm(total=self.num_utterances) as pbar, open(
            os.path.join(self.working_log_directory, "lat_gen_fmllr_log_like.csv"),
            "w",
            encoding="utf8",
        ) as log_file:
            log_file.write("utterance,log_likelihood,num_frames\n")
            if self.use_mp:
                manager = mp.Manager()
                error_dict = manager.dict()
                return_queue = manager.Queue()
                stopped = Stopped()
                procs = []
                for i, args in enumerate(self.lat_gen_fmllr_arguments()):
                    function = LatGenFmllrFunction(args)
                    p = KaldiProcessWorker(i, return_queue, function, error_dict, stopped)
                    procs.append(p)
                    p.start()
                while True:
                    try:
                        utterance, log_likelihood, num_frames = return_queue.get(timeout=1)
                        log_file.write(f"{utterance},{log_likelihood},{num_frames}\n")
                        if stopped.stop_check():
                            continue
                    except Empty:
                        for proc in procs:
                            if not proc.finished.stop_check():
                                break
                        else:
                            break
                        continue
                    pbar.update(1)
                for p in procs:
                    p.join()
                if error_dict:
                    for v in error_dict.values():
                        raise v
            else:
                for args in self.lat_gen_fmllr_arguments():
                    function = LatGenFmllrFunction(args)
                    for utterance, log_likelihood, num_frames in function.run():
                        log_file.write(f"{utterance},{log_likelihood},{num_frames}\n")
                        pbar.update(1)

        Generate lattice with fMLLR transforms

        See Also
        -------
        :class:`~montreal_forced_aligner.transcription.multiprocessing.LatGenFmllrFunction`
            Multiprocessing function
        :meth:`.Transcriber.lat_gen_fmllr_arguments`
            Arguments for function
        
Generate lattice with fMLLR transforms
See Also
Generate lattice with fMLLR transforms See Also
def lat_gen_fmllr(self):
        self.logger.info("Regenerating lattices with fMLLR transforms...")
        with tqdm.tqdm(total=self.num_utterances) as pbar, open(
            os.path.join(self.working_log_directory, "lat_gen_fmllr_log_like.csv"),
            "w",
            encoding="utf8",
        ) as log_file:
            log_file.write("utterance,log_likelihood,num_frames\n")
            if self.use_mp:
                manager = mp.Manager()
                error_dict = manager.dict()
                return_queue = manager.Queue()
                stopped = Stopped()
                procs = []
                for i, args in enumerate(self.lat_gen_fmllr_arguments()):
                    function = LatGenFmllrFunction(args)
                    p = KaldiProcessWorker(i, return_queue, function, error_dict, stopped)
                    procs.append(p)
                    p.start()
                while True:
                    try:
                        utterance, log_likelihood, num_frames = return_queue.get(timeout=1)
                        log_file.write(f"{utterance},{log_likelihood},{num_frames}\n")
                        if stopped.stop_check():
                            continue
                    except Empty:
                        for proc in procs:
                            if not proc.finished.stop_check():
                                break
                        else:
                            break
                        continue
                    pbar.update(1)
                for p in procs:
                    p.join()
                if error_dict:
                    for v in error_dict.values():
                        raise v
            else:
                for args in self.lat_gen_fmllr_arguments():
                    function = LatGenFmllrFunction(args)
                    for utterance, log_likelihood, num_frames in function.run():
                        log_file.write(f"{utterance},{log_likelihood},{num_frames}\n")
                        pbar.update(1)
def lat_gen_fmllr ( self ) : self . logger . info ( "Regenerating lattices with fMLLR transforms..." ) with tqdm . tqdm ( total = self . num_utterances ) as pbar , open ( os . path . join ( self . working_log_directory , "lat_gen_fmllr_log_like.csv" ) , "w" , encoding = "utf8" , ) as log_file : log_file . write ( "utterance,log_likelihood,num_frames\n" ) if self . use_mp : manager = mp . Manager ( ) error_dict = manager . dict ( ) return_queue = manager . Queue ( ) stopped = Stopped ( ) procs = [ ] for i , args in enumerate ( self . lat_gen_fmllr_arguments ( ) ) : function = LatGenFmllrFunction ( args ) p = KaldiProcessWorker ( i , return_queue , function , error_dict , stopped ) procs . append ( p ) p . start ( ) while True : try : utterance , log_likelihood , num_frames = return_queue . get ( timeout = 1 ) log_file . write ( f"{utterance},{log_likelihood},{num_frames}\n" ) if stopped . stop_check ( ) : continue except Empty : for proc in procs : if not proc . finished . stop_check ( ) : break else : break continue pbar . update ( 1 ) for p in procs : p . join ( ) if error_dict : for v in error_dict . values ( ) : raise v else : for args in self . lat_gen_fmllr_arguments ( ) : function = LatGenFmllrFunction ( args ) for utterance , log_likelihood , num_frames in function . run ( ) : log_file . write ( f"{utterance},{log_likelihood},{num_frames}\n" ) pbar . update ( 1 )
Generate lattice with fMLLR transforms
See Also
Generate lattice with fMLLR transforms See Also
"""
        Generate lattice with fMLLR transforms

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