Tag page number to key-value pair extraction from each page using azure form recognizer

Copper Contributor

I have successfully extracted key-value pairs from multipage tiff image. However, I am unable to tag each key-value pair to a page number.

 

with open(os.path.join(input_path, self.filename), "rb") as f:
    file = document_analysis_client.begin_analyze_document("prebuilt-document",document=f, locale="en-US")

poller = file.result()

 

For accessing key-value pairs:

for kv_pair in poller.key_value_pairs:
    if kv_pair.key and kv_pair.value:
        print(kv_pair.key.content, kv_pair.value.content)

 

For accessing page number:

for page in poller.pages:
    print(page.page_number)

 

I am unable to tag each key-value pair to its page number from where it has been extracted

 

0 Replies