activities
latest
false
Document Understanding Activities
Last updated Aug 30, 2024

Classify Document

UiPath.IntelligentOCR.StudioWeb.Activities.ClassifyDocument

Description

You can use this activity to classify documents, by selecting a desired classifier, and a document that you would like to classify.

Note: The Classify Document activity uses public endpoints.

The supported languages for the generative models are the same as the used OCR engine used. For more information, check the OCR Supported languages page.

Unless this activity is the first Document Understanding activity part of a Studio workflow, the input should be Document Data. File should only be used as input if the activity is the first Document Understanding one part of a Studio workflow.

Project compatibility

Cross-platform

Configuration

Properties

  • Project - Requires you to select your Document Understanding project from the drop-down menu. The available options are:
    • Predefined - The default project type
    • You can create a new project by clicking the + icon.
  • Classifier - Requires you to select your Document Understanding classifier from the drop-down menu.
    Note: The data sent to the Generative Classifier will be sent to an LLM Model instance which is not publicly available, will not leave it, and once processed, it will not be stored or used for training.
    • Predefined - The default project type
    • Generative Classifier - The generative classifier type
      • Prompt - Prompt to identify Document Types, provided as key-value pairs, where the key represents the name of the Document Type and the value a description for it, helping the classifier identify such documents.
        • Document Type - Provide the name of the document type to be used as classification result (30-character limit).
        • Generative prompt - Requires you to provide the prompt as input for the Generative Classifier. The maximum number of characters allowed is 1000.
  • Input - Provide the input file or the Document Data object.
    Important: The maximum numbers of pages a file can have is 500. Files exceeding this limit fail to be classified.
    Tip: When your files aren't stored as an IResource type variable, there's an option to perform a conversion. Use LocalResource.FromPath(<reference_to_the_file>) in the Input property field for this.
    Consider a scenario where you are iterating through a list of files using a For Each activity. Suppose currentItem is your iterating variable. To convert currentItem into IResource, paste LocalResource.FromPath(currentItem) into the Input field.

Advanced Options

  • Minimum confidence - Specify the minimum confidence threshold based on which a document type is assigned during classification. If a document's confidence score falls below this threshold, its Document Type is reported as "unknown".
    Tip: Most document types generate a prediction with a confidence level. Setting this property prevents false positives by only considering the predictions with a confidence level above the threshold. You can identify an optimal confidence level by testing various documents within your workflow, recording the results in an Excel spreadsheet, for example, and then analyze what threshold value is the most accurate.

Input

  • Timeout (seconds) - Maximum execution time (in seconds) for the call to the generative model. If the operation exceeds this timeout, it is automatically terminated to prevent delays or hangs. This property is only displayed if the Generative Classifier is selected as a classifier.

Output

  • Document Data - All the validated extracted field data from the file.

Using the generative classifier

To quickly get started with the generative capabilities of the Classify Document activity, perform the following steps:

  1. Add a Classify Document activity
  2. From the Project dropdown list, select Predefined.
  3. For Classifier, select Generative Classifier.

    The Prompt property appears in the body of the activity.

  4. In the Prompt field, provide your instructions as Dictionary key-value pairs, where:
    • Key represents the Document Type (example: CV).
    • Value represents the Generative prompt: The description used by the generative classifier to identify the document types.

      For example, check the following table for a sample of key-value pairs:

      Table 1. Key-value pairs used as a prompt for the generative classifier
      Document typeGenerative prompt
      CV"Find common CV keywords such as "Education", "Skills", and "Experience"."
      Invoice"Find common field names such as "Invoice number" "Bill to" or "Total Amount"."
    Figure 1. Key-value pairs used as a prompt for the generative classifier

    Key-value pairs used as a prompt for the generative classifier

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.