montreal_forced_aligner/corpus/acoustic_corpus.py
def construct_base_feature_string(self, all_feats: bool = False) -> str:
        """
        Construct the base feature string independent of job name

        Used in initialization of MonophoneTrainer (to get dimension size) and IvectorTrainer (uses all feats)

        Parameters
        ----------
        all_feats: bool
            Flag for whether all features across all jobs should be taken into account

        Returns
        -------
        str
            Base feature string
        """
        j = self.jobs[0]
        if all_feats:
            feat_path = os.path.join(self.base_data_directory, "feats.scp")
            utt2spk_path = os.path.join(self.base_data_directory, "utt2spk.scp")
            cmvn_path = os.path.join(self.base_data_directory, "cmvn.scp")
            feats = f"ark,s,cs:apply-cmvn --utt2spk=ark:{utt2spk_path} scp:{cmvn_path} scp:{feat_path} ark:- |"
            feats += " add-deltas ark:- ark:- |"
            return feats
        utt2spks = j.construct_path_dictionary(self.data_directory, "utt2spk", "scp")
        cmvns = j.construct_path_dictionary(self.data_directory, "cmvn", "scp")
        features = j.construct_path_dictionary(self.data_directory, "feats", "scp")
        for dict_name in j.current_dictionary_names:
            feat_path = features[dict_name]
            cmvn_path = cmvns[dict_name]
            utt2spk_path = utt2spks[dict_name]
            feats = f"ark,s,cs:apply-cmvn --utt2spk=ark:{utt2spk_path} scp:{cmvn_path} scp:{feat_path} ark:- |"
            if self.uses_deltas:
                feats += " add-deltas ark:- ark:- |"

            return feats

        Construct the base feature string independent of job name

        Used in initialization of MonophoneTrainer (to get dimension size) and IvectorTrainer (uses all feats)

        Parameters
        ----------
        all_feats: bool
            Flag for whether all features across all jobs should be taken into account

        Returns
        -------
        str
            Base feature string
        
Construct the base feature string independent of job name
Used in initialization of MonophoneTrainer (to get dimension size) and IvectorTrainer (uses all feats)

Parameters

bool
Flag for whether all features across all jobs should be taken into account

Returns

str
Base feature string
Construct the base feature string independent of job name Used in initialization of MonophoneTrainer ( to get dimension size ) and IvectorTrainer ( uses all feats ) Parameters bool Flag for whether all features across all jobs should be taken into account Returns str Base feature string
def construct_base_feature_string(self, all_feats: bool = False) -> str:
        j = self.jobs[0]
        if all_feats:
            feat_path = os.path.join(self.base_data_directory, "feats.scp")
            utt2spk_path = os.path.join(self.base_data_directory, "utt2spk.scp")
            cmvn_path = os.path.join(self.base_data_directory, "cmvn.scp")
            feats = f"ark,s,cs:apply-cmvn --utt2spk=ark:{utt2spk_path} scp:{cmvn_path} scp:{feat_path} ark:- |"
            feats += " add-deltas ark:- ark:- |"
            return feats
        utt2spks = j.construct_path_dictionary(self.data_directory, "utt2spk", "scp")
        cmvns = j.construct_path_dictionary(self.data_directory, "cmvn", "scp")
        features = j.construct_path_dictionary(self.data_directory, "feats", "scp")
        for dict_name in j.current_dictionary_names:
            feat_path = features[dict_name]
            cmvn_path = cmvns[dict_name]
            utt2spk_path = utt2spks[dict_name]
            feats = f"ark,s,cs:apply-cmvn --utt2spk=ark:{utt2spk_path} scp:{cmvn_path} scp:{feat_path} ark:- |"
            if self.uses_deltas:
                feats += " add-deltas ark:- ark:- |"
            return feats
def construct_base_feature_string ( self , all_feats : bool = False ) -> str : j = self . jobs [ 0 ] if all_feats : feat_path = os . path . join ( self . base_data_directory , "feats.scp" ) utt2spk_path = os . path . join ( self . base_data_directory , "utt2spk.scp" ) cmvn_path = os . path . join ( self . base_data_directory , "cmvn.scp" ) feats = f"ark,s,cs:apply-cmvn --utt2spk=ark:{utt2spk_path} scp:{cmvn_path} scp:{feat_path} ark:- |" feats += " add-deltas ark:- ark:- |" return feats utt2spks = j . construct_path_dictionary ( self . data_directory , "utt2spk" , "scp" ) cmvns = j . construct_path_dictionary ( self . data_directory , "cmvn" , "scp" ) features = j . construct_path_dictionary ( self . data_directory , "feats" , "scp" ) for dict_name in j . current_dictionary_names : feat_path = features [ dict_name ] cmvn_path = cmvns [ dict_name ] utt2spk_path = utt2spks [ dict_name ] feats = f"ark,s,cs:apply-cmvn --utt2spk=ark:{utt2spk_path} scp:{cmvn_path} scp:{feat_path} ark:- |" if self . uses_deltas : feats += " add-deltas ark:- ark:- |" return feats
Construct the base feature string independent of job name
Used in initialization of MonophoneTrainer (to get dimension size) and IvectorTrainer (uses all feats)
Construct the base feature string independent of job name Used in initialization of MonophoneTrainer ( to get dimension size ) and IvectorTrainer ( uses all feats )
"""
        Construct the base feature string independent of job name

        Used in initialization of MonophoneTrainer (to get dimension size) and IvectorTrainer (uses all feats)

        Parameters
        ----------
        all_feats: bool
            Flag for whether all features across all jobs should be taken into account

        Returns
        -------
        str
            Base feature string
        """
self
all_feats
bool