azure-ai-document-intelligence-dotnet
Skill này làm gì
Công cụ này giúp trích xuất thông tin quan trọng từ tài liệu như hóa đơn, biên lai và thẻ căn cước. Nó có thể đọc văn bản, bảng và dữ liệu có cấu trúc.
Khi nào nên dùng
- ✓Khi bạn muốn tự động sắp xếp hóa đơn và biên lai.
- ✓Khi bạn cần trích xuất dữ liệu từ giấy tờ tùy thân.
- ✓Khi bạn cần đọc văn bản và bảng từ bất kỳ tài liệu nào.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-ai-document-intelligence-dotnet/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Trích xuất tên nhà cung cấp và tổng số tiền từ hóa đơn PDF này.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Bạn cung cấp một tài liệu (như PDF hoặc hình ảnh) và chọn một mô hình có sẵn (như “invoice” hoặc “receipt”). Công cụ đọc tài liệu và trả về thông tin bạn yêu cầu.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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)
{
…
Câu hỏi thường gặp
“Mô hình có sẵn” là gì?
Đó là các mô hình mà công cụ đã hiểu sẵn, được huấn luyện để nhận diện các loại tài liệu cụ thể như hóa đơn hoặc biên lai.
Tôi có thể dùng tài liệu của mình để huấn luyện công cụ không?
Có, bạn có thể tạo mô hình tùy chỉnh cho các tài liệu mà mô hình có sẵn không bao gồm.
Thông tin trích xuất được lưu ở đâu?
Công cụ trích xuất thông tin và trả về để bạn dùng trong chương trình. Cách lưu phụ thuộc vào cách bạn thiết lập mã của mình.
Chi tiết
Mô tả gốc của tác giả
Azure AI Document Intelligence SDK for .NET. Extract text, tables, and structured data from documents using prebuilt and custom models.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #3884
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.