AdversaLLC's picture
|
download
raw
1.86 kB
metadata
license: mit

Dataset Title: OCR-to-JSON Information Extraction

Project Overview

This dataset is specifically designed for fine-tuning Large Language Models (LLMs) to perform structured data extraction from Optical Character Recognition (OCR) outputs. The primary objective is to convert raw, unstructured text strings—often containing noise, misalignments, and formatting inconsistencies—into valid, machine-readable JSON objects.


Dataset Specifications

Attribute Description
File Format JSON Lines (.jsonl)
Task Type Supervised Fine-Tuning (SFT) / Instruction Tuning
Language English
Encoding UTF-8

Data Structure

Each entry in the dataset consists of a single JSON object per line with two primary fields:

  • prompt – The raw OCR text extracted from a document (e.g., invoices, receipts, or forms).
  • completion – The corresponding ground-truth information structured as a nested JSON dictionary.

Data Field Definitions

Prompt Field

Represents the "source" text.

  • Includes headers, dates, numerical values, and currency symbols as recognized by standard OCR engines.
  • May contain line breaks (\n) and varied spacing representative of physical document layouts.

Completion Field

Represents the "target" output.

Follows a strict schema containing keys such as:

  • invoice_number
  • date
  • vendor_name
  • total_amount
  • line_items (list of objects)

Usage Instructions

Requirements

  • Python 3.10+
  • datasets (Hugging Face)
  • transformers library

Loading the Dataset

from datasets import load_dataset

dataset = load_dataset("json", data_files="real_dataset.jsonl", split="train")
print(dataset[0])

Xet Storage Details

Size:
1.86 kB
·
Xet hash:
d1e5cb433506ae68b177230f6bb85bb6438a3ac006917c9e002ec1ea3d818037

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.