montreal_forced_aligner/transcription/transcriber.py
def parse_parameters(
        cls,
        config_path: Optional[str] = None,
        args: Optional[Namespace] = None,
        unknown_args: Optional[List[str]] = None,
    ) -> MetaDict:
        """
        Parse configuration parameters from a config file and command line arguments

        Parameters
        ----------
        config_path: str, optional
            Path to yaml configuration file
        args: :class:`~argparse.Namespace`, optional
            Arguments parsed by argparse
        unknown_args: list[str], optional
            List of unknown arguments from argparse

        Returns
        -------
        dict[str, Any]
            Dictionary of specified configuration parameters
        """
        global_params = {}
        if config_path and os.path.exists(config_path):
            with open(config_path, "r", encoding="utf8") as f:
                data = yaml.load(f, Loader=yaml.SafeLoader)
                data = parse_old_features(data)
                for k, v in data.items():
                    if k == "features":
                        global_params.update(v)
                    else:
                        if v is None and k in {
                            "punctuation",
                            "compound_markers",
                            "clitic_markers",
                        }:
                            v = []
                        global_params[k] = v
        global_params.update(cls.parse_args(args, unknown_args))
        return global_params

        Parse configuration parameters from a config file and command line arguments

        Parameters
        ----------
        config_path: str, optional
            Path to yaml configuration file
        args: :class:`~argparse.Namespace`, optional
            Arguments parsed by argparse
        unknown_args: list[str], optional
            List of unknown arguments from argparse

        Returns
        -------
        dict[str, Any]
            Dictionary of specified configuration parameters
        
Parse configuration parameters from a config file and command line arguments
Parameters

str, optional
Path to yaml configuration file
args: :class:`~argparse.Namespace`, optional
Arguments parsed by argparse
unknown_args: list[str], optional
List of unknown arguments from argparse

Returns

dict[str, Any]
Dictionary of specified configuration parameters
Parse configuration parameters from a config file and command line arguments Parameters str optional Path to yaml configuration file args : : class : ` ~argparse . Namespace ` optional Arguments parsed by argparse unknown_args : list [ str ] optional List of unknown arguments from argparse Returns dict [ str Any ] Dictionary of specified configuration parameters
def parse_parameters(
        cls,
        config_path: Optional[str] = None,
        args: Optional[Namespace] = None,
        unknown_args: Optional[List[str]] = None,
    ) -> MetaDict:
        global_params = {}
        if config_path and os.path.exists(config_path):
            with open(config_path, "r", encoding="utf8") as f:
                data = yaml.load(f, Loader=yaml.SafeLoader)
                data = parse_old_features(data)
                for k, v in data.items():
                    if k == "features":
                        global_params.update(v)
                    else:
                        if v is None and k in {
                            "punctuation",
                            "compound_markers",
                            "clitic_markers",
                        }:
                            v = []
                        global_params[k] = v
        global_params.update(cls.parse_args(args, unknown_args))
        return global_params
def parse_parameters ( cls , config_path : Optional [ str ] = None , args : Optional [ Namespace ] = None , unknown_args : Optional [ List [ str ] ] = None , ) -> MetaDict : global_params = { } if config_path and os . path . exists ( config_path ) : with open ( config_path , "r" , encoding = "utf8" ) as f : data = yaml . load ( f , Loader = yaml . SafeLoader ) data = parse_old_features ( data ) for k , v in data . items ( ) : if k == "features" : global_params . update ( v ) else : if v is None and k in { "punctuation" , "compound_markers" , "clitic_markers" , } : v = [ ] global_params [ k ] = v global_params . update ( cls . parse_args ( args , unknown_args ) ) return global_params
Parse configuration parameters from a config file and command line arguments
Parameters
Parse configuration parameters from a config file and command line arguments Parameters
"""
        Parse configuration parameters from a config file and command line arguments

        Parameters
        ----------
        config_path: str, optional
            Path to yaml configuration file
        args: :class:`~argparse.Namespace`, optional
            Arguments parsed by argparse
        unknown_args: list[str], optional
            List of unknown arguments from argparse

        Returns
        -------
        dict[str, Any]
            Dictionary of specified configuration parameters
        """
cls
config_path
Optional[str]
args
Optional[Namespace]
unknown_args
Optional[List[str]]