/ Модель

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

Контекст
512 токенов
Лицензия
Apache 2.0
Архитектура
distilbert · dense
Базовая модель
distilbert-base-uncased
Библиотека
transformers
Опубликована
10 ноя 2026

distilbert-squad2

Ответы на вопросыТекст → текст4 профессии
128скачиваний за 30 дней0лайковвеса обновлены15 ноя 2026

Описание модели

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

Англоязычная модель DistilBERT извлекает ответы на вопросы из заданного текста и может воздержаться от ответа, если его там нет.

Ingsyling/distilbert-squad2 — англоязычная модель для извлечения ответов из текста, созданная Дэвидом Фалеем и Косисочукву Огбуанья как учебный проект по обработке естественного языка. Она дообучена на SQuAD 2.0 на базе DistilBERT и принимает вопрос вместе с текстовым фрагментом, возвращая один непрерывный отрывок из этого фрагмента либо пустой ответ, если подходящего ответа нет. Архитектура — DistilBertForQuestionAnswering, размер — 66 млн параметров, максимальная длина контекста — 512 токенов. Модель подходит для поиска фактов в английских документах и демонстраций извлекающего вопросно-ответного поиска. На тесте SQuAD 2.0 авторы сообщают Exact Match 64,14 и F1 67,38; на CPU Apple M2 медианное время ответа составило 31 мс на вопрос.

Модель склонна отвечать даже на вопросы без ответа, слабо справляется с вопросами «почему» и «как», длинными ответами и документами, значительно превышающими контекст. Она извлекает фрагмент из исходного текста, а не объединяет сведения и не рассуждает. Обучение проводилось на англоязычных абзацах Википедии, поэтому перенос на другие языки и типы текстов не подтверждён. Не рекомендуется использовать ответы в медицинских, юридических и финансовых сценариях без проверки человеком. Лицензия — Apache-2.0.

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

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

Ограничения

Модель часто отвечает на вопросы, ответа на которые в тексте нет, и слабо справляется с вопросами «почему», длинными ответами и длинными документами. Она извлекает один непрерывный фрагмент, обучена на англоязычных абзацах Википедии и не предназначена для критически важных решений без проверки человеком.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

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

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

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

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

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

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

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

Открыть на Hugging Face

DistilBERT fine-tuned on SQuAD 2.0

distilbert-base-uncased fine-tuned for extractive question answering on SQuAD 2.0. Given a passage and a question, it marks the words in the passage that answer the question, or says that the passage does not contain an answer.

A course project for CSCI 390 (Natural Language Processing and Applications) by David Faleye and Kosisochukwu Ogbuanya. Code, training notebook, evaluation and error analysis: https://github.com/Davidfaleye360/AI-Question-Answering-System

How to use it

from transformers import pipeline

qa = pipeline("question-answering", model="Ingsyling/distilbert-squad2")
result = qa(
    question="In what country is Normandy located?",
    context="The Normans gave their name to Normandy, a region in France.",
    handle_impossible_answer=True,   # allow "no answer"; the answer is then an empty string
)
print(result["answer"])   # France

This needs transformers 4.x (version 5 removed the question-answering pipeline). The project's own code (src/predict.py in the repository) does the same without the pipeline and also returns the top candidates and the no-answer score.

Results

SQuAD 2.0 dev set, 11,873 questions, scored with the official squad_v2 metric at the default no-answer threshold.

Exact MatchF1Questions
All64.1467.3811,873
Answerable65.6972.175,928
Unanswerable62.5962.595,945

For comparison, measured with the same code:

ModelExact MatchF1ParametersCPU time per question
This model64.1467.3866 M31 ms
deepset/roberta-base-squad279.9082.91124 M57 ms
distilbert-base-uncased before fine-tuning (first 1,000 questions)1.24.666 M

CPU time is the median over 200 dev questions on an Apple M2 laptop. Tuning the no-answer threshold raises this model's F1 to 68.08 (cross-validated over dev articles).

Training

SettingValue
DataSQuAD 2.0 training set, 130,319 questions (131,754 windows)
Window384 tokens, 128 tokens of overlap
Epochs2 (16,470 steps)
Batch size16
Learning rate3e-5, linear warm-up over the first 10% of steps, then linear decay
Weight decay0.01
Precisionmixed (fp16)
Seed42
Hardware and timeone Tesla T4 (Google Colab), 44 minutes

Unanswerable questions, and windows that do not contain the whole answer, are labelled with the [CLS] position. The training loss fell from 5.81 to about 0.9.

Limitations

  • It copies, it does not reason. The answer is always one continuous piece of the passage. Questions whose answer has to be put together from several sentences, and most "why" questions, are beyond it.
  • It is too willing to answer. 52% of its errors on the dev set are answers to unanswerable questions, typically questions that reuse the passage's wording and change one detail or reverse the meaning.
  • "Why" and "how" questions and long answers are weak: F1 is 59 for "why" questions and 51 for answers of ten or more words, against 85 for "how many".
  • Long documents need care. Reading a whole article in overlapping windows lowers F1 by 16 to 23 points with this model's default settings, mainly because it stops abstaining.
  • English Wikipedia only. It was trained on Wikipedia paragraphs, uncased, and has not been tested on other kinds of text or other languages.
  • Do not use it where a wrong answer has consequences (medical, legal, financial) without a person checking.

Licences

The base model is released under Apache 2.0. SQuAD 2.0 is released under CC BY-SA 4.0.

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
DistilBertForQuestionAnswering
Ревизия весов
95ec972

0 моделей