我正在关注https://codelabs.developers.google.com/codelabs/docai-form-parser-v3-python#7上的教程,我遵循了他们指定的所有步骤......
我按照教程中指定的方式使用 Cloud SDK 进行开发,但随后
他们给出的代码如下:
project_id= 'YOUR_PROJECT_ID'
location = 'YOUR_PROJECT_LOCATION' # Format is 'us' or 'eu'
processor_id = 'YOUR_PROCESSOR_ID' # Create processor in Cloud Console
file_path = 'form.pdf' # The local file in your current working directory
from google.cloud import documentai_v1beta3 as documentai
from google.cloud import storage
def process_document(
project_id=project_id, location=location, processor_id=processor_id, file_path=file_path
):
# Instantiates a client
client = documentai.DocumentProcessorServiceClient()
# The full resource name of the processor, e.g.:
# projects/project-id/locations/location/processor/processor-id
# You must create new processors …Run Code Online (Sandbox Code Playgroud)