/ Модель

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

Контекст
514 токенов
Параметры
454 млн
Лицензия
Apache 2.0
Архитектура
roberta · dense
Базовая модель
roberta-large-1160k
Опубликована
24 апр 2025

scandi-nli-large-v2

Классификация текстаТекст → label4 профессии

Дообученная RoBERTa Large для zero-shot-классификации и определения логического отношения между текстами на датском, норвежском букмоле и шведском.

218скачиваний за 30 дней3лайкавеса обновлены26 апр 2025

Бенчмарки

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

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

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

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

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

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

ScandiNLI Large v2 — модель естественного логического вывода для датского, норвежского букмола и шведского языков, разработанная AI Sweden. Это дообученная модель RoBERTa Large на 454,1 млн параметров; она принимает текстовые посылки и гипотезы и определяет их отношение, поддерживая сценарии zero-shot-классификации. Контекст модели — до 514 токенов.

Модель подходит для классификации текстов по пользовательским категориям и проверки того, следует ли гипотеза из посылки, противоречит ей или не связана с ней. В оценке авторов версия v2 показала в среднем по трём скандинавским языкам точность 84,95% и macro-F1 75,41%. Для шведского и норвежского оценка проводилась на машинно переведённом MultiNLI, поэтому эти результаты могут не полностью отражать качество на оригинальных данных. Модель распространяется по лицензии Apache-2.0.

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

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

Ограничения

В оценках для шведского и норвежского использовался машинно переведённый MultiNLI, а не золотой стандарт на оригинальных данных. Показатели на тестовых выборках не гарантируют такого же качества на других текстах и сценариях.

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

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

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

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

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

Открыть на Hugging Face

ScandiNLI - Natural Language Inference model for Scandinavian Languages

This model is a fine-tuned version of AI-Sweden-Models/roberta-large-1160k for Natural Language Inference in Danish, Norwegian Bokmål and Swedish.

We have released three models for Scandinavian NLI, of different sizes:

A demo of this model can be found in this Hugging Face Space - check it out!

The performance and model size of each of them can be found in the Performance section below.

Quick start

You can use this model in your scripts as follows:

>>> from transformers import pipeline
>>> classifier = pipeline(
...     "zero-shot-classification",
...     model="alexandrainst/scandi-nli-large",
... )
>>> classifier(
...     "Mexicansk bokser advarer Messi - 'Du skal bede til gud, om at jeg ikke finder dig'",
...     candidate_labels=['sundhed', 'politik', 'sport', 'religion'],
...     hypothesis_template="Dette eksempel handler om {}",
... )
{'sequence': "Mexicansk bokser advarer Messi - 'Du skal bede til gud, om at jeg ikke finder dig'",
 'labels': ['sport', 'religion', 'politik', 'sundhed'],
 'scores': [0.6134647727012634,
  0.30309760570526123,
  0.05021871626377106,
  0.03321893885731697]}

Performance

We assess the models both on their aggregate Scandinavian performance, as well as their language-specific Danish, Swedish and Norwegian Bokmål performance.

In all cases, we report Matthew's Correlation Coefficient (MCC), macro-average F1-score as well as accuracy.

Scandinavian Evaluation

The Scandinavian scores are the average of the Danish, Swedish and Norwegian scores, which can be found in the sections below.

ModelMCCMacro-F1AccuracyNumber of Parameters
GPT-4o-mini68.88%68.57%76.89%?
alexandrainst/scandi-nli-large-v2 (this)75.42%75.41%84.95%354M
alexandrainst/scandi-nli-large73.70%74.44%83.91%354M
MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil769.01%71.99%80.66%279M
alexandrainst/scandi-nli-base67.42%71.54%80.09%178M
joeddav/xlm-roberta-large-xnli64.17%70.80%77.29%560M
MoritzLaurer/mDeBERTa-v3-base-mnli-xnli63.94%70.41%77.23%279M
NbAiLab/nb-bert-base-mnli61.71%68.36%76.08%178M
alexandrainst/scandi-nli-small56.02%65.30%73.56%22M

Danish Evaluation

We use a test split of the DanFEVER dataset to evaluate the Danish performance of the models.

The test split is generated using this gist.

ModelMCCMacro-F1AccuracyNumber of Parameters
GPT-4o-mini90.14%63.70%95.16%?
alexandrainst/scandi-nli-large-v2 (this)75.65%59.23%87.89%354M
alexandrainst/scandi-nli-large73.80%58.41%86.98%354M
MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil768.37%57.10%83.25%279M
alexandrainst/scandi-nli-base62.44%55.00%80.42%178M
NbAiLab/nb-bert-base-mnli56.92%53.25%76.39%178M
MoritzLaurer/mDeBERTa-v3-base-mnli-xnli52.79%52.00%72.35%279M
joeddav/xlm-roberta-large-xnli49.18%50.31%69.73%560M
alexandrainst/scandi-nli-small47.28%48.88%73.46%22M

Swedish Evaluation

We use the test split of the machine translated version of the MultiNLI dataset to evaluate the Swedish performance of the models.

We acknowledge that not evaluating on a gold standard dataset is not ideal, but unfortunately we are not aware of any NLI datasets in Swedish.

ModelMCCMacro-F1AccuracyNumber of Parameters
GPT-4o-mini66.31%77.00%77.31%?
alexandrainst/scandi-nli-large-v2 (this)79.02%85.99%85.99%354M
alexandrainst/scandi-nli-large76.69%84.47%84.38%354M
joeddav/xlm-roberta-large-xnli75.35%83.42%83.55%560M
MoritzLaurer/mDeBERTa-v3-base-mnli-xnli73.84%82.46%82.58%279M
MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil773.32%82.15%82.08%279M
alexandrainst/scandi-nli-base72.29%81.37%81.51%178M
NbAiLab/nb-bert-base-mnli64.69%76.40%76.47%178M
alexandrainst/scandi-nli-small62.35%74.79%74.93%22M

Norwegian Evaluation

We use the test split of the machine translated version of the MultiNLI dataset to evaluate the Norwegian performance of the models.

We acknowledge that not evaluating on a gold standard dataset is not ideal, but unfortunately we are not aware of any NLI datasets in Norwegian.

ModelMCCMacro-F1AccuracyNumber of Parameters
GPT-4o-mini50.19%65.00%65.46%?
alexandrainst/scandi-nli-large-v2 (this)71.59%81.00%80.96%354M
alexandrainst/scandi-nli-large70.61%80.43%80.36%354M
joeddav/xlm-roberta-large-xnli67.99%78.68%78.60%560M
alexandrainst/scandi-nli-base67.53%78.24%78.33%178M
MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil765.33%76.73%76.65%279M
MoritzLaurer/mDeBERTa-v3-base-mnli-xnli65.18%76.76%76.77%279M
NbAiLab/nb-bert-base-mnli63.51%75.42%75.39%178M
alexandrainst/scandi-nli-small58.42%72.22%72.30%22M

Training procedure

It has been fine-tuned on a dataset composed of DanFEVER as well as machine translated versions of MultiNLI and CommitmentBank into all three languages, and machine translated versions of FEVER and Adversarial NLI into Swedish.

The training split of DanFEVER is generated using this gist.

The three languages are sampled equally during training, and they're validated on validation splits of DanFEVER and machine translated versions of MultiNLI for Swedish and Norwegian Bokmål, sampled equally.

Check out the Github repository for the code used to train the ScandiNLI models, and the full training logs can be found in this Weights and Biases report.

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 2e-05
  • train_batch_size: 128
  • eval_batch_size: 128
  • seed: 4242
  • gradient_accumulation_steps: 1
  • total_train_batch_size: 128
  • optimizer: Adam with betas=(0.9, 0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • lr_scheduler_warmup_steps: 1,000
  • max_steps: 50,000

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
RobertaForSequenceClassification
Ревизия весов
6172dab

0 моделей