autointent.modules.base.BaseModule#
- class autointent.modules.base.BaseModule#
Bases:
abc.ABC
Base module for all intent classification modules.
- abstract fit(*args, **kwargs)#
Fit the model.
- score(context, metrics)#
Calculate metric on test set and return metric value.
- Parameters:
context (autointent.context.Context) – Context to score
- Raises:
ValueError – If unknown scheme is provided
- Return type:
- abstract score_cv(context, metrics)#
- abstract score_ho(context, metrics)#
- abstract get_assets()#
Return useful assets that represent intermediate data into context.
- Returns:
Artifact containing intermediate data
- Return type:
- abstract clear_cache()#
Clear cache.
- Return type:
None
- dump(path)#
Dump all data needed for inference.
- Parameters:
path (str) – Path to dump
- Return type:
None
- load(path, embedder_config=None, cross_encoder_config=None)#
Load data from file system.
- Parameters:
path (str) – 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:
None
- abstract predict(*args, **kwargs)#
Predict on the input.
- predict_with_metadata(*args, **kwargs)#
Predict on the input with metadata.
- classmethod from_context(context, **kwargs)#
- Abstractmethod:
- Parameters:
context (autointent.context.Context)
- Return type:
Initialize self from context.
- Parameters:
context (autointent.context.Context) – Context to init from
- Returns:
Initialized module
- Return type:
- static score_metrics_ho(params, metrics_dict)#
Score metrics on the test set.