lazy_text_classifiers.model_wrappers package#

Submodules#

lazy_text_classifiers.model_wrappers.estimator_base module#

class lazy_text_classifiers.model_wrappers.estimator_base.EstimatorBase[source]#

Bases: ABC

Base class for estimators.

abstract fit(x: Collection[str], y: Collection[str]) EstimatorBase[source]#

Fit the estimator.

Parameters:
x: Collection[str]

The training data.

y: Collection[str]

The testing data.

Returns:
“EstimatorBase”

The estimator.

abstract predict(x: Collection[str]) Collection[str][source]#

Predict the values using the fitted estimator.

Parameters:
x: Collection[str]

The data to predict.

Returns:
Collection[str]

The predictions.

lazy_text_classifiers.model_wrappers.fine_tuned_transformer module#

class lazy_text_classifiers.model_wrappers.fine_tuned_transformer.TransformerEstimator(base_model: str = 'distilbert-base-uncased', training_args: TrainingArguments | None = None, eval_size: float = 0.2, output_dir: Path | str | None = None, verbose: bool = False, **kwargs: dict[str, Any])[source]#

Bases: EstimatorBase

fit(x: Collection[str], y: Collection[str]) TransformerEstimator[source]#

Fit the estimator.

Parameters:
x: Collection[str]

The training data.

y: Collection[str]

The testing data.

Returns:
“TransformerEstimator”

The estimator.

predict(x: Collection[str]) Collection[str][source]#

Predict the values using the fitted estimator.

Parameters:
x: Collection[str]

The data to predict.

Returns:
Collection[str]

The predictions.

trainer: Trainer | None = None#

lazy_text_classifiers.model_wrappers.semantic_logit module#

lazy_text_classifiers.model_wrappers.setfit_transformer module#

class lazy_text_classifiers.model_wrappers.setfit_transformer.TransformerEstimator(base_model: str = 'distilbert-base-uncased', training_args: dict[str, Any] | None = None, eval_size: float = 0.2, output_dir: Path | str | None = None, verbose: bool = False, **kwargs: dict[str, Any])[source]#

Bases: EstimatorBase

fit(x: Collection[str], y: Collection[str]) TransformerEstimator[source]#

Fit the estimator.

Parameters:
x: Collection[str]

The training data.

y: Collection[str]

The testing data.

Returns:
“TransformerEstimator”

The estimator.

predict(x: Collection[str]) Collection[str][source]#

Predict the values using the fitted estimator.

Parameters:
x: Collection[str]

The data to predict.

Returns:
Collection[str]

The predictions.

trainer: SetFitTrainer | None = None#

lazy_text_classifiers.model_wrappers.tfidf_logit module#

Module contents#

Various model wrappers.