Word.confidence
The content in this help topic pertains to SuiteScript 2.1.
|
Property Description |
The confidence level for the word. This property is a number between 0 and 1 indicating how confident the service is in the accuracy of the extracted text (Word.text) of the word. 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 word in your scripts. For example, to minimize the risk of errors, you could choose to accept only words 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_parking_application.pdf"),
documentType: documentCapture.DocumentType.OTHERS,
features: [documentCapture.Feature.TEXT_EXTRACTION]
});
const wordToProcess = extractedData.pages[0].words[0];
if (wordToProcess.confidence > 0.9) {
// Accept the word
} else {
// Reject the word
}
...
// Add additional code