FieldLabel.confidence
The content in this help topic pertains to SuiteScript 2.1.
|
Property Description |
The confidence level for the field label. This property is a number between 0 and 1 indicating how confident the service is in the accuracy of the extracted name (FieldLabel.name) for the field label. For example, a confidence value of 0.95 means that the service is 95% confident about the extracted name. You can use the confidence level to set a threshold for accepting the extracted name in your scripts. For example, to minimize the risk of errors, you could choose to accept only names 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 |
|
|
Parent Object |
|
|
Sibling Object Members |
|
|
Since |
2025.2 |
Errors
|
Error Code |
Thrown If |
|---|---|
|
|
You try to set the value of this property. |
Syntax
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_tax_form.pdf"),
documentType: documentCapture.DocumentType.TAX_FORM,
features: [documentCapture.Feature.FIELD_EXTRACTION]
});
const fieldLabelToProcess = extractedData.pages[0].fields[0].label;
if (fieldLabelToProcess.confidence > 0.9) {
// Accept the field name
} else {
// Reject the field name
}
...
// Add additional code