/ Модель

Характеристики

Контекст
512 токенов
Параметры
137 млн
Лицензия
MIT
Архитектура
bert · dense
Опубликована
11 сен 2022

InLegalBERT

Заполнение пропусковТекст → текст3 профессии

Англоязычная BERT-модель, дополнительно обученная на судебных документах Индии для заполнения маски и получения представлений юридического текста.

8 813скачиваний за 30 дней112лайковвеса обновлены11 мая 2023

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

InLegalBERT — модель BERT, разработанная исследователями Департамента компьютерных наук и технологий Индийского технологического института в Харагпуре для работы с англоязычными юридическими текстами Индии. Она продолжает обучение LEGAL-BERT-SC на корпусе примерно из 5,4 млн документов Верховного суда Индии и высших судов за 1950–2019 годы с задачами masked language modeling и next sentence prediction.

Модель имеет архитектуру BERT с 12 слоями, скрытым размером 768 и 12 головами внимания; в метаданных указано 136,7 млн параметров, контекст — до 512 токенов. Основная задача модели по карточке Hugging Face — заполнение маски. Её также можно использовать как основу для извлечения представлений текста и дообучать для классификации юридических норм, сегментации судебных документов и прогнозирования решений суда. В README сообщается о лучших результатах по этим трём задачам по сравнению с использованными авторами базовыми моделями.

Модель принимает и выдаёт текст; она предназначена для английских юридических документов индийской судебной системы. Лицензия — MIT. Результаты по прикладным задачам описаны для дообученных вариантов, поэтому для классификации, сегментации или прогнозирования решений потребуется отдельная настройка модели.

Сценарии применения

  • восстановление замаскированных слов в индийских судебных документах
  • получение векторных представлений юридических текстов
  • дообучение для определения применимых статей закона по фактам дела
  • дообучение для сегментации судебного документа на функциональные части
  • дообучение для классификации исхода судебного дела

Ограничения

Модель обучена на англоязычных судебных документах Индии, поэтому её применение к другим языкам и правовым системам может быть ограничено. Для классификации статей закона, сегментации и предсказания решений суда требуется дообучение на соответствующей задаче.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

InLegalBERT

Model and tokenizer files for the InLegalBERT model from the paper Pre-training Transformers on Indian Legal Text.

Training Data

For building the pre-training corpus of Indian legal text, we collected a large corpus of case documents from the Indian Supreme Court and many High Courts of India. The court cases in our dataset range from 1950 to 2019, and belong to all legal domains, such as Civil, Criminal, Constitutional, and so on. In total, our dataset contains around 5.4 million Indian legal documents (all in the English language). The raw text corpus size is around 27 GB.

Training Setup

This model is initialized with the LEGAL-BERT-SC model from the paper LEGAL-BERT: The Muppets straight out of Law School. In our work, we refer to this model as LegalBERT, and our re-trained model as InLegalBERT. We further train this model on our data for 300K steps on the Masked Language Modeling (MLM) and Next Sentence Prediction (NSP) tasks.

Model Overview

This model uses the same tokenizer as LegalBERT. This model has the same configuration as the bert-base-uncased model: 12 hidden layers, 768 hidden dimensionality, 12 attention heads, ~110M parameters.

Usage

Using the model to get embeddings/representations for a piece of text

from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("law-ai/InLegalBERT")
text = "Replace this string with yours"
encoded_input = tokenizer(text, return_tensors="pt")
model = AutoModel.from_pretrained("law-ai/InLegalBERT")
output = model(**encoded_input)
last_hidden_state = output.last_hidden_state

Fine-tuning Results

We have fine-tuned all pre-trained models on 3 legal tasks with Indian datasets:

  • Legal Statute Identification (ILSI Dataset)[Multi-label Text Classification]: Identifying relevant statutes (law articles) based on the facts of a court case
  • Semantic Segmentation (ISS Dataset)[Sentence Tagging]: Segmenting the document into 7 functional parts (semantic segments) such as Facts, Arguments, etc.
  • Court Judgment Prediction (ILDC Dataset)[Binary Text Classification]: Predicting whether the claims/petitions of a court case will be accepted/rejected

InLegalBERT beats LegalBERT as well as all other baselines/variants we have used, across all three tasks. For details, see our paper.

Citation

@inproceedings{paul-2022-pretraining,
  url = {https://arxiv.org/abs/2209.06049},
  author = {Paul, Shounak and Mandal, Arpan and Goyal, Pawan and Ghosh, Saptarshi},
  title = {Pre-trained Language Models for the Legal Domain: A Case Study on Indian Law},
  booktitle = {Proceedings of 19th International Conference on Artificial Intelligence and Law - ICAIL 2023}
  year = {2023},
}

About Us

We are a group of researchers from the Department of Computer Science and Technology, Indian Insitute of Technology, Kharagpur. Our research interests are primarily ML and NLP applications for the legal domain, with a special focus on the challenges and oppurtunites for the Indian legal scenario. We have, and are currently working on several legal tasks such as:

  • named entity recognition, summarization of legal documents
  • semantic segmentation of legal documents
  • legal statute identification from facts, court judgment prediction
  • legal document matching

You can find our publicly available codes and datasets here.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · fill-mask

Можно запустить

Подбираем GPU…

Класс архитектуры
BertForPreTraining
Ревизия весов
b5ecfed

0 моделей