Incremental audio production with duration mismatch handling, adaptive stem extension, and pre-mix alignment verification
日本語の概要は準備中です。原文の説明を表示しています。
Resilient multi-tier PDF extraction with sequential fallback strategies when initial reading fails
インストールする前に、エージェントに与えられる指示の中身を確認できます。
When processing complex documents (tax forms, legal documents, scanned materials), PDF extraction often fails on the first attempt. This skill provides a systematic fallback approach that tries multiple extraction methods in sequence until one succeeds.
Start with command-line tools that often handle edge cases better:
# Extract text maintaining layout
pdftotext -layout input.pdf output.txt
# Extract raw text (faster, less formatting)
pdftotext input.pdf output.txt
# Extract specific page range
pdftotext -f 1 -l 3 input.pdf output.txt
Check if output contains meaningful content before proceeding.
If shell tools fail, use Python libraries with different extraction approaches:
# Using PyPDF2 for basic text extraction
import PyPDF2
with open('document.pdf', 'rb') as f:
reader = PyPDF2.PdfReader(f)
text = ''.join(page.extract_text() for page in reader.pages)
# Using pdfplumber for tables and structured content
import pdfplumber
with pdfplumber.open('document.pdf') as pdf:
for page in pdf.pages:
text = page.extract_text()
tables = page.extract_tables()
# Using pypdf for newer PDF features
from pypdf import PdfReader
reader = PdfReader('document.pdf')
text = ''.join(page.extract_text() for page in reader.pages)
If the PDF contains images or scanned content, use OCR:
# Using tesseract via command line
tesseract input.pdf output --psm 6
# Using Python with pytesseract
import pytesseract
from pdf2image import convert_from_path
images = convert_from_path('document.pdf')
text = ''.join(pytesseract.image_to_string(img) for img in images)
def extract_pdf_resilient(pdf_path):
"""Try multiple extraction methods until one succeeds."""
# Tier 1: Shell extraction
result = run_shell(f'pdftotext -layout "{pdf_path}" -')
if result.stdout and len(result.stdout.strip()) > 100:
return result.stdout, 'pdftotext'
# Tier 2: Python libraries
try:
import pdfplumber
with pdfplumber.open(pdf_path) as pdf:
text = ''.join(page.extract_text() or '' for page in pdf.pages)
if text.strip():
return text, 'pdfplumber'
except Exception:
pass
# Tier 3: OCR fallback
try:
from pdf2image import convert_from_path
import pytesseract
images = convert_from_path(pdf_path)
text = ''.join(pytesseract.image_to_string(img) for img in images)
if text.strip():
return text, 'tesseract-ocr'
except Exception:
pass
raise ExtractionError("All extraction methods failed")
| Indicator | Action |
|---|---|
| Empty output | Proceed to next tier |
| Garbled/special characters | Try next tier |
| Partial content | Accept if meets minimum threshold |
| Tool not available | Skip to next tier |
| Format-specific errors | Try alternative library |
Before declaring extraction complete:
def validate_extraction(text):
if not text or len(text.strip()) < 50:
return False
if text.count('') > len(text) * 0.1: # Too many replacement chars
return False
if len(set(text)) < 10: # Too little character variety
return False
return True
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Incremental audio production with duration mismatch handling, adaptive stem extension, and pre-mix alignment verification
日本語の概要は準備中です。原文の説明を表示しています。
Incremental audio production with duration alignment handling, per-stem verification, and adaptive extension strategies
日本語の概要は準備中です。原文の説明を表示しています。
Create serverless API proxy endpoints that hide API keys and provide a unified backend for the dashboard frontend. Designed for Vercel deployment.
日本語の概要は準備中です。原文の説明を表示しています。
End-to-end audio production workflow with stems, effects, archiving, and verification
日本語の概要は準備中です。原文の説明を表示しています。
Handle cascading data retrieval tool failures by falling back to embedded knowledge generation
日本語の概要は準備中です。原文の説明を表示しています。
Fallback pattern for executing Python code when execute_code_sandbox fails
日本語の概要は準備中です。原文の説明を表示しています。