Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
[{'expected': SplitInfo(name='train', num_bytes=0, num_examples=22218, shard_lengths=None, dataset_name=None), 'recorded': SplitInfo(name='train', num_bytes=4424510976, num_examples=18949, shard_lengths=[2187, 2180, 2195, 2181, 2192, 2184, 2188, 2180, 1462], dataset_name='deepsynth-en-legal')}]
Error code:   UnexpectedError

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

text
string
summary
string
image
image
source_dataset
string
original_split
string
original_index
int64
SECTION 1. LIABILITY OF BUSINESS ENTITIES PROVIDING USE OF FACILITIES TO NONPROFIT ORGANIZATIONS. (a) Definitions.--In this section: (1) Business entity.--The term ``business entity'' means a firm, corporation, association, partnership, consortium, joint venture, or oth...
Shields a business entity from civil liability relating to any injury or death occurring at a facility of that entity in connection with a use of such facility by a nonprofit organization if: (1) the use occurs outside the scope of business of the business entity; (2) such injury or death occurs during a period that su...
billsum
train
0
SECTION 1. SHORT TITLE. This Act may be cited as the ``Human Rights Information Act''. SEC. 2. FINDINGS. Congress finds the following: (1) The people of the United States consider the national and international protection and promotion of human rights and the rule of law the mos...
Human Rights Information Act - Requires certain Federal agencies to identify and organize all human rights records regarding activities occurring in Guatemala and Honduras after 1944 for declassification and disclosure purposes, and to make them available to the public. Instructs the President to report to Congress re...
billsum
train
1
SECTION 1. SHORT TITLE. This Act may be cited as the ``Jackie Robinson Commemorative Coin Act''. SEC. 2. COIN SPECIFICATIONS. (a) $1 Silver Coins.--In commemoration of the 50th anniversary of the breaking of the color barrier in major league baseball by Jackie Robinson, the Secretary of the Treasury (here...
Jackie Robinson Commemorative Coin Act - Directs the Secretary of the Treasury to: (1) mint and issue one-dollar silver coins emblematic of Jackie Robinson in commemoration of the 50th anniversary of the breaking of the color barrier in major league baseball; and (2) distribute surcharge proceeds to the Jackie Robinso...
billsum
train
2
SECTION 1. NONRECOGNITION OF GAIN WHERE ROLLOVER TO SMALL BUSINESS INVESTMENTS. (a) In General.--Part III of subchapter O of chapter 1 of the Internal Revenue Code of 1986 (relating to common nontaxable exchanges) is amended by adding at the end the following new section: ``SEC. 1045. ROLLOVER OF...
Amends the Internal Revenue Code to provide (temporarily) for the nontaxable rollover of gain from qualified small business stock to another small business stock.
billsum
train
3
SECTION 1. SHORT TITLE. This Act may be cited as the ``Native American Energy Act''. SEC. 2. TABLE OF CONTENTS. The table of contents for this Act is as follows: Sec. 1. Short title. Sec. 2. Table of contents. Sec. 3. Appraisals. Sec. 4. Standardization. Sec. 5. Environmental reviews of major Federal action...
Native American Energy Act - (Sec. 3) Amends the Energy Policy Act of 1992 to allow the Secretary of the Interior, an affected Indian tribe, or a certified third-party appraiser under contract with the Indian tribe to appraise Indian land or trust assets involved in a transaction requiring the Secretary's approval. De...
billsum
train
4
SECTION 1. SHORT TITLE. This Act may be cited as the ``Holocaust Victims Insurance Relief Act of 2001''. SEC. 2. FINDINGS AND PURPOSE. (a) Findings.--The Congress finds the following: (1) The Holocaust, including the murder of 6,000,000 European Jews, the systematic destruction of famil...
Holocaust Victims Insurance Relief Act of 2001 - Directs the Archivist of the United States to establish and maintain a Holocaust Insurance Registry to consist of information on holders and issuers (and related liable entities) of Holocaust-era insurance policies that were: (1) in effect after January 30, 1933, and bef...
billsum
train
5
SECTION 1. SCHOOL-BASED MENTAL HEALTH AND STUDENT SERVICE PROVIDERS. (a) In General.--Subpart 14 of title V of the Elementary and Secondary Education Act of 1965 (20 U.S.C. 7269 et seq.) is amended-- (1) by inserting after the subpart heading the following: ``CHAPTER A--SYSTEMS INTEGRATION; PROMOT...
Amends the Elementary and Secondary Education Act of 1965 to establish a program to assist States and local educational agencies (LEAs) to recruit, train, and hire additional school-based mental health and student service providers, including additional school counselors, psychologists, and social workers (in order to ...
billsum
train
6
SECTION 1. SHORT TITLE. This Act may be cited as the ``Gallatin Land Consolidation Act of 1998''. SEC. 2. FINDINGS. Congress finds that-- (1) the land north of Yellowstone National Park possesses outstanding natural characteristics and wildlife habitats that make the land a va...
Gallatin Land Consolidation Act of 1998 - Provides for the exchange of land and other assets including certain timber harvest rights by the Secretaries of Agriculture and the Interior with the Big Sky Lumber Co. (BSL) for inclusion in the Gallatin National Forest and Deerlodge National Forest, Montana. Directs the Sec...
billsum
train
7
SECTION 1. SHORT TITLE. This Act may be cited as the ``Marine Debris Act Amendments of 2012''. SEC. 2. REFERENCES. Except as otherwise expressly provided, whenever in this Act an amendment is expressed as an amendment to a section or other provision, the reference shall be considered to be made to a secti...
Marine Debris Act Reauthorization Amendments of 2012 - Reauthorizes appropriations through FY2015 for, and revises provisions of, the Marine Debris Research, Prevention, and Reduction Act. (Sec. 3) Renames such Act as the Marine Debris Act. Replaces provisions establishing within the National Oceanic and Atmospheric A...
billsum
train
8
SECTION 1. SHORT TITLE. This Act may be cited as the ``Indian Needs Assessment and Program Evaluation Act of 2001''. SEC. 2. FINDINGS, PURPOSES. (a) Findings.--Congress finds that-- (1) the United States and the Indian tribes have a unique legal and political government-to-government re...
Indian Needs Assessment and Program Evaluation Act of 2001 - Directs the Secretary of the Interior to contract with an appropriate entity to develop a uniform method, criteria, and procedures for determining, analyzing, and compiling the program and service assistance needs of Indian tribes and Indians nationwide.Requi...
billsum
train
9
SECTION 1. SHORT TITLE. This Act may be cited as the ``Kidney Disease Educational Benefits Act of 2002''. SEC. 2. MEDICARE COVERAGE OF KIDNEY DISEASE EDUCATION SERVICES. (a) Coverage of Kidney Disease Education Services.-- (1) In general.--Section 1861 of the Social Security Act (42 U.S...
Kidney Disease Educational Benefits Act of 2002 - Amends title XVIII (Medicare) of the Social Security Act, as amended by the Medicare, Medicaid, and SCHIP Benefits Improvement and Protection Act of 2000, to provide coverage for kidney disease education services furnished, upon the managing physician's referral, to an ...
billsum
train
10
SECTION 1. SHORT TITLE. This Act may be cited as the ``Public Safety and Protection Investment Act of 2003''. SEC. 2. BUSINESS DEDUCTION FOR PURCHASE AND INSTALLATION OF SECURITY DEVICES. (a) In General.--Part VI of subchapter B of chapter 1 of the Internal Revenue Code of 1986 (relating to ...
Public Safety and Protection Investment Act of 2003 - Amends the Internal Revenue Code to allow businesses to expense the costs of purchasing and installing qualifying security devices.
billsum
train
11
SECTION 1. SHORT TITLE. This Act may be cited as the ``National Center for Social Work Research Act''. SEC. 2. FINDINGS. The Congress finds as follows: (1) Social workers focus on the improvement of individual and family functioning and the creation of effective health and ment...
National Center for Social Work Research Act - Amends the Public Health Service Act to establish the National Center for Social Work Research (and a related advisory council) to conduct, support, and disseminate targeted research on social work methods and outcomes related to problems of significant social concern.Sets...
billsum
train
12
SECTION 1. SHORT TITLE. This Act may be cited as the ``Federal Agency Protection of Privacy Act''. SEC. 2. REQUIREMENT THAT AGENCY RULEMAKING TAKE INTO CONSIDERATION IMPACTS ON INDIVIDUAL PRIVACY. (a) In General.--Title 5, United States Code, is amended by adding after section 553 the follow...
Federal Agency Protection of Privacy Act - Requires Federal agencies: (1) when publishing a general notice of proposed rulemaking for any proposed rule or for an interpretative rule involving the internal revenue laws, to prepare, make available for public comment, and publish an initial analysis describing the rule's ...
billsum
train
13
End of preview.

DeepSynth - BillSum Legal Document Summarization

Dataset Description

US Congressional bills with human-written summaries. Specialized for legal document summarization with complex structure, formal language, and legislative terminology.

This dataset is part of the DeepSynth project, which uses visual text encoding for multilingual summarization with the DeepSeek-OCR vision-language model. Text documents are converted into images and processed through a frozen 380M parameter visual encoder, enabling 20x token compression while preserving document layout and structure.

Key Features

  • Original High-Quality Images: Full-resolution images stored once, augmented on-the-fly during training
  • Random Augmentation Pipeline: Rotation, perspective, color jitter, and resize transforms for better generalization
  • Visual Text Encoding: 20x compression ratio (1 visual token ≈ 20 text tokens)
  • Document Structure Preservation: Layout and formatting maintained through image representation
  • Human-Written Summaries: High-quality reference summaries for each document
  • Deduplication Tracking: Source dataset and index tracking prevents duplicates

Dataset Statistics

  • Total Samples: ~22,000
  • Language(s): English
  • Domain: US Congressional bills
  • Average Document Length: ~3,000 tokens
  • Average Summary Length: ~200 tokens

Source Dataset

Based on the BillSum dataset of US Congressional bills.

Image Augmentation Pipeline

Images are stored at original resolution (up to 1600×2200) and augmented during training for better generalization:

Available Augmentation Transforms

  • Random Rotation: ±10° rotation for orientation invariance
  • Random Perspective: 0.1-0.2 distortion to simulate viewing angles
  • Random Resize: 512-1600px range for multi-scale learning
  • Color Jitter: Brightness, contrast, saturation adjustments (±20%)
  • Random Horizontal Flip: Optional (use with caution for text)

All transforms preserve aspect ratio with padding to maintain text readability. This approach:

  • Reduces storage: 6x less disk space (single image vs 6 resolutions)
  • Increases flexibility: Any resolution on-the-fly vs pre-computed fixed sizes
  • Improves generalization: Random transforms prevent overfitting to specific resolutions

Dataset Structure

Data Fields

  • text (string): Original document text
  • summary (string): Human-written summary
  • image (PIL.Image): Original full-size rendered document image (up to 1600×2200)
  • source_dataset (string): Origin dataset name
  • original_split (string): Source split (train/validation/test)
  • original_index (int): Original sample index for deduplication

Data Example

{
    'text': 'A BILL to amend the Internal Revenue Code of 1986...',
    'summary': 'This bill amends the Internal Revenue Code to...',
    'image': <PIL.Image>,  # Original resolution (up to 1600×2200)
    'source_dataset': 'billsum',
    'original_split': 'train',
    'original_index': 0
}

Usage

Loading the Dataset

from datasets import load_dataset

# Load full dataset
dataset = load_dataset("baconnier/deepsynth-en-legal")

# Streaming for large datasets
dataset = load_dataset("baconnier/deepsynth-en-legal", streaming=True)

Training Example with DeepSeek-OCR and Augmentation

from transformers import AutoProcessor, AutoModelForVision2Seq
from datasets import load_dataset
from deepsynth.data.transforms import create_training_transform

# Load model and processor
model = AutoModelForVision2Seq.from_pretrained("deepseek-ai/DeepSeek-OCR")
processor = AutoProcessor.from_pretrained("deepseek-ai/DeepSeek-OCR")

# Load dataset
dataset = load_dataset("baconnier/deepsynth-en-legal")

# Create augmentation pipeline (random rotation, perspective, resize, color jitter)
transform = create_training_transform(
    target_size_range=(512, 1600),  # Random resize range
    rotation_degrees=10,             # ±10° rotation
    perspective_distortion=0.1,      # Perspective transform
    brightness_factor=0.2,           # ±20% brightness
    contrast_factor=0.2,             # ±20% contrast
)

# Process sample with augmentation
sample = dataset['train'][0]
augmented_image = transform(sample['image'])  # Apply random transforms
inputs = processor(
    images=augmented_image,
    text=sample['text'],
    return_tensors="pt"
)

# Fine-tune decoder only (freeze encoder)
for param in model.encoder.parameters():
    param.requires_grad = False

# Training loop with on-the-fly augmentation...

Training Recommendations

DeepSeek-OCR Fine-Tuning

# Recommended hyperparameters with augmentation
training_args = {
    "learning_rate": 2e-5,
    "batch_size": 4,
    "gradient_accumulation_steps": 4,
    "num_epochs": 3,
    "mixed_precision": "bf16",
    "freeze_encoder": True,  # IMPORTANT: Only fine-tune decoder

    # Augmentation parameters
    "rotation_degrees": 10,           # Random rotation ±10°
    "perspective_distortion": 0.1,    # Perspective transform
    "resize_range": (512, 1600),      # Random resize 512-1600px
    "brightness_factor": 0.2,         # ±20% brightness
    "contrast_factor": 0.2,           # ±20% contrast
}

Expected Performance

  • Baseline (text-to-text): ROUGE-1 ~40-42
  • DeepSeek-OCR (visual): ROUGE-1 ~44-47 (typical SOTA)
  • Training Time: ~6-8 hours on A100 (80GB) for full dataset
  • GPU Memory: ~40GB with batch_size=4, mixed_precision=bf16

Dataset Creation

This dataset was created using the DeepSynth pipeline:

  1. Source Loading: Original text documents from billsum
  2. Text-to-Image Conversion: Documents rendered as PNG images (DejaVu Sans 12pt, Unicode support)
  3. Original Resolution Storage: Full-quality images stored once (up to 1600×2200)
  4. Incremental Upload: Batches of 5,000 samples uploaded to HuggingFace Hub
  5. Deduplication: Source tracking prevents duplicate samples

Note: Images are augmented on-the-fly during training using random transformations (rotation, perspective, resize, color jitter) for better generalization across different resolutions and conditions.

Rendering Specifications

  • Font: DejaVu Sans 12pt (full Unicode support for multilingual text)
  • Line Wrapping: 100 characters per line
  • Margin: 40px
  • Background: White (255, 255, 255)
  • Text Color: Black (0, 0, 0)
  • Format: PNG with lossless compression

Citation

If you use this dataset in your research, please cite:

@misc{deepsynth-en-legal,
    title={{DeepSynth BillSum Legal Document Summarization: Visual Text Encoding with Random Augmentation for Summarization}},
    author={Baconnier},
    year={2025},
    publisher={HuggingFace},
    howpublished={\url{https://huggingface.co/datasets/baconnier/deepsynth-en-legal}}
}

Source Dataset Citation

@inproceedings{kornilova2019billsum,
    title={BillSum: A Corpus for Automatic Summarization of US Legislation},
    author={Kornilova, Anastassia and Eidelman, Vladimir},
    booktitle={Proceedings of the 2nd Workshop on New Frontiers in Summarization},
    year={2019}
}

License

CC0 1.0 Universal (Public Domain Dedication)

Note: This dataset inherits the license from the original source dataset. Please review the source license before commercial use.

Limitations and Bias

  • Legal jargon: Heavy use of legislative and legal terminology
  • Complex structure: Bills have nested sections, subsections, clauses
  • US-specific: United States federal legislation only
  • Formal language: Very different from conversational or news text
  • Long documents: Bills can be 10,000+ tokens

Additional Information

Dataset Curators

Created by the DeepSynth team as part of multilingual visual summarization research.

Contact

Acknowledgments

  • DeepSeek-OCR: Visual encoder from DeepSeek AI
  • Source Dataset: billsum
  • HuggingFace: Dataset hosting and infrastructure
Downloads last month
50

Paper for baconnier/deepsynth-en-legal