/ Модель

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

Контекст
514 токенов
Параметры
305 млн
Лицензия
MIT
Архитектура
xlm-roberta · dense
Опубликована
2 мар 2022

cross-en-de-roberta-sentence-transformer

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

Модель XLM-RoBERTa создаёт семантические эмбеддинги английских и немецких предложений для поиска сходных текстов как внутри одного языка, так и между языками.

17 294скачиваний за 30 дней71лайквеса обновлены17 сен 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

T-Systems-onsite выпустила модель на основе XLM-RoBERTa для получения векторных представлений предложений на английском и немецком языках. Модель дообучена для сравнения семантической близости предложений, в том числе между языками: тексты на английском и немецком с похожим смыслом отображаются в близкие векторы. Репозиторий содержит версии весов для PyTorch, Safetensors и TensorFlow; общее число параметров — 305,2 млн, контекст — до 514 токенов.

Модель предназначена для семантического поиска, оценки текстового сходства и поиска перефразирований. Её можно использовать, например, чтобы искать немецкие документы по английскому запросу или сравнивать предложения по косинусному сходству. Для работы авторы рекомендуют библиотеку Sentence Transformers. Модель дообучена на англо-немецких данных STSbenchmark с дополнительными парами предложений между языками; карточка приводит результаты оценки на английском, немецком и их межъязыковых парах.

Лицензия — MIT. Модель выдаёт эмбеддинги, а не готовые текстовые ответы; качество поиска зависит от корпуса и настроек сравнения. Карточка описывает её применение прежде всего для английского и немецкого языков, поэтому не следует считать заявленное межъязыковое качество универсальным для других языковых пар.

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

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

Ограничения

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

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

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

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

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

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

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

Открыть на Hugging Face

Cross English & German RoBERTa for Sentence Embeddings

This model is intended to compute sentence (text) embeddings for English and German text. These embeddings can then be compared with cosine-similarity to find sentences with a similar semantic meaning. For example this can be useful for semantic textual similarity, semantic search, or paraphrase mining. To do this you have to use the Sentence Transformers Python framework.

The speciality of this model is that it also works cross-lingually. Regardless of the language, the sentences are translated into very similar vectors according to their semantics. This means that you can, for example, enter a search in German and find results according to the semantics in German and also in English. Using a xlm model and multilingual finetuning with language-crossing we reach performance that even exceeds the best current dedicated English large model (see Evaluation section below).

Sentence-BERT (SBERT) is a modification of the pretrained BERT network that use siamese and triplet network structures to derive semantically meaningful sentence embeddings that can be compared using cosine-similarity. This reduces the effort for finding the most similar pair from 65hours with BERT / RoBERTa to about 5 seconds with SBERT, while maintaining the accuracy from BERT.

Source: Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks

This model is fine-tuned from Philip May and open-sourced by T-Systems-onsite. Special thanks to Nils Reimers for your awesome open-source work, the Sentence Transformers, the models and your help on GitHub.

How to use

To use this model install the sentence-transformers package (see here: https://github.com/UKPLab/sentence-transformers).

from sentence_transformers import SentenceTransformer
model = SentenceTransformer('T-Systems-onsite/cross-en-de-roberta-sentence-transformer')

For details of usage and examples see here:

Training

The base model is xlm-roberta-base. This model has been further trained by Nils Reimers on a large scale paraphrase dataset for 50+ languages. Nils Reimers about this on GitHub:

A paper is upcoming for the paraphrase models.

These models were trained on various datasets with Millions of examples for paraphrases, mainly derived from Wikipedia edit logs, paraphrases mined from Wikipedia and SimpleWiki, paraphrases from news reports, AllNLI-entailment pairs with in-batch-negative loss etc.

In internal tests, they perform much better than the NLI+STSb models as they have see more and broader type of training data. NLI+STSb has the issue that they are rather narrow in their domain and do not contain any domain specific words / sentences (like from chemistry, computer science, math etc.). The paraphrase models has seen plenty of sentences from various domains.

More details with the setup, all the datasets, and a wider evaluation will follow soon.

The resulting model called xlm-r-distilroberta-base-paraphrase-v1 has been released here: https://github.com/UKPLab/sentence-transformers/releases/tag/v0.3.8

Building on this cross language model we fine-tuned it for English and German language on the STSbenchmark dataset. For German language we used the dataset of our German STSbenchmark dataset which has been translated with deepl.com. Additionally to the German and English training samples we generated samples of English and German crossed. We call this multilingual finetuning with language-crossing. It doubled the traing-datasize and tests show that it further improves performance.

We did an automatic hyperparameter search for 33 trials with Optuna. Using 10-fold crossvalidation on the deepl.com test and dev dataset we found the following best hyperparameters:

  • batch_size = 8
  • num_epochs = 2
  • lr = 1.026343323298136e-05,
  • eps = 4.462251033010287e-06
  • weight_decay = 0.04794438776350409
  • warmup_steps_proportion = 0.1609010732760181

The final model was trained with these hyperparameters on the combination of the train and dev datasets from English, German and the crossings of them. The testset was left for testing.

Evaluation

The evaluation has been done on English, German and both languages crossed with the STSbenchmark test data. The evaluation-code is available on Colab. As the metric for evaluation we use the Spearman’s rank correlation between the cosine-similarity of the sentence embeddings and STSbenchmark labels.

Model NameSpearmanGermanSpearmanEnglishSpearmanEN-DE & DE-EN(cross)
xlm-r-distilroberta-base-paraphrase-v10.80790.83500.7983
xlm-r-100langs-bert-base-nli-stsb-mean-tokens0.78770.84650.7908
xlm-r-bert-base-nli-stsb-mean-tokens0.78770.84650.7908
roberta-large-nli-stsb-mean-tokens0.63710.86390.4109
T-Systems-onsite/german-roberta-sentence-transformer-v20.85290.86340.8415
paraphrase-multilingual-mpnet-base-v20.83550.86820.8309
T-Systems-onsite/cross-en-de-roberta-sentence-transformer0.85500.86600.8525

License

Copyright (c) 2020 Philip May, T-Systems on site services GmbH

Licensed under the MIT License (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License by reviewing the file LICENSE in the repository.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей