/ Модель

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

Лицензия
Apache 2.0
Библиотека
unquote
Опубликована
5 сен 2026

unquote-small

Разметка токеновТекст → label4 профессии

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

65скачиваний за 30 дней0лайковвеса обновлены5 сен 2026

Бенчмарки

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

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

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

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

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

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

Unquote-small — компактная модель NagaYu с 31 млн параметров для разметки строк электронной почты на восемь зон: основной текст, цитаты, строки атрибуции, подписи, дисклеймеры, мобильные футеры, автоответы и заголовки пересылки. Она использует эмбеддинги токенов, структурные признаки и трансформер по последовательности строк, а затем выбирает разметку с помощью алгоритма Витерби. Модель предназначена для очистки переписки перед анализом или передачей в языковую модель; доступны PyTorch- и ONNX-файлы, включая int8-вариант для CPU.

В README приведены результаты на 1 200 отложенных сообщениях: для поставляемого режима указаны macro F1 0,844 и измеренная потеря строк основного текста 0,008%. Модель настроена консервативно: при сомнении она предпочитает оставить цитату, а не удалить текст автора. Поддерживаются 15 языков, включая русский, английский, немецкий, французский, японский и китайский. Лицензия — Apache-2.0.

Порог уверенности позволяет выбирать компромисс между сокращением объёма текста и риском удалить нужную строку. Гарантии абсолютного сохранения основного текста нет: на повреждённых письмах зафиксированы ошибки, а строгий режим оставляет больше подписей и цитат. Модель может быть неподходящей, если требуется удалить каждую цитату независимо от риска потери авторского текста.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

Unquote-small

Strip the quoted history off an email without deleting the part you wrote.

Quoted replies, signatures and legal boilerplate are most of a mail thread and none of its meaning. Removing them before you pay a model to read the thread is easy money — right up until the cleaner eats a paragraph the sender actually wrote, and you have no way to notice.

unquote-small is a 31M-parameter CPU model that tags every line of an email as one of eight zones. It is built around one asymmetry: leaving quoted text in costs you tokens; taking body text out costs you the message. Every decision is biased toward keeping.

Results

Measured on 1,200 held-out messages (synthetic + real public mailing-list mail). Splits are disjoint by thread, so no reply shares a split with the parent it quotes.

Systembody loss ↓macro F1 ↑token reductionms/msg
talon (rule-based standard)4.178%0.59238.2%0.5
email-reply-parser (rule-based)8.207%0.71947.5%0.1
Unquote (fp32, gated — shipped default)0.008%0.84435.9%17.6
Unquote (int8 ONNX)0.008%0.84435.9%6.4
Unquote (fp32, gate off)1.176%0.95142.3%19.0
Unquote heuristic (no weights)0.243%0.33737.2%2.1

body loss is the fraction of true BODY lines a system deletes — the number that decides whether a cleaner is safe to run unattended.

By language (synthetic split)

Systemenfrdejaruptkoesnlit
talon (rule-based standard)0.5100.5680.4590.4800.4670.4580.4590.3870.5230.299
email-reply-parser (rule-based)0.7000.7560.6000.7510.6320.7470.6120.6690.6620.677
Unquote (fp32, gated — shipped default)0.8230.8730.8740.9060.9140.8990.8660.8460.8730.879
Unquote (int8 ONNX)0.8250.8730.8790.9050.9140.8990.8660.8460.8740.878
Unquote (fp32, gate off)0.9550.9730.9690.9970.9840.9730.9480.9640.9750.989
Unquote heuristic (no weights)0.2290.2260.2660.4110.2520.2650.1940.2550.2560.230

Scored on the synthetic split because its labels are correct by construction. Non-English real mail in the evaluation corpus has pattern-derived gold for the trailer zones, which would be circular to score a rule-based baseline against.

Rule-based extractors carry English rule tables; this model has no such centre of gravity. English-vs-rest macro-F1 gap: talon +0.049, Unquote −0.059.

Use

from unquote import ZoneTagger
tagger = ZoneTagger.from_pretrained("NagaYu/unquote-small")
print(tagger.clean(raw_email))            # body only
pip install "unquote[export] @ git+https://github.com/NagaYu/unquote"
unquote clean mail.txt --keep body,attribution

Files in this repo: model.pt (torch), model.onnx (int8, 6.4 ms/msg), model.fp32.onnx, tokenizer.json, config.json, gate.json (the fitted safety thresholds), sweep.json (the full calibration curve).

What it promises

It will not delete your body text, bought in four places you can inspect:

MechanismStrength
BODY is not in the removable set; --keep quote still keeps bodystructural
The gate only ever moves a label toward BODYstructural, property-tested
At gate threshold 1.0 nothing is removed at allmathematical
Per-zone thresholds fitted for zero body loss on held-out calibration dataempirical

That last row is the honest one. A confidence gate cannot stop a confidently wrong prediction. On deliberately damaged mail at threshold 0.999 the measured body loss was mean 0.0005 / worst 0.0625, affecting 1 message in 120. The claim is "fitted to zero body loss and measured on held-out data", not an impossibility proof.

It does not promise a perfect split. Leftover quoted lines are an accepted outcome of that trade. If you need every quoted byte gone and can tolerate losing prose, this is the wrong tool.

Choosing an operating point

The gate ships fitted for zero body loss. That is one point on a measured curve:

body-loss budgetthresholdmeasured body losstoken reduction
0.00%0.99990.000%34.7%
0.05%0.990.045%52.0%
0.20%0.9150.193%53.4%
0.50%0.7050.499%54.2%
1.00%00.728%54.7%

The curve is steep — accepting roughly one lost line in 2,200 nearly doubles the savings. Move along it with --threshold, or refit with scripts/train.py --target-body-loss 0.002.

Cost of the strict end: at zero body loss the gate rescues signatures the model was 89% sure about, so SIGNATURE F1 falls from 0.897 ungated to 0.429 gated. That is the trade working as designed, but it leaves more signature text in place than the model is capable of removing.

The eight zones

BODY (never removable), QUOTE, ATTRIBUTION, SIGNATURE, DISCLAIMER, MOBILE_FOOTER, AUTOREPLY, FORWARD_HEADER.

Two conventions: everything inside a quoted message collapses to QUOTE (including its signature — a quoted signature is not this author's), and the introducer line keeps its own zone at every nesting depth.

Architecture

tokens of one line -> embedding -> shift-mix -> masked mean+max pool
concat 88 structural features (quote depth, script, wrap width, distance from end)
-> transformer over the LINE sequence        <- where the evidence actually is
-> per-line emissions + learned transitions
-> Viterbi over (zone, seen_trailer)         <- "no body after a signature", enforced

8 document layers, d_model 512, vocab 21,079, 31.1M parameters. Position is encoded from both ends: trailer zones are anchored to the end of a message, so the encoder gets distance-from-end alongside distance-from-start.

Decoding runs Viterbi over the augmented state (zone, seen_trailer), which latches once a signature/disclaimer/mobile-footer line is emitted; BODY is -inf in the latched half. No body line can follow a signature no matter what the network scores — including via the SIGNATURE -> QUOTE -> BODY path that a pairwise transition ban cannot block.

Training data

Public mailing-list archives only — Apache (lists.apache.org), Python (mail.python.org), GNU (lists.gnu.org) and the localized Debian lists in 15 languages — plus synthetic threads from unquote.compose whose labels are correct by construction.

Excluded on purpose: Enron and every corpus like it. Freely downloadable, and still a collection of private messages whose authors never consented to publication. Public availability is not consent. The dataset builder enforces a deny-list.

Privacy. Every real message is scrubbed before training: addresses become RFC 2606 reserved domains, phone numbers move to the +1-555-01xx fictional range, and every participant's name is replaced — not just the sender's, since attribution lines and quoted signatures name third parties. Archive-obfuscated addresses (a <at> b.com) are handled too. Replacements are structure-preserving, so the tagging task is unchanged.

Limitations

  • Throughput is tens to hundreds of messages/second, not thousands. 17.6 ms/msg fp32, 6.4 ms/msg int8, single process on 6 CPU threads. A 31M transformer over a line sequence does not reach thousands/sec on one core.
  • Trained on developer mailing lists. Corporate mail, marketing mail and ticketing-system notifications are out of distribution.
  • Real-data gold for SIGNATURE/DISCLAIMER is pattern-derived; those rows are flagged in the benchmark output and are not admissible evidence against a rule-based baseline.
  • HTML-only messages are dropped at ingest — without line structure there is nothing to line-tag.
  • An earlier checkpoint trained on synthetic data alone scored 0.982 on synthetic and 0.321 on real mail. Withholding real data did not make the evaluation honest, it made the model useless; thread-disjoint splitting is what protects it instead.

Citation and source

Code, benchmark harness, dataset builder and the four guarantee tests: https://github.com/NagaYu/unquote

Licensed Apache-2.0. Archive content remains under the terms of the archives it came from.

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

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

GPU в ailist

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

Нельзя запустить

Библиотека «unquote» рантаймом не поддерживается.

Ревизия весов
978297b

0 моделей