montreal_forced_aligner/alignment/mixins.py
def compile_information(self):
        """
        Compiles information about alignment, namely what the overall log-likelihood was
        and how many files were unaligned.

        See Also
        --------
        :func:`~montreal_forced_aligner.alignment.multiprocessing.compile_information_func`
            Multiprocessing helper function for each job
        :meth:`.AlignMixin.compile_information_arguments`
            Job method for generating arguments for the helper function
        """
        compile_info_begin = time.time()

        jobs = self.compile_information_arguments()

        if self.use_mp:
            alignment_info = run_mp(
                compile_information_func, jobs, self.working_log_directory, True
            )
        else:
            alignment_info = run_non_mp(
                compile_information_func, jobs, self.working_log_directory, True
            )

        avg_like_sum = 0
        avg_like_frames = 0
        average_logdet_sum = 0
        average_logdet_frames = 0
        beam_too_narrow_count = 0
        too_short_count = 0
        for data in alignment_info.values():
            beam_too_narrow_count += len(data["unaligned"])
            too_short_count += len(data["too_short"])
            avg_like_frames += data["total_frames"]
            avg_like_sum += data["log_like"] * data["total_frames"]
            if "logdet_frames" in data:
                average_logdet_frames += data["logdet_frames"]
                average_logdet_sum += data["logdet"] * data["logdet_frames"]

        if not avg_like_frames:
            self.logger.warning(
                "No files were aligned, this likely indicates serious problems with the aligner."
            )
        else:
            if too_short_count:
                self.logger.debug(
                    f"There were {too_short_count} utterances that were too short to be aligned."
                )
            if beam_too_narrow_count:
                self.logger.debug(
                    f"There were {beam_too_narrow_count} utterances that could not be aligned with "
                    f"the current beam settings."
                )
            average_log_like = avg_like_sum / avg_like_frames
            if average_logdet_sum:
                average_log_like += average_logdet_sum / average_logdet_frames
            self.logger.debug(f"Average per frame likelihood for alignment: {average_log_like}")
        self.logger.debug(f"Compiling information took {time.time() - compile_info_begin}")

        Compiles information about alignment, namely what the overall log-likelihood was
        and how many files were unaligned.

        See Also
        --------
        :func:`~montreal_forced_aligner.alignment.multiprocessing.compile_information_func`
            Multiprocessing helper function for each job
        :meth:`.AlignMixin.compile_information_arguments`
            Job method for generating arguments for the helper function
        
Compiles information about alignment, namely what the overall log-likelihood was
and how many files were unaligned.

See Also
Compiles information about alignment namely what the overall log - likelihood was and how many files were unaligned . See Also
def compile_information(self):
        compile_info_begin = time.time()
        jobs = self.compile_information_arguments()
        if self.use_mp:
            alignment_info = run_mp(
                compile_information_func, jobs, self.working_log_directory, True
            )
        else:
            alignment_info = run_non_mp(
                compile_information_func, jobs, self.working_log_directory, True
            )
        avg_like_sum = 0
        avg_like_frames = 0
        average_logdet_sum = 0
        average_logdet_frames = 0
        beam_too_narrow_count = 0
        too_short_count = 0
        for data in alignment_info.values():
            beam_too_narrow_count += len(data["unaligned"])
            too_short_count += len(data["too_short"])
            avg_like_frames += data["total_frames"]
            avg_like_sum += data["log_like"] * data["total_frames"]
            if "logdet_frames" in data:
                average_logdet_frames += data["logdet_frames"]
                average_logdet_sum += data["logdet"] * data["logdet_frames"]
        if not avg_like_frames:
            self.logger.warning(
                "No files were aligned, this likely indicates serious problems with the aligner."
            )
        else:
            if too_short_count:
                self.logger.debug(
                    f"There were {too_short_count} utterances that were too short to be aligned."
                )
            if beam_too_narrow_count:
                self.logger.debug(
                    f"There were {beam_too_narrow_count} utterances that could not be aligned with "
                    f"the current beam settings."
                )
            average_log_like = avg_like_sum / avg_like_frames
            if average_logdet_sum:
                average_log_like += average_logdet_sum / average_logdet_frames
            self.logger.debug(f"Average per frame likelihood for alignment: {average_log_like}")
        self.logger.debug(f"Compiling information took {time.time() - compile_info_begin}")
def compile_information ( self ) : compile_info_begin = time . time ( ) jobs = self . compile_information_arguments ( ) if self . use_mp : alignment_info = run_mp ( compile_information_func , jobs , self . working_log_directory , True ) else : alignment_info = run_non_mp ( compile_information_func , jobs , self . working_log_directory , True ) avg_like_sum = 0 avg_like_frames = 0 average_logdet_sum = 0 average_logdet_frames = 0 beam_too_narrow_count = 0 too_short_count = 0 for data in alignment_info . values ( ) : beam_too_narrow_count += len ( data [ "unaligned" ] ) too_short_count += len ( data [ "too_short" ] ) avg_like_frames += data [ "total_frames" ] avg_like_sum += data [ "log_like" ] * data [ "total_frames" ] if "logdet_frames" in data : average_logdet_frames += data [ "logdet_frames" ] average_logdet_sum += data [ "logdet" ] * data [ "logdet_frames" ] if not avg_like_frames : self . logger . warning ( "No files were aligned, this likely indicates serious problems with the aligner." ) else : if too_short_count : self . logger . debug ( f"There were {too_short_count} utterances that were too short to be aligned." ) if beam_too_narrow_count : self . logger . debug ( f"There were {beam_too_narrow_count} utterances that could not be aligned with " f"the current beam settings." ) average_log_like = avg_like_sum / avg_like_frames if average_logdet_sum : average_log_like += average_logdet_sum / average_logdet_frames self . logger . debug ( f"Average per frame likelihood for alignment: {average_log_like}" ) self . logger . debug ( f"Compiling information took {time.time() - compile_info_begin}" )
Compiles information about alignment, namely what the overall log-likelihood was
and how many files were unaligned.
Compiles information about alignment namely what the overall log - likelihood was and how many files were unaligned .
"""
        Compiles information about alignment, namely what the overall log-likelihood was
        and how many files were unaligned.

        See Also
        --------
        :func:`~montreal_forced_aligner.alignment.multiprocessing.compile_information_func`
            Multiprocessing helper function for each job
        :meth:`.AlignMixin.compile_information_arguments`
            Job method for generating arguments for the helper function
        """
self
func
`~montreal_forced_aligner.alignment.multiprocessing.compile_information_func`
Multiprocessing helper function for each job
` ~montreal_forced_aligner . alignment . multiprocessing . compile_information_func ` Multiprocessing helper function for each job
meth
`.AlignMixin.compile_information_arguments`
Job method for generating arguments for the helper function
` . AlignMixin . compile_information_arguments ` Job method for generating arguments for the helper function