Elamur Research

LEDGAR: A Large-Scale Multi-label Corpus for Text Classification of Legal Provisions in Contracts

Paper · 2020 · Don Tuggener, Pius von Däniken, Thomas Peetz et al.

Summary

To find the same kind of provision across many contracts, a reader has to recognize it even when the parties describe it differently. The heading can help, but some provisions lack headings, and similar headings can refer to different obligations. LEDGAR approaches this problem as text classification. Given the wording of a provision, the task is to identify its topic or topics. The authors knew of no freely available collection that supplied this kind of topical labeling for contract provisions. Their contribution was to assemble one at a scale that would be hard to reach by reviewing and labeling every paragraph individually.

The authors started with material contracts filed through the U.S. Securities and Exchange Commission’s EDGAR system. A recurring layout gave them a way to pair text with a likely topic. A bold or underlined heading followed by punctuation could supply the label, and the differently formatted text that came next could supply the provision. The authors screened these pairs, removed duplicate provision texts, and cleaned the vocabulary of headings. They separated compound headings when they had evidence that the parts were used as independent labels, combined some singular and plural forms, and removed labels found in too few contracts or concentrated in unusually few documents. The final cleanup counts give 846,274 provisions from 60,540 contracts, with 104,990,418 tokens and 12,608 distinct labels. The share of provisions carrying multiple labels is 16.44%.

The paper tests several ways to turn that broad collection into a more focused classification task. One keeps frequent labels, another represents longer headings using shorter names found inside them, and another uses topics a lawyer selected for non-disclosure agreements. Simply looking for a label name in the body of a provision performed poorly compared with trained classifiers. On the test subset built from the most frequent topics, DistilBERT reached a micro F1 of 0.95. On the subset formed by decomposing headings, an attention-weighted classifier reached 0.72 on the same metric, while DistilBERT had difficulty with low-frequency labels. The choice of label inventory changed which approach worked best.

The authors also tested transfer from the filings to English non-disclosure agreements collected separately and annotated by legal professionals. The best transferred micro F1 was 0.52, using DistilBERT with thresholds tuned on external development examples. Logistic regression trained directly on the external annotations reached 0.76 on that metric. Some provision types transferred well, while others changed meaning with the contract type or the annotation practice. Together, the experiments show what can be learned from headings at scale and why a familiar heading is only a starting point for matching categories across collections.

Interesting ideas

  • I1. Labels from document layout. Text that is visually marked as a heading (bold or underlined, followed by a period or colon) can act as free supervision for the paragraph that follows. This could produce labeled data from any collection of structured documents, such as regulations, standards, or official templates.
  • I2. Cautious splitting of compound labels. Delimiters like "and", commas, or "&" can either join two labels or belong to a single label. The authors split only when each resulting part already exists as a standalone label. This cheap check is a reusable way to normalize noisy, user-generated tag sets.
  • I3. Regression-based outlier filtering. The authors fit a linear relation between how often a label occurs and how many documents it appears in. They then remove labels that fall well below that line, meaning labels concentrated in only a few documents. The distance is normalized by the expected value, so frequent labels are allowed more variance. The same approach could flag boilerplate or source-specific categories in other crawled datasets.
  • I4. Release raw, filter downstream. The corpus is published without a frequency cutoff, and tables show how different thresholds change its size. Users can then build anything from extreme-classification benchmarks to small, practical labelsets from the same resource.
  • I5. Testing outside the source corpus. The classifiers are also evaluated on contracts that did not come from the corpus. This shows whether models trained on cheaply scraped data hold up on real documents, which is worth checking for any automatically built training set.

Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.

Deep dive: LEDGAR: A Large-Scale Multi-label Corpus for Text Classification of Legal Provisions in Contracts

LEDGAR turns headings in SEC contracts into labels for legal provisions and tests how well classifiers trained on them work on other agreements. · about 35 minutes to read

The problem and its context

What a provision label is supposed to tell a reader

A contract can contain provisions about how notices must be given, which law governs the agreement, and what happens when the agreement ends. These are different subjects within the same document. A category assigned to the entire contract would give little help locating the passage that deals with notices. LEDGAR makes the provision the unit of classification because provisions are the units people work with when drafting, negotiating, or examining an agreement. A provision can also address several subjects, so the task allows several labels for the same passage.

The paper connects the legal importance of provisions to speech acts. A passage in a contract can do something in the agreement, such as imposing a duty or specifying a permission. Its legal function and its subject are different descriptions. A passage about how to handle confidential material after termination may describe a duty, while its topic concerns the consequences of termination. Another passage can also impose a duty while dealing with a different subject altogether. A collection organized around duties and permissions would support questions about those functions. A collection organized around provision types would support questions about where agreements address a particular subject.

This distinction matters for the resource the authors wanted to build. When a provision has several topics, each of its labels can describe a part of what it covers. Even the name of a single topic can vary across contracts. A label inventory assembled from the documents therefore inherits the decisions of their drafters about how to divide subjects and what to call them. Before that inventory can support a prediction task, the researchers need a way to recognize when two names should be treated as variants, when a name should be split, and when the evidence for a label is too narrow to justify keeping it.

The paper also places LEDGAR within research on extreme classification, where the choices available to a classifier can number in the thousands or more. Its connection to that problem follows from the way the labels are collected. A fixed inventory written in advance can limit the number of possible categories. Taking names from a large body of contracts allows common names to recur and specialized names to accumulate. The resulting diversity is useful for studying infrequent categories, although a broad inventory also makes it harder to collect enough examples of each target and to judge a system by a single pooled score.

The paper describes earlier efforts that made EDGAR easier to work with. OpenEDGAR provided a way to extract information from the archive and store it in a relational database. That made tasks such as locating Exhibit-10 filings more convenient. The work also illustrated uses of archive text, including training word embeddings on press releases. EDGAR access solves the problem of locating documents and working with them in bulk. LEDGAR starts from that point and asks how to identify provision boundaries and acquire the topical targets for individual passages.

Another resource discussed in the paper is LexNLP, a software library for natural language processing in the legal domain. It included utilities for tasks such as dividing text into units and finding named entities, along with rules for extracting and normalizing items such as amounts and durations. It also offered representations learned from legal text and a classifier for recognizing whether a document is a contract. The distinction in scale is important here. Recognizing a contract tells a researcher what kind of document they have. Identifying the subjects of its provisions asks what the document contains and where that content begins and ends.

The closest large-scale topical comparison described by the authors came from EU legislation. That project assigned concepts to documents, with 57K legislative documents and an inventory of 4.3K concepts. It gave the authors a precedent for studying legal text with a large set of possible labels. LEDGAR asks the corresponding question at a different unit of analysis and with a different object of study. Its examples are passages within agreements, with categories drawn from headings written into those agreements. Large-Scale Multi-Label Text Classification on EU Legislation

The other comparison came from work on German tenancy law. Researchers took sentences and assigned functional categories such as prohibition, permission, and duty. The paper also describes experiments combining rules with active learning, as well as a follow-up that asked whether annotations from tenancy law could help classify sentences in rental agreements. That follow-up raised a question that LEDGAR would encounter in a topical setting. An annotation may be useful in another collection only to the extent that the categories and examples still correspond. For the tenancy-law work, the categories concerned legal function. For LEDGAR, the question is whether topic names from filed contracts still make sense under a separate annotation scheme.

The gap the authors identified was specific. There were ways to retrieve SEC documents, methods for analyzing legal language, topical classification of legislation, and sentence classification by legal function. They were looking for a freely available resource organized around the topics of individual contract provisions. Existing text and existing classification methods supplied parts of the solution. What was missing was a large collection in which provision bodies were paired with topic labels, with enough information about their origins to judge what those labels meant.

Why use headings as evidence

Material contracts offered both the passages of interest and a recurring indication of what those passages were about. A drafter may put a name at the start of a paragraph to help a human reader navigate the document. If the file preserves the formatting of that name, the same distinction can help an extraction program identify it. The heading then becomes a form of linguistic annotation, although it was created for readers of the agreement instead of according to a shared research guideline.

Using layout in this way determines what the resulting research task can measure. During collection, the heading supplies the proposed answer. During classification, the provision body supplies the evidence for predicting it. A heading that recurs in the body may give the classifier an obvious clue. A provision may also use different wording to express the same subject, in which case a literal match will miss it. The separation makes it possible to ask whether classifiers can learn associations between the contents of provisions and the names applied to them.

The method, step by step

From a filing to a labeled example

LEDGAR stands for Labeled EDGAR. The authors use EDGAR, the Electronic Data Gathering, Analysis, and Retrieval system, to reach documents submitted to the U.S. Securities and Exchange Commission. They concentrate on Exhibit-10 material contracts, which include agreements such as shareholder, employment, and non-disclosure agreements. This choice gives the collection several kinds of contracts while retaining provision topics, such as governing law, that can recur across them. The crawl covered Exhibit-10 contracts from 2016 through 2019, inclusive, and gathered 117,578 contracts before extraction.

The key observation is that a provision often starts with a visible change in formatting. A short name might appear underlined or in bold, followed by a period or colon and then a passage in another style. To a reader, the name announces the subject of the text. To the scraper, the sequence supplies a candidate boundary between the heading and the body. The scraper looks near the start of blocks marked as paragraphs or divisions and checks for the formatting patterns the authors observed in the filings. The paper identifies underlining and font markup among the ways those patterns appear in the source documents.

The scraper assigns separate roles to the pieces it finds. The emphasized opening text becomes a possible label. The material after the delimiter becomes possible provision text. The label and the text are then screened before the extraction is kept. Among the checks described in the paper are length bounds for the elements, a requirement for an upper-case initial character, and checks involving stopwords. Stopwords here are common words that would make a poor heading or passage by themselves. The checks reject candidates made up entirely of those words and headings that end in them. The paper describes these as examples from a larger set of rules in the released codebase.

Each of these decisions concerns evidence available at the time of scraping. The extractor can see where a differently formatted phrase occurs, how the phrase ends, and what follows it. It has no separate annotation to consult when deciding whether the phrase names the topic accurately. The rules aim to admit useful heading–body pairs from documents with varying layouts. The resulting supervision still depends on how the agreement was written and how its formatting was represented in the filing.

How LEDGAR turns contract filings into classification data

The steps in order.

How LEDGAR turns contract filings into classification dataStep 1: Gather Exhibit-10 contracts from EDGAR1. Gather Exhibit-10 contracts from EDGARStep 2: Find marked headings at paragraph openings2. Find marked headings at paragraph openingsStep 3: Separate candidate headings from their provision text3. Separate candidate headings from their provision textStep 4: Screen extractions and remove duplicate provision texts4. Screen extractions and remove duplicate provision textsStep 5: Split compound headings and merge selected name variants5. Split compound headings and merge selected name variantsStep 6: Filter labels by their distribution across contracts6. Filter labels by their distribution across contractsStep 7: Release provisions with labels and contract paths7. Release provisions with labels and contract paths

Cleaning texts and cleaning names

The first cleanup pass removes duplicate provision texts. This operates on the bodies of the examples, so it can reduce the number of training examples as well as the number of source contracts represented after cleaning. Subsequent operations on names have a different effect. A split changes the provision’s set of labels, while a merge changes which name represents a category. The authors report the corpus counts after each pass, which makes it possible to distinguish these changes from the disappearance of provision texts.

A compound heading is evidence that the provision may concern several topics. During scraping, the authors treat semicolons and slashes in headings as separators. Other separators require more care. An occurrence of “and,” a comma, or an ampersand can join independent topic names, or it can be part of a single name. In a heading such as Consideration and Payment, the two parts can be read as topics in their own right. A heading about the rights of a successor and retiring agent uses “and” inside a description of whose rights are at issue. Treating every conjunction as a separator would create fragments with very different status.

The rule for an ambiguous separator is to try a split and check whether the resulting components are already attested as standalone labels. If they are, the provision receives those component labels. The rule uses the corpus itself as evidence about how a heading should be read. It can recover topics that otherwise would be represented only under a longer compound name. Its decision is based on independent use of the resulting strings, so a rare but valid component that never appears by itself can fail the check.

The singular–plural pass checks for a different kind of overlap. The authors find labels ending in “s” and see whether dropping that character yields another name already in the vocabulary. When they find a pair, they retain the plural spelling as the destination for the merged label. Waiver and Waivers illustrate the relationship. The test is an attestation check combined with a spelling rule. It has a narrow purpose that is easy to follow through the collection. It will miss equivalent names that differ in several words or in their order.

Splitting and merging can both reduce the number of distinct labels. With a split, an old compound name can disappear because its parts already have entries in the vocabulary. At the same time, the provision that formerly carried the compound may carry several labels. With a merge, two spellings become one entry. Thus a smaller inventory can coexist with more label assignments per provision. The authors’ cleanup statistics record both quantities to show the different kinds of change.

Measuring how widely a label is used

The authors distinguish how frequently a label occurs from how many contracts contain it. Many uses concentrated in a handful of agreements provide a different kind of evidence from many uses spread across a broad set of documents. The aim of the pruning step is to keep categories that have some support beyond the particular agreements in which they were found.

They first remove labels that occur in fewer than five contracts. They then look for labels that are unusually concentrated even among those that pass this rule. A single document-count threshold would apply the same standard to all survivors, regardless of their overall frequency. Instead, the authors assume that more frequent labels should generally appear in more contracts. They fit a linear regression using label occurrence counts and observed contract counts. For a given label, the fitted line supplies an expected number of contracts at that label’s frequency.

dist(ldfᵢ, ldf̂ᵢ) = (ldfᵢ − ldf̂ᵢ) / ldfᵢ

Here, i identifies a label. ldfᵢ is the observed number of contracts containing label i, and ldf̂ᵢ is the number predicted by the fitted regression from the label’s occurrence frequency. The hat marks a fitted value. The minus sign gives the observed count minus the predicted count, and division by the observed count expresses the difference relative to that count. dist(ldfᵢ, ldf̂ᵢ) is the resulting signed distance. It is negative when a label occurs in fewer contracts than the fit predicts.

The authors calculate the standard deviation of these distances to characterize how widely they vary. They flag negative distances whose magnitude exceeds that standard deviation. Only the side of the distribution associated with narrow document coverage is relevant to the rule. A label appearing in more documents than the fit predicts would have a positive distance and would pass this part of the filter. The normalization lets the size of the raw gap be judged relative to the label’s observed document count.

The paper gives examples involving a mezzanine loan option and an issuing lender’s resignation after assignment. The filter identifies these names through their distribution, without trying to determine their legal importance from the words themselves. Its underlying assumption is that a category with unusually narrow coverage may reflect practices specific to some agreements. This is a way of shaping a general corpus. Whether one of the excluded categories is worth studying in a more specialized setting remains a separate question.

Using shorter names to represent longer ones

The authors also propose a way to reorganize the label inventory after cleaning. They observe that long headings tend to be infrequent and ask whether the inventory contains shorter labels that could serve as their components. Their criterion is textual. A shorter label qualifies when its name matches a consecutive sequence of tokens within the longer name. A token here is one of the units into which the heading is divided for comparison. The words have to appear together in the longer heading, in the same order.

A heading about compliance with environmental laws illustrates the idea. Compliance and Environmental Laws can be recovered from contiguous portions of the long label if both shorter names exist in the inventory. The same rule can find several levels. A long heading can point to a shorter heading with more than one word, which can in turn point to still shorter labels. The paper illustrates the process with a share adjustment heading and shows both intermediate labels and the terminal labels that result from decomposition.

In the graph, the nodes are the label names and arrows run from longer names to shorter component names. Each step shortens the name, so following arrows cannot bring the traversal back to where it started. That is the sense in which the graph is directed and acyclic. A leaf is a label with no further outgoing decomposition. When an experiment projects the data to leaf labels, the target for a provision becomes the terminal components found by following the graph from its original labels.

This projection changes the task given to a classifier. A body paired with one specific long heading can now be paired with several short topics. Several distinct headings can also contribute examples to a shared shorter category. The construction can recover useful common vocabulary without a lawyer hand-building the whole hierarchy. Its definition of a component is an observed text sequence. That sequence may capture a genuine topical relationship, or it may lose a qualification that matters to the meaning of the original heading.

What is released and how classifiers are trained

The corpus is released as a JSONL file. In that format each line contains an object representing an example, with provision for the body text, label for the extracted labels, and source for the relative path to the originating contract. The authors also release their corpus construction and classification code. They keep the examples that survive cleanup without imposing an additional overall occurrence cutoff for release. Document coverage has already served as a screening criterion. Researchers can then choose stricter frequency cutoffs or a narrower topic inventory for a particular experiment.

For the paper’s classification experiments, the starting point is a subset of the released data with a specified target inventory. Each LEDGAR subset is divided randomly into training, development, and test portions using the paper’s 70%-10%-20% split, in that order. Training examples are used to learn how provision wording relates to the labels. The development portion supports choices such as decision thresholds. Test examples are used for the reported assessment. The paper compares a string-matching baseline with several trained approaches, including classifiers that look directly at word occurrences and classifiers that summarize the whole provision before predicting labels.

The simplest rule checks the provision body for the names of the available labels and assigns every label it finds. Logistic regression uses TF-IDF features for individual words. These features give a classifier direct access to word occurrences, weighted using their frequency in the document and their distribution across documents. A separate logistic regression classifier is fitted for each label. In this setup, evidence for one label can be evaluated independently of evidence for another.

The bag-of-words approach uses fastText representations for the tokens. The term “bag of words” describes a representation built by pooling information from the tokens without preserving their sequence in the final vector. In the basic version, each dimension of the token representations is averaged across the provision. The resulting vector goes to a two-layer multilayer perceptron, a feed-forward classifier that learns how to combine the dimensions for prediction. The attention variant learns a weight for each token representation before forming the pooled vector. It can therefore give more weight to some words than others. The paper draws these parts of the approach from earlier work on sub-word information and attention for document classification. Enriching Word Vectors with Subword Information · Hierarchical Attention Networks for Document Classification

The DistilBERT approach uses fine-tuning, which means adapting a pretrained system using examples from the task at hand. Its classifier takes the representation of the special beginning-of-input token, written [CLS], as a summary of the provision. The authors adapt the training implementation from the Transformers library for multilabel classification. The neural classifiers described in the paper have a sigmoid output, which assigns a separate score to each label. That arrangement allows several labels to score highly for the same body. A softmax, which the authors replace in the DistilBERT script, makes the outputs compete for a shared probability total. DistilBERT · BERT · Transformers

A separate decision still has to turn each score into a yes or no for the label. The paper describes searching thresholds from 0.1 to 0.9 in 0.01 increments and retaining the threshold that gives the best micro F1 for each label. This associates threshold selection with the behavior of individual labels. A high threshold generally makes the decision more conservative, while a low threshold admits more predictions. When a rare label has unstable scores, choosing a threshold from available examples can be difficult. The paper returns to this issue when explaining why DistilBERT produces many extra label assignments in one of the larger inventories.

Experiments and results

How much survives collection and cleanup

Of the 117,578 contracts crawled, 72,605 contributed labeled provisions to the initial scrape. At that point there were 1,850,284 provisions and 183,622 distinct label names. Duplicate removal left 1,081,177 provisions represented in 63,794 contracts. The number of names also fell at this stage, to 182,328. These are successive counts taken after different operations. The crawl count describes the intake, while the scrape count describes the contracts that yielded examples matching the extraction rules.

The later filtering stages reduced the number of provisions and labels further. The filter for occurrence in enough separate contracts left 908,465 provisions across 61,456 contracts, with 21,003 labels. Outlier filtering brought the counts to 846,274 provisions, 60,540 contracts, and 12,608 labels. The paper’s abstract describes the provision total as almost 100,000, which conflicts with the cleanup table and the detailed account of the final filtering step. The figures used for the cleaned release here are the detailed counts.

The authors report 104,990,418 tokens and a vocabulary of 52,098 for the cleaned corpus. Among the extracted examples, a provision averages 124 tokens, with a standard deviation of 104. A represented contract averages 13 extracted provisions, with a standard deviation of 20. These statistics describe what the procedure could recover from the documents. The wide spread in lengths and in the number of recovered provisions gives a sense of the variation within that extracted material.

The paper also shows how an additional threshold would change the release. Requiring a label to occur at least 100 times leaves 1,442 labels, 625,519 provisions, and 57,118 contracts. At a threshold of 1,000, the inventory falls to 130 labels and the resulting subset contains 319,334 provisions. At 10,000, it contains 5 labels and 62,701 provisions. Counts are for the resulting subcorpora at those thresholds. A frequency requirement affects both the category inventory and which bodies are available for study. Even after a large reduction in topic variety, frequent topics can still supply a substantial number of examples.

The classification tasks and their scores

The authors evaluate a set of classifiers on four ways of selecting or representing topics. The proto subset uses the 13 most frequent labels, taking the cutoff from the average number of extracted provisions per contract. It has 110,156 provisions, of which 12.50% carry several labels. The rationale is to approximate the kinds of topics often encountered in a contract. Selection is based on frequency across the corpus, so the subset should be read as a common-topic task. It does not describe a template that individual contracts were required to follow.

The freq100 subset uses the cutoff of 100 occurrences per label and has 625,519 provisions and 1,442 labels. Provisions with several labels account for 16.13% of this subset. This task retains a much broader vocabulary than proto while giving each target some minimum amount of evidence in the data used to construct the subset. It preserves the cleaned heading vocabulary for the labels that meet the frequency rule.

The leaves task instead projects headings through the graph and predicts the resulting terminal labels. The paper gives 832,513 provisions and 945 leaf labels for this setting, with 59.19% of provisions carrying several labels. It calls the provision count unchanged in the projection, although the stated count differs from the final cleanup total. The paper does not explain the difference. The size reported for the projection describes that experiment, while the final cleanup count describes the release in the corpus construction account.

For the NDA subset, a lawyer selected topics characteristically found in non-disclosure agreements. Among the examples are Severability, Confidential Information, and Non-Assignment. The subset has 46 labels and 110,082 provisions, of which 8.30% carry several labels. Selection is based on provision type. A body about a topic relevant to non-disclosure agreements can come from another kind of contract in EDGAR. This point matters in the transfer experiment, where the external examples do all come from NDAs.

The paper reports precision, recall, and F1 on the test portions. Precision measures how many of a classifier’s positive assignments agree with the recorded labels. Recall measures how many of the recorded assignments the classifier recovers. F1 combines the two, so a classifier needs both useful positive predictions and adequate coverage to score well. In a multilabel task, each provision offers several possible decisions. Predicting an extra topic and missing a different topic on the same provision affect different parts of the evaluation.

Micro scores pool decisions across labels, giving topics with many examples more influence on the result. Macro scores give labels equal weight in averaging, making performance on less common targets more visible. The two views matter when a dataset mixes frequent headings with sparsely represented ones. A good pooled score can coexist with weaker coverage across labels. Looking at recall and precision alongside F1 also helps distinguish missed assignments from excessive predictions.

Results on held-out LEDGAR provisions

On proto, DistilBERT leads with micro F1 of 0.95 and macro F1 of 0.94. Logistic regression reaches 0.93 micro F1 and 0.92 macro F1, and the attention-weighted bag-of-words classifier reaches 0.93 on both. The label-name rule yields 0.60 micro F1 and 0.63 macro F1. Across this set of familiar topics, the trained approaches score well even when they summarize the input in quite different ways. Literal matching recovers some assignments, but the body may convey the topic using wording that differs from its heading.

On freq100, the attention-weighted approach gives the strongest micro F1, at 0.71. It has micro precision of 0.72 and micro recall of 0.69. Logistic regression records 0.68 micro F1, with precision of 0.59 and recall of 0.78. The label-name rule reaches micro recall of 0.49 but micro precision of only 0.04. Finding topic names in the passage produces many matches that fail to agree with the assigned labels. That failure is easier to see in the precision and recall figures than in a single summary score.

Classifier comparison on the LEDGAR freq100 test split by micro F1

Learned classifiers outperform literal heading matches and attention weighting leads the comparison.

Classifier comparison on the LEDGAR freq100 test split by micro F1Label name: 0.07Label name0.07Logistic regression: 0.68Logistic regression0.68Bag of words with multilayer perceptron: 0.69Bag of words with multilayer perceptron0.69Bag of words with attention and multilayer perceptron (this paper): 0.71Bag of words with attention andmultilayer perceptron (this paper)0.71DistilBERT: 0.60DistilBERT0.60
The numbers
System or settingMicro F1
Label name0.07
Logistic regression0.68
Bag of words with multilayer perceptron0.69
Bag of words with attention and multilayer perceptron (this paper)0.71
DistilBERT0.60

On the leaves test split, the attention-weighted classifier reaches micro F1 of 0.72, with precision of 0.74 and recall of 0.70. Logistic regression reaches micro F1 of 0.69 and has the highest macro F1, at 0.70. DistilBERT reaches micro recall of 0.73, alongside micro precision of 0.20 and micro F1 of 0.31. It retrieves many recorded positive assignments but adds a large number of extra ones. This contrast is visible because the paper reports precision and recall separately. The classifier’s low F1 has a different profile from that of a system that predicts very few positives.

On the source NDA subset, the attention-weighted classifier has the best micro F1 at 0.93, while logistic regression has the best macro F1 at 0.84. Logistic regression reaches macro recall of 0.84, and the attention-weighted classifier reaches macro precision of 0.88. DistilBERT has micro F1 of 0.92 and macro F1 of 0.78. A classifier selected to do well across all assignments would therefore lead to a different choice from one selected to give comparable attention to each topic. These figures also establish how well the approaches work with the particular NDA-related targets in LEDGAR before the paper moves to a different set of documents and annotations.

Testing on NDAs collected separately

For the external test, the authors gathered publicly available English NDAs from the internet. Three legal professionals applied their company’s annotation scheme. The researchers identified 46 labels in that scheme that could be mapped by name to labels in the source corpus. This produced a shared set of targets for the experiment. The annotations were still made for different purposes. In LEDGAR, the labels originated in headings supplied by contract drafters. In the external collection, professionals read the agreements under a common set of company guidelines and labeled sentences.

The external collection contains 14,142 annotated units, 7,193 with multiple labels, and 423,654 tokens. Its vocabulary is 7,921, and the mean token count per unit is 30, with a standard deviation of 23. The paper compares that average with 124 tokens per extracted provision in LEDGAR. It also reports 51% of external units as multilabel, compared with 8% in its discussion of the source NDA subset. These figures describe differences in both the amount of text supplied for a decision and the number of topics assigned to it. The longer source paragraphs may supply several cues within the same passage. The external sentences receive multiple labels considerably more often even though each input is shorter.

The external material is divided into training, development, and test portions using the paper’s 70-10-20% split. In the in-domain condition, classifiers learn from the external annotations. In the transfer condition, the classifiers are trained using LEDGAR, then their prediction thresholds are tuned on the external development portion. The paper calls this quasi zero-shot classification. The distinction is between where the classifier learns the relationship between the wording and labels and where its decision thresholds are adjusted. The external test remains held out in both conditions.

In the external test with in-domain training, logistic regression leads with micro F1 of 0.76 and macro F1 of 0.62. The plain bag-of-words classifier reaches 0.72 micro F1. Its counterpart with attention reaches 0.63, while DistilBERT records 0.53. The results are much lower than those on the source NDA subset even when the external training annotations are available. Those source and external scores describe different prediction tasks because the units of text and annotation procedures differ.

Under transfer, DistilBERT leads on external micro F1 with 0.52. Its micro precision is 0.48 and its micro recall is 0.55. Logistic regression has the strongest macro F1, at 0.46, alongside macro recall of 0.47. DistilBERT follows at 0.44 macro F1. The pattern is similar to that seen on the source subsets in one respect. Approaches can change rank when the evaluation shifts from pooled decisions to average behavior across topics.

Classifier comparison on the external NDA test split under transfer by micro F1

DistilBERT leads when training uses LEDGAR and thresholds are tuned on external development annotations.

Classifier comparison on the external NDA test split under transfer by micro F1Label name: 0.08Label name0.08Logistic regression: 0.48Logistic regression0.48Bag of words with multilayer perceptron: 0.45Bag of words with multilayer perceptron0.45Bag of words with attention and multilayer perceptron: 0.47Bag of words with attention andmultilayer perceptron0.47DistilBERT (this paper): 0.52DistilBERT (this paper)0.52
The numbers
System or settingMicro F1
Label name0.08
Logistic regression0.48
Bag of words with multilayer perceptron0.45
Bag of words with attention and multilayer perceptron0.47
DistilBERT (this paper)0.52

The aggregate scores establish that source training gives the classifiers some ability to identify topics in independently collected agreements. They also set the scale of the result relative to training on the target annotations. Looking at how individual labels behave makes the transfer evidence more specific. Some categories support a high score even under a change of documents and annotation practice, while others that are easy to pair by name turn out to be difficult to predict across the two sources.

What the ablations show

How cleanup changes what counts as a label

The paper does not report a classifier ablation for each cleanup rule. It does, however, record the corpus after successive cleanup operations and compare classifier variants that differ in how they pool the words of a provision. Those analyses answer different questions. The corpus counts show what the rules do to the data. The classifier comparisons show what happens when a representation is changed under a particular evaluation setup.

The effect of splitting ambiguous compound headings is especially clear. After duplicate removal, 6.32% of provisions have several labels. After splitting, the rate is 16.69%, with 1,081,177 provisions at both stages. The number of distinct label names falls from 182,328 to 166,063. A proportion of examples previously described with a single compound string are now described by several existing categories. Consequently, the original multilabel rate reflects drafting and extraction conventions as well as the number of topics expressed in the bodies.

Merging singular and plural names leaves the provision count and the reported multilabel rate unchanged at that stage, while the label vocabulary falls to 158,842. The largest contraction of the inventory comes with the rule requiring presence across several contracts, after which there are 21,003 labels. The subsequent outlier screen reduces that number to 12,608. At the same time, the share of examples with several labels goes from 17.39% to 16.44% between these two document-distribution stages. These figures describe how much structure the filtering removes. An experiment with independent review would be needed to estimate which deleted labels were extraction errors and which were valid specialized topics.

The leaf analysis shows an even larger change in the makeup of the task. The projection produces 945 leaf labels, and 59.19% of the resulting examples carry several labels. The source headings can encode several components within a single string, and projection moves that information into the label set of the example itself. This creates many more occasions for a classifier to choose several positive outputs. The leaves and freq100 results are comparisons of alternate tasks, since their label meanings, frequencies, and collections of examples differ. They do not isolate the effect of applying the graph while holding the target task fixed.

What changes when the classifier can weight words

The closest controlled architecture comparison adds attention to the bag-of-words classifier. Both versions form a vector from token embeddings and pass it to the same kind of feed-forward classifier. The difference is whether the pooling step gives the tokens equal weight or learns which token vectors should contribute more. On the freq100 test split, micro F1 is 0.69 with simple averaging and 0.71 with attention. On the leaves test split, the corresponding scores are 0.69 and 0.72. The authors find broad benefits from attention on the source subsets, although some metrics remain tied or move in a different direction.

The external NDA test with in-domain training reverses the pooled result. There the basic bag-of-words classifier reaches 0.72 micro F1, and the attention version reaches 0.63. Macro F1 is 0.54 for both. The authors suggest there may be too few local training examples for some topics to learn suitable attention weights. The comparison establishes that weighting the tokens is beneficial for some of the source tasks and can hurt under this particular external training condition. It does not identify the amount of data at which the effect would change, since the paper does not vary sample size while holding the rest of the external experiment fixed.

The logistic regression comparison offers another clue, with more factors changing at once. Its direct word features can give strong recall for categories identified by individual lexical cues. The authors propose this as an explanation for its macro results and its competitiveness when examples are scarce. Pooling word vectors or relying on a single contextual summary can make a particular word less directly available to the classifier. This is an interpretation of the pattern, since the approaches also differ in training and architecture. The literal baseline gives the argument some nuance. Individual words can be useful signals without requiring the complete topic name to occur verbatim in the body.

Which topics transfer and why they may differ

With DistilBERT on the leaves task, the authors inspected the scores for low-frequency labels. They found that the scores made threshold tuning unreliable and that the resulting classifier assigned these labels too often. The sharp gap between micro precision of 0.20 and recall of 0.73 fits that account. The paper suggests pooling the contextual token representations with attention as a possible alternative to using the single [CLS] representation. It does not include a comparison of those alternatives, so the reported issue concerns the classifier and threshold procedure actually tested.

The authors also inspected individual topic scores for DistilBERT under transfer to external NDAs. Pearson’s correlation between label frequency and F1 was 0.44. Pearson’s correlation describes the direction and strength of a linear association. The positive value here indicates a tendency for categories with more examples to achieve higher F1, while leaving substantial room for differences among topics. The analysis does not establish that collecting more examples under an unchanged label definition would resolve every weak category.

Several topics, including Non-Assignment, Severability, and Waivers, are reported at around 0.80 F1 in the transfer test. Other topics, including Data Security and Consequences of Termination of Contract, are reported at around 0.30 F1. The authors examined examples and found cases where a name looked similar in the two inventories but the passages assigned to it differed in subject matter. The later decision to map the names was therefore only part of what would be needed to establish that the annotations were interchangeable.

Termination illustrates how an apparent match can conceal different wording and obligations. In an NDA, the relevant text can concern destruction of confidential material. In a software license, it can concern uninstalling software. In a construction agreement, it can concern settling costs. All can be instances of the consequences of ending an agreement, but the examples available during training may emphasize a different set of actions from those encountered at test time. This helps explain why the paper considers selecting source examples by contract type a possible way to improve transfer for some categories. The experiment measures the variation in transfer and offers an explanation from the authors’ inspection. It does not test that proposed restriction.

Limitations

Limits identified by the authors

The collection covers text for which the scraper could find a plausible label. Other parts of the source agreements are omitted. The reported provision count per contract therefore concerns extracted and retained passages. It cannot be read as the number of provisions the agreements contain in full. This distinction is relevant to the proto design because the number of frequent topics selected for that task comes from the extraction-based average.

The authors also recognize that more equivalent headings remain after normalization. They mention alternative ways to name tax withholding, with variation in both the form and order of the words. A suffix check can consolidate some easy cases, and a rule for separators can recover familiar names within compound headings. Neither rule gives the collection a general way to decide that two strings refer to the same category. A classifier can consequently be penalized for choosing a plausible alternative name when the task uses a different one as the recorded answer. The paper proposes extending the merging procedure, leaving that experiment to future work.

The large inventory is part of the contribution, while the demonstrated classification results cover subsets. The authors propose applying methods designed for extreme classification to the full corpus in future work. The headline size of the release and the label counts in the evaluated tasks describe different things. The subset results show that much of the collected material can support classification experiments. They do not establish the precision or recall achievable when every released label is a candidate at prediction time.

For external transfer, the authors stress the need to check whether the target definitions agree with the categories found in the filings. Their inspection suggests that contract type can give a broad label a narrower local meaning. The findings also suggest a reason to identify the contract types in LEDGAR and associate provisions with them. That information could support experiments using source examples matched to the target contract type. The paper’s test uses labels selected for NDA relevance and compares them with annotations made on external NDAs. It does not report a result for the proposed contract-type restriction.

What the setup leaves open

Headings provide supervision from actual contracts, but that supervision has a particular source. A drafter can combine subjects under a single name, put an important subject in an unmarked paragraph, or choose an umbrella heading for a passage with several parts. The formatting rules favor paragraph openings recognizable in the markup. What survives the scraper therefore depends on drafting and formatting conventions in addition to topical content. The checks make it feasible to gather examples in volume. They do not supply an independent estimate of how completely the release covers any kind of contract or provision.

The completed corpus also reflects the decision to favor labels that occur across different documents. That choice can make an inventory more useful for general provision classification. It can also eliminate a narrowly used label that a specialist would regard as meaningful. Label concentration is the evidence the filter uses, rather than a judgment about whether the category is valid. The paper gives corpus sizes and examples of removed labels, but no separately annotated sample from which to estimate the filter’s error rate. The reductions should be read as changes in coverage under the authors’ assumptions.

The hierarchy similarly offers a reproducible construction whose edges are based on strings. A sequence inside a longer heading may name a component of its topic. It may also carry a different meaning on its own or depend on words around it for the relevant interpretation. Synonymous headings that share no appropriate consecutive sequence will remain apart. Short headings that coincide textually can be joined by the procedure even where a domain specialist might want a distinction. The leaf classification experiment shows that the projected labels can be predicted from bodies. It does not validate each graph edge as a relationship of legal meaning.

A further distinction concerns the kind of generalization evaluated inside LEDGAR. The paper describes random splits for the subcorpora and exact provision-text deduplication during construction. It does not establish that contracts or drafting families are kept wholly within a single partition, or that near-duplicate passages are removed. For that reason, the source test scores on their own leave open how performance would change when holding out entire contracts or clusters of similar language. The external NDA experiment does have a separate document source and addresses part of that question. It simultaneously introduces changes in annotation and input units, which makes it hard to determine how much of the observed score change comes specifically from a change in source documents.

The term quasi zero-shot is important to the interpretation of the external scores. Classifier training uses LEDGAR in that condition, and threshold selection uses labeled external development material. This represents a transfer situation in which practitioners have some evidence about how the target annotations behave. The paper does not report how the same classifiers would perform if their thresholds were chosen without that evidence. An external F1 from this setup therefore measures the combination of source training and limited target calibration.

There is also a limit to drawing conclusions about legal analysis from agreement with the recorded topic. The tested systems receive a passage and predict categories such as Waivers or Confidential Information. Correctly identifying a topic under that evaluation leaves questions about the precise obligations, their relationship to the rest of the contract, and their legal effect outside the measured task. What the experiments support is narrower and concrete. Text labeled by contract headings can train classifiers to recognize provision topics, with performance that depends on how the topics are defined, how often they occur, and how closely the training and test annotations correspond.

What came after

Benchmarking and contract authoring

The 2021 LexGLUE work cites LEDGAR in the context of a benchmark for English legal language understanding. The connection is particularly direct at the level of evaluation design. LEDGAR makes provision classification measurable by defining examples, target categories, and test scores. A benchmark for legal language understanding frames such measurements as tasks that can be used to assess systems. The citing record establishes that connection without specifying which preparation choices or splits were carried over. LexGLUE, 2021

The 2022 LexGLUE work also cites LEDGAR under the English legal benchmark framing. Its relationship to the original corpus highlights why benchmark details matter. LEDGAR itself reports results for several different views of the same resource, and even changes in the way headings are represented can alter the prediction problem. A citation to the corpus identifies a source for this kind of task. The label inventory, unit of analysis, and split determine what a particular benchmark score can be compared with. LexGLUE, 2022

ClauseRec brings the clause into a different workflow, recommending provisions to assist someone authoring a contract. A classifier starts with a passage and asks which topics describe it. A recommendation framework asks which clause to present in a drafting setting. Both give individual provisions a role within larger agreements. The later work cites LEDGAR from that authoring context, although its citing record does not specify a reuse of the corpus or the extraction rules. ClauseRec

The study of customized and generalist transformers for legal contract classification likewise cites LEDGAR from a closely related prediction setting. Its stated comparison is about specialization of the classifier. LEDGAR’s experiments varied the input representation and found that the ranking depended on the label inventory and on which score was used. That provides context for reading a later comparison of classifier families. The citation establishes the continuity of the problem, while the later study’s results and exact choice of evaluation data are unspecified here. Customized vs. Generalist Transformers for Legal Contract Classification

The survey of natural language processing for the legal domain cites LEDGAR within a review spanning tasks, datasets, approaches, and challenges. For that wider view, LEDGAR supplies a concrete example of a task and its corresponding data construction. It identifies the passage to be classified, derives labels from author-supplied headings, and records how processing changes the available categories. A survey can place that contribution alongside resources built for other purposes without implying that they use the same units or annotation practices. Natural Language Processing for the Legal Domain

LeXFiles and LegalLAMA cite LEDGAR in work on English legal language resources across national contexts. Their stated scope is broader than the SEC filing source on which LEDGAR relies. The connection is to the use of legal texts as resources for developing and assessing language technology. It leaves open whether LEDGAR’s provision labels, its source documents, or its results had any further role in the later work. LeXFiles and LegalLAMA

SaulLM cites LEDGAR in work on developing a language system for law. LEDGAR supplies an earlier example of how the legal domain can be made concrete in an experiment. Its labels and test inputs come from a specified legal genre and a defined extraction procedure. The later work takes up law as a domain for language-system development. The citing relationship alone leaves its use of LEDGAR for training or evaluation unspecified. SaulLM

LexSumm and LexT5 cite LEDGAR from the setting of English legal text summarization. Summarization asks for a condensed account of a legal text. LEDGAR’s task instead asks for the topics of a provision from a given inventory. The common concern is how to make an evaluation specific to the legal material and the unit of text under study. The citation connects those resource-building efforts without establishing that the provision labels were used as targets in summarization. LexSumm and LexT5

CBR-RAG places a citation to LEDGAR within legal question answering, using case-based reasoning with retrieval-augmented generation. Its task concerns finding and using relevant material to answer a question. LEDGAR’s experiment concerns assigning a topic to a supplied body. The citation brings the corpus into the context of a legal application where identifying relevant text also matters, though it does not establish that the retrieval procedure uses LEDGAR provisions. CBR-RAG

JuriFindIT cites LEDGAR from the context of an Italian legal retrieval dataset. That link extends the citing record to a resource with a different language and a different evaluation task. Retrieval asks which material is relevant to a search, while provision classification starts from a passage and assigns it a subject. Both depend on explicit choices about what constitutes an item and how success is recorded. The cited relationship documents LEDGAR’s place among legal data resources, with the details of any direct reuse left unspecified. JuriFindIT

 Institutions

 Fields, topics and concepts

Cite

Cite as Don Tuggener, Pius von Däniken, Thomas Peetz and Mark Cieliebak. 2020. LEDGAR: A Large-Scale Multi-label Corpus for Text Classification of Legal Provisions in Contracts. Proceedings of the Twelfth Language Resources and Evaluation Conference.

The paper itself, not this page. BibTeX from the library's record of the work.

@inproceedings{tuggener2020ledgar,
  title = {{LEDGAR: A Large-Scale Multi-label Corpus for Text Classification of Legal Provisions in Contracts}},
  author = {Don Tuggener, Pius {von Däniken}, Thomas Peetz and Mark Cieliebak},
  booktitle = {Proceedings of the Twelfth Language Resources and Evaluation Conference},
  year = {2020},
  doi = {10.21256/zhaw-20087},
  url = {https://doi.org/10.21256/zhaw-20087}
}

References

27 references, 7 of them with a card of ours. Each entry links to our card when we hold the work, else to OpenAlex and Google Scholar searches for it.

  1. Nikolaos Aletras, et al., editors. (2019). Proceedings of the Natural Legal Language Processing Workshop 2019, Minneapolis, Minnesota. Association for Computational Linguistics. OpenAlex ↗ · Scholar ↗
  2. Bengio, S., Dembczynski, K., Joachims, T., Kloft, M., and Varma, M. (2019). Extreme Classification (Dagstuhl Seminar 18291). Dagstuhl Reports, 8(7):62–80. OpenAlex ↗ · Scholar ↗
  3. Bojanowski, P., Grave, E., Joulin, A., and Mikolov, T. (2017). Enriching word vectors with subword information. Transactions of the Association for Computational Linguistics, 5:135–146.
  4. Bommarito, M. J., Katz, D. M., and Detterman, E. M. (2018a). LexNLP: Natural language processing and information extraction for legal and regulatory texts. arXiv preprint, abs/1806.03688. OpenAlex ↗ · Scholar ↗
  5. Bommarito, M. J., Katz, D. M., and Detterman, E. M. (2018b). OpenEDGAR: Open source software for SEC EDGAR analysis. arXiv preprint, abs/1806.04973. OpenAlex ↗ · Scholar ↗
  6. Chalkidis, I., Fergadiotis, E., Malakasiotis, P., and Androutsopoulos, I. (2019). Large-scale multi-label text classification on EU legislation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 6314–6322, Florence, Italy, July. Association for Computational Linguistics.
  7. Choromanska, A. and Kumar Jain, I. (2019). Extreme multiclass classification criteria. Computation, 7(1). OpenAlex ↗ · Scholar ↗
  8. Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. (2018). Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805.
  9. Fisch, J. E. (2018). Governance by contract: The implications for corporate bylaws. Calif. L. Rev., 106:373. OpenAlex ↗ · Scholar ↗
  10. Glaser, I., Scepankova, E., and Matthes, F. (2018). Classifying semantic types of legal sentences: Portability of machine learning models. In JURIX, pages 61–70. OpenAlex ↗ · Scholar ↗
  11. Hershkoff, H. and Kahan, M. (2018). Selection provisions in corporate contracts. Wash. L. Rev., 93:265. OpenAlex ↗ · Scholar ↗
  12. Jain, H., Balasubramanian, V., Chunduri, B., and Varma, M. (2019). Slice: Scalable linear extreme classifiers trained on 100 million labels for related searches. In Proceedings of the Twelfth ACM International Conference on Web Search and Data Mining, pages 528–536. ACM. OpenAlex ↗ · Scholar ↗
  13. Joulin, A., Bojanowski, P., Mikolov, T., Jégou, H., and Grave, E. (2018). Loss in translation: Learning bilingual word mapping with a retrieval criterion. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing.
  14. Jeroen Keppens et al., editors. (2017). Proceedings of the 16th edition of the International Conference on Artificial Intelligence and Law, ICAIL 2017. ACM. OpenAlex ↗ · Scholar ↗
  15. Knapp, C. L., Crystal, N. M., and Prince, H. G. (2019). Problems in Contract Law: cases and materials. Aspen Publishers. OpenAlex ↗ · Scholar ↗
  16. Mills, K. R. (2019). Talking about regulation in 10-k annual reports; uniformity in a naive sample. Finance Graduate Theses & Dissertations. OpenAlex ↗ · Scholar ↗
  17. Monica Palmirani, editor. (2018). Legal Knowledge and Information Systems - JURIX 2018: The Thirty-first Annual Conference, Groningen, The Netherlands, 12-14 December 2018, volume 313 of Frontiers in Artificial Intelligence and Applications. IOS Press. OpenAlex ↗ · Scholar ↗
  18. Georg Rehm, et al., editors. (2018). Proceedings of the 1st Workshop on Language Resources and Technologies for the Legal Knowledge Graph, Paris, France. European Language Resources Association (ELRA). OpenAlex ↗ · Scholar ↗
  19. Sanh, V., Debut, L., Chaumond, J., and Wolf, T. (2019). Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter.
  20. Soni, A., Pappu, A., Busa-Fekete, R., and Dembczynski, K. (2018). Extreme multilabel classification for social media chairs’ welcome and organization. In Companion Proceedings of the The Web Conference 2018, pages 1893–1894. International World Wide Web Conferences Steering Committee. OpenAlex ↗ · Scholar ↗
  21. Trosborg, A. (1991). An analysis of legal speech acts in english contract law. ’It is hereby performed’. HERMES-Journal of Language and Communication in Business, 4(6):65–90. OpenAlex ↗ · Scholar ↗
  22. Trosborg, A. (1995). Statutes and contracts: An analysis of legal speech acts in the english language of the law. Journal of Pragmatics, 23(1):31–53. OpenAlex ↗ · Scholar ↗
  23. Waltl, B., Muhr, J., Glaser, I., Bonczek, G., Scepankova, E., and Matthes, F. (2017). Classifying legal norms with active machine learning. Legal Knowledge and Information Systems, page 11. OpenAlex ↗ · Scholar ↗
  24. Waltl, B., Bonczek, G., Scepankova, E., and Matthes, F. (2019). Semantic types of legal norms in german laws: classification and analysis using local linear explanations. Artificial Intelligence and Law, 27(1):43–71. OpenAlex ↗ · Scholar ↗
  25. Wolf, T., Debut, L., Sanh, V., Chaumond, J., Delangue, C., Moi, A., Cistac, P., Rault, T., Louf, R., Funtowicz, M., and Brew, J. (2019). Transformers: State-of-the-art natural language processing.
  26. Yang, Z., Yang, D., Dyer, C., He, X., Smola, A., and Hovy, E. (2016). Hierarchical attention networks for document classification. In Proceedings of the 2016 conference of the North American chapter of the association for computational linguistics: human language technologies, pages 1480–1489.
  27. Yovel, J. (2000). What is contract law about–speech act theory and a critique of skeletal promises. Northwestern University Law Review, 94:937. OpenAlex ↗ · Scholar ↗

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/tuggener-2020-ledgar-large-scale-multi-label/