/ Модель

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

Контекст
512 токенов
Параметры
124 млн
Лицензия
Apache 2.0
Архитектура
t5 · dense

t5-end2end-question-generation

Языковая модель3 профессии

T5-base, дообученная на SQuAD модель для генерации вопросов по текстовому контексту.

135скачиваний за 30 дней18лайковвеса обновлены10 окт 2021

Бенчмарки

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

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

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

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

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

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

Thomas Simonini разработал модель t5-end2end-question-generation: это версия T5-base, дообученная на датасете SQuAD для генерации вопросов по заданному контексту. Модель принимает текст контекста и формулирует на его основе вопросы; например, контекстом может быть описание языка программирования.

Модель содержит 123,7 млн параметров, использует архитектуру T5 для преобразования текста в текст и распространяется в формате PyTorch. Длина контекста составляет 512 токенов. В README приведён результат оценки на тестовой выборке SQuAD: loss 1,5691.

Лицензия — Apache-2.0. Модель предназначена для генерации вопросов по текстовым фрагментам; её карточка не подтверждает качество на других языках или доменах и не приводит дополнительных оценок.

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

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

Ограничения

В README приведена оценка только на SQuAD; качество на других языках и типах текстов не подтверждено. Контекст ограничен 512 токенами.

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

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

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

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

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

Открыть на Hugging Face

t5-end2end-question-generation

This model is a fine-tuned version of t5-base on the squad dataset to generate questions based on a context.

👉 If you want to learn how to fine-tune the t5 model to do the same, you can follow this tutorial

For instance:

Context: "Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum and first released in 1991, Python's design philosophy emphasizes code readability with its notable use of significant whitespace."
Questions:

    Who created Python?,
    When was Python first released?
    What is Python's design philosophy?

It achieves the following results on the evaluation set:

  • Loss: 1.5691

Use the Model

from transformers import T5ForConditionalGeneration, T5TokenizerFast

hfmodel = T5ForConditionalGeneration.from_pretrained("ThomasSimonini/t5-end2end-question-generation")

text= "The abolition of feudal privileges by the National Constituent Assembly on 4 August 1789 and the Declaration \\nof the Rights of Man and of the Citizen (La Déclaration des Droits de l'Homme et du Citoyen), drafted by Lafayette \\nwith the help of Thomas Jefferson and adopted on 26 August, paved the way to a Constitutional Monarchy \\n(4 September 1791 – 21 September 1792). Despite these dramatic changes, life at the court continued, while the situation \\nin Paris was becoming critical because of bread shortages in September. On 5 October 1789, a crowd from Paris descended upon Versailles \\nand forced the royal family to move to the Tuileries Palace in Paris, where they lived under a form of house arrest under \\nthe watch of Lafayette's Garde Nationale, while the Comte de Provence and his wife were allowed to reside in the \\nPetit Luxembourg, where they remained until they went into exile on 20 June 1791."

def run_model(input_string, **generator_args):
  generator_args = {
  "max_length": 256,
  "num_beams": 4,
  "length_penalty": 1.5,
  "no_repeat_ngram_size": 3,
  "early_stopping": True,
  }
  input_string = "generate questions: " + input_string + " </s>"
  input_ids = tokenizer.encode(input_string, return_tensors="pt")
  res = hfmodel.generate(input_ids, **generator_args)
  output = tokenizer.batch_decode(res, skip_special_tokens=True)
  output = [item.split("<sep>") for item in output]
  return output
  
run_model(text)

=> [['When did the National Constituent Assembly abolish feudal privileges?',
  ' Who drafted the Declaration of the Rights of Man and of the Citizen?',
  ' When was the Constitutional Monarchy established?',
  ' What was the name of the Declaration that paved the way to a constitutional monarchy?',
  '']]

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 0.0001
  • train_batch_size: 4
  • eval_batch_size: 4
  • seed: 42
  • gradient_accumulation_steps: 16
  • total_train_batch_size: 64
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • num_epochs: 7

Training results

Training LossEpochStepValidation Loss
2.58340.341001.9107
1.96420.682001.7227
1.85261.023001.6627
1.73831.364001.6354
1.72231.695001.6154
1.68712.036001.6096
1.63092.377001.6048
1.62422.718001.5923
1.62263.059001.5855
1.56453.3910001.5874
1.57053.7311001.5822
1.55434.0712001.5817
1.52844.4113001.5841
1.52754.7514001.5741
1.52695.0815001.5715
1.50795.4216001.5701
1.48765.7617001.5754
1.4986.118001.5699
1.48526.4419001.5693
1.47766.7820001.5691

Framework versions

  • Transformers 4.10.3
  • Pytorch 1.9.0+cu102
  • Datasets 1.12.1
  • Tokenizers 0.10.3

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

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

GPU в ailist

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

Нельзя запустить

У модели не указана задача.

Класс архитектуры
T5ForConditionalGeneration
Ревизия весов
1dda3f9

0 моделей