视觉画布设计
canvas-design
基于设计原则创作静态视觉作品,用于海报与品牌图形。
unstructured【文档与办公】Use the Unstructured Python package to partition documents into elements, inspect element metadata, chunk outputs for RAG, clean/stage data, add embeddings, evaluate extraction quality, and diagnose optional dependency readiness.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this repo skill when a task involves the unstructured Python package for preparing raw documents for downstream ML, RAG, annotation, enrichment, or evaluation workflows.
all-docs or ingest unless the user explicitly needs broad coverage.unstructured doctor or python -m unstructured.cli doctor when a format fails because many capabilities depend on optional Python packages and system tools.pip install unstructured
pip install "unstructured[docx,pptx,xlsx]"
pip install "unstructured[pdf,image]"
pip install "unstructured[csv,md,rtf,epub]"
Base install is enough for text, HTML, XML, JSON/NDJSON, email, and core APIs. Optional extras add document families, OCR/PDF/image support, audio transcription, token chunking, provider embeddings, and external ingest connectors.
Common system tools:
libmagic improves MIME detection through python-magic.tesseract and poppler-utils are commonly needed for OCR/PDF/image workflows.soffice from LibreOffice is needed for legacy .doc and .ppt conversion.pandoc is needed by pypandoc-backed formats when the bundled binary is unavailable.ffmpeg is needed for audio decoding.sub-skills/partitioning/SKILL.md to turn files, streams, URLs, text, HTML, PDFs/images, Office documents, tabular data, email, JSON, XML, markup, books, or audio into Element objects.sub-skills/elements-and-metadata/SKILL.md to inspect Element subclasses, metadata, coordinates, data-source metadata, table HTML/cells, JSON/NDJSON, Markdown, text, or HTML staging.sub-skills/chunking/SKILL.md to configure chunk_elements(), chunk_by_title(), integrated partition chunking, token/character limits, overlap, table behavior, and orig_elements retention.sub-skills/data-preparation/SKILL.md to clean extracted text, stage annotation outputs, use lightweight NLP helpers, or prepare local outputs for downstream systems.sub-skills/embeddings/SKILL.md to add embeddings to elements with OpenAI, OctoAI, Mixedbread, VoyageAI, VertexAI, Bedrock, or Hugging Face providers while keeping credentials safe.sub-skills/evaluation/SKILL.md to compare predicted and gold outputs with text extraction, element type, table, and optional object detection metrics.python -m unstructured.cli doctor
python -m unstructured.cli doctor --for pdf
python -m unstructured.cli doctor --file report.pdf
If the console script is installed, unstructured doctor is equivalent. The doctor command reports Python dependency readiness per file type and checks common system tools. Use it before installing broad extras or debugging a partitioning error by trial and error.
For a reusable local diagnostic wrapper, use sub-skills/partitioning/scripts/partition_diagnostics.py. For package-level environment snapshots, use scripts/inspect_unstructured_environment.py.
from unstructured.partition.auto import partition
from unstructured.staging.base import elements_to_json
chunks = partition(
filename="report.pdf",
strategy="auto",
chunking_strategy="by_title",
max_characters=1200,
new_after_n_chars=900,
include_orig_elements=False,
)
json_text = elements_to_json(chunks, indent=2)
Use partitioning for format-specific options, chunking for sizing/table/orig-elements decisions, and elements-and-metadata for JSON/output details.
python sub-skills/partitioning/scripts/inspect_tables.py elements.json --out-dir tables --index
Use this after exporting elements to JSON when table structure or metadata.text_as_html must be validated.
python sub-skills/evaluation/scripts/evaluate_elements_pair.py \
--prediction predicted.json \
--gold gold.json
Use the evaluation sub-skill before running large metric batches so shape and obvious mismatches are caught locally.
references/troubleshooting.md for cross-cutting install/import, optional dependency, system tool, and CLI/API failure modes.references/repo-provenance.md before refreshing this skill against a newer checkout.scripts/inspect_unstructured_environment.py for a credential-safe environment and capability summary.