extract-from-pdfs
Skill4 starsChanged 15 days agoMITView on GitHub
This skill should be used when extracting structured data from scientific PDFs for systematic reviews, meta-analyses, or database creation. Use when working with collections of research papers that need to be converted into analyzable datasets with validation metrics.
- Reads credentials
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 9 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
Do not use for:
- Distinctive: line 39
Read the setup guide for installation and configuration:
- Distinctive: line 62
Create custom schema from template:
- Very specific: line 71
Add domain-specific instructions for Claude
- Distinctive: line 80
Run the 6-step pipeline (plus optional validation):
- Distinctive: line 185
Use imperative language in instructions.
- Distinctive: line 210
Use conservative criteria (when in doubt, include paper) to avoid false negatives.
- Distinctive: line 225
Use abstract filtering to reduce PDF processing
- Distinctive: line 226
Use local Ollama for filtering (free)
- Distinctive: line 251
Run initial extraction with baseline schema
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Extract Structured Data from Scientific PDFs
Purpose
Extract standardized, structured data from scientific PDF literature using Claude's vision capabilities. Transform PDF collections into validated databases ready for statistical analysis in Python, R, or other frameworks.
Core capabilities:
- Organize metadata from BibTeX, RIS, directories, or DOI lists
- Filter papers by abstract using Claude (Haiku/Sonnet) or local models (Ollama)
- Extract structured data from PDFs with customizable schemas
- Repair and validate JSON outputs automatically
- Enrich with external databases (GBIF, WFO, GeoNames, PubChem, NCBI)
- Calculate precision/recall metrics for quality assurance
- Export to Python, R, CSV, Excel, or SQLite
When to Use This Skill
Use when:
- Conducting systematic literature reviews requiring data extraction
- Building databases from scientific publications
- Converting PDF collections to structured datasets
- Validating extraction quality with ground truth metrics
- Comparing extraction approaches (different models, prompts)
Do not use for:
- Single PDF summarization (use basic PDF reading instead)
- Full-text PDF search (use document search tools)
- PDF editing or manipulation
Getting Started
1. Initial Setup
Read the setup guide for installation and configuration:
cat references/setup_guide.mdKey setup steps:
- Install dependencies:
conda env create -f environment.yml - Set API keys:
export ANTHROPIC_API_KEY='your-key' - Optional: Install Ollama for free local filtering
2. Define Extraction Requirements
Ask the user:
- Research domain and extraction goals
- How PDFs are organized (reference manager, directory, DOI list)
- Approximate collection size
- Preferred analysis environment (Python, R, etc.)
Provide 2-3 example PDFs to analyze structure and design schema.
3. Design Extraction Schema
Create custom schema from template:
cp assets/schema_template.json my_schema.jsonCustomize for the specific domain:
- Set
objectivedescribing what to extract - Define
output_schemawith field types and descriptions - Add domain-specific
instructionsfor Claude - Provide
output_exampleshowing desired format
See assets/example_flower_visitors_schema.json for real-world ecology example.
Workflow Execution
Complete Pipeline
Run the 6-step pipeline (plus optional validation):
# Step 1: Organize metadata
python scripts/01_organize_metadata.py \
--source-type bibtex \
--source library.bib \
--pdf-dir pdfs/ \
--output metadata.json
# Step 2: Filter papers (optional - recommended)
# Choose backend: anthropic-haiku (cheap), anthropic-sonnet (accurate), ollama (free)
python scripts/02_filter_abstracts.py \
--metadata metadata.json \
--backend anthropic-haiku \
--use-batches \
--output filtered_papers.json
# Step 3: Extract from PDFs
python scripts/03_extract_from_pdfs.py \
--metadata filtered_papers.json \
--schema my_schema.json \
--method batches \
--output extracted_data.json
# Step 4: Repair JSON
python scripts/04_repair_json.py \
--input extracted_data.json \
--schema my_schema.json \
--output cleaned_data.json
# Step 5: Validate with APIs
python scripts/05_validate_with_apis.py \
--input cleaned_data.json \
--apis my_api_config.json \
--output validated_data.json
# Step 6: Export to analysis format
python scripts/06_export_database.py \
--input validated_data.json \
--format python \
--output resultsValidation (Optional but Recommended)
Calculate extraction quality metrics:
# Step 7: Sample papers for annotation
python scripts/07_prepare_validation_set.py \
--extraction-results cleaned_data.json \
--schema my_schema.json \
--sample-size 20 \
--strategy stratified \
--output validation_set.json
# Step 8: Manually annotate (edit validation_set.json)
# Fill ground_truth field for each sampled paper
# Step 9: Calculate metrics
python scripts/08_calculate_validation_metrics.py \
--annotations validation_set.json \
--output validation_metrics.json \
--report validation_report.txtValidation produces precision, recall, and F1 metrics per field and overall.
Detailed Documentation
Access comprehensive guides in the references/ directory:
Setup and installation:
cat references/setup_guide.mdComplete workflow with examples:
cat references/workflow_guide.mdValidation methodology:
cat references/validation_guide.mdAPI integration details:
cat references/api_reference.mdCustomization
Schema Customization
Modify my_schema.json to match the research domain:
- Objective: Describe what data to extract
- Instructions: Step-by-step extraction guidance
- Output schema: JSON schema defining structure
- Important notes: Domain-specific rules
- Examples: Show desired output format
Use imperative language in instructions. Be specific about data types, required vs optional fields, and edge cases.
API Configuration
Configure external database validation in my_api_config.json:
Map extracted fields to validation APIs:
gbif_taxonomy- Biological taxonomywfo_plants- Plant names specificallygeonames- Geographic locationsgeocode- Address to coordinatespubchem- Chemical compoundsncbi_gene- Gene identifiers
See assets/example_api_config_ecology.json for ecology-specific example.
Filtering Customization
Edit filtering criteria in scripts/02_filter_abstracts.py (line 74):
Replace TODO section with domain-specific criteria:
- What constitutes primary data vs review?
- What data types are relevant?
- What scope (geographic, temporal, taxonomic) is needed?
Use conservative criteria (when in doubt, include paper) to avoid false negatives.
Cost Optimization
Backend selection for filtering (Step 2):
- Ollama (local): $0 - Best for privacy and high volume
- Haiku (API): ~$0.25/M tokens - Best balance of cost/quality
- Sonnet (API): ~$3/M tokens - Best for complex filtering
Typical costs for 100 papers:
- With filtering (Haiku + Sonnet): ~$4
- With local Ollama + Sonnet: ~$3.75
- Without filtering (Sonnet only): ~$7.50
Optimization strategies:
- Use abstract filtering to reduce PDF processing
- Use local Ollama for filtering (free)
- Enable prompt caching with
--use-caching - Process in batches with
--use-batches
Quality Assurance
Validation workflow provides:
- Precision: % of extracted items that are correct
- Recall: % of true items that were extracted
- F1 score: Harmonic mean of precision and recall
- Per-field metrics: Identify weak fields
Use metrics to:
- Establish baseline extraction quality
- Compare different approaches (models, prompts, schemas)
- Identify areas for improvement
- Report extraction quality in publications
Recommended sample sizes:
- Small projects (<100 papers): 10-20 papers
- Medium projects (100-500 papers): 20-50 papers
- Large projects (>500 papers): 50-100 papers
Iterative Improvement
- Run initial extraction with baseline schema
- Validate on sample using Steps 7-9
- Analyze field-level metrics and error patterns
- Revise schema, prompts, or model selection
- Re-extract and re-validate
- Compare metrics to verify improvement
- Repeat until acceptable quality achieved
See references/validation_guide.md for detailed guidance on interpreting metrics and improving extraction quality.
Available Scripts
Data organization:
scripts/01_organize_metadata.py- Standardize PDFs and metadata
Filtering:
scripts/02_filter_abstracts.py- Filter by abstract (Haiku/Sonnet/Ollama)
Extraction:
scripts/03_extract_from_pdfs.py- Extract from PDFs with Claude vision
Processing:
scripts/04_repair_json.py- Repair and validate JSONscripts/05_validate_with_apis.py- Enrich with external databasesscripts/06_export_database.py- Export to analysis formats
Validation:
scripts/07_prepare_validation_set.py- Sample papers for annotationscripts/08_calculate_validation_metrics.py- Calculate P/R/F1 metrics
Assets
Templates:
assets/schema_template.json- Blank extraction schema templateassets/api_config_template.json- API validation configuration template
Examples:
assets/example_flower_visitors_schema.json- Ecology extraction exampleassets/example_api_config_ecology.json- Ecology API validation example
Other versions2 projects use a version of this.
Word for word · 2
- brunoasm/my_claude_skills★ 12100% same
- OpenxIntelligence/Coding-Agent-Skills★ 4100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository169 other files it gives its agents.
- epub-skill/CLAUDE.mdCLAUDE.md
- linear-cli-skill/CLAUDE.mdCLAUDE.md
- AgentDB Advanced FeaturesSkill
- AgentDB Learning PluginsSkill
- AgentDB Memory PatternsSkill
- AgentDB Performance OptimizationSkill
- AgentDB Vector SearchSkill
- agent-evalSkill
- agentic-jujutsuSkill
- agile-product-ownerSkill
- ai-tool-pickerSkill
- algorithmic-artSkill
- api-connectorSkill
- api-design-patternsSkill
- architecture-diagram-creatorSkill
- article-extractorSkill
- aws-agentic-aiSkill
- aws-cdk-developmentSkill
- aws-cost-operationsSkill
- aws-serverless-edaSkill
- biogeobearsSkill
- brainstormingSkill
- brand-guidelinesSkill
- canvas-designSkill
- capa-officerSkill
- ceo-advisorSkill
- changelog-generatorSkill
- code-auditorSkill
- codebase-documenterSkill
- code-executionSkill
- code-explainerSkill
- code-refactorSkill
- code-reviewerSkill
- code-transferSkill
- content-creatorSkill
- content-research-writerSkill
- conversation-analyzerSkill
- csv-data-summarizerSkill
- cto-advisorSkill
- d3-vizSkill
- dashboard-creatorSkill
- defense-in-depthSkill
- deploy-itSkill
- developer-growth-analysisSkill
- dispatching-parallel-agentsSkill
- doc-coauthoringSkill
- docxSkill
- domain-name-brainstormerSkill
- dwa-councilSkill
- error-fixerSkill
- escalation-reasoningSkill
- evaluator-optimizerSkill
- executing-plansSkill
- fda-consultant-specialistSkill
- feature-planningSkill
- file-operationsSkill
- file-organizerSkill
- finishing-a-development-branchSkill
- firebase-buddySkill
- flowchart-creatorSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

