Hugging Face Text Classification
This action can be executed on data object level lets you automatically send predefined template to a configurable Hugging Face endpoint to classify the data object. There are different variants to configure the classification.
Available Context
For more information on context limitations refer to the Available Context section.
Multiselect: Yes Elements: Data Objects
Classification Variants
Apply classification on a select or multiselect field
Configuration Options
This action can be executed on data object level lets you automatically send predefined template to a configurable Hugging Face endpoint to classify the data object. This variant of the action can be used to classify the data object based on the values of a select or multiselect field.
To get the best results, you should use your own predefined model for this action. In comparison to the 'Hugging Face Zero Shot Text Classification', there is no need to include the possible results in the request as they are already predefined. This also leads to the omission of the limitation of possible results.
The configuration options for this variant are as follows:
template: "{{ subject.name }} is a {{ subject.type }} of {{ subject.color|join(', ') }} color."
select_attribute_field: brand
replace_existing_selection: true
minimum_confidence: 0.8
model_endpoint: 'https://your-hugging-face.huggingface.cloud/'
Detailed Configuration Options
template
: Required string. A Twig template string that defines the input to be sent to the AI model. All attributes of the data object can be used in the template using thesubject
variable.select_attribute_field
: Required string. The name of the select or multiselect field to be used for classification.replace_existing_selection
: Type: Boolean. Default:false
. If true, existing selection will be replaced with the new ones. This only applies to multiselect fields.minimum_confidence
: Type: Float. Default:0.8
. The minimum confidence for a selection to be added to the data object.model_endpoint
: Type: String. Endpoint url of the Hugging Face model to use.
Apply classification on the pimcore tags
Configuration Options
This action can be executed on data object level lets you automatically send predefined template to a configurable Hugging Face endpoint to classify the data object. This variant of the action can be used to classify the data object based on Pimcore Tags.
To get the best results, you should use your own predefined model for this action. In comparison to the 'Hugging Face Zero Shot Text Classification', there is no need to include the possible results in the request as they are already predefined. This also leads to the omission of the limitation of possible results.
The configuration options for this variant are as follows:
template: "{{ subject.name }} is a {{ subject.type }} of {{ subject.color|join(', ') }} color."
replace_existing_tags: true
tag_root_node: 0
tag_only_leaf_nodes: true
minimum_confidence: 0.8
model_endpoint: 'https://your-hugging-face.huggingface.cloud/'
Detailed Configuration Options
template
: Required string. A Twig template string that defines the input to be sent to the AI model. All attributes of the data object can be used in the template using thesubject
variable.replace_existing_tag
: Type: Boolean. Default:false
. If true, existing tags will be replaced with the new ones.minimum_confidence
: Type: Float. Default:0.8
. The minimum confidence for a tag to be added to the data object.tag_root_node
: Type: Integer. Default:0
. The root node of the tag to be used for classification.tag_only_leaf_nodes
: Type: Boolean. Default:true
. If true, only the leaf nodes of the tag will be used for classification.model_endpoint
: Type: String. Endpoint url of the Hugging Face model to use.