Zero-Shot Financial Metrics Extraction into Typed JSON
30 Production Challenge Scenarios • Real-Time Automated Quality Scoring

Interactive Prompt Engineering Lab

Test and score your prompts against real-world enterprise scenarios. Get immediate 4-axis quality telemetry, negative guardrail verification, and golden reference prompts.

Read Syllabus
1. Authoritative Persona
Expert role + zero fluff
25 pts
2. Deterministic Schema
XML tags + JSON / keys
25 pts
3. Negative Guardrails
NEVER / fallback rules
25 pts
4. Token Efficiency
150–1,800 chars concise
25 pts
Data Engineering & RAGIntermediate

Zero-Shot Financial Metrics Extraction into Typed JSON

Extract revenue, gross margin, diluted EPS, and YoY growth percentages from an unstructured CEO shareholder letter into a strict JSON schema with zero hallucinated numbers.

Target Input Context / Untrusted Data:
Text Excerpt: "Fiscal 2025 was a record achievement: total revenues reached $8.42 billion, up twelve percent from $7.51 billion in the prior fiscal period. Our GAAP diluted earnings per share expanded to $3.18, compared with $2.84 last year. Gross margins stood at a healthy 68.4%."
Quality Requirements & Guardrails:
Define a Senior Financial Data Extraction Engineer persona.
Enforce JSON schema with typed floats and exact currency units.
Enforce a strict anti-extrapolation rule: if a number is not explicitly mentioned, output null.
Validate that mathematically derived numbers (e.g. YoY growth) are either directly quoted or marked as calculated.
Your System Prompt Draft
69 chars~17 tokens
Golden Reference Architecture (100% Quality Benchmark)
<system_instructions>
You are an Automated Financial Data Parser.
Extract key metrics from the provided shareholder letter into strict, machine-readable JSON.

EXTRACTION CONSTRAINTS:
1. NUMERICAL INTEGRITY: Extract numbers as raw floats (e.g. 8420000000 or 8.42). Do not guess or extrapolate missing fields; set missing values strictly to `null`.
2. OUTPUT SCHEMA:
{
  "fiscal_year": number,
  "revenue": { "value_billions": float, "currency": "USD", "yoy_growth_percent": float },
  "diluted_eps": { "gaap": float, "prior_year": float },
  "gross_margin_percent": float,
  "confidence_score": float
}
3. Output strictly valid JSON enclosed inside <financial_data> tags with no conversational markdown.
</system_instructions>