Legal Analytics
Definition
Natural language processing (NLP) is the study of how computers handle language. Legal analytics applies artificial intelligence and NLP to legal documents such as laws, court decisions, contracts, and privacy policies (Lippi et al., 2019; Zhong et al., 2020). It finds the parts of a document, the arguments of a court, the unfair terms of a contract, and the likely outcome of a case. These documents are long and hard to read. Legal analytics tools can support consumers, lawyers, judges, and public agencies.Core concepts
Structure
Legal documents are long and lack explicit markup of their parts. Systems first segment a raw document into its relevant parts, such as the facts, the requests of a party, or the arguments of a lawyer. Each sentence can also receive a rhetorical role, the function it plays in the document.
Arguments
Argument mining retrieves the chains of premises and conclusions behind a decision, which show the reasoning of a court. Legal argument mining uses domain-specific component types, such as factual and legal premises. It also labels each legal premise with its argument scheme, the pattern of reasoning it follows, such as reasoning from a rule or a precedent.
Outcome
Outcome prediction predicts the decision of a court from the text of a case. For instance, a system predicts whether the court upholds or rejects the request of a party.
Compliance
Compliance analysis checks whether a document respects the law. Systems flag terms of service clauses that may be unfair to consumers, and check privacy policies against the General Data Protection Regulation (GDPR), the EU data protection law.
What is legal annotation?
Most legal analytics methods start from annotated documents. Legal experts mark the parts of a document that matter for a legal question and give each part a label. An annotation schema fixes these parts, their labels, and their links. Annotation guidelines tell the annotators how to apply the schema. The agreement between annotators measures how reliable the labels are. Models trained on such annotations learn to produce the same structure for new documents.
The examples below follow the four core concepts. For structure, clauses of privacy policies are annotated with their parts, and rules derived from the GDPR rate how informative each clause is. For arguments, court decisions are annotated with chains of premises and conclusions. For outcome, decisions are annotated with the requests of the parties, their claims and arguments, and the final ruling. For compliance, terms of service are annotated with the category and the fairness level of each clause. The last example follows one annotated clause across two languages.
Under the EU General Data Protection Regulation (GDPR), a privacy policy must say which categories of personal data it processes. Experts mark each clause about data with its category of data, the specification that introduces a list, and the subcategories in that list. Each mark is open when its terms are vague or its list is open-ended, and closed when they are precise or exhaustive. Annotation rules combine these marks to rate each clause as sufficiently or insufficiently informative.
TikTok privacy policy
C1Category · openProfile Information. C2We collect Category · closedinformation that you provide when you set up an account, Specification · opensuch as Subcategory · closedyour date of birth, Subcategory · closedusername, Subcategory · closedemail address and/or Subcategory · closedtelephone number, and Subcategory · closedpassword. C3You can add Category · openother information to your profile, Specification · opensuch as Subcategory · opena bio or Subcategory · closeda profile photo.
Merchants, Payment and Transaction Fulfillment Providers. C4We receive Category · openinformation about you from merchants as well as payment and transaction fulfillment providers, Specification · opensuch as Subcategory · closedpayment confirmation details, and Subcategory · closedinformation about the delivery of products you have purchased through our shopping features.
CategorySpecificationSubcategory OpenClosed
2 Clauses and rules
| Clause | Category | Specification | Subcategories |
|---|---|---|---|
| C1L2 · R1 | open | none | none |
| C2L1 · R2 | closed | open | closed5 closed |
| C3L2 · R2 | open | open | open1 open · 1 closed |
| C4L2 · R2 | open | open | closed2 closed |
| Rules | |||
| L1 · R1 | closed | none | none |
| L1 · R2 | closed | any | any |
| L1 · R3 | open | closed | closed |
| L2 · R1 | open | none | none |
| L2 · R2 | open | open | any |
| L2 · R3 | open | closed | open |
L1sufficiently informativeL2insufficiently informative
4 clauses about personal data: 1 sufficiently informative3 insufficiently informative
In court decisions, legal premises state rules, precedents, or principles, and factual premises describe the case. Each legal premise is also labelled with the argument scheme it follows.
1 The text
[...] FP1 Factual premiseHowever, it must be pointed out that that argument is based on a misreading of that judgment. [...] LP1 Legal premise · Precedent, classificationIt is apparent from that judgment that the fact of coming from a compulsory levy is, on the contrary, sufficient to identify State resources (see, to that effect, [...]). [...] FP2 Factual premiseThe first part of the fourth ground of appeal must therefore be rejected as unfounded.
2 Argument graph
- Legal premise LP1 "It is apparent from that judgment that the fact of coming from a compulsory levy is, on the contrary, sufficient to identify State resources" supports Factual premise FP1 "However, it must be pointed out that that argument is based on a misreading of that judgment."
- Factual premise FP1 "However, it must be pointed out that that argument is based on a misreading of that judgment." supports Factual premise FP2 "The first part of the fourth ground of appeal must therefore be rejected as unfounded."
Tax decisions are annotated with the request of each party, the claims that ground it, the arguments that support the claims, and the decision of the court on the request. Outcome prediction uses these annotated parts to predict whether the court upholds or rejects a request.
1 The text
[...] R1 RequestThe first-instance decision was appealed by the tax office before this Regional Tax Commission, C1 Claimwhich insisted that its assessment was correct A1 Argumentbecause the analysis of the company revealed undeclared revenues, assessed inductively, and the disallowance of non-deductible costs. [...] For these reasons, [the Commission] D1 Decision · Upheldupholds the appeal of the tax office and reverses the first-instance decision.
2 Argument graph
- Decision D1 "upholds the appeal of the tax office and reverses the first-instance decision." upholds Request R1 "The first-instance decision was appealed by the tax office before this Regional Tax Commission,"
- Claim C1 "which insisted that its assessment was correct" supports Request R1 "The first-instance decision was appealed by the tax office before this Regional Tax Commission,"
- Argument A1 "because the analysis of the company revealed undeclared revenues, assessed inductively, and the disallowance of non-deductible costs." supports Claim C1 "which insisted that its assessment was correct"
Online terms of service often contain clauses that may be unfair to consumers under EU law. Annotators mark each clause that falls into a category of potential unfairness, such as unilateral termination, and grade it as clearly fair, potentially unfair, or clearly unfair.
Academia.edu terms of service
Modification
Unilateral change · Potentially unfairAcademia.edu reserves the right, at its sole discretion, to modify the Site, Services and these Terms, at any time and without prior notice. If we modify these Terms we will post the modification on the Site or provide you with notice of the modification. We will also update the “Last Updated Date” at the top of these Terms. Contract by using · Potentially unfairBy continuing to access or use the Site or Services after we have posted a modification on the Site or have provided you with notice of a modification, you are indicating that you agree to be bound by the modified Terms. If the modified Terms are not acceptable to you, your only recourse is to cease using the Site and Services.
Termination and Account Cancellation
Unilateral termination · Clearly unfairAcademia.edu reserves the right, at its sole discretion, to discontinue or terminate the Site and Services and to terminate these Terms, at any time and without prior notice. Unilateral termination · Clearly unfairIf you breach any of these Terms, Academia.edu will have the right to suspend or disable your Account or terminate these Terms, at its sole discretion and without prior notice to you. Unilateral termination · Clearly unfairAcademia.edu reserves the right to revoke your access to and use of the Site, Services and Collective Content at any time, with or without cause. You may cancel your Account at any time by visiting your Account Settings page and clicking on “Remove” or by sending an email to feedback@academia.edu.
5 of 9 sentences flagged as unfair: 3 clearly unfair2 potentially unfair
Annotation projection copies the labels of an English contract to the same contract in another language, so that a classifier can be trained there without new annotation. The example shows why sentence-level projection is hard: one English sentence matches two German ones.
1 The texts
English
AC1 Annotated clause · content removal, unilateral terminationWe reserve the right to delete or disable Content alleged to violate copyright laws or these Terms and reserve the right to terminate the account(s) of violators.
German
MC1 Matching clause · content removalWir behalten uns das Recht vor, Inhalte zu löschen oder zu deaktivieren, die vorgeblich gegen Urheberrechtsgesetze oder diese Bedingungen verstoßen. MC2 Matching clause · unilateral terminationZusätzlich behalten wir uns das Recht vor, den/die Account(s) des Beschuldigten zu sperren.
2 Clause alignment
- Annotated clause AC1 "We reserve the right to delete or disable Content alleged to violate copyright laws or these Terms and reserve the right to terminate the account(s) of violators." content removal Matching clause MC1 "Wir behalten uns das Recht vor, Inhalte zu löschen oder zu deaktivieren, die vorgeblich gegen Urheberrechtsgesetze oder diese Bedingungen verstoßen."
- Annotated clause AC1 "We reserve the right to delete or disable Content alleged to violate copyright laws or these Terms and reserve the right to terminate the account(s) of violators." unilateral termination Matching clause MC2 "Zusätzlich behalten wir uns das Recht vor, den/die Account(s) des Beschuldigten zu sperren."
Research areas
Legal documents are long, lack explicit markup of their parts, and use legal jargon. Systems label their sentences, names, topics, and key statements so that later tasks can build on them.
- Rhetorical role prediction
- Given a court decision split into sentences, the task is to label each sentence with its rhetorical role, such as preamble, facts, or arguments. A rhetorical role is the function that a sentence plays in the document.
- Legal named entity recognition
- Given a legal document, the task is to find named entities and label each with its type. Named entities are mentions of specific entities, such as the petitioner, the respondent, the court, or a statute.
- Legal topic classification
- Given a law or another legal document, the task is to assign one or more topic labels from a fixed list of categories.
- Extraction of legal principles
- Given a court decision, the task is to find the passages where the court states a principle of law or a general interpretation.
Argument mining finds the premises and conclusions in a text and the links between them. In law, it gives structured access to the reasoning of courts.
- Argument component classification
- Given the sentences of a court decision, the task is to find the argumentative ones and classify each argument component as a premise or a conclusion. A premise gives a reason, and a conclusion is the point that the premises support.
- Premise type classification
- Given a premise, the task is to classify it as factual, legal, or both. A factual premise describes events of the case, while a legal premise states rules, precedents, or principles.
- Argument scheme classification
- Given a legal premise, the task is to assign one or more argument schemes, such as rule, precedent, or principle. An argument scheme is a typical pattern of reasoning.
- Argument structure prediction
- Given pairs of argument components, the task is to predict whether they are linked. For linked pairs, the task is to classify the relation, such as support or attack.
Outcome prediction links the text of a case to the final decision of the court. Studies rely either on features that describe the case or on the text of the decisions.
- Judgment outcome prediction
- Given the description of a case or an appeal, the task is to predict whether the court upholds or rejects it.
- Request outcome prediction
- Given a request by a party, with its claims and arguments, the task is to predict whether the court upholds or rejects that request.
- Violation prediction
- Given the facts of a case before the European Court of Human Rights, the task is to predict whether the court finds a violation. A violation is a breach of an article of the European Convention on Human Rights.
- Unanimity prediction
- Given the description of a case, the task is to predict whether the judges reached the decision unanimously.
Consumers rarely read terms of service, the contracts that govern online services. Systems flag clauses that may be unfair and check privacy policies against data protection law.
- Unfair clause detection
- Given a sentence from a terms of service document, the task is to say whether it contains a potentially unfair clause. A clause is unfair when it creates a significant imbalance in rights and obligations, to the detriment of the consumer.
- Unfairness category classification
- Given a potentially unfair clause, the task is to assign its category, such as limitation of liability or unilateral termination. Some datasets also grade each clause as clearly fair, potentially unfair, or clearly unfair.
- Explaining unfairness
- Given a clause classified as unfair, the task is to retrieve the legal rationales that explain why it may be unfair. Rationales are short justifications written by legal experts.
- Privacy policy assessment
- Given a privacy policy, the task is to check each clause against the General Data Protection Regulation (GDPR), the EU data protection law. The check covers required information, lawful processing, and clear language.
- Data practice identification
- Given a privacy policy, the task is to identify the data processing practices it describes, such as data collection, transfer, and sharing.
Most legal language tools are built for English, while the European Union works in 24 official languages. Researchers transfer annotations, translate documents, and compare models on multilingual benchmarks.
- Annotation projection
- Given a document annotated in one language and its version in another language, the task is to transfer the labels onto the matching sentences. The two versions may not be exact translations.
- Transfer through machine translation
- Given legal documents in a new language, the task is to reuse an English system through machine translation. Either the training documents or each query document is translated.
- Cross-lingual transfer
- Given a model trained on one language, the task is to apply it to another language without new labels. It relies on representations shared across languages, such as multilingual embeddings.
- Multilingual benchmarking
- Given a collection of legal datasets in many languages, the task is to compare models with shared aggregate scores.
Large language models (LLMs), such as ChatGPT or GPT-4, can address a task from an instruction and a few examples. Their results on legal tasks are mixed, so studies compare them with smaller models trained on labelled data.
- Prompting for unfair clause detection
- Given a terms of service clause and an instruction, the task is to have an LLM say whether the clause is unfair. The prompt may include a few examples.
- Example selection for legal argument mining
- Given a legal argument mining task and a pool of labelled examples, the task is to choose which examples the LLM sees. The choice can change for each new input.
- LLM annotation for training data
- Given court decisions without labels, the task is to have an LLM label them. A smaller model is then trained on these labels and compared with the LLM.
- Legal benchmarks for LLMs
- Given a shared set of legal tasks written by experts, the task is to measure how well LLMs reason about law with few examples.
Our focus
Legal argumentation
We study how machines can find and classify the arguments that courts write in their decisions. This gives structured access to the reasoning behind a judgment.
Current
Dynamic Demonstrations Selection for Few-Shot Legal Argument Mining
Argument Mining and Empirical Legal Research Workshop (AMELR) · 2025
Choosing few-shot examples per query by similarity lets LLMs mine legal arguments in EU court rulings as well as or better than expert-chosen examples.
Past work
- AMELIA - Argument Mining Evaluation on Legal documents in ItAlian: A CALAMITA Challenge
- Argumentation Structure Prediction in CJEU Decisions on Fiscal State Aid
- Detecting Arguments in CJEU Decisions on Fiscal State Aid
Interpretability
We build models that explain their decisions with the reasons a legal expert would give. This can help users check a prediction and decide whether to trust the tool.
Past work
- Combining Transformers with Natural Language Explanations
- Detecting and explaining unfairness in consumer contracts through memory networks
- Explaining Potentially Unfair Clauses to the Consumer with the CLAUDETTE tool
- Deep Learning for Detecting and Explaining Unfairness in Consumer Contracts
Unfair clause detection
We build systems that find clauses in online contracts and privacy policies that may harm consumers. Few people read these documents, so automatic tools can help consumers and lawyers.
Current
Is It Worth Using LLMs for Unfair Clause Detection in Terms of Service?
International Conference on Artificial Intelligence and Law (ICAIL) · 2025
Seven large language models, prompted in three ways, face fine-tuned classifiers at spotting unfair clauses in Terms of Service, and the fine-tuned classifiers still win.
Past work
- Detecting Vague Clauses in Italian Privacy Policies Using Transformers, LLMs, and Cross-Lingual Techniques
- The force awakens: Artificial intelligence for consumer law
- Consumer protection requires artificial intelligence
- CLAUDETTE: an automated detector of potentially unfair clauses in online terms of service
- Towards Consumer-Empowering Artificial Intelligence
- Automated Processing of Privacy Policies Under the EU General Data Protection Regulation
Cross-linguality
We study how to move legal annotations and models from one language to another. In the European Union, the same document often exists in several languages.
Past work
- Unfair clause detection in terms of service across multiple languages
- LEXTREME: A Multi-Lingual and Multi-Task Benchmark for the Legal Domain
- Cross-lingual Annotation Projection in Legal Texts
Reading court decisions
We study how machines can find the parts and key statements of a court decision. Legal experts are few and costly, so we also study how to build training data with less of their time.
Current
Automated Extraction of Judicial Interpretative Formulas in EU Case Law on VAT
International Conference on Legal Knowledge and Information Systems (JURIX) · 2025
A pipeline trains small classifiers on LLM-labelled EU tax rulings to find the Court's interpretative paragraphs, matching the LLM on expert-labelled test data.
Past work
- TeamUnibo at SemEval-2023 Task 6: A transformer based approach to Rhetorical Roles prediction and NER in Legal Texts
- Combining WordNet and Word Embeddings in Data Augmentation for Legal Texts
Legal argumentation
Current
Choosing few-shot examples per query by similarity lets LLMs mine legal arguments in EU court rulings as well as or better than expert-chosen examples.
- Dynamic Demonstrations Selection for Few-Shot Legal Argument MiningFrancesco Alfieri, Giulia Grundler, et al. · 2025
Past work
AMELIA tests whether language models can classify legal arguments in Italian, with three tasks built on 225 expert-annotated decisions on Value Added Tax.
- AMELIA - Argument Mining Evaluation on Legal documents in ItAlian: A CALAMITA ChallengeGiulia Grundler, Andrea Galassi, et al. · 2024
The paper annotates five kinds of support and attack links in CJEU state aid decisions and tests which neural models predict them best.
- Argumentation Structure Prediction in CJEU Decisions on Fiscal State AidPiera Santin, Giulia Grundler, et al. · 2023
Demosthenes is a corpus of 40 EU Court of Justice decisions on fiscal state aid, annotated with premises, conclusions, and legal argument schemes.
- Detecting Arguments in CJEU Decisions on Fiscal State AidGiulia Grundler, Piera Santin, et al. · 2022
Interpretability
Past work
memBERT gives a transformer a memory of plain-text expert explanations, so each prediction points to the rationale behind it while keeping classification performance.
- Combining Transformers with Natural Language ExplanationsFederico Ruggeri, Marco Lippi, et al. · 2024
Memory networks read a knowledge base of expert legal rationales to detect unfair clauses in terms of service and to point to the reasons.
- Detecting and explaining unfairness in consumer contracts through memory networksFederico Ruggeri, Francesca Lagioia, et al. · 2022
CLAUDETTE now tells consumers why a Terms of Service clause may be unfair, by linking each flagged clause to legal rationales written by experts.
- Explaining Potentially Unfair Clauses to the Consumer with the CLAUDETTE toolRūta Liepiņa, Federico Ruggeri, et al. · 2020
Linking unfair clauses in Terms of Service to a knowledge base of rationales may let memory networks explain their outputs and detect unfair clauses better.
- Deep Learning for Detecting and Explaining Unfairness in Consumer ContractsFrancesca Lagioia, Federico Ruggeri, et al. · 2019
Unfair clause detection
Current
Seven large language models, prompted in three ways, face fine-tuned classifiers at spotting unfair clauses in Terms of Service, and the fine-tuned classifiers still win.
- Is It Worth Using LLMs for Unfair Clause Detection in Terms of Service?Marco Panarelli, Andrea Galassi, et al. · 2025
Past work
A new corpus of 30 Italian privacy policies shows that BERT models beat LLMs at flagging vague data clauses and that resources transfer across languages.
- Detecting Vague Clauses in Italian Privacy Policies Using Transformers, LLMs, and Cross-Lingual TechniquesGiulia Grundler, Mariaceleste Musicco, et al. · 2025
A position paper that argues AI can serve consumers, not only businesses, by analyzing contracts, privacy policies, ads, and app code at scale.
- The force awakens: Artificial intelligence for consumer lawMarco Lippi, Giuseppe Contissa, et al. · 2020
Technology companies have quickly become powerful with their access to large amounts of data and machine learning technologies, but consumers could be empowered too with automated tools to protect their rights.
- Consumer protection requires artificial intelligenceMarco Lippi, Giuseppe Contissa, et al. · 2019
CLAUDETTE uses machine learning to detect potentially unfair clauses in online terms of service, and could serve lawyers and consumers alike.
- CLAUDETTE: an automated detector of potentially unfair clauses in online terms of serviceMarco Lippi, Przemysław Pałka, et al. · 2019
Businesses use AI and big data to profile consumers; this paper argues that AI and Law should also build AI tools that defend consumers.
- Towards Consumer-Empowering Artificial IntelligenceGiuseppe Contissa, Francesca Lagioia, et al. · 2018
A new methodology and annotated corpus let machine learning systems check the compliance and adequacy of privacy policies under the GDPR.
- Automated Processing of Privacy Policies Under the EU General Data Protection RegulationGiuseppe Contissa, Koen Docter, et al. · 2018
Cross-linguality
Past work
With good machine translation, an English unfair-clause detector for Terms of Service matches detectors trained on new German, Italian, and Polish corpora.
- Unfair clause detection in terms of service across multiple languagesAndrea Galassi, Francesca Lagioia, et al. · 2024
LEXTREME gathers 11 legal datasets in 24 languages into one benchmark with a single score, and shows that legal language understanding remains hard.
- LEXTREME: A Multi-Lingual and Multi-Task Benchmark for the Legal DomainJoel Niklaus, Veton Matoshi, et al. · 2023
Annotations made by legal experts on English contracts are projected onto their German versions, even when the two versions do not match sentence by sentence.
- Cross-lingual Annotation Projection in Legal TextsAndrea Galassi, Kasper Drazewski, et al. · 2020
Reading court decisions
Current
A pipeline trains small classifiers on LLM-labelled EU tax rulings to find the Court's interpretative paragraphs, matching the LLM on expert-labelled test data.
- Automated Extraction of Judicial Interpretative Formulas in EU Case Law on VATGiulia Grundler, Piera Santin, et al. · 2025
Past work
Context-aware legal transformers label the rhetorical role of each sentence in Indian court judgments, and a BiLSTM-CRF head finds legal named entities.
- TeamUnibo at SemEval-2023 Task 6: A transformer based approach to Rhetorical Roles prediction and NER in Legal TextsYuri Noviello, Enrico Pallotta, et al. · 2023
Replacing words in legal sentences with WordNet candidates chosen by GloVe similarity yields synthetic samples that legal experts scored above four alternative methods.
- Combining WordNet and Word Embeddings in Data Augmentation for Legal TextsSezen Perçin, Andrea Galassi, et al. · 2022