Skip to main content

Artifacts

Artifacts are data are used by models to operate. Currently, the only supported artifact is the ClassHierarchy artifact which is used for hierarchy classification.

Create a classification hierarchy

from truestate.artifacts.classification import Category, ClassHierarchy

hierarchy = ClassHierarchy(
name="my_hierarchy_create_classification_class",
choices=[
Category(
label="marketing",
criteria="This company is a marketing company",
subcategories=[
Category(
label="digital_marketing",
criteria="This company is a digital marketing company",
),
Category(
label="traditional_marketing",
criteria="This company is a traditional marketing company (e.g. out of home, print, etc.)",
),
],
),
Category(label="oil_gas", criteria="This company is an oil & gas company"),
Category(label="finance", criteria="This company is a finance company"),
],
)