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
- Extract Content: Reads all PDFs from specified directory using pypdf
- Analyze Topics: Uses Claude to identify key concepts, entities, dates, and relationships
- 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
- Difficulty Calibration: Adjusts question complexity and required reasoning depth
- 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:
- Load PDFs: Extract text from all PDFs in directory
- Adaptive Chunking:
- Easy: 300-500 char chunks
- Medium: 800-1000 char chunks
- Hard: 1200-1500 char chunks with 25% overlap
- Topic Analysis: Use Claude to identify:
- Key entities (companies, products, people, dates)
- Main concepts and themes
- Relationships and connections
- Question Generation (Claude-powered):
- Generate questions matching difficulty requirements
- Ensure diverse question types
- Create comprehensive ground truth answers
- Extract supporting evidence passages
- Validation:
- Verify evidence supports answer
- Check answer completeness
- Validate JSON structure
- 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
1---2name: dataset-generator3description: Generate evaluation datasets with adjustable difficulty levels from PDF documents for RAG system testing and benchmarking4---5
6# Dataset Generator Skill
7
8Generate high-quality benchmark evaluation datasets with adjustable difficulty levels from custom PDF documents. Perfect for testing RAG systems, knowledge graphs, and Q&A models.
9
10## Usage
11
12Invoke this skill with:
13```
14/dataset-generator <pdf_directory> [output_file] [num_questions] [difficulty]
15```
16
17**Arguments:**
18- `$1` (required) - Path to PDF directory containing source documents
19- `$2` (optional) - Output JSON file path (default: `benchmark_dataset.json`)
20- `$3` (optional) - Number of questions to generate (default: 20)
21- `$4` (optional) - Difficulty level: `easy`, `medium`, `hard`, or `mixed` (default: `mixed`)
22
23## Examples
24
25```bash
26# Generate 20 mixed-difficulty questions
27/dataset-generator ./pdfs
28
29# Generate 30 hard questions
30/dataset-generator ./pdfs hard_benchmark.json 30 hard
31
32# Generate 15 easy questions for testing retrieval
33/dataset-generator ./pdfs easy_test.json 15 easy
34```
35
36## What This Skill Does
37
381. **Extract Content**: Reads all PDFs from specified directory using pypdf
392. **Analyze Topics**: Uses Claude to identify key concepts, entities, dates, and relationships
403. **Generate Questions**: Creates questions across 5 types:
41 - **Fact Retrieval**: Direct facts extractable from single passages
42 - **Multi-hop Reasoning**: Requires connecting 2-3 pieces of information
43 - **Comparative Analysis**: Compare concepts, approaches, or entities
44 - **Contextual Summarization**: Broad understanding across multiple sections
45 - **Creative Generation**: Application/scenario-based questions
464. **Difficulty Calibration**: Adjusts question complexity and required reasoning depth
475. **Format Output**: Standard benchmark JSON format with:
48 - Question and ground truth answer
49 - Question type classification
50 - Difficulty level
51 - 2-5 supporting evidence passages
52 - Evidence relationship explanations
53
54## Difficulty Levels
55
56### Easy (Single-hop, Direct)
57- **Reasoning**: Answerable from a single chunk/passage
58- **Evidence**: Direct quotes sufficient
59- **Chunk Size**: 300-500 chars
60- **Examples**:
61 - "What is [Product/Service] described in the document?"
62 - "Who is mentioned as the CEO in [Year]?"
63 - "What is the duration/cost/size of [Feature]?"
64
65### Medium (Multi-hop, Inference)
66- **Reasoning**: Requires 2-3 pieces of information
67- **Evidence**: Light inference and connection needed
68- **Chunk Size**: 800-1000 chars
69- **Examples**:
70 - "How does [Concept A] affect [Concept B]?"
71 - "What are the requirements for [Process/System]?"
72
73### Hard (Synthesis, Cross-document)
74- **Reasoning**: Requires synthesizing info across multiple documents
75- **Evidence**: Implicit relationships, complex inference
76- **Chunk Size**: 1200-1500 chars
77- **Examples**:
78 - "Compare [Company's] approach in [Document A] vs [Document B]"
79 - "Summarize how [System] addresses [Challenge] across all documents"
80
81### Mixed (Balanced Distribution)
82- **Distribution**: 40% easy, 40% medium, 20% hard
83- **Purpose**: Comprehensive testing across difficulty spectrum
84- **Chunk Size**: Adaptive (1000 chars average)
85
86## Output Format
87
88Standard evaluation JSON format:
89```json
90[
91 {
92 "id": "unique-hash-id",
93 "question": "What is the main product described?",
94 "answer": "The main product is a cloud-based solution that provides...",
95 "question_type": "Fact Retrieval",
96 "difficulty": "easy",
97 "evidence": [
98 "The product is a cloud-based solution that provides enterprise-grade features...",
99 "Key capabilities include real-time processing and analytics..."
100 ],
101 "evidence_relations": "Evidence 1 defines the product, evidence 2 details key capabilities."
102 }
103]
104```
105
106## Implementation Details
107
108When invoked, execute Python script `generate_benchmark_with_difficulty.py` which:
109
1101. **Load PDFs**: Extract text from all PDFs in directory
1112. **Adaptive Chunking**:
112 - Easy: 300-500 char chunks
113 - Medium: 800-1000 char chunks
114 - Hard: 1200-1500 char chunks with 25% overlap
1153. **Topic Analysis**: Use Claude to identify:
116 - Key entities (companies, products, people, dates)
117 - Main concepts and themes
118 - Relationships and connections
1194. **Question Generation** (Claude-powered):
120 - Generate questions matching difficulty requirements
121 - Ensure diverse question types
122 - Create comprehensive ground truth answers
123 - Extract supporting evidence passages
1245. **Validation**:
125 - Verify evidence supports answer
126 - Check answer completeness
127 - Validate JSON structure
1286. **Output**: Save to specified file with statistics
129
130## Statistics Reported
131
132After generation:
133- Total questions generated
134- Questions per type breakdown
135- Questions per difficulty
136- Average answer length
137- Average evidence passages per question
138- Processing time
139
140## Requirements
141
142- Python 3.8+
143- pypdf library (auto-installed if missing)
144- Anthropic API key (from environment)
145- PDF files in specified directory
146
147## Notes
148
149- For **hard** questions, ensures cross-document synthesis by analyzing multiple PDFs
150- For **easy** questions, uses direct extraction with minimal inference
151- Always includes 2-5 evidence passages per question
152- Validates that evidence actually supports the answer
153- Uses unique hash IDs for question tracking
154- Compatible with RAGAs and other evaluation frameworks