Skip to content
dataset-generator logo

Dataset Generator Skill

dataset-generator

Generate evaluation datasets with adjustable difficulty levels from PDF documents for RAG system testing and benchmarking

SKILL.md

Full skill instructions

Dataset Generator Skill

Generate high-quality benchmark evaluation datasets with adjustable difficulty levels from custom PDF documents. Perfect for testing RAG systems, knowledge graphs, and Q&A models.

Usage

Invoke this skill with:

/​dataset-generator <pdf_directory> [output_file] [num_questions] [difficulty]

Arguments:

  • $1 (required) - Path to PDF directory containing source documents
  • $2 (optional) - Output JSON file path (default: benchmark_dataset.json)
  • $3 (optional) - Number of questions to generate (default: 20)
  • $4 (optional) - Difficulty level: easy, medium, hard, or mixed (default: mixed)

Examples

# Generate 20 mixed-difficulty questions
/​dataset-generator ./​pdfs

# Generate 30 hard questions
/​dataset-generator ./​pdfs hard_benchmark.json 30 hard

# Generate 15 easy questions for testing retrieval
/​dataset-generator ./​pdfs easy_test.json 15 easy

What This Skill Does

  1. Extract Content: Reads all PDFs from specified directory using pypdf
  2. Analyze Topics: Uses Claude to identify key concepts, entities, dates, and relationships
  3. Generate Questions: Creates questions across 5 types:
    • Fact Retrieval: Direct facts extractable from single passages
    • Multi-hop Reasoning: Requires connecting 2-3 pieces of information
    • Comparative Analysis: Compare concepts, approaches, or entities
    • Contextual Summarization: Broad understanding across multiple sections
    • Creative Generation: Application/​scenario-based questions
  4. Difficulty Calibration: Adjusts question complexity and required reasoning depth
  5. Format Output: Standard benchmark JSON format with:
    • Question and ground truth answer
    • Question type classification
    • Difficulty level
    • 2-5 supporting evidence passages
    • Evidence relationship explanations

Difficulty Levels

Easy (Single-hop, Direct)

  • Reasoning: Answerable from a single chunk/​passage
  • Evidence: Direct quotes sufficient
  • Chunk Size: 300-500 chars
  • Examples:
    • "What is [Product/​Service] described in the document?"
    • "Who is mentioned as the CEO in [Year]?"
    • "What is the duration/​cost/​size of [Feature]?"

Medium (Multi-hop, Inference)

  • Reasoning: Requires 2-3 pieces of information
  • Evidence: Light inference and connection needed
  • Chunk Size: 800-1000 chars
  • Examples:
    • "How does [Concept A] affect [Concept B]?"
    • "What are the requirements for [Process/​System]?"

Hard (Synthesis, Cross-document)

  • Reasoning: Requires synthesizing info across multiple documents
  • Evidence: Implicit relationships, complex inference
  • Chunk Size: 1200-1500 chars
  • Examples:
    • "Compare [Company's] approach in [Document A] vs [Document B]"
    • "Summarize how [System] addresses [Challenge] across all documents"

Mixed (Balanced Distribution)

  • Distribution: 40% easy, 40% medium, 20% hard
  • Purpose: Comprehensive testing across difficulty spectrum
  • Chunk Size: Adaptive (1000 chars average)

Output Format

Standard evaluation JSON format:

[
  {
    "id": "unique-hash-id",
    "question": "What is the main product described?",
    "answer": "The main product is a cloud-based solution that provides...",
    "question_type": "Fact Retrieval",
    "difficulty": "easy",
    "evidence": [
      "The product is a cloud-based solution that provides enterprise-grade features...",
      "Key capabilities include real-time processing and analytics..."
    ],
    "evidence_relations": "Evidence 1 defines the product, evidence 2 details key capabilities."
  }
]

Implementation Details

When invoked, execute Python script generate_benchmark_with_difficulty.py which:

  1. Load PDFs: Extract text from all PDFs in directory
  2. Adaptive Chunking:
    • Easy: 300-500 char chunks
    • Medium: 800-1000 char chunks
    • Hard: 1200-1500 char chunks with 25% overlap
  3. Topic Analysis: Use Claude to identify:
    • Key entities (companies, products, people, dates)
    • Main concepts and themes
    • Relationships and connections
  4. Question Generation (Claude-powered):
    • Generate questions matching difficulty requirements
    • Ensure diverse question types
    • Create comprehensive ground truth answers
    • Extract supporting evidence passages
  5. Validation:
    • Verify evidence supports answer
    • Check answer completeness
    • Validate JSON structure
  6. Output: Save to specified file with statistics

Statistics Reported

After generation:

  • Total questions generated
  • Questions per type breakdown
  • Questions per difficulty
  • Average answer length
  • Average evidence passages per question
  • Processing time

Requirements

  • Python 3.8+
  • pypdf library (auto-installed if missing)
  • Anthropic API key (from environment)
  • PDF files in specified directory

Notes

  • For hard questions, ensures cross-document synthesis by analyzing multiple PDFs
  • For easy questions, uses direct extraction with minimal inference
  • Always includes 2-5 evidence passages per question
  • Validates that evidence actually supports the answer
  • Uses unique hash IDs for question tracking
  • Compatible with RAGAs and other evaluation frameworks

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View