Utils

Logging

class src.utils.logging.LoggingBase(config: LoggingConfig, logger_prefix: str = 'Main')[source]

Bases: object

Logging class with default setup for logging

Mlflow

src.utils.mlflow.get_unique_run_name(run_name: str) str[source]

Mflow unique helper :param run_name: :return:

Warnings

src.utils.warnings.deprecated(func)[source]

This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used.

Wrappers

src.utils.wrapper.entering(func)[source]

Pre function logging

src.utils.wrapper.exiting(func)[source]

Post function logging

src.utils.wrapper.wrap(pre: Callable, post: Callable)[source]

Wrapper

Zeroshot

class src.utils.zeroshot.ZeroshotMatching(model_id: str, taxonomy: Taxonomy, verbose: bool = False)[source]

Bases: object

Zeroshot wrapper model

_init_model()[source]

Model initialization :return:

_prep_taxonomy() None[source]

Formatting input taxonomy

:return:nothing

match(text: str)[source]

predicting with text input

Parameters:

text – input text to classify

Returns:

the classification response