montreal_forced_aligner/transcription/transcriber.py
def _load_transcripts(self):
        """Load transcripts from Kaldi temporary files"""
        for score_args in self.score_arguments():
            for tra_path in score_args.tra_paths.values():

                with open(tra_path, "r", encoding="utf8") as f:
                    for line in f:
                        t = line.strip().split(" ")
                        utt = t[0]
                        utterance = self.utterances[utt]
                        speaker = utterance.speaker
                        lookup = speaker.dictionary.reversed_word_mapping
                        ints = t[1:]
                        if not ints:
                            continue
                        transcription = []
                        for i in ints:
                            transcription.append(lookup[int(i)])
                        utterance.transcription_text = " ".join(transcription)
Load transcripts from Kaldi temporary files
Load transcripts from Kaldi temporary files
Load transcripts from Kaldi temporary files
def _load_transcripts(self):
        for score_args in self.score_arguments():
            for tra_path in score_args.tra_paths.values():
                with open(tra_path, "r", encoding="utf8") as f:
                    for line in f:
                        t = line.strip().split(" ")
                        utt = t[0]
                        utterance = self.utterances[utt]
                        speaker = utterance.speaker
                        lookup = speaker.dictionary.reversed_word_mapping
                        ints = t[1:]
                        if not ints:
                            continue
                        transcription = []
                        for i in ints:
                            transcription.append(lookup[int(i)])
                        utterance.transcription_text = " ".join(transcription)
def _load_transcripts ( self ) : for score_args in self . score_arguments ( ) : for tra_path in score_args . tra_paths . values ( ) : with open ( tra_path , "r" , encoding = "utf8" ) as f : for line in f : t = line . strip ( ) . split ( " " ) utt = t [ 0 ] utterance = self . utterances [ utt ] speaker = utterance . speaker lookup = speaker . dictionary . reversed_word_mapping ints = t [ 1 : ] if not ints : continue transcription = [ ] for i in ints : transcription . append ( lookup [ int ( i ) ] ) utterance . transcription_text = " " . join ( transcription )
Load transcripts from Kaldi temporary files
Load transcripts from Kaldi temporary files
"""Load transcripts from Kaldi temporary files"""
self