Filter Submissions

Create a Filter when querying for WorkflowSubmissions.

Introduction

SubmissionFilter is designed to work alongside[ListSubmissions][(https://developer.indicodata.ai/docs/manage-submission](https://developer.indicodata.ai/docs/manage-submission)), enhancing the search functionality for Submissions by allowing the specification of the following parameters:

  • input_filename: submissions with input file names containing this string
  • status: submissions in the following status. Options:[PROCESSING, PENDING_REVIEW, PENDING_AUTO_REVIEW, COMPLETE, FAILED]
  • retrieved: filter submissions on the retrieved flag

SubmissionFilter

Inputs

📥

SubmissionFilter Inputs

input_filename: str submissions with input file names containing this string

status: str submissions in this status. Options: [PROCESSING, PENDING_REVIEW, PENDING_ADMIN_REVIEW, COMPLETE, FAILED]

retrieved: bool Filter submissions on the retrieved flag

Outputs

📤

SubmissionFilter Outputs

dict containing query filter parameters

Using Multiple SubmissionFilters

To combine multiple filters in a ListSubmissions call, you must use an And or an Or filter.

  • And Filter: joins two SubmissionFilters and filter for all submissions that meet both filter conditions
  • Or Filter: joins two SubmissionFilters and filter for all submissions that meet at least one of the provided filter conditions

Try It Out

Try out the SubmissionFilter call:

from indico.filters import SubmissionFilter, and_, or_

# Filters for all submissions with PENDING_AUTO_REVIEW status 
pending_auto_review = SubmissonFilter(status="PENDING_AUTO_REVIEW", retrieved=False)

submissions = client.call(
    ListSubmissions(submission_ids=[4], filters=pending_auto_review)
)

# Filters for all submissions with either a PENDING_AUTO_REVIEW status or a PENDING_REVIEW status
multi_filter = or_(
    SubmissionFilter(status="PENDING_AUTO_REVIEW", retrieved=False),
    SubmissionFilter(status="PENDING_REVIEW", retrieved=False),
)
using IndicoV2.Submissions.Models;

// Filters for submissions that have a COMPLETE status and are not retrieved
var completeFilter = new SubmissionFilter {
    InputFilename = "",
    Status = SubmissionStatus.COMPLETE,
    Retrieved = false
};
                    
// Filters for submissions that have a FAILED status and are retrieved or not retrieved
// Because there are two conditions, they need to be combined in an AND filter
var failedFilter = new AndFilter
{
    And = new List<IFilter>() {
        new SubmissionFilter {
            InputFilename = "",
            Status = SubmissionStatus.FAILED,
            Retrieved = false
        },
        new SubmissionFilter {
            InputFilename = "",
            Status = SubmissionStatus.FAILED,
            Retrieved = true
        }
    }
};
// Filters for submissions that meet the requirements for completeFilter or failedFilter
var filters = new OrFilter
{
    Or = new List<IFilter>() { completeFilter, failedFilter }
};

var submissions = new List<ISubmission> (await submissionClient.ListAsync(null, new[] { 4 }, filters));
import com.indico.type.SubmissionStatus;
import com.indico.type.SubmissionFilter;

/*
* List all submissions that are COMPLETE or FAILED
* Generate submission results for these
* Delay gathering the results until required
*/
List<SubmissionFilter> filters = new ArrayList<>();

/*
Adds a filter to search for submissions with a COMPLETE status
*/
filters.add(
  new SubmissionFilter.Builder().status(SubmissionStatus.COMPLETE).build()
);

/*
Adds a filter to search for submissions with a FAILED status
*/
filters.add(
  new SubmissionFilter.Builder().status(SubmissionStatus.FAILED).build()
);

/*
Creates a new filter that searches for submissions that match any of the previously added filters
*/
SubmissionFilter subFilter = new SubmissionFilter.Builder().ors(filters).build();

List<Submission> submissions = client.listSubmissions().filters(subFilter).query();

Possible submission statuses

The possible submission statuses are as follows:

  • COMPLETE - If Review is enabled: The review process is complete and final predictions are ready, OR the submission did not go through any extraction model and therefore could not be reviewed by our system
    If Review is NOT enabled: Final predictions are ready.
  • PENDING_REVIEW - Predictions are made, and the document/image is awaiting a human review.
  • PENDING_ADMIN_REVIEW - The initial reviewer rejected the document/image and awaiting admin review.
  • PENDING_AUTO_REVIEW - If review and auto review are enabled for a workflow: Submissions will go to this state first, which can be programmatically "reviewed" based on a custom script before going to PENDING_REVIEW state for a human reviewer.
  • PENDING_EXCEPTIONS_REVIEW - Predictions are made, and the document/image is awaiting a human reclassification.
  • QUEUED- The submission is in queue for processing or is currently being processed. Submissions are processed in a "first in, first out" order.
  • FAILED Something went wrong during document processing or predictions, and the document was never completed through the workflow.

After a submission has been processed and is in COMPLETE, PENDING_REVIEW or PENDING_ADMIN_REVIEW status, you are able to retrieve the prediction results (even if it hasn’t been human-reviewed).​