Skip to main content
Version: 25.1

templates.ModelBasedTemplateSchema

class templates.ModelBasedTemplateSchema(*args, **kwargs)

Model Based template

Parameters

NameTypeDefaultInfo
include_fieldsList[str]The fields to include in the model featurization.
target_fieldstrThe field containing the model predictions.
model_typestr
The specific model used, must be contained in:

[“zsl_text_match”, “zsl_entailment”, “masked_lm”, “logistic_regression”, “one_class_svm”, “tfidf_logreg”, “setfit”, “sdnet”, “sequence_embedding”]

model_namestrA user specified string name given to the trained model.
valueintThe class index this LF should vote for.
dirpathstrThe path to the stored model in minio.
thresholdfloatThe confidence threshold below which this LF should abstain.
unique_model_nameOptional[str]NoneA unique name for the model, usually the same as dirpath.
is_multilabelboolFalseWhether or not the task this LF is being applied to is multi-label.
multilabel_absent_as_abstainboolTrueIf this is a multi-label task, True if we should replace “absent” votes output by the model with “abstain” votes.

artifact_config_keys

static artifact_config_keys()

The names of the fields in the template schema pydantic model that represent paths to files or directories that contain data which back the LF template. For example, paths to a dictionary on disk that’s used within an LF.

Return type

List[str]