Line.confidence

Note:

The content in this help topic pertains to SuiteScript 2.1.

Property Description

The confidence level for the line.

This property is a number between 0 and 1 indicating how confident the service is in the accuracy of the extracted text (Line.text) of the line. For example, a confidence value of 0.95 means that the service is 95% confident about the extracted text.

You can use the confidence level to set a threshold for accepting the extracted line in your scripts. For example, to minimize the risk of errors, you could choose to accept only lines with a confidence level above 0.9 (or 90%).

Type

number

Supported Script Types

Server scripts

For more information, see SuiteScript 2.x Script Types.

Module

N/documentCapture Module

Parent Object

documentCapture.Line

Sibling Object Members

Line Object Members

Since

2025.2

Errors

Error Code

Thrown If

READ_ONLY

You try to set the value of this property.

Syntax

Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/documentCapture Module Script Samples.

            // Add additional code
...

const extractedData = documentCapture.documentToStructure({
    file: file.load("SuiteScripts/sample_parking_application.pdf"),
    documentType: documentCapture.DocumentType.OTHERS,
    features: [documentCapture.Feature.TEXT_EXTRACTION]
});

const lineToProcess = extractedData.pages[0].lines[0];

if (lineToProcess.confidence > 0.9) {
    // Accept the line
} else {
    // Reject the line
}

...
// Add additional code 

          

General Notices