Slug: metadata-to-label Version: 1.0.0 Infer: Yes

Overview

Metadata to Label Model

This model converts document metadata properties into document labels based on configurable rules. It examines metadata values, evaluates conditions, and applies labels when conditions are met.

How It Works

  1. The model examines the document’s metadata for specified properties
  2. For each property found, it evaluates a condition using the property’s value
  3. If the condition evaluates to true, it applies the corresponding label to the document

Options Configuration

OptionDescription
propertiesList of property-to-label conversion rules, each containing a name, expression, and label

Each property configuration requires:

  • name: The metadata property name to check
  • expression: A condition using value as the property value
  • label: The label to apply when the condition is true

Expression Syntax

The expression field supports simple conditional expressions with the following capabilities:

  • Basic comparisons: ==, !=, >, <, >=, <=
  • Logical operators: and, or, not
  • String checks: value == 'text', 'text' in value
  • Case-insensitive checks: value.lower() == 'text'
  • Existence checks: value is not None

The keyword value always represents the current metadata property’s value.

Process Flow

Example Configurations

Flag Unpublishable Documents

properties:
  - name: ShouldPublish
    expression: value == 'False' or value == 'false'
    label: DO_NOT_PUBLISH

Label Documents by Department

properties:
  - name: Department
    expression: value == 'Finance'
    label: FINANCE
  - name: Department
    expression: value == 'HR'
    label: HUMAN_RESOURCES

Flag Priority Documents

properties:
  - name: Priority
    expression: value > 8
    label: HIGH_PRIORITY

Use Cases

This model is particularly useful for:

  • Converting external system metadata into Kodexa document labels
  • Creating document filtering and routing rules based on metadata
  • Implementing conditional workflows based on document properties
  • Integrating with systems that use metadata rather than labels
  • Simplifying document classification based on existing metadata

Since the model uses simple evaluation of expressions, it provides a lightweight way to implement business rules without complex coding.

name: dont_publish property: ShouldPublishXml expression: value == ‘False’ or value == ‘false’


Inference Options

The following options can be configured when using this model for inference:

NameLabelTypeDescriptionDefaultRequired
propertiesPropertieslistN/A-No

Model Details

  • Provider: Kodexa AI