/ Модель

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

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

propositionizer-wiki-flan-t5-large

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

Модель на базе T5 разбивает текст на атомарные пропозиции в формате JSON для последующего поиска и извлечения информации.

597скачиваний за 30 дней52лайкавеса обновлены13 дек 2023

Бенчмарки

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

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

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

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

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

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

chentong00/propositionizer-wiki-flan-t5-large — модель сегментации текста на отдельные пропозиции, опубликованная как часть работы «Dense X Retrieval: What Retrieval Granularity Should We Use?» Chen et al. (2023). Она основана на архитектуре T5 и содержит 385,2 млн параметров. На вход подаётся текст с заголовком, разделом и содержимым; модель возвращает список пропозиций в формате JSON.

Модель предназначена для разбиения документов на более мелкие смысловые утверждения, например при подготовке данных для поиска и извлечения информации. Максимальная длина контекста — 512 токенов. Весы доступны в формате safetensors, лицензия — Apache-2.0.

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

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

Ограничения

Контекст ограничен 512 токенами. README не описывает оценку качества и не приводит подробностей о поведении на языках, отличных от английского.

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

This is the proposition segmentation model from "Dense X Retrieval: What Retrieval Granularity Should We Use?" by Chen et. al. 2023.

Usage

The prompt to the model is formatted like: Title: {title}. Section: {section}. Content: {content}. The output of the model is a list of propositions in JSON format.

For example, if we use the model to decompose the following passage:

Title: Leaning Tower of Pisa. Section: . Content: Prior to restoration work performed between 1990 and 2001, Leaning Tower of Pisa leaned at an angle of 5.5 degrees, but the tower now leans at about 3.99 degrees. This means the top of the tower is displaced horizontally 3.9 meters (12 ft 10 in) from the center.

The output will be:

["Prior to restoration work performed between 1990 and 2001, Leaning Tower of Pisa leaned at an angle of 5.5 degrees.", "Leaning Tower of Pisa now leans at about 3.99 degrees.", "The top of Leaning Tower of Pisa is displaced horizontally 3.9 meters (12 ft 10 in) from the center."]

Example Code

Example:

from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
import torch
import json

model_name = "chentong00/propositionizer-wiki-flan-t5-large"
device = "cuda" if torch.cuda.is_available() else "cpu"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name).to(device)

title = "Leaning Tower of Pisa"
section = ""
content = "Prior to restoration work performed between 1990 and 2001, Leaning Tower of Pisa leaned at an angle of 5.5 degrees, but the tower now leans at about 3.99 degrees. This means the top of the tower is displaced horizontally 3.9 meters (12 ft 10 in) from the center."

input_text = f"Title: {title}. Section: {section}. Content: {content}"

input_ids = tokenizer(input_text, return_tensors="pt").input_ids
outputs = model.generate(input_ids.to(device), max_new_tokens=512).cpu()

output_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
try:
    prop_list = json.loads(output_text)
except:
    prop_list = []
    print("[ERROR] Failed to parse output text as JSON.")
print(json.dumps(prop_list, indent=2))

Expected Output:

[
  "Prior to restoration work performed between 1990 and 2001, Leaning Tower of Pisa leaned at an angle of 5.5 degrees.",
  "Leaning Tower of Pisa now leans at about 3.99 degrees.",
  "The top of Leaning Tower of Pisa is displaced horizontally 3.9 meters (12 ft 10 in) from the center."
]

Citation

@article{chen2023densex,
  title={Dense X Retrieval: What Retrieval Granularity Should We Use?},
  author={Tong Chen and Hongwei Wang and Sihao Chen and Wenhao Yu and Kaixin Ma and Xinran Zhao and Hongming Zhang and Dong Yu},
  journal={arXiv preprint arXiv:2312.06648},
  year={2023},
  URL = {https://arxiv.org/pdf/2312.06648.pdf}
}

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

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

GPU в ailist

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

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

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

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

0 моделей