autointent.Pipeline#

class autointent.Pipeline(nodes)#

Pipeline optimizer class.

Parameters:

nodes (list[autointent.nodes.NodeOptimizer] | list[autointent.nodes.InferenceNode])

nodes#
set_config(config)#

Set configuration for the optimizer.

Parameters:

config (autointent.configs.LoggingConfig | autointent.configs.VectorIndexConfig | autointent.configs.EmbedderConfig) – Configuration

Return type:

None

classmethod from_search_space(search_space)#

Create pipeline optimizer from dictionary search space.

Parameters:

search_space (list[dict[str, Any]] | pathlib.Path | str) – Dictionary config

Return type:

Pipeline

classmethod default_optimizer(multilabel)#

Create pipeline optimizer with default search space for given classification task.

Parameters:

multilabel (bool) – Whether the task multi-label, or single-label.

Return type:

Pipeline

fit(dataset, force_multilabel=False)#

Optimize the pipeline from dataset.

Parameters:
  • dataset (autointent.Dataset) – Dataset for optimization

  • force_multilabel (bool) – Whether to force multilabel or not

Returns:

Context

Return type:

autointent.Context

classmethod from_dict_config(nodes_configs)#

Create inference pipeline from dictionary config.

Parameters:

nodes_configs (list[dict[str, Any]]) – list of dictionary config for nodes

Returns:

pipeline ready for inference

Return type:

Pipeline

classmethod from_config(nodes_configs)#

Create inference pipeline from config.

Parameters:

nodes_configs (list[autointent.configs.InferenceNodeConfig]) – list of config for nodes

Return type:

Pipeline

classmethod load(path)#

Load pipeline in inference mode.

This method loads fitted modules and tuned hyperparameters. :path: path to optimization run directory :return: initialized pipeline, ready for inference

Parameters:

path (str | pathlib.Path)

Return type:

Pipeline

predict(utterances)#

Predict the labels for the utterances.

Parameters:

utterances (list[str]) – list of utterances

Returns:

list of predicted labels

Return type:

numpy.typing.NDArray[Any]

predict_with_metadata(utterances)#

Predict the labels for the utterances with metadata.

Parameters:

utterances (list[str]) – list of utterances

Returns:

prediction output

Return type:

autointent._pipeline._schemas.InferencePipelineOutput