Chuyển đến nội dung
Skillpedia
Agent48k · #3885

azure-ai-document-intelligence-ts

Skill này làm gì

Công cụ này trích xuất thông tin quan trọng từ tài liệu, như văn bản, bảng và dữ liệu có cấu trúc. Nó hiểu được nhiều loại tài liệu khác nhau, như hóa đơn và biên lai, hoặc có thể được huấn luyện để hiểu tài liệu tùy chỉnh.

Khi nào nên dùng

  • ✓Khi bạn cần tự động trích xuất dữ liệu từ hóa đơn và biên lai.
  • ✓Khi bạn sắp xếp và tìm kiếm thông tin trong khối lượng lớn tài liệu.
  • ✓Khi bạn xây dựng hệ thống cần hiểu nội dung của các loại tài liệu cụ thể.

Liên kết skill

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

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-ai-document-intelligence-ts/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Trích xuất dữ liệu hóa đơn từ liên kết này: [invoice link]”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn gửi tài liệu (qua liên kết hoặc tệp) cho công cụ. Nó dùng các mô hình đã huấn luyện sẵn hoặc tùy chỉnh để nhận diện và trích xuất thông tin bạn cần, như số tiền, ngày tháng và tên.

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 Document Intelligence REST SDK for TypeScript

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

Installation

npm install @azure-rest/ai-document-intelligence @azure/identity

Environment Variables

DOCUMENT_INTELLIGENCE_ENDPOINT=https://<resource>.cognitiveservices.azure.com
DOCUMENT_INTELLIGENCE_API_KEY=<api-key>

Authentication

Important: This is a REST client. DocumentIntelligence is a function, not a class.

DefaultAzureCredential

import DocumentIntelligence from "@azure-rest/ai-document-intelligence";
import { DefaultAzureCredential } from "@azure/identity";

const client = DocumentIntelligence(
  process.env.DOCUMENT_INTELLIGENCE_ENDPOINT!,
  new DefaultAzureCredential()
);

API Key

import DocumentIntelligence from "@azure-rest/ai-document-intelligence";

const client = DocumentIntelligence(
  process.env.DOCUMENT_INTELLIGENCE_ENDPOINT!,
  { key: process.env.DOCUMENT_INTELLIGENCE_API_KEY! }
);

Analyze Document https://example.com

import DocumentIntelligence, {
  isUnexpected,
  getLongRunningPoller,
  AnalyzeOperationOutput
} from "@azure-rest/ai-document-intelligence";

const initialResponse = await client
  .path("/documentModels/{modelId}:analyze", "prebuilt-layout")
  .post({
    contentType: "application/json",
    body: {
      urlSource: "https://example.com/document.pdf"
    },
    queryParameters: { locale: "en-US" }
  });

if (isUnexpected(initialResponse)) {
  throw initialResponse.body.error;
}

const poller = getLongRunningPoller(client, initialResponse);
const result = (await poller.pollUntilDone()).body as AnalyzeOperationOutput;

console.log("Pages:", result.analyzeResult?.pages?.length);
console.log("Tables:", result.analyzeResult?.tables?.length);

Analyze Document (Local File)

import { readFile } from "node:fs/promises";

const fileBuffer = await readFile("./document.pdf");
const base64Source = fileBuffer.toString("base64");

const initialResponse = await client
  .path("/documentModels/{modelId}:analyze", "prebuilt-invoice")
  .post({
    contentType: "application/json",
    body: { base64Source }
  });

if (isUnexpected(initialResponse)) {
  throw initialResponse.body.error;
}

const poller = getLongRunningPoller(client, initialResponse);
const result = (await poller.pollUntilDone()).body as AnalyzeOperationOutput;

Prebuilt Models

Model ID Description
prebuilt-read OCR - text and language extraction
prebuilt-layout Text, tables, selection marks, structure
prebuilt-invoice Invoice fields
prebuilt-receipt Receipt fields
prebuilt-idDocument ID document fields
prebuilt-tax.us.w2 W-2 tax form fields
prebuilt-healthInsuranceCard.us Health insurance card fields
prebuilt-contract Contract fields
prebuilt-bankStatement.us Bank statement fields

Extract Invoice Fields

const initialResponse = await client
  .path("/documentModels/{modelId}:analyze", "prebuilt-invoice")
  .post({
    contentType: "application/json",
    body: { urlSource: invoiceUrl }
  });

if (isUnexpected(initialResponse)) {
  throw initialResponse.body.error;
}

const poller = getLongRunningPoller(client, initialResponse);
const result = (await poller.pollUntilDone()).body as AnalyzeOperationOutput;

const invoice = result.analyzeResult?.documents?.[0];
if (invoice) {
  console.log("Vendor:", invoice.fields?.VendorName?.content);
  console.log("Total:", invoice.fields?.InvoiceTotal?.content);
  console.log("Due Date:", invoice.fields?.DueDate?.content);
}

Extract Receipt Fields

const initialResponse = await client
  .path("/documentModels/{modelId}:analyze", "prebuilt-receipt")
  .post({
    contentType: "application/json",
    body: { urlSource: receiptUrl }
  });

const poller = getLongRunningPoller(client, initialResponse);
const result = (await poller.pollUntilDone()).body as AnalyzeOperationOutput;

const receipt = result.analyzeResult?.documents?.[0];
if (receipt) {
  console.log("Merchant:", receipt.fields?.MerchantName?.content);
  console.log("Total:", receipt.fields?.Total?.content);
  
  for (const item of receipt.fields?.Items?.values || []) {
    console.log("Item:", item.properties?.Description?.content);
    console.log("Price:", item.properties?.TotalPrice?.content);
  }
}

…

Câu hỏi thường gặp

Tôi có thể xử lý những loại tài liệu nào?

Bạn có thể xử lý nhiều loại tài liệu, gồm hóa đơn, biên lai, giấy tờ tùy thân, thẻ bảo hiểm y tế, hợp đồng và tờ khai thuế. Công cụ cũng có thể được huấn luyện để hiểu tài liệu tùy chỉnh.

Công cụ biết cần trích xuất gì bằng cách nào?

Nó dùng các mô hình trí tuệ nhân tạo. Một số mô hình đã sẵn sàng hiểu các loại tài liệu phổ biến (như hóa đơn), còn các mô hình khác có thể được huấn luyện bằng ví dụ của bạn để trích xuất thông tin cụ thể.

Tôi có cần biết lập trình để dùng không?

Bản thân công cụ là một dịch vụ lập trình, nhưng bạn có thể dùng qua các giao diện hoặc công cụ giúp đơn giản hóa quy trình, không cần viết mã phức tạp.

Chi tiết

Mô tả gốc của tác giả

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

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#3885
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự