Перейти к содержанию
Skillpedia
Агенты48k · #3884

azure-ai-document-intelligence-dotnet

Что он делает

Этот инструмент помогает извлекать важную информацию из документов, таких как счета, чеки и удостоверения личности. Он может считывать текст, таблицы и структурированные данные.

Когда использовать

  • ✓Чтобы автоматически систематизировать счета и чеки.
  • ✓Чтобы извлекать данные из удостоверяющих документов.
  • ✓Чтобы считывать текст и таблицы из любого документа.

Ссылка на скилл

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-ai-document-intelligence-dotnet/SKILL.md

Скопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.

Как использовать

Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.

Готовое сообщение для вставки

Используй этот скилл, чтобы помочь мне: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-ai-document-intelligence-dotnet/SKILL.md Прочитай файл SKILL.md по этой ссылке и следуй его инструкциям в моей задаче.
Хотите, чтобы ваш ИИ сам находил такие скиллы?Установите бесплатный MCP Skillpedia: одна строка, и перед каждой задачей он ищет среди 15 000+ скиллов.Установить за 1 минуту →

Пример запроса к вашему ИИ

“Извлеки название поставщика и общую сумму из PDF-счета.”

5 новых скиллов в неделю. 1 минута чтения.

Как это работает

Вы передаете документ (например, PDF или изображение) и выбираете готовую модель (например, «invoice» или «receipt»). Инструмент считывает документ и возвращает нужную информацию.

Технический текст (оригинальный SKILL.md)

Оригинальный текст автора на английском, прямо с GitHub.

Azure.AI.DocumentIntelligence (.NET)

Extract text, tables, and structured data from documents using prebuilt and custom models.

Installation

dotnet add package Azure.AI.DocumentIntelligence
dotnet add package Azure.Identity

Current Version: v1.0.0 (GA)

Environment Variables

DOCUMENT_INTELLIGENCE_ENDPOINT=https://<resource-name>.cognitiveservices.azure.com/
DOCUMENT_INTELLIGENCE_API_KEY=<your-api-key>
BLOB_CONTAINER_SAS_URL=https://<storage>.blob.core.windows.net/<container>?<sas-token>

Authentication

Microsoft Entra ID (Recommended)

using Azure.Identity;
using Azure.AI.DocumentIntelligence;

string endpoint = Environment.GetEnvironmentVariable("DOCUMENT_INTELLIGENCE_ENDPOINT");
var credential = new DefaultAzureCredential();
var client = new DocumentIntelligenceClient(new Uri(endpoint), credential);

Note: Entra ID requires a custom subdomain (e.g., https://<resource-name>.cognitiveservices.azure.com/), not a regional endpoint.

API Key

string endpoint = Environment.GetEnvironmentVariable("DOCUMENT_INTELLIGENCE_ENDPOINT");
string apiKey = Environment.GetEnvironmentVariable("DOCUMENT_INTELLIGENCE_API_KEY");
var client = new DocumentIntelligenceClient(new Uri(endpoint), new AzureKeyCredential(apiKey));

Client Types

Client Purpose
DocumentIntelligenceClient Analyze documents, classify documents
DocumentIntelligenceAdministrationClient Build/manage custom models and classifiers

Prebuilt Models

Model ID Description
prebuilt-read Extract text, languages, handwriting
prebuilt-layout Extract text, tables, selection marks, structure
prebuilt-invoice Extract invoice fields (vendor, items, totals)
prebuilt-receipt Extract receipt fields (merchant, items, total)
prebuilt-idDocument Extract ID document fields (name, DOB, address)
prebuilt-businessCard Extract business card fields
prebuilt-tax.us.w2 Extract W-2 tax form fields
prebuilt-healthInsuranceCard.us Extract health insurance card fields

Core Workflows

1. Analyze Invoice

using Azure.AI.DocumentIntelligence;

Uri invoiceUri = new Uri("https://example.com/invoice.pdf");

Operation<AnalyzeResult> operation = await client.AnalyzeDocumentAsync(
    WaitUntil.Completed, 
    "prebuilt-invoice", 
    invoiceUri);

AnalyzeResult result = operation.Value;

foreach (AnalyzedDocument document in result.Documents)
{
    if (document.Fields.TryGetValue("VendorName", out DocumentField vendorNameField)
        && vendorNameField.FieldType == DocumentFieldType.String)
    {
        string vendorName = vendorNameField.ValueString;
        Console.WriteLine($"Vendor Name: '{vendorName}', confidence: {vendorNameField.Confidence}");
    }

    if (document.Fields.TryGetValue("InvoiceTotal", out DocumentField invoiceTotalField)
        && invoiceTotalField.FieldType == DocumentFieldType.Currency)
    {
        CurrencyValue invoiceTotal = invoiceTotalField.ValueCurrency;
        Console.WriteLine($"Invoice Total: '{invoiceTotal.CurrencySymbol}{invoiceTotal.Amount}'");
    }
    
    // Extract line items
    if (document.Fields.TryGetValue("Items", out DocumentField itemsField)
        && itemsField.FieldType == DocumentFieldType.List)
    {
        foreach (DocumentField item in itemsField.ValueList)
        {
            var itemFields = item.ValueDictionary;
            if (itemFields.TryGetValue("Description", out DocumentField descField))
                Console.WriteLine($"  Item: {descField.ValueString}");
        }
    }
}

2. Extract Layout (Text, Tables, Structure)

Uri fileUri = new Uri("https://example.com/document.pdf");

Operation<AnalyzeResult> operation = await client.AnalyzeDocumentAsync(
    WaitUntil.Completed, 
    "prebuilt-layout", 
    fileUri);

AnalyzeResult result = operation.Value;

// Extract text by page
foreach (DocumentPage page in result.Pages)
{
    Console.WriteLine($"Page {page.PageNumber}: {page.Lines.Count} lines, {page.Words.Count} words");
    
    foreach (DocumentLine line in page.Lines)
    {
        Console.WriteLine($"  Line: '{line.Content}'");
    }
}

// Extract tables
foreach (DocumentTable table in result.Tables)
{
    Console.WriteLine($"Table: {table.RowCount} rows x {table.ColumnCount} columns");
    foreach (DocumentTableCell cell in table.Cells)
    {

…
Частые вопросы

Что такое «готовые модели»?

Это модели, которые инструмент уже умеет использовать. Они обучены распознавать конкретные типы документов, например счета или чеки.

Можно ли использовать свои документы для обучения инструмента?

Да, для документов, которых нет среди готовых моделей, можно создать собственные модели.

Где сохраняется извлеченная информация?

Инструмент извлекает информацию и возвращает ее вам для использования в вашей программе. Где и как она сохраняется, зависит от того, как вы настроили свой код.

Подробности

Оригинальное описание автора

Azure AI Document Intelligence SDK for .NET. Extract text, tables, and structured data from documents using prebuilt and custom models.

repo: sickn33/agentic-awesome-skills

Популярность

Звёзды на GitHub
48k
Место в рейтинге
#3884
Лицензия
MIT
Обновлён
15.10.2026

Полезен ли этот скилл?

0

Войдите , чтобы голосовать.

Комментарии

  • …

Другие скиллы из этого репозитория

Похожие скиллы