SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.15799 · EMNLP · 2023

DALE: Generative Data Augmentation for Low-Resource Legal NLP

Sreyan Ghosh, Sonal Kumar, Chandra Kiran Evuru

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 2 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2310.15799.json · badge: /api/ran/2310.15799.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
Sreyan88/DALE canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
clean_pipeline Ran
ran; our contract draft was wrong, not the code
Sreyan88/DALE/bart_ft/genius_utils.py
code served (permissive licence) · get_code("a23480196cc5e81c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def remove_special_characters(text):
    pat = '[^a-zA-z0-9.,!?/:;\\"\\\'\\s]'
    new_text = re.sub(pat, '', text)
    return new_text

def remove_brakets(text):
    text = re.sub('\\[(.*)\\]', '', text)
    text = re.sub('\\((.*)\\)', '', text)
    return text

def clean_pipeline(text):
    return remove_brakets(remove_special_characters(text))

ARGS = {
    'text': 'Hello [world] (test) with @special# characters! And some normal text.'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_freq Ran
ran; our contract draft was wrong, not the code
Sreyan88/DALE/pmi/k_gram_pmi.py
code served (permissive licence) · get_code("147caaead7de63a1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned FreqDist. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from nltk.probability import FreqDist
from nltk.util import ngrams

# Create a small corpus of tokenized sentences
# Each sentence is a list of tokens (strings)
corpus_tokens = [
    ['the', 'cat', 'sat', 'on', 'the', 'mat'],
    ['the', 'dog', 'ran', 'in', 'the', 'park'],
    ['birds', 'fly', 'in', 'the', 'sky']
]

ARGS = {
    'corpus_tokens': corpus_tokens,
    'n': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
nltk, numpy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type FreqDist — a FreqDist output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a FreqDist output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_label2desc Ran
ran; our contract draft was wrong, not the code
Sreyan88/DALE/label_mapping/label_desc.py
code served (permissive licence) · get_code("7e73f2fcd3832619")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

# The function get_label2desc takes a dataset_name parameter and returns
# a dictionary mapping label indices to descriptions based on dataset type.
# It has no complex dependencies - just a string parameter.

ARGS = {
    'dataset_name': 'ng20'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_top_pmi_ngrams Ran
ran; our contract draft was wrong, not the code
Sreyan88/DALE/mask_dataset.py
code served (permissive licence) · get_code("5b1c15e2a052fc90")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import pickle
import tempfile
import operator

# Create a temporary directory for PMI pickle files
temp_dir = tempfile.mkdtemp()

# Create sample PMI data and save it as pickle files
# PMI data is typically a dict with tuple keys and float values

# Create first pickle file with typ='ngram'
pmi_data_1 = {
    ('hello', 'world'): 0.95,
    ('foo', 'bar'): 0.75,
    ('test', 'case'): 0.85,
    ('python', 'code'): 0.88,
    ('machine', 'learning'): 0.92,
}

with open(os.path.join(temp_dir, 'pmi_ngram_1.pkl'), 'wb') as f:
    pickle.dump(pmi_data_1, f)

# Create second pickle file with typ='ngram'
pmi_data_2 = {
    ('deep', 'learning'): 0.91,
    ('neural', 'network'): 0.89,
    ('data', 'science'): 0.87,
    ('random', 'forest'): 0.80,
}

with open(os.path.join(temp_dir, 'pmi_ngram_2.pkl'), 'wb') as f:
    pickle.dump(pmi_data_2, f)

# Create a file that doesn't match the typ filter (should be ignored)
with open(os.path.join(temp_dir, 'other_data.pkl'), 'wb') as f:
    pickle.dump({'ignored': 0.5}, f)

# Create an empty pickle file with matching typ (should be skipped)
with open(os.path.join(temp_dir, 'pmi_ngram_empty.pkl'), 'wb') as f:
    pickle.dump({}, f)

ARGS = {
    'pmi_path': temp_dir,
    'p': 0.6,  # Keep top 60% of ngrams
    'typ': 'ngram'  # Filter for files containing 'ngram'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
my_topk Ran
ran, honoured the contract we drafted
Sreyan88/DALE/bart_ft/bart_finetune_casehold.py
code served (permissive licence) · get_code("888e401a8ad6f1f6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Analyze the function:
# - my_topk takes a parameter `text`
# - It calls text.split(' ') which means text must be a string
# - It returns an integer based on the length of the split

# Create a simple string with enough words to test the logic
text = "hello world this is a test string with many words for testing purposes"

ARGS = {
    "text": text
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
nltk_whitespace_tokenizer Ran
ran; our contract draft was wrong, not the code
Sreyan88/DALE/bart_ft/aspect_keybert.py
code served (permissive licence) · get_code("f579a8268e17a0e2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from nltk.tokenize import word_tokenize, WhitespaceTokenizer

# Set random seed for reproducibility
torch.manual_seed(0)

# The function nltk_whitespace_tokenizer takes a single parameter: text
# It expects text to be a string that can be tokenized by WhitespaceTokenizer

ARGS = {
    "text": "Hello world this is a test string for tokenization"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
nltk, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
remove_brakets Ran
ran; our contract draft was wrong, not the code
Sreyan88/DALE/bart_ft/genius_utils.py
code served (permissive licence) · get_code("49c1f33f431d9c86")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def remove_brakets(text):
    text = re.sub('\\[(.*)\\]', '', text)
    text = re.sub('\\((.*)\\)', '', text)
    return text

ARGS = {
    'text': 'Hello [world] and (everyone)'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
remove_special_characters Ran
ran; our contract draft was wrong, not the code
Sreyan88/DALE/bart_ft/genius_utils.py
code served (permissive licence) · get_code("a3961c19a34724f0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def remove_special_characters(text):
    pat = '[^a-zA-z0-9.,!?/:;\\"\\\'\\s]'
    new_text = re.sub(pat, '', text)
    return new_text

ARGS = {
    'text': 'Hello, World! This is a test@#$% with special chars&*()'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_sentences Not yet run
unverified (harvested, no recorded run)
Sreyan88/DALE/mask_dataset.py
code served (permissive licence) · get_code("7aa4ea289d984233")
How it ran

no invocation recorded.

my_topk Not yet run
unverified (harvested, no recorded run)
Sreyan88/DALE/bart_ft/bart_finetune_multi_class.py
code served (permissive licence) · get_code("a7be799abc21526d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 10 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

We present DALE, a novel and effective generative Data Augmentation framework for lowresource LEgal NLP. DALE addresses the challenges existing frameworks pose in generating effective data augmentations of legal documents -legal language, with its specialized vocabulary and complex semantics, morphology, and syntax, does not benefit from data augmentations that merely rephrase the source sentence. To address this, DALE, built on an Encoder-Decoder Language Model, is pre-trained on a novel unsupervised text denoising objective based on selective masking -our masking strategy exploits the domain-specific language characteristics of templatized legal documents to mask collocated spans of text. Denoising these spans help DALE acquire knowledge about legal concepts, principles, and language usage. Consequently, it develops the ability to generate coherent and diverse augmentations with novel contexts. Finally, DALE performs conditional generation to generate synthetic augmentations for low-resource Legal NLP tasks. We demonstrate the effectiveness of DALE on 13 datasets spanning 6 tasks and 4 low-resource settings. DALE outperforms all our baselines, including LLMs, qualitatively and quantitatively, with improvements of 1%-50%.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2310.15799")
get_code_for_paper("2310.15799")
have("2310.15799")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2310.15799.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2310.15799.svg)](https://syntology.ai/paper/2310.15799)

Connect an agent — have() is free.