AGB-DE: A Corpus for the Automated Legal Assessment of Clauses in German Consumer Contracts

July 2, 2026 ยท View on GitHub

AGB-DE is a legal NLP corpus for the automated detection of potentially void clauses in German standard form consumer contracts. It consists of 3,764 clauses that have been legally assessed by experts and annotated as potentially void (1) or valid (0). Additionally, each clause is annotated with a topic label. This repository contains the corpus itself, code that was uses to anonymize the data, code that was used to train and evaluate baseline models, and the results of the baseline evaluation itself.

How to cite

@inproceedings{braun-matthes-2024-agb,
    title = "{AGB}-{DE}: A Corpus for the Automated Legal Assessment of Clauses in {G}erman Consumer Contracts",
    author = "Braun, Daniel  and
      Matthes, Florian",
    editor = "Ku, Lun-Wei  and
      Martins, Andre  and
      Srikumar, Vivek",
    booktitle = "Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
    month = aug,
    year = "2024",
    address = "Bangkok, Thailand",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2024.acl-long.559/",
    doi = "10.18653/v1/2024.acl-long.559",
    pages = "10389--10405",
    abstract = "Legal tasks and datasets are often used as benchmarks for the capabilities of language models. However, openly available annotated datasets are rare. In this paper, we introduce AGB-DE, a corpus of 3,764 clauses from German consumer contracts that have been annotated and legally assessed by legal experts. Together with the data, we present a first baseline for the task of detecting potentially void clauses, comparing the performance of an SVM baseline with three fine-tuned open language models and the performance of GPT-3.5. Our results show the challenging nature of the task, with no approach exceeding an F1-score of 0.54. While the fine-tuned models often performed better with regard to precision, GPT-3.5 outperformed the other approaches with regard to recall. An analysis of the errors indicates that one of the main challenges could be the correct interpretation of complex clauses, rather than the decision boundaries of what is permissible and what is not."
}

Data

The dataset consists of 3,764 clauses from 93 German consumer standard form contracts. Each clause has been annotated with its topic(s) and whether the clause is valid (0) or potentially void (1). The table below shows the distribution of topics among the clauses and the share of potentially void clauses per topic. For more details about the data please take a look at the paper and the datasheet.

topicnumber of clausesshare_void
age200
applicability1482.03
applicableLaw873.45
arbitration971.03
changes911.11
codeOfConduct290
conclusionOfContract5575.92
contractLanguage410
delivery4757.16
description460
disposal360
intellectualProperty390
language911.11
liability2119
party00
payment6426.07
personalData1150.87
placeOfJurisdiction531.89
prices1471.36
retentionOfTitle1252.4
severability3511.43
textStorage571.75
warranty3146.37
withdrawal5063.75
Total lvl 137984.8

agb-de dataset

ModelPrecisionRecallF1-Score
svm0.370.270.31
bert-base-german-cased0.500.270.35
xlm-roberta-base0.000.000.00
gerpt20.710.140.23
gpt-3.5-turbo-0125 0.060.920.11

agb-de-under dataset

ModelPrecisionRecallF1-Score
svm0.400.320.36
bert-base-german-cased0.510.570.54
xlm-roberta-base0.750.080.15
gerpt20.640.430.52
gpt-3.5-turbo-0125 0.130.920.22

How to use

The easiest way to use the corpus is through the dataset and baseline model provided on ๐Ÿค— Huggingface. See also example.py.

from datasets import load_dataset
from transformers import AutoTokenizer
from transformers import AutoModelForSequenceClassification
from transformers import pipeline

# load corpus
ds = load_dataset("d4br4/agb-de")

# load model
modelname = "d4br4/AGBert"
model = AutoModelForSequenceClassification.from_pretrained(modelname)
tokenizer = AutoTokenizer.from_pretrained(modelname)

# create classification pipeline
clf = pipeline("text-classification", model, tokenizer=tokenizer, max_length=512, truncation=True)

# classify clause text
prediction = clf.predict(ds["test"][0]["text"])

# check classification output
if prediction[0]["label"] == "valid":
    print("This clause is valid.")

else:
    print("This clause is void.")

Contact

If you have any question, please contact:

Daniel Braun (University of Twente)
d.braun@utwente.nl

Acknowledgment

The data collection and annotation was supported by funds of the Federal Ministry of Justice and Consumer Protection (BMJV) based on a decision of the Parliament of the Federal Republic of Germany via the Federal Office for Agriculture and Food (BLE) under the innovation support programme.