L2 Hub
Pontus
analysis
Classifier

L2 Construct: classifier

classification

Description

The classifier L2 analyzes text input to determine its category based on a predefined set of categories. It leverages natural language processing techniques and pre-trained models to classify text into one of the specified categories. The L2 outputs the category that best matches the input text.

L2 Data

  1. Provider: pontus
  2. Module: analysis
  3. Action: classifier

Example Step

{
  "name": "insert-your-step-name",
  "type": "l2",
  "l2_data": {
    "provider": "pontus",
    "module": "analysis",
    "action": "classifier"
  }
}
 

Input

Example

{
  "categories": [
    {
      "name": "high-priority",
      "selection_criterion": "The email requires immediate attention."
    },
    {
      "name": "medium-priority",
      "selection_criterion": "The email requires attention soon but not urgently."
    },
    {
      "name": "low-priority",
      "selection_criterion": "The email does not require attention anytime soon."
    }
  ],
  "text": "Dear John,\n\n\tI hope this message finds you well.\n\n\tI wanted to inform you about an important team meeting scheduled for August 8th at 10:00 AM. Your presence and input are highly valued, and we would appreciate it if you could make every effort to attend. We will be discussing key updates and making decisions that require your expertise.\n\n\tPlease let me know if you have any questions or if there are any scheduling conflicts.\n\n\tThank you for your prompt attention to this matter.\n\n\tBest regards,\n\n\tJane Smith\n\tSenior Controller Manager\n\tjane.smith@example.com"
}
 

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pontus.bpa/pkgs/l2/pontus/analysis/classifier-input",
  "$ref": "#/$defs/ClassifierInput",
  "$defs": {
    "Category": {
      "properties": {
        "name": {
          "type": "string"
        },
        "selection_criterion": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["name", "selection_criterion"]
    },
    "ClassifierInput": {
      "properties": {
        "categories": {
          "items": {
            "$ref": "#/$defs/Category"
          },
          "type": "array"
        },
        "text": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["categories", "text"]
    }
  }
}
 

Output

Example

{
  "category": "high-priority"
}
 

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pontus.bpa/pkgs/l2/pontus/analysis/classifier-output",
  "$ref": "#/$defs/ClassifierOutput",
  "$defs": {
    "ClassifierOutput": {
      "properties": {
        "category": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["category"]
    }
  }
}