Prompting technique

Prompt-based Extraction (Cloze Prompting with Verbalizer)

This Candidate is [MASK]. Prompt-based Sentiment Extraction and Reference Letters, arXiv:2410.16325 (2024) · read the paper

What it does

The method transforms a classification task into fill-in-the-blank: text is inserted into a template with a [MASK], and the model selects the most probable word from a predefined list (verbalizer). This ensures predictability and high accuracy in extracting sentiment or category.

Task typeextraction
Shapesingle shot
Effortsingle step
Addressesanswers that are close but wrong; the same prompt giving different answers; output that ignores the requested format
Published2024-10-18
AuthorsFabian Slonimczyk

When it helps

Use this technique when you need to extract sentiment or classify text with high accuracy and predictability. Particularly effective for analyzing recommendation letters, customer reviews, and employee feedback. Suitable when consistent evaluations and correlation with real results are important. Ideal for HR tasks (candidate assessment), content moderation, and sentiment analysis in reviews. Apply when you need to restrict the model to specific answer categories instead of free generation.

A prompt you can paste

Generic by design: it applies the technique without knowing your task. Adapt the marked parts.

Prompt
Ты — ассистент-аналитик. Твоя задача — классифицировать текст по заданным категориям, используя метод "заполнение маски" с вербализатором.

**# Контекст**
[Опишите здесь контекст, в котором используется текст. Например: "Я собираю отзывы о нашей новой функции 'Экспорт в PDF' и хочу автоматически классифицировать их по основной теме, чтобы направить в нужную команду."]

**# Входной текст**
[Вставьте сюда текст, который нужно проанализировать. Например: "Спасибо за новую функцию! Очень ждал. В целом работает хорошо, но было бы здорово, если бы можно было выбирать ориентацию страницы — книжную или альбомную. Сейчас по умолчанию только книжная, и мои таблицы не помещаются."]

**# Задача**
Проанализируй приведенный выше **Входной текст** и определи его основную тему/категорию. Для этого мысленно подставь его в следующий шаблон и выбери наиболее подходящее слово из предложенных списков.

**# Шаблон**
`[Входной текст] В этом тексте пользователь в первую очередь описывает [МАСКА].`

**# Списки слов для выбора (Вербализатор)**
*   **Категория 1:** `["слово1_категории1", "слово2_категории1", "слово3_категории1"]`
*   **Категория 2:** `["слово1_категории2", "слово2_категории2", "слово3_категории2"]`
*   **Категория 3:** `["слово1_категории3", "слово2_категории3", "слово3_категории3"]`
[Добавьте или измените категории и слова в соответствии с вашей задачей.]

**# Формат ответа**
В ответе укажи ТОЛЬКО ОДНО слово, которое ты выбрал из списков. Никаких дополнительных объяснений.

If this one does not fit, the two closest alternatives in the corpus are Requirement-Oriented Prompt Engineering (ROPE) and Hard-to-Easy Instruction Ordering, which target the same failure from a different angle.

Worked example

The same technique applied to a concrete job: pull structured fields out of inconsistent invoices. Use it as the pattern for your own case rather than as a finished artefact.

Worked example
Ты — ассистент-аналитик, специализирующийся на извлечении структурированных данных из нерегулярных документов, таких как счета. Твоя задача — извлекать ключевую информацию из предоставленного счета и представлять ее в стандартизированном формате.

**# Контекст**
Я получаю счета от разных поставщиков в различных форматах. Мне нужно извлечь конкретные поля из каждого счета, чтобы внести их в нашу систему учета. Точность и полнота извлечения критически важны.

**# Входной текст (Счет)**
[ВСТАВЬТЕ ТЕКСТ СЧЕТА ЗДЕСЬ]

**# Задача**
Проанализируй приведенный выше **Входной текст (Счет)** и извлеки следующую информацию. Используй для этого шаблон и списки слов, чтобы обеспечить предсказуемость и точность.

**# Шаблон**
`[Входной текст] Из этого счета были извлечены следующие данные: [МАСКА].`

**# Списки слов для выбора (Вербализатор)**
*   **Основные поля:** `["Номер счета", "Дата счета", "Сумма к оплате", "Имя поставщика", "Наименование услуги/товара", "Срок оплаты"]`
*   **Дополнительные поля:** `["Адрес поставщика", "Контактная информация поставщика", "Налоговый номер поставщика", "Описание позиции", "Количество", "Цена за единицу", "Общая сумма по позиции"]`

**# Формат ответа**
В ответе предоставь извлеченные данные в формате JSON. Каждый ключ в JSON должен соответствовать одному из **Основные поля** или **Дополнительные поля**. Если какое-либо поле не найдено во входном тексте, используй значение `null`.

**Пример JSON-структуры:**

Get this written for your actual task

Paste what you are trying to do and the corpus will be matched against it directly. Free, no account, about ten seconds.

Free · no signup · ~10s
0.00match confidence
single retrieval pass
Prompt for your task

      

That number is low on purpose, and it is real. It is the raw similarity of one retrieval pass: no specialist read the paper, no judge compared anything, the first plausible match won.

6,235techniques in the corpus
one of which is this page

Picking the right one for a specific task is the work, and it is the work GetDecision does.

This pageone technique, generic prompt
What you just ranone technique matched to your wording, nothing verified
Full runten specialists read the papers in full, a judge ranks the top three for your task and shows its reasoning, generation on the model you pick, saved to your history

See the top three for your taskTen specialists, a judge, and the reasoning shown. Free account, first run included.

Run the full analysis

Related techniques

Requirement-Oriented Prompt Engineering (ROPE)ROPE (Requirement-Oriented Prompt Engineering) is an approach to creating prompts as detailed technical specif…Hard-to-Easy Instruction OrderingA technique for ordering instructions in a prompt following the "hard-to-easy" principle. Complex constraints …MetaPrompting (Structured Reasoning)Method of prompting structuring by providing LLM with a ready-made response template in JSON or Markdown forma…Structured Prompting with Iterative RefinementA method of structuring prompts by dividing them into three blocks: Style Profile (tone, voice, format), Conte…

All techniques · Failure modes and fixes