core.commands

Basic training and inference functions.

deeppavlov.core.commands.infer.build_agent_from_config(config_path: str) → deeppavlov.core.agent.agent.Agent[source]

Build and return the agent described in corresponding configuration file.

deeppavlov.core.commands.infer.build_model_from_config(config: [<class 'str'>, <class 'pathlib.Path'>, <class 'dict'>], mode: str = 'infer', load_trained: bool = False, as_component: bool = False) → deeppavlov.core.common.chainer.Chainer[source]

Build and return the model described in corresponding configuration file.

deeppavlov.core.commands.infer.interact_agent(config_path: str) → None[source]

Start interaction with the agent described in corresponding configuration file.

deeppavlov.core.commands.infer.interact_model(config_path: str) → None[source]

Start interaction with the model described in corresponding configuration file.

deeppavlov.core.commands.infer.predict_on_stream(config_path: str, batch_size: int = 1, file_path: Optional[str] = None) → None[source]

Make a prediction with the component described in corresponding configuration file.

deeppavlov.core.commands.train.fit_chainer(config: dict, iterator: Union[deeppavlov.core.data.data_learning_iterator.DataLearningIterator, deeppavlov.core.data.data_fitting_iterator.DataFittingIterator]) → deeppavlov.core.common.chainer.Chainer[source]

Fit and return the chainer described in corresponding configuration dictionary.

deeppavlov.core.commands.train.prettify_metrics(metrics: dict, precision: int = 4) → collections.OrderedDict[source]

Prettifies the dictionary of metrics.

deeppavlov.core.commands.train.train_evaluate_model_from_config(config: [<class 'str'>, <class 'pathlib.Path'>, <class 'dict'>], to_train: bool = True, to_validate: bool = True) → None[source]

Make training and evaluation of the model described in corresponding configuration file.