lex-glue  by coastalcph

Benchmark for legal language understanding and NLP model evaluation

Created 4 years ago
253 stars

Top 99.3% on SourcePulse

GitHubView on GitHub
Project Summary

LexGLUE provides a standardized benchmark dataset and evaluation framework for legal natural language understanding (NLP) tasks. It aims to advance research in legal NLP by enabling the development and transparent evaluation of generic models capable of handling multiple legal text-processing challenges. The project targets NLP researchers, legal tech practitioners, and interdisciplinary scholars, offering a unified entry point to seven diverse legal NLP datasets and facilitating the push towards foundation models for the legal domain.

How It Works

Inspired by the GLUE and SuperGLUE benchmarks, LexGLUE consolidates seven existing legal NLP datasets, selected based on criteria similar to SuperGLUE. The project simplifies tasks to enhance accessibility for newcomers and general-purpose models. It offers Python APIs integrated with the Hugging Face datasets and transformers libraries, allowing for straightforward data loading, experimentation, and performance evaluation. This approach promotes the development of robust, adaptable legal NLP models.

Quick Start & Requirements

  • Primary install: Use the Hugging Face datasets library: pip install datasets. Load datasets via from datasets import load_dataset; dataset = load_dataset("coastalcph/lex_glue", "task_name").
  • Prerequisites: Python 3.x, torch>=1.9.0, transformers>=4.9.0, scikit-learn>=0.24.1, datasets>=1.12.1, and other listed scientific Python packages. GPU and CUDA are recommended for running transformer-based experiments.
  • Resource Footprint: Experiments can be run on Google Colab with GPU acceleration. Code for replicating results is available in the repository.
  • Links: Hugging Face Datasets: https://huggingface.co/datasets/coastalcph/lex_glue. GitHub Repository: https://github.com/coastalcph/lex-glue.

Highlighted Details

  • Supported Tasks: Includes multi-label classification (ECtHR Tasks A & B, EUR-LEX, UNFAIR-ToS), multi-class classification (SCOTUS, LEDGAR), and multiple-choice question answering (CaseHOLD).
  • Datasets: Covers European Court of Human Rights (ECtHR), US Supreme Court (SCOTUS), EU legislation (EUR-LEX), contract provisions (LEDGAR), unfair terms of service (UNFAIR-ToS), and case holdings (CaseHOLD).
  • Performance Benchmarking: Provides leaderboards with averaged F1 scores (μ-F1 / m-F1) for various models, including BERT, RoBERTa, Legal-BERT, Longformer, and BigBird, across different model sizes.
  • Hugging Face Integration: Seamlessly works with the Hugging Face ecosystem for easy model and dataset management.

Maintenance & Community

The project encourages community participation through GitHub Discussions for questions and submitting new results. Plans are in place to develop an integrated submission environment and an automated leaderboard. Credits are given to specific contributors for bug identification.

Licensing & Compatibility

The repository's license is not explicitly stated in the README. This absence may pose compatibility concerns for commercial use or integration into closed-source projects without further clarification.

Limitations & Caveats

LexGLUE currently lacks an automated submission system and leaderboard; participants must manually submit results via GitHub discussions and pull requests. The specific license governing the dataset and code is not provided, which could be a barrier for certain adoption scenarios. Running experiments, especially with larger models, requires significant computational resources, although lighter models and free platforms like Google Colab are suggested alternatives.

Health Check
Last Commit

9 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
3 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.