/ Модель

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

Архитектура
relik-reader · dense
Опубликована
4 июн 2024

relik-reader-deberta-v3-base-aida

ЭмбеддингиТекст → embedding5 профессий

Англоязычный компонент ReLiK Reader для связывания сущностей с базой знаний и извлечения отношений из текста.

245скачиваний за 30 дней0лайковвеса обновлены5 авг 2024

Бенчмарки

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

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

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

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

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

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

Это веса компонента ReLiK Reader из системы Retrieve, Read and LinK, разработанной Sapienza NLP. Модель предназначена для извлечения информации: связывания упомянутых в тексте сущностей с элементами базы знаний и извлечения отношений между сущностями. Reader работает в составе ReLiK вместе с retriever-компонентом, который находит релевантные документы; в этом репозитории размещены именно веса reader для варианта AIDA.

Архитектура указана как RelikReaderSpanModel семейства ReLiK Reader; файлы представлены в формате PyTorch. Карточка приводит оценку базовой версии ReLiK на наборе AIDA и других тестах entity linking, включая результаты InKB Micro F1 и скорость обработки. Модель ориентирована на англоязычные данные. Лицензия и размер весов в предоставленных источниках не описаны.

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

  • связывание упомянутых сущностей с базой знаний
  • извлечение отношений между сущностями в тексте
  • разметка сущностей для последующего анализа документов
  • обработка тестового набора AIDA для entity linking

Ограничения

Reader предназначен для работы как часть ReLiK и использует retriever для поиска релевантных документов. В предоставленной карточке не приведены лицензия и характеристики размера модели.

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

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

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

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

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

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

Открыть на Hugging Face

A blazing fast and lightweight Information Extraction model for Entity Linking and Relation Extraction.

This repository contains the weights for the ReLiK Reader component.

🛠️ Installation

Installation from PyPI

pip install relik

Install with optional dependencies

Install with all the optional dependencies.

pip install relik[all]

Install with optional dependencies for training and evaluation.

pip install relik[train]

Install with optional dependencies for FAISS

FAISS PyPI package is only available for CPU. For GPU, install it from source or use the conda package.

For CPU:

pip install relik[faiss]

For GPU:

conda create -n relik python=3.10
conda activate relik

# install pytorch
conda install -y pytorch=2.1.0 pytorch-cuda=12.1 -c pytorch -c nvidia

# GPU
conda install -y -c pytorch -c nvidia faiss-gpu=1.8.0
# or GPU with NVIDIA RAFT
conda install -y -c pytorch -c nvidia -c rapidsai -c conda-forge faiss-gpu-raft=1.8.0

pip install relik

Install with optional dependencies for serving the models with FastAPI and Ray.

pip install relik[serve]

Installation from source

git clone https://github.com/SapienzaNLP/relik.git
cd relik
pip install -e .[all]

🚀 Quick Start

ReLiK is a lightweight and fast model for Entity Linking and Relation Extraction. It is composed of two main components: a retriever and a reader. The retriever is responsible for retrieving relevant documents from a large collection, while the reader is responsible for extracting entities and relations from the retrieved documents. ReLiK can be used with the from_pretrained method to load a pre-trained pipeline.

Here is an example of how to use ReLiK for Entity Linking:

from relik import Relik
from relik.inference.data.objects import RelikOutput

relik = Relik.from_pretrained("sapienzanlp/relik-entity-linking-large")
relik_out: RelikOutput = relik("Michael Jordan was one of the best players in the NBA.")
RelikOutput(
  text="Michael Jordan was one of the best players in the NBA.",
  tokens=['Michael', 'Jordan', 'was', 'one', 'of', 'the', 'best', 'players', 'in', 'the', 'NBA', '.'],
  id=0,
  spans=[
      Span(start=0, end=14, label="Michael Jordan", text="Michael Jordan"),
      Span(start=50, end=53, label="National Basketball Association", text="NBA"),
  ],
  triples=[],
  candidates=Candidates(
      span=[
          [
              [
                  {"text": "Michael Jordan", "id": 4484083},
                  {"text": "National Basketball Association", "id": 5209815},
                  {"text": "Walter Jordan", "id": 2340190},
                  {"text": "Jordan", "id": 3486773},
                  {"text": "50 Greatest Players in NBA History", "id": 1742909},
                  ...
              ]
          ]
      ]
  ),
)

📊 Performance

We evaluate the performance of ReLiK on Entity Linking using GERBIL. The following table shows the results (InKB Micro F1) of ReLiK Large and Base:

ModelAIDAMSNBCDerK50R128R500O15O16TotOODAIT (m:s)
GENRE83.773.754.160.746.740.356.150.058.254.538:00
EntQA85.872.152.964.554.141.961.151.360.556.420:00
ReLiKBase85.372.355.668.048.141.662.552.360.757.200:29
➡️ ReLiKLarge86.475.056.372.851.743.065.157.263.460.201:46

Comparison systems' evaluation (InKB Micro F1) on the in-domain AIDA test set and out-of-domain MSNBC (MSN), Derczynski (Der), KORE50 (K50), N3-Reuters-128 (R128), N3-RSS-500 (R500), OKE-15 (O15), and OKE-16 (O16) test sets. Bold indicates the best model. GENRE uses mention dictionaries. The AIT column shows the time in minutes and seconds (m:s) that the systems need to process the whole AIDA test set using an NVIDIA RTX 4090, except for EntQA which does not fit in 24GB of RAM and for which an A100 is used.

🤖 Models

Models can be found on 🤗 Hugging Face.

💽 Cite this work

If you use any part of this work, please consider citing the paper as follows:

@inproceedings{orlando-etal-2024-relik,
    title     = "Retrieve, Read and LinK: Fast and Accurate Entity Linking and Relation Extraction on an Academic Budget",
    author    = "Orlando, Riccardo and Huguet Cabot, Pere-Llu{\'\i}s and Barba, Edoardo and Navigli, Roberto",
    booktitle = "Findings of the Association for Computational Linguistics: ACL 2024",
    month     = aug,
    year      = "2024",
    address   = "Bangkok, Thailand",
    publisher = "Association for Computational Linguistics",
}

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

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

GPU в ailist

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

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

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
RelikReaderSpanModel
Ревизия весов
3bed884

0 моделей