Energy Plat
Energy Plat

Reputation: 1

Custom Document Extractor Processor ID Not Found

I am trying to process a pdf document in Python using the Custom Document Extractor from Doc AI. I tried using a managed version which can found in the deploy & use tab on the console. I used Google's sample code and inputted the managed version's processor ID. I then get the following error:

NotFound: 404 Processor with id 'id' not found. [reason: "PROCESSOR_NOT_FOUND"
domain: "documentai.googleapis.com"
metadata {
  key: "processor_id"
  value: "id"
}
]

I tried using the processor's overall id, and that worked fine, the document was extracted and there was an output. I am assuming this is the out of the box version? The managed version's processor id was not found when I executed the below code:

`from google.cloud import documentai_v1

def list_processors(project_id, location):
    client = documentai_v1.DocumentProcessorServiceClient()
    parent = f"projects/{project_id}/locations/{location}"

    response = client.list_processors(parent=parent)
    for processor in response:
        print(f"Processor name: {processor.name}")
        print(f"Processor display name: {processor.display_name}\n")

project_id = "id"
location = "us"  # for example, 'us' or 'eu'
list_processors(project_id, location)`

Upvotes: 0

Views: 652

Answers (1)

Holt Skinner
Holt Skinner

Reputation: 2234

It looks like you're mixing up Processors and Processor Versions. Here's the documentation on Processor Versions and how they are configured.

https://cloud.google.com/document-ai/docs/manage-processor-versions

And for the Out of the Box/Foundation Model feature of Custom Document Extractor, you need to create a new version that uses the labels you input.

This guide has recently been updated with the new features including creating a version using Generative AI Foundation Models

https://cloud.google.com/document-ai/docs/workbench/build-custom-processor#build_processor_version_using_foundation_model

Then use this Python Code Sample to process a document and extract entities including with a processor version.

https://cloud.google.com/document-ai/docs/handle-response#documentai_process_specialized_document-python

Upvotes: 0

Related Questions