Skip to content
Showcase/LexGLUE: Legal Language Understanding Benchmark
intermediatetext

LexGLUE: Legal Language Understanding Benchmark

LexGLUE is a benchmark of 7 legal NLP datasets in English (Chalkidis et al., ACL 2022) covering EU and US law. This Potato config reproduces its classification tasks for annotation.

About this dataset

LexGLUE (Legal General Language Understanding Evaluation) is a benchmark for legal language understanding in English, introduced by Ilias Chalkidis and colleagues at ACL 2022. It bundles existing legal NLP datasets into a single suite so models can be compared on legal text across courts, statutes, and contracts.

The benchmark holds 7 tasks drawn from European and US sources: ECtHR Task A and Task B (European Court of Human Rights violations), SCOTUS (US Supreme Court issue areas), EUR-LEX (EU law tagged with EuroVoc concepts), LEDGAR (contract provision topics), UNFAIR-ToS (unfair terms of service clauses), and CaseHOLD (multiple-choice holdings of US court cases).

Task formats span multi-class classification, multi-label classification, and multiple-choice question answering. Label spaces range from a handful of categories (UNFAIR-ToS) to 100 (EUR-LEX EuroVoc concepts, LEDGAR provision types). The suite is used to test whether models pretrained on legal corpora generalize across legal domains better than generic models.

The Potato config below provides a simplified, LexGLUE-inspired legal-classification task rather than the benchmark's exact per-dataset label spaces: a radio for document relevance, a multiselect over broad areas of law (contract, criminal, constitutional, tax, property, administrative), and a free-text field for the legal reasoning behind each label.

Tasks
7 legal NLP datasets
Total examples
139,532
Jurisdictions
EU and US law
SCOTUS classes
14 issue areas
EUR-LEX / LEDGAR labels
100 each
Venue
ACL 2022 (long paper)
Q1: Rate your experience12345Q2: Primary use case?ResearchIndustryEducationQ3: Additional feedback

Configuration Fileconfig.yaml

This Potato config reproduces the annotation task. Save it as config.yaml and run potato start config.yaml to try it.

yaml
# LexGLUE - Legal Document Understanding
# Based on Chalkidis et al., ACL 2022
# Paper: https://aclanthology.org/2022.acl-long.297/
# Dataset: https://huggingface.co/datasets/lex_glue
#
# This task evaluates legal document understanding by asking annotators to
# assess relevance, classify areas of law, and provide legal reasoning
# for case summaries from the LexGLUE benchmark.
#
# Relevance Assessment:
# - Relevant: The case summary is relevant to the stated legal question
# - Not Relevant: The case summary is not relevant to the stated question
#
# Areas of Law:
# - Contract Law, Criminal Law, Constitutional Law, Tax Law,
#   Property Law, Administrative Law
#
# Annotation Guidelines:
# 1. Read the legal case summary carefully
# 2. Note the jurisdiction for context
# 3. Determine if the case is relevant to the legal question
# 4. Select all applicable areas of law
# 5. Provide brief legal reasoning for your classifications

annotation_task_name: "LexGLUE - Legal Document Understanding"
task_dir: "."

data_files:
  - sample-data.json

item_properties:
  id_key: "id"
  text_key: "text"

output_annotation_dir: "annotation_output/"
output_annotation_format: "json"

port: 8000
server_name: localhost

annotation_schemes:
  - annotation_type: radio
    name: relevance
    description: "Is this legal case summary relevant to the query?"
    labels:
      - "Relevant"
      - "Not Relevant"
    keyboard_shortcuts:
      "Relevant": "1"
      "Not Relevant": "2"
    tooltips:
      "Relevant": "The case summary addresses or is pertinent to the stated legal question"
      "Not Relevant": "The case summary does not address the stated legal question"

  - annotation_type: multiselect
    name: areas_of_law
    description: "Which areas of law does this case involve?"
    labels:
      - "Contract Law"
      - "Criminal Law"
      - "Constitutional Law"
      - "Tax Law"
      - "Property Law"
      - "Administrative Law"
    tooltips:
      "Contract Law": "Disputes involving agreements, obligations, and breach of contract"
      "Criminal Law": "Cases involving criminal offenses, prosecution, and sentencing"
      "Constitutional Law": "Cases involving constitutional rights, powers, and interpretation"
      "Tax Law": "Disputes involving taxation, tax liability, and tax regulations"
      "Property Law": "Cases involving ownership, transfer, and use of property"
      "Administrative Law": "Cases involving government agency actions and regulations"

  - annotation_type: text
    name: legal_reasoning
    description: "Provide brief legal reasoning for your classifications"

annotation_instructions: |
  You will be shown a legal case summary with its jurisdiction.
  1. Read the case summary carefully.
  2. Determine if the case is relevant to the legal context.
  3. Select all areas of law that apply to this case.
  4. Write a brief explanation of your legal reasoning.

html_layout: |
  <div style="padding: 15px; max-width: 800px; margin: auto;">
    <div style="background: #fef3c7; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; display: inline-block;">
      <strong style="color: #92400e;">Jurisdiction:</strong>
      <span style="color: #78350f;">{{jurisdiction}}</span>
    </div>
    <div style="background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; padding: 16px; margin-bottom: 16px;">
      <strong style="color: #0369a1;">Case Summary:</strong>
      <p style="font-size: 16px; line-height: 1.7; margin: 8px 0 0 0;">{{text}}</p>
    </div>
  </div>

allow_all_users: true
instances_per_annotator: 50
annotation_per_instance: 2
allow_skip: true
skip_reason_required: false

Sample Datasample-data.json

json
[
  {
    "id": "lexglue_001",
    "text": "The plaintiff entered into a lease agreement with the defendant for commercial property. After the defendant failed to make rental payments for three consecutive months, the plaintiff sought to terminate the lease and recover unpaid rent plus damages. The court found that the lease contained a valid termination clause and awarded the plaintiff the outstanding balance.",
    "jurisdiction": "US Federal"
  },
  {
    "id": "lexglue_002",
    "text": "The defendant was charged with securities fraud for misleading investors about the financial health of the company. The prosecution presented evidence of falsified earnings reports and insider trading activities. The jury found the defendant guilty on all counts, resulting in a sentence of 15 years imprisonment and restitution of $4.2 million.",
    "jurisdiction": "US Federal"
  }
]

// ... and 8 more items

Get This Design

View on GitHub

Clone or download from the repository

Quick start:

git clone https://github.com/davidjurgens/potato-showcase.git
cd potato-showcase/text/domain-specific/lexglue-legal-understanding
potato start config.yaml

Dataset & paper

Chalkidis et al., ACL 2022

Citation (BibTeX)

bibtex
@inproceedings{chalkidis-etal-2022-lexglue,
    title = "{L}ex{GLUE}: A Benchmark Dataset for Legal Language Understanding in {E}nglish",
    author = "Chalkidis, Ilias and Jana, Abhik and Hartung, Dirk and Bommarito, Michael and Androutsopoulos, Ion and Katz, Daniel and Aletras, Nikolaos",
    booktitle = "Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics",
    year = "2022",
    url = "https://aclanthology.org/2022.acl-long.297",
    pages = "4310--4330"
}

Details

Annotation Types

radiomultiselecttext

Domain

NLPLegal

Use Cases

Legal ClassificationDocument UnderstandingLegal NLP

Tags

lexgluelegallawdocument-classificationacl2022

Found an issue or want to improve this design?

Open an Issue