Hi Luzuko Yena,
Yes, it is possible to extract only tables using Azure AI Document Intelligence.
Azure AI Document Intelligence provides multiple models to analyze documents, such as:
· Prebuilt Layout Model
· Prebuilt Document Model
· Custom Models
To extract only tables, you should use the Layout Model, which is designed for this purpose.
What it does:
· Extracts text lines
· Extracts tables (structure + cell content)
· Extracts selection marks (checkboxes)
It does not extract key-value pairs or entities — perfect if you're only focused on layout elements like tables.
To Use (via REST API / SDKs / Azure Portal)
Example using Python SDK:
from azure.ai.formrecognizer import DocumentAnalysisClient
from azure.core.credentials import AzureKeyCredential
endpoint = "https://<your-resource-name>.cognitiveservices.azure.com/"
key = "<your-key>"
document_analysis_client = DocumentAnalysisClient(
endpoint=endpoint, credential=AzureKeyCredential(key)
)
# Use layout model
poller = document_analysis_client.begin_analyze_document(
"prebuilt-layout", document=open("your_file.pdf", "rb")
)
result = poller.result()
# Extract tables only
for table in result.tables:
print(f"\nTable with {table.row_count} rows and {table.column_count} columns")
for cell in table.cells:
print(f"Cell [{cell.row_index}, {cell.column_index}] - content: '{cell.content}'")
Hope this helps. Do let me know if you any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.
Thank you!