/ Модель

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

Контекст
1 024 токена
Лицензия
Apache 2.0
Архитектура
gpt2 · dense
Базовая модель
gpt2
Библиотека
transformers
Опубликована
22 ноя 2023

open-australian-legal-gpt2

Генерация текстаТекст → текст3 профессии

Дообученная на австралийском законодательстве модель GPT-2 для генерации юридического текста и дальнейшей адаптации к задачам австралийского права.

129скачиваний за 30 дней5лайковвеса обновлены15 дек 2023

Бенчмарки

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

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

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

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

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

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

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

Open Australian Legal GPT2 — языковая модель на архитектуре GPT-2, разработанная Umar Butler и дообученная на корпусе австралийских законов и нормативных актов. Она предназначена для генерации и продолжения текста, а также может служить основой для последующего дообучения под задачи обработки австралийских юридических материалов. Обучающий корпус включал 37 560 документов и около 635 млн токенов; длина контекста модели — 1 024 токена. Модель принимает и генерирует текст на английском языке.

Модель ориентирована на юридический язык Австралии и может быть полезна для экспериментов с юридическими текстами и создания специализированных производных моделей. Автор отмечает, что она устарела: её сменила Open Australian Legal LLM. Возможны смещения в сторону законодательного стиля и права Содружества; в обучающих данных могли отсутствовать нормы Виктории, Северной территории и Австралийской столичной территории. Лицензия — Apache 2.0.

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

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

Ограничения

Модель устарела и автор рекомендует использовать её преемника Open Australian Legal LLM. Она может смещаться к законодательному стилю и праву Содружества; право Виктории, Северной территории и Австралийской столичной территории могло быть недостаточно представлено.

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

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

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

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

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

Открыть на Hugging Face

⚠️ This model has been superseded by the Open Australian Legal LLM, the largest open source language model trained on Australian law. You are encouraged to use that model instead. ⚠️

Open Australian Legal GPT2 ‍⚖️

Open Australian Legal GPT2 is the first open source language model trained on Australian law.

Naturally, as a finetune of GPT2, the model may be used for any of the tasks for which GPT2 is suitable, including text generation, text completion and question answering.

Trained on 37,560 laws and regulations, comprising 635,482,112 tokens, taken from the Open Australian Legal Corpus, the model is intended specifically to be finetuned for downstream natural language processing tasks applied to the Australian legal domain.

To ensure its accessibility to as wide an audience as possible, the model is issued under the Apache Licence 2.0.

Those interested in learning more about the model are encouraged to read Umar Butler's accompanying article, How I built the first open LLM for Australian law.

A smaller, distilled version of the model trained on the same dataset may be found here, and a larger model trained on a greater number of Australian legal documents is available here.

Usage 👩‍💻

The code snippet below demonstrates just one of the many ways in which the model may be accessed:

>>> from transformers import pipeline, set_seed

>>> set_seed(42) # We set a seed for reproducibility.
>>> generator = pipeline('text-generation', model='umarbutler/open-australian-legal-gpt2')
>>> generator('Under the Crimes Act 1914')
[{'generated_text': 'Under the Crimes Act 1914, a person who is liable to a payment of a benefit under the Act is also liable to pay'}]

Creation 🧪

37,560 documents were sampled from the Open Australian Legal Corpus by filtering for primary and secondary legislation that, when stripped of whitespace, was not empty. Such documents were then randomly shuffled and added to blocks 1,024-tokens-long, with GPT2's end-of-sequence token ('<|endoftext|>') being used as a delimiter as well as to pad the end of the final block, resulting in a training dataset of 620,588 blocks, or 635,482,112 tokens.

The training dataset was subsequently fed to GPT2 via transformers.Trainer with the following hyperparameters:

HyperparameterValue
Sequence length1,024
Epochs3
OptimiserAdamW
Learning rate1e-5
Learning rate schedulerLinear with warmup
Batch size per device4
Weight decay0.01
Warmup ratio0.06

After training for 3 epochs, or 465,441 steps, over a period of ~25 hours on two GeForce RTX 4090s, the model achieved a training loss of 0.61.

Limitations 🚧

Although the model has not been tested for bias, one would expect it to exhibit much of the same, if not all, the biases of GPT2.

One might also expect the model to exhibit a bias towards the type of language employed in legislation and regulations (its source materials) as well as towards Commonwealth law (the largest source of legislation in the Open Australian Legal Corpus at the time of the model's creation).

Finally, it is worth noting that the model may lack knowledge of Victorian, Northern Territory and Australian Capital Territory law as licensing restrictions had prevented their inclusion in the training data.

Licence 📜

The model is issued under the Apache Licence 2.0.

Citation 🔖

If you've relied on the model for your work, please cite:

@misc{butler-2023-open-australian-legal-gpt2,
    author = {Butler, Umar},
    year = {2023},
    title = {Open Australian Legal GPT2},
    publisher = {Hugging Face},
    version = {1.0.0},
    url = {https://huggingface.co/datasets/umarbutler/open-australian-legal-gpt2}
}

Acknowledgements 🙏

In the spirit of reconciliation, the author acknowledges the Traditional Custodians of Country throughout Australia and their connections to land, sea and community. He pays his respect to their Elders past and present and extends that respect to all Aboriginal and Torres Strait Islander peoples today.

The author thanks the sources of the Open Australian Legal Corpus for making their data available under open licences.

The author also acknowledges the developers of the many Python libraries relied upon in the training of the model, as well as the makers of GPT2, which the model was built atop.

Finally, the author is eternally grateful for the endless support of his wife and her willingness to put up with many a late night spent writing code and quashing bugs.

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

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

GPU в ailist

Универсальный рантайм · transformers

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

Подбираем GPU…

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

0 моделей