CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-azure-ai-documentintelligence

Azure AI Document Intelligence client library for Python - a cloud service that uses machine learning to analyze text and structured data from documents

76

1.18x
Overview
Eval results
Files

task.mdevals/scenario-4/

Document Classifier Lifecycle Challenge

Build a small module that manages custom document classifiers end to end: create them from blob training sources, inspect and list what exists, copy classifiers between resources, and clean them up when no longer needed.

Capabilities

Build classifiers from blob samples

  • Given a doc type to blob container mapping (blob container URLs per doc type) and classifier id, initiates classifier training and waits until ready, returning metadata including the classifier id and doc type keys. @test

Inspect classifiers

  • Fetches classifier details by id and returns its description plus doc type names; listing classifiers returns an iterable containing the id when it exists. @test

Copy classifiers across resources

  • Generates copy authorization on the target resource and uses it to copy a source classifier to a target id, returning metadata showing the target id matches the request. @test

Cleanup classifiers

  • Deletes a classifier id and confirms it no longer appears in listings; repeated deletion calls do not raise errors. @test

Implementation

@generates

API

from typing import Any, Dict, Iterable

def build_classifier(admin_client: Any, classifier_id: str, doc_type_sources: Dict[str, str], description: str = "") -> Any:
    """Start and wait for classifier creation using blob container URLs mapped by doc type; return completed classifier metadata."""

def get_classifier_summary(admin_client: Any, classifier_id: str) -> Dict[str, Any]:
    """Fetch classifier details and return summary with the classifier id, description, and doc type keys."""

def list_classifier_ids(admin_client: Any) -> Iterable[str]:
    """Return iterable of classifier identifiers available on the resource."""

def copy_classifier_between_resources(source_admin_client: Any, target_admin_client: Any, source_classifier_id: str, target_classifier_id: str, description: str = "") -> Any:
    """Authorize on the target resource for the given target id and execute copy from the source classifier; return copied classifier metadata."""

def delete_classifier_if_exists(admin_client: Any, classifier_id: str) -> None:
    """Delete classifier if present without raising when already removed."""

Dependencies { .dependencies }

azure-ai-documentintelligence { .dependency }

Provides document intelligence administration client for building, inspecting, copying, and deleting classifiers.

Install with Tessl CLI

npx tessl i tessl/pypi-azure-ai-documentintelligence

tile.json