deeppavlov.core.models

Abstract model classes and interfaces.

class deeppavlov.core.models.component.Component[source]

Abstract class for all callables that could be used in Chainer’s pipe.

class deeppavlov.core.models.serializable.Serializable(save_path: Union[str, pathlib.Path, None], load_path: Union[str, pathlib.Path, None] = None, mode: str = 'infer', *args, **kwargs)[source]

deeppavlov.models.model.serializable.Serializable is an abstract base class that expresses the interface for all models that can serialize data to a path.

class deeppavlov.core.models.estimator.Estimator(save_path: Union[str, pathlib.Path, None], load_path: Union[str, pathlib.Path, None] = None, mode: str = 'infer', *args, **kwargs)[source]

Abstract class for components that could be fitted on the data as a whole.

class deeppavlov.core.models.nn_model.NNModel(save_path: Union[str, pathlib.Path, None], load_path: Union[str, pathlib.Path, None] = None, mode: str = 'infer', *args, **kwargs)[source]

Abstract class for deep learning components.

class deeppavlov.core.models.tf_backend.TfModelMeta[source]

Metaclass that helps all child classes to have their own graph and session.

class deeppavlov.core.models.tf_model.TFModel(*args, **kwargs)[source]

Parent class for all components using TensorFlow.

class deeppavlov.core.models.keras_model.KerasModel(**kwargs)[source]

Builds Keras model with TensorFlow backend.

epochs_done

number of epochs that were done

batches_seen

number of epochs that were seen

train_examples_seen

number of training samples that were seen

sess

tf session

class deeppavlov.core.models.keras_model.KerasWrapper(cls: type, save_path: Optional[str] = None, load_path: Optional[str] = None, mode: str = None, **kwargs)[source]

A wrapper over external Keras models. It is used, for example, to wrap CharacterTagger. A subclass of KerasModel

cls

the class to be wrapped

save_path

the path where model is saved

load_path

the path from where model is loaded

mode

usage mode

**kwargs

a dictionary containing model parameters specified in the main part of json config that corresponds to the model