document-extraction
ما الذي تفعله
تستخدم هذه المهارة خدمة Agentic Document Extraction من LandingAI لقراءة المستندات واستخراج المعلومات التي تحتاجها. وهي مخصصة لمن يريد بيانات من النماذج والفواتير أو الجداول دون كتابتها يدويًا.
متى تستخدمها
- ✓عندما تحتاج إلى تحويل ملف PDF أو صورة ممسوحة إلى نص Markdown منظم.
- ✓عندما تريد استخراج حقول محددة، مثل أرقام الفواتير أو إجمالياتها، من المستندات.
- ✓عندما تحتاج إلى فرز دفعة من المستندات المختلطة حسب نوعها.
رابط المهارة
https://github.com/andrewyng/context-hub/blob/main/content/landingai/skills/ade/document-extraction/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“أريد قراءة ملف الفاتورة هذا بصيغة PDF، واستخراج رقم الفاتورة وتاريخها وإجماليها في جدول.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يعد الوكيل أداة ADE بمفتاح API الخاص بك، ويرسل المستند إلى الخدمة، ويعيد النص أو الحقول التي طلبتها. يحتاج إلى مفتاح ADE API ليعمل.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Document Extraction (ADE)
Overview
LandingAI's Agentic Document Extraction (ADE) is a document processing SaaS that parses, extracts, and classifies documents without requiring templates or training. It provides three main capabilities:
- Parse: Convert documents into structured Markdown with hierarchical JSON representation
- Extract: Pull specific structured data using JSON schemas or Pydantic models
- Split: Classify and separate multi-document batches by type
Key Benefits:
- No ML training or templates required
- Layout-agnostic parsing (works with any document structure)
- Supports 20+ file formats (PDF, images, spreadsheets, presentations)
- Precise visual grounding (bounding boxes, page numbers)
- Multiple models optimized for different document types
Quick Start
1. Installation
Never install packages globally without user approval. Always check for a local Python environment first.
1. .venv/bin/python — uv-managed (this project)
2. venv/bin/python — standard Python venv
3. uv run python — if pyproject.toml exists
4. poetry run python — if poetry.lock exists
5. python3 — system fallback; warn the user
Use the local environment to install: landingai-ade, python-dotenv
2. API Key Setup
The user may have already setup a .env file in the same directory as the document-extraction skill with the API key. You MUST check this path first (ls -la .*/skills/document-extraction/.env). Also try checking on the same directory as this SKILL.md file.
If not, provide instructions to create one. The script below will search for .env in common locations and load it.
.venv/bin/python - << 'EOF'
import os
from pathlib import Path
from dotenv import load_dotenv
# Load API key: prefer existing env var, then .env file lookup
if os.environ.get("VISION_AGENT_API_KEY"):
print("API key found in existing environment variable")
else:
def _find_env():
for d in [Path.cwd().resolve(), *Path.cwd().resolve().parents]:
for candidate in [
# ADD the directory where the document-extraction skill is located
d / '.env',
d / 'document-extraction/.env',
d / 'skills/document-extraction/.env',
]:
if candidate.is_file():
return candidate
return None
env = _find_env()
if env:
load_dotenv(env)
print(f"API key loaded from: {env}")
else:
print("Warning: VISION_AGENT_API_KEY not set and no .env found")
EOF
If not key is found instruct the user to get an API key from https://va.landing.ai/settings/api-key
Copy .env-sample to .env and add your API key:
cp .env-sample .env
Edit .env and add your key:
VISION_AGENT_API_KEY=your_actual_api_key_here
Note: The .env file is gitignored for security. Advanced users can also set the environment variable directly: export VISION_AGENT_API_KEY=<your-key>
EU Endpoint: If using the EU endpoint, set environment="eu" when initializing the client.
3. Basic Parse Example
from dotenv import load_dotenv
load_dotenv() # Load API key from .env
from landingai_ade import LandingAIADE
from pathlib import Path
client = LandingAIADE()
# Parse a document
response = client.parse(
document=Path("document.pdf"),
model="dpt-2-latest"
)
# Access results
print(f"Pages: {response.metadata.page_count}")
print(f"Chunks: {len(response.chunks)}")
print("\nMarkdown output:")
print(response.markdown[:500]) # First 500 chars
# Save Markdown for extraction
with open("output.md", "w", encoding="utf-8") as f:
f.write(response.markdown)
4. Basic Extract Example
from dotenv import load_dotenv
load_dotenv()
from landingai_ade import LandingAIADE
from landingai_ade.lib import pydantic_to_json_schema
from pydantic import BaseModel, Field
from pathlib import Path
# Define extraction schema using Pydantic
class Invoice(BaseModel):
invoice_number: str = Field(description="Invoice number")
invoice_date: str = Field(description="Invoice date")
total_amount: float = Field(description="Total amount in USD")
vendor_name: str = Field(description="Vendor name")
# Convert to JSON schema
schema = pydantic_to_json_schema(Invoice)
client = LandingAIADE()
# Extract from parsed markdown
response = client.extract(
s
الأسئلة الشائعة
ما أنواع الملفات المدعومة؟
تذكر المهارة أنها تعمل مع ملفات PDF والصور والجداول والعروض التقديمية، من بين أكثر من 20 صيغة.
هل أحتاج إلى قالب لكل مستند؟
لا. تذكر المهارة أنها تعمل دون قوالب أو تدريب لكل تخطيط.
أين يُحفظ مفتاح API الخاص بي؟
تقرأه المهارة من ملف .env محلي في مجلد المشروع.
التفاصيل
الوصف الأصلي من المؤلف
Use this skill for intelligent document processing and content extraction using LandingAI's Agentic Document Extraction (ADE). Trigger when users need to (1) Parse documents (PDFs, images, spreadsheets, presentations) into structured Markdown with layout understanding, (2) Extract specific structured data from documents using schemas (invoice fields, form data, table data, etc.), (3) Classify and separate multi-document batches by type (invoices vs receipts, statements vs forms, etc.), (4) Process large documents asynchronously (up to 1GB/1000 pages), (5) Get visual grounding (bounding boxes,
repo: andrewyng/context-hub
الشعبية
- نجوم GitHub
- 14k
- الترتيب
- #11271
- الترخيص
- MIT
- آخر تحديث
- 31/5/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
get-api-docs
14kيساعد وكيلك على جلب وثائق محدثة لواجهات برمجة وأطر خارجية قبل كتابة الشيفرة، بدلًا من الاعتماد على الذاكرة القديمة.
bloc-cubit
14kيعلّم وكيلك إدارة حالة التطبيق في Flutter باستخدام Bloc أو Cubit، ومتى تختار كلًا منهما، والإعدادات الآمنة للاختبار.
riverpod
14kيعلّم وكيلك إدارة حالة تطبيق Flutter باستخدام Riverpod، ويشمل المزودات والبيانات غير المتزامنة والاختبار، بإعدادات افتراضية مناسبة لكل حالة.
document-workflows
14kيساعد وكيلك على بناء خطوط معالجة متكررة تعالج كثيرًا من المستندات دفعة واحدة، وتجهّزها لأدوات البحث، وتحمّل النتائج في قاعدة بيانات.
مهارات مشابهة
gitcrawl
394kيتيح لوكيلك البحث في أرشيف محفوظ لمشكلات GitHub وطلبات السحب، وتجميع المكرر منها، والتحقق من حالتها الحالية على GitHub.
slacrawl
394kيتيح لوكيلك البحث في رسائل Slack داخل أرشيف محلي وعدّها، والتحقق من مدى حداثة الأرشيف، وتحديثه عند الحاجة.
goplaces
394kيساعد وكيلك على البحث عن الأماكن وعرض تفاصيلها وتقييماتها وتحديد أسمائها عبر Google Places، مع مخرجات JSON للسكربتات.