/ Модель

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

Контекст
514 токенов
Параметры
305 млн
Лицензия
CC BY-SA 4.0
Архитектура
xlm-roberta · dense
Базовая модель
paraphrase-multilingual-MiniLM-L12-v2
Библиотека
sentence-transformers
Опубликована
19 ноя 2024

TRoTR-paraphrase-multilingual-MiniLM-L12-v2

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

Дообученная многоязычная Sentence Transformers модель для сравнения семантического сходства и тематической связанности предложений и контекстов.

25скачиваний за 30 дней0лайковвеса обновлены21 ноя 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Francesco Periti и соавторы представляют TRoTR-paraphrase-multilingual-MiniLM-L12-v2 — дообученную модель Sentence Transformers на базе sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2. Она кодирует предложения и контексты в эмбеддинги для оценки семантического сходства и тематической связанности, в частности при анализе того, как меняется контекст повторно использованного текста. В примере README модель сравнивает контексты библейской цитаты в разных сообщениях.

Модель использует архитектуру XLM-RoBERTa с плотным представлением, содержит 305,2 млн параметров и принимает последовательности длиной до 514 токенов. Карточка указывает поддержку английского языка; базовая модель многоязычная, однако README не подтверждает языки, на которых это дообучение проверено. Веса доступны в формате safetensors.

Модель подходит для сравнения пар контекстов и поиска тематически близких текстов, но её назначение связано с задачами TRoTR, а эксперимент с цитатами сам по себе не подтверждает качество на широком круге доменов. Лицензия — CC BY-SA 4.0.

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

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

Ограничения

README приводит пример сравнения контекстов и описывает задачи TRoTR, но не сообщает метрики качества или проверки на других доменах. Метаданные указывают английский язык; многоязычность унаследована от базовой модели, но языки дообучения и оценки здесь не уточнены.

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

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

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

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

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

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

Открыть на Hugging Face

TRoTR-all-distilroberta-v1

FrancescoPeriti/TRoTR-paraphrase-multilingual-MiniLM-L12-v2 is a fine-tuned version of the sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2.

NOTE: In our work, we performed cross-validation across 10 different folds. For a given model (e.g., paraphrase-multilingual-MiniLM-L12-v2), this process involved fine-tuning 10 separate models and reporting the average performance across the test folds. Rather than sharing all the fine-tuned models for each fold, we decided to provide only an example model for the FOLD1. Please note that the results in the paper are based on the averaged performance across all folds. Therefore, the performance of this single model is not directly comparable to the results reported in the paper.

You can find more details in our paper TRoTR: A Framework for Evaluating the Recontextualization of Text by Francesco Periti, Pierluigi Cassotti, Stefano Montanelli, Nina Tahmasebi, and Dominik Schlechtweg. The repository of our project is https://github.com/FrancescoPeriti/TRoTR.

Model Description

This model is designed to evaluate the topic relatedness of text reuse in different contexts.

The model is fine-tuned on the TRoTR dataset for text recontextualization using contrastive learning. Specifically, given a target text-reuse excerpt 𝑡 within two contexts 𝑐₁ and 𝑐₂, the model is trained to minimize the embedding distance between 𝑐₁ and 𝑐₂ if they share the same topic, and to maximize the distance if they don't share the same topic.

As an example, consider three recontextualizations of the biblical passage John 15:13:

  • (1) It’s the wonderful pride month!! ❤️🧡💛💚💙💜 Honestly pride is everyday! Love is love don’t forget I love you ❤️. Remember this! John 15:12-13: “My command is this: Love each other as I have loved you. Greater love has no one than this: to lay down one’s life for one’s friends”
  • (2) At a large Crimean event today Putin quoted the Bible to defend the special military operation in Ukraine which has killed thousands and displaced millions. His words “There is no greater love than if someone gives soul for their friends”. And people were cheering him. Madness!!!
  • (3) “Freeing people from genocide is the reason, motive & goal of the military operation we started in the Donbas& Ukraine”, Putin says, then quotes the Bible: “There is no greater love than to lay down one’s life for one’s friends.” It’s like Billy Graham meets North Korea

In this example, the biblical passage is incorporated within three texts with different topic recontextualizations. In particular, the text (1) has a different topic with respect to text (2) and (3), while the texts (2) and (3) are topic related

How to Get Started with the Model

from sentence_transformers import SentenceTransformer

# Load the model
model = SentenceTransformer('FrancescoPeriti/TRoTR-paraphrase-multilingual-MiniLM-L12-v2')

# Example sentences for text recontextualization
context1 = "It's the wonderful pride month!! ❤️🧡💛💚💙💜 Honestly pride is everyday! Love is love don't forget I love you ❤️. Remember this! John 15:12-13: My command is this: Love each other as I have loved you. Greater love has no one than this: to lay down one's life for one's friends"
context2 = "At a large Crimean event today Putin quoted the Bible to defend the special military operation in Ukraine which has killed thousands and displaced millions. His words \"Greater love has no one than this: to lay down one's life for one's friends\". And people were cheering him. Madness!!!"
context3 = "\"Freeing people from genocide is the reason, motive and goal of the military operation we started in the Donbas and Ukraine\", Putin says, then quotes the Bible: \"Greater love has no one than this: to lay down one's life for one's friends\" It's like Billy Graham meets North Korea."

# Encode the two contexts into embeddings
embedding1 = model.encode([context1])
embedding2 = model.encode([context2])
embedding3 = model.encode([context3])

# Calculate similarity
similarity1 = model.similarity(embedding1, embedding2)
similarity2 = model.similarity(embedding1, embedding3)
similarity3 = model.similarity(embedding2, embedding3)

# Print the similarity score
print(f"Cosine similarities between the contexts: {similarity1}, {similarity2}, {similarity3}")
# Cosine similarities between the contexts: tensor([[0.2952]]), tensor([[0.3269]]), tensor([[0.8744]])

Citation

Francesco Periti, Pierluigi Cassotti, Stefano Montanelli, Nina Tahmasebi, and Dominik Schlechtweg. 2024. TRoTR: A Framework for Evaluating the Re-contextualization of Text Reuse. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pages 13972–13990, Miami, Florida, USA. Association for Computational Linguistics.

BibTeX:

@inproceedings{periti2024trotr,
    title = {{TRoTR: A Framework for Evaluating the Re-contextualization of Text Reuse}},
    author = "Periti, Francesco  and Cassotti, Pierluigi  and Montanelli, Stefano  and Tahmasebi, Nina  and Schlechtweg, Dominik",
    editor = "Al-Onaizan, Yaser  and Bansal, Mohit  and Chen, Yun-Nung",
    booktitle = "Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing",
    month = nov,
    year = "2024",
    address = "Miami, Florida, USA",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2024.emnlp-main.774",
    pages = "13972--13990",
    abstract = "Current approaches for detecting text reuse do not focus on recontextualization, i.e., how the new context(s) of a reused text differs from its original context(s). In this paper, we propose a novel framework called TRoTR that relies on the notion of topic relatedness for evaluating the diachronic change of context in which text is reused. TRoTR includes two NLP tasks: TRiC and TRaC. TRiC is designed to evaluate the topic relatedness between a pair of recontextualizations. TRaC is designed to evaluate the overall topic variation within a set of recontextualizations. We also provide a curated TRoTR benchmark of biblical text reuse, human-annotated with topic relatedness. The benchmark exhibits an inter-annotator agreement of .811. We evaluate multiple, established SBERT models on the TRoTR tasks and find that they exhibit greater sensitivity to textual similarity than topic relatedness. Our experiments show that fine-tuning these models can mitigate such a kind of sensitivity.",
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей