DEV Community

Cover image for AI Tagging for Page-Level Metadata with Tensorlake Page Classification
Sarah Guthals, PhD for Tensorlake

Posted on • Originally published at tensorlake.ai

AI Tagging for Page-Level Metadata with Tensorlake Page Classification

Most unstructured business documents (e.g. contracts, insurance files, loan applications) are more than just a blob of text. They contain distinct sections: summaries, terms, annexes, signatures, transaction logs, and more. Treating the entire document as a single unit of data makes it harder to build rich metadata for downstream systems like CRMs, vector databases, or retrieval-augmented generation (RAG) pipelines.

That’s where AI Tagging with Tensorlake’s Page Classification changes the game.

What Is AI Tagging?

AI Tagging is the automated process of assigning relevant, meaningful labels (tags) to content so that it can be organized, searched, and acted on without manual review. For documents, this might mean tagging a page as “financial summary,” “transaction details,” or “terms and conditions.”

These tags become powerful metadata, enabling:

  • Search filtering — narrowing down results to only the most relevant sections.
  • Automated workflows — triggering business logic based on the presence of a tag.
  • Improved RAG pipelines — retrieving only the pages worth sending to an LLM.

In most AI tagging workflows, tagging is applied to the document as a whole. Tensorlake goes deeper: we classify and tag at the page level, giving developers far more granular control.

Page Classification for Metadata Creation

With Tensorlake’s Document Ingestion API, you can classify each page of a document using simple natural-language descriptions. For example:

page_classifications = [
    PageClassConfig(name="transactions", description="Detailed list of transactions"),
    PageClassConfig(name="terms", description="Terms and conditions or legal disclaimers"),
    PageClassConfig(name="unclassified", description="Any page that isn't classified already")
]

doc_ai = DocumentAI()

parse_id = doc_ai.parse(
    file="https://pub-226479de18b2493f96b64c6674705dd8.r2.dev/510071197-TD-Bank-statement.pdf",
    page_classifications=page_classifications
)

print(f"Parse job submitted with ID: {parse_id}")

# Get the result
result = doc_ai.wait_for_completion(parse_id)

print("Page Classifications:")
for page_classification in result.page_classes:
    print(f"- {page_classification.page_class}: {page_classification.page_numbers}")
Enter fullscreen mode Exit fullscreen mode

Would give you the results:

Page Classifications:
- transactions: [1, 3, 4, 5]
- terms: [2]
- unclassified: [6]
Enter fullscreen mode Exit fullscreen mode

Try it out for yourself with this Colab Notebook.

What You Can Do with Page-Level AI Tagging

Once Tensorlake’s Page Classification has tagged each page, you can:

  • Run extraction schemas only on pages that match selected tags (see docs).
  • Store tags as metadata in your CRM, vector database, or knowledge graph.
  • Gate retrieval so vector search/RAG only touches the right pages.
  • Export complete Markdown for specific page classes (e.g., only “transactions” or “terms”).

Wrap Up

AI Tagging with Tensorlake’s Page Classification turns messy, mixed-format documents into precise, page-level metadata your systems can use—whether that’s driving CRM automations, enforcing compliance, or sharpening vector-database retrieval for RAG. The result: less noise, lower token spend, and faster, more reliable workflows.

Try it now:

Run the step-by-step Colab notebook to see page-level tags in action: Open Colab

Dive deeper into schemas and API details in the Page Classification docs

Point-and-click in the Tensorlake Cloud Playground to prototype without code: cloud.tensorlake.ai

Ship the tags into your CRM or vector DB, use them to filter what reaches your LLM, and start treating every page like a first-class data source.

Top comments (0)