autointent.Pipeline#
- class autointent.Pipeline(nodes, seed=42)#
Pipeline optimizer class.
See tutorial on AutoML features of AutoIntent in User Guides.
- Parameters:
nodes (list[autointent.nodes.NodeOptimizer] | list[autointent.nodes.InferenceNode])
seed (int | None)
- nodes#
- set_config(config)#
Set the configuration for the pipeline.
- Parameters:
config (autointent.configs.LoggingConfig | autointent.configs.EmbedderConfig | autointent.configs.CrossEncoderConfig | autointent.configs.DataConfig | autointent.configs.HFModelConfig | autointent.configs.HPOConfig | autointent.configs.VectorIndexConfig) – Configuration object.
- Return type:
None
- classmethod from_search_space(search_space, seed=42)#
Instantiate pipeline optimizer from given search space.
- classmethod from_preset(name, seed=42)#
Instantiate pipeline optimizer from a preset.
- classmethod from_optimization_config(config)#
Create pipeline optimizer from optimization config.
- Parameters:
config (dict[str, Any] | pathlib.Path | str | autointent.OptimizationConfig) – dictionary or a path to yaml file.
- Return type:
- fit(dataset, refit_after=False, incompatible_search_space='filter', preflight='off')#
Optimize the pipeline from dataset.
- Parameters:
dataset (autointent.Dataset) – dataset for optimization.
refit_after (bool) – whether to refit on whole data after optimization. Valid only for hold-out validaiton.
incompatible_search_space (autointent.custom_types.SearchSpaceValidationMode) – how to handle data-incompatible modules occurring in search space.
preflight (PreflightMode) – experimental gate that runs
autointent.advisor.run_preflight()over the pipeline’s effective config + dataset before any heavy work."off"(default) skips it entirely."warn"logs findings — INFO for AMPLE, WARNING for TIGHT, ERROR for OVER — but never raises; note it probes the HF Hub for model metadata, so it adds network round-trips."strict"additionally raisesautointent.advisor.PreflightErrorwhen any finding has severity OVER, so unfeasible runs abort before fit.
- Raises:
RuntimeError – If pipeline is in inference mode.
PreflightError – If
preflight="strict"and any OVER finding is produced.
- Return type:
- dump(path=None)#
Dump pipeline to disk.
One can reuse it for inference later with
autointent.Pipeline.load().- Parameters:
path (str | pathlib.Path | None)
- Return type:
None
- validate_modules(dataset, mode)#
Validate modules with dataset.
- Parameters:
dataset (autointent.Dataset) – Dataset for validation.
mode (autointent.custom_types.SearchSpaceValidationMode) – Validation mode.
- Return type:
None
- classmethod from_config(nodes_configs)#
Create inference pipeline from config.
- Parameters:
nodes_configs (list[autointent.configs.InferenceNodeConfig]) – list of config for nodes
- Return type:
- classmethod load(path, embedder_config=None, cross_encoder_config=None)#
Load pipeline in inference mode.
- Parameters:
path (str | pathlib.Path) – Path to load
embedder_config (autointent.configs.EmbedderConfig | None) – one can override presaved settings
cross_encoder_config (autointent.configs.CrossEncoderConfig | None) – one can override presaved settings
- Return type:
- predict(utterances)#
Predict the labels for the utterances.