FieldLabel Object Members for Document Processing in SuiteScript
FieldLabel Object enhances document processing with confidence and name properties in SuiteScript 2.1.
TL;DR Opening
The FieldLabel Object in SuiteScript 2.1 introduces two key properties: confidence and name, which facilitate the reliable extraction of field labels from documents. Utilizing these properties can greatly improve the accuracy of automated document processing in your scripts.
What are FieldLabel Object Members?
The FieldLabel object encompasses essential properties used in server scripts to evaluate and handle field labels derived from documents processed through the document capture functionality. The two main properties of the FieldLabel object are:
FieldLabel Properties
| Property | Type | Description |
|---|---|---|
FieldLabel.confidence | number | Indicates the confidence level of the field label extracted from a document. Range is between 0 (no confidence) to 1 (full confidence). |
FieldLabel.name | string | Contains the extracted name of the field label. |
Understanding the Confidence Level
The confidence property is a numerical indicator (between 0 and 1) that reflects how accurate the system believes the extracted name is. For example:
- A confidence of
0.95signifies a 95% certainty in the accuracy of thename. - This value can guide script decisions; set a threshold (like
0.90) to only accept highly confident name extractions, thus reducing potential errors.
Example Syntax
Below is a sample code snippet demonstrating how to utilize the FieldLabel object properties in SuiteScript:
1// Add additional code2...3 4const extractedData = documentCapture.documentToStructure({5 file: file.load("SuiteScripts/sample_tax_form.pdf"),6 documentType: documentCapture.DocumentType.TAX_FORM,7 features: [documentCapture.Feature.FIELD_EXTRACTION]8});9 10const fieldLabelToProcess = extractedData.pages[0].fields[0].label;11 12if (fieldLabelToProcess.confidence > 0.9) {13 // Accept the field name14} else {15 // Reject the field name16}17 18...19// Add additional codeImportant Errors
When working with FieldLabel object members, note that attempting to set the value for the properties will throw a READ_ONLY error. This indicates that the properties can only be accessed but not modified.
Who This Affects
- Developers: Utilize these properties for enhanced document processing capabilities in server scripts.
- Administrators: Manage and oversee implementations that involve document capture and processing.
Key Takeaways
- The FieldLabel object improves document processing accuracy through
confidenceandnameproperties. - Employ confidence levels to filter and validate extracted names effectively.
- Scripts must handle
READ_ONLYerrors when managing FieldLabel properties.
Frequently Asked Questions (4)
Does the FieldLabel object apply to both WMS and standard NetSuite?
How do I check the confidence level of an extracted field label?
What happens if I try to modify the properties of a FieldLabel object?
Is there a recommended threshold for the confidence property when processing field labels?
Was this article helpful?
More in Platform
- Edit Extension Manifest for SuiteScript in NetSuite 2023.2
Learn how to manually edit the extension manifest.json file in NetSuite SuiteScript and safeguard your changes.
- RecordType Property for SuiteQL Metadata Retrieval in NetSuite
RecordType property retrieves metadata for SuiteQL queries. Essential for fetching valid fields and relationships.
- Create Custom Module.ServiceController in NetSuite 2019.2
Create a Custom Module.ServiceController to handle HTTP requests in NetSuite 2019.2. Step 1: Create a Custom [Module].ServiceController
- Deploy and Local Distribution Directories in SuiteCommerce
Deploy and local distribution directories in SuiteCommerce manage file organization for deployments and local server setups effectively.
Advertising
Reach Platform Professionals
Put your product in front of NetSuite experts who work with Platform every day.
Sponsor This Category