Skip to content
Showcase/LexGLUE - Legal Document Understanding
intermediatetext

LexGLUE - Legal Document Understanding

Legal document understanding and classification based on the LexGLUE benchmark (Chalkidis et al., ACL 2022). Annotators assess the relevance of legal case summaries, classify applicable areas of law, and provide legal reasoning.

Q1: Rate your experience12345Q2: Primary use case?ResearchIndustryEducationQ3: Additional feedback

Configuration Fileconfig.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

[
  {
    "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

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