templates.ModelBasedTemplateSchema
- class templates.ModelBasedTemplateSchema(*args, **kwargs)
Model Based template
- Parameters:
include_fields (List[str]) – The fields to include in the model featurization.
target_field (str) – The field containing the model predictions.
model_type (str) –
- 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_name (str) – A user specified string name given to the trained model.
value (int) – The class index this LF should vote for.
dirpath (str) – The path to the stored model in minio.
threshold (float) – The confidence threshold below which this LF should abstain.
unique_model_name (Optional[str] = None) – A unique name for the model, usually the same as dirpath.
is_multilabel (bool = False) – Whether or not the task this LF is being applied to is multi-label
multilabel_absent_as_abstain (bool = True) – If this is a multi-label task, True if we should replace “absent” votes output by the model with “abstain” votes
- 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
]