snorkelflow_extensions.taxonomy_distillation.entities.Property
- class snorkelflow_extensions.taxonomy_distillation.entities.Property(name: str, definition: str, categories: Dict[str, Taxonomy])
Bases:
object
A classification dimension within a hierarchical taxonomy.
Properties represent categorical dimensions used for text classification. Each property contains multiple categories (represented as
Taxonomy
objects) that text can be classified into. Properties enable the creation of multi-dimensional classification systems where text is evaluated across multiple categorical dimensions simultaneously.Properties are fundamental building blocks for hierarchical taxonomies, allowing classification to proceed from general categories to increasingly specific subcategories within each dimensional aspect.
Methods
__init__
(name, definition, categories)parse_multiple_from_str
(properties_str)Create Property objects from structured text input. Attributes
name
definition
categories
- categories: Dict[str, Taxonomy]
- definition: str
- name: str
- classmethod parse_multiple_from_str(properties_str: str) List[Property]
Create Property objects from structured text input.
Parses a multi-property string format into individual
Property
instances. Each property section contains a name, definition, and associated categories. This method is commonly used to process output from language models during taxonomy generation workflows.Input format requirements:
---
** PROPERTY NAME **
Definition: Property definition.
** CATEGORY NAME ** Category description.
** CATEGORY NAME ** Category description.
---Parameters
Parameters
Returns
Returns
List of Property objects parsed from the input string.
Return type
Return type
list of Property
Name Type Default Info properties_str str
Multi-property text string following the required format with triple-dash section separators and double-asterisk delimited names.
parse\_multiple\_from\_str
parse_multiple_from_str