egrecho.core.feature_extractor#

class egrecho.core.feature_extractor.BaseFeature(**kwargs)[source]#

Bases: ConfigFileMixin, SaveLoadMixin

A base class offers serialize methods for feature extractor.

The implementation of the extraction method is intended for derived classes. Its purpose is to align with open-source pretrained models and facilitate coordination between model inputs and the frontend data processor. Consequently, it is a simplified adaptation of the feature_extractor module in huggingface extractor.

__init__(**kwargs)[source]#

Set elements of kwargs as attributes.

classmethod from_dict(feature_extractor_dict, **kwargs)[source]#

Instantiates a feature extractor from a Python dictionary of parameters.

Parameters:
  • feature_extractor_dict (Dict[str, Any]) -- Dictionary that will be used to instantiate the feature extractor object.

  • **kwargs -- overwrite kwargs.

Return type:

BaseFeature

Returns:

The instantiated feature extractor object.

to_dict()[source]#

Serializes this instance to a Python dictionary.

Return type:

Dict[str, Any]

Returns:

Dict[str, Any].

classmethod get_extractor_dict(path, **kwargs)[source]#

Get config file from dir/file path.