Nanonets API to get prediction results for all files uploaded to a model within a specified timeframe. This API delivers detailed outputs including the initial predictions, any modifications made to the files, and the final results for each file.
You can test this API on this page using the API key. First, generate the API key, enter the model_id
, start_day_interval
and current_batch_day
in the parameter boxes below. Once you have added all the parameters, hit the “Try It!” button on the right side panel to see the response in the response box on the right side panel.
Basic Structure:
- moderated_images_count (integer): Represents the total number of pages across all approved files. All these pages are included in the “moderated_images” array.
- unmoderated_images_count (integer): Represents the total number of pages across all files that are either rejected or not yet approved.
- moderated_images (array): This array contains information about the files and their pages that have been approved (moderated). Each object within the array represents a single page of a file. For example, if you have three approved files, each with two pages, this array will contain six objects.
- unmoderated_images (array): This array includes details of the files and their pages that are either pending approval or have been rejected (unmoderated). Each object in the array corresponds to a page of a file. For instance, if you have two files, each with two pages, that are either rejected or not yet approved, the array will contain four objects.
- signed_urls: Object containing URLs with signed access for different versions of the images. The original expiry urls are valid for 4 hrs and original with long expiry urls are valid for 180 days.
Note: In Nanonets, approval operates at the file level, where "moderated" denotes "approved." In the example below, the specified timeframe includes two files: one approved file with 2 pages and one rejected/not yet approved file with 1 page. The approved file is reflected by moderated_images_count = 2, while the rejected/not yet approved file is represented by unmoderated_images_count = 1.
{
"moderated_images_count": 2,
"unmoderated_images_count": 1,
"moderated_images": [],
"unmoderated_images": [],
"signed_urls": {
}
}
Description of each field inside the Json Response:
model_id:
Represents the specific model_id used for making predictions.day_since_epoch:
The number of days since January 1, 1970 (GMT), representing the upload date of the file.is_moderated:
A boolean value indicating whether the file is approved or not.- 'TRUE' means file is approved.
- ‘FALSE’ means file is rejected or not approved.
id:
This represent the specific page inside the fileurl:
Path to the uploaded image file.predicted_boxes:
An array containing details of predicted bounding boxes on the image/page.id:
Unique identifier of the bounding box.label:
The label name, which corresponds to the field or table header as configured in the model.xmin
,ymin
,xmax
,ymax
: This represents the minimum and maximum x,y-coordinate of the bounding box used to predict the value for the specified label.score:
A confidence score in prediction represents the model's certainty in its output. It's a numerical value, usually between 0 and 1, indicating the probability that the prediction is correct. A higher score means greater confidence in the prediction's accuracy.ocr_text
: This is the predicted value associated with the labelstatus
: This field represent the status of the label predicted, it’s always correctly_predicted.type
: This represent if the label is field or table header. Possible values are field and table.page:
The page number in the document where the label is located, with 0 representing the first page and so on.label_id
: A unique identifier associated with each label as defined in the model.cells:
An array of cell predictions within the identified table.id
: This is the unique identifier for the cell prediction.row
,col
: This represent the row and column numbers where the cell is located.label
: The label name, which corresponds to the table header as configured in the model.xmin
,ymin
,xmax
,ymax
: This represents the minimum and maximum x,y-coordinate of the bounding box used to predict the value for the specified label.score
: A confidence score in prediction represents the model's certainty in its output. It's a numerical value, usually between 0 and 1, indicating the probability that the prediction is correct. A higher score means greater confidence in the prediction's accuracy.text
: This represent the predicted value associated with the cell within the table.verification_status:
Indicates the moderation status of a document or a specific field. It can take the values "moderated" if the item has been manually reviewed and modified as necessary, or "correctly_predicted" if the model's initial prediction was accurate and required no further modifications. If the file is approved the verification_status` inside the moderated_box for each cell will change to “moderated”.status
: This represent the status of the cell based on validation rules configured in the workflow section. Indicates whether the initial prediction for the cell within the table passed validation checks. Possible values are "success" if all checks passed, or “failed” if any validation failed.failed_validation
: This represent the specific reason for the validation failure of a cell within the table. It is only populated if thevalidation_status
for the cell is "failed." For instance, "Content Length is greater than or equal to 2" could be a reason indicating that the cell content did not meet the required content length criteria set by the validation rules.label_id
: A unique identifier associated with each label as defined in the model.
moderated_boxes:
An array containing details of bounding boxes that have been modified.size:
Dimensions of the image/page (width and height).page:
The page number within the document associated with the image/page.request_file_id:
The unique identifier of the file you uploaded to the model for prediction. You can find this ID on the extract data page of the model for each file.original_file_name:
This is the name of the file for which you fetched predictions using the API.assigned_member:
The team member assigned to review or moderate the file.no_of_fields:
The number of fields configured in the “AI Training” section.export_status:
Status of exporting the file data (e.g., "failed", “success”).exported_at:
This column represent the UUID (timestamp) at which export of the extracted data triggered.updated_at:
Timestamp indicating when the image details were last updated.verified_at:
UUID(Timestamp) indicating when the image was approved/unapproved.verified_by:
Identifier of the user who verified the image.current_stage_id:
Unique identifier of the current processing stage. (e.g., “ffffffff-ffff-ffff-ffff-ffffffffffff” represent the approved stage)uploaded_by:
Email of the user who uploaded the image.upload_channel:
The channel through which the image was uploaded (e.g., "ui").file_url:
Path to the original uploaded file.request_metadata:
This is a body parameter that you include in the request when making an API call. It is returned in the API response and is typically used to uniquely identify and map the file you uploaded.raw_ocr:
An array containing raw OCR data before moderation or correction.approval_status:
This represent the approval status of the file, it will be black if file is not approved, “approved” if file is approved, and “rejected” if file is rejected.processing_type:
This indicates how the file was processed, specifying whether it was handled async or sync. If this field in the response is empty, it means the file was processed sync. If it shows "async," the file was processed async. For more details on sync and async processing, please refer to this page.assigned_members:
This represents the list of user emails assigned to the file for review/approval.