/ Модель

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

Контекст
514 токенов
Параметры
305 млн
Лицензия
Apache 2.0
Архитектура
xlm-roberta · dense
Базовая модель
xlm-roberta-base
Библиотека
transformers
Опубликована
11 сен 2026

deference-keigo

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

Модель выявляет ошибки направления и формы японских honorific-выражений кэйго в деловой письменной речи.

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

Бенчмарки

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

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

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

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

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

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

Deference — это модель токенной классификации для выявления ошибок в употреблении японских форм вежливости кэйго в деловой письменной речи. Она разработана на базе xlm-roberta-base и дообучена на корпусе NagaYu/deference-keigo-corpus; архитектура — XLM-RoBERTa с классификационной головой, около 305,2 млн параметров по метаданным. Модель определяет направление выраженного почтения и тип ошибки, а приложение связывает вывод с соответствующим разделом японских рекомендаций по кэйго 2007 года.

Для оценки направления почтения требуется указать адресата и контекстную позицию во входном префиксе. Заявлены CPU-инференс и поддержка японского языка; максимальный контекст — 514 токенов. Валидационные метрики высоки на корпусе, построенном по правилам рекомендаций, однако это не доказывает такую же точность на реальной переписке.

Модель ориентирована на письменные нормы и не предназначена для диалектов и разговорной речи. Она не выносит оценку автору текста: если действующее лицо нельзя определить по контексту, модель не делает вывод о направлении почтения. Лицензия репозитория — Apache-2.0.

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

  • поиск ошибок направления почтения в японской деловой переписке
  • проверка смешения уважительных и скромных форм кэйго
  • выявление двойных honorific-форм
  • проверка употребления конструкций go-...-sareru
  • подготовка пояснений со ссылками на рекомендации по японскому кэйго

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

Deference — Japanese honorific (keigo) error detection

Detects the direction of deference in Japanese business writing and points to the passage of the Council for Cultural Affairs' Keigo no Shishin (敬語の指針, 2007) that the judgement rests on.

A token-classification model over BIO × error type, trained on a corpus constructed from the norm by rule — no LLM was used to create the errors.

  • Base model: xlm-roberta-base
  • Parameters: 277.5M (0.277B)
  • Inference: CPU, ~26 ms per message after int8 quantisation
  • Code, evaluation and Gradio app: https://github.com/NagaYu/deference

The problem this addresses

Whether a Japanese honorific is appropriate often cannot be decided from the string. The guidelines define sonkeigo as raising the one who acts and kenjougo I as raising the one the act is directed to (Ch.2 Sec.1, pp.14-15). So 「お持ちします」 is appropriate when the writer carries something and inappropriate when the reader does (Ch.3 Sec.2-2 Q11, p.37). The verdict also flips with the audience (Ch.3 Sec.3-2 Q25, pp.44-45).

The audience is therefore a required input, encoded as a prefix.

Input format

[社外][書き手:自分側][相手:貴社] <message body>

The prefix carries the audience and the standpoints; character offsets of predictions are mapped back onto the body. Use the deference package rather than building the prefix by hand:

from deference import Deference, MailContext, Audience, Person, Party

df = Deference(engine="neural", model_dir="<path to this checkpoint>")
ctx = MailContext(
    audience=Audience.EXTERNAL,
    persons=(Person("佐藤", Party.SELF_GROUP), Person("田中", Party.ADDRESSEE)),
)
for f in df.check(open("mail.txt").read(), ctx).reportable:
    print(f.span.text, f.message, f.citation.render("en"))

Raw transformers use is possible but you lose the citation, the correction candidates and the variation filter:

from transformers import AutoTokenizer, AutoModelForTokenClassification
tok = AutoTokenizer.from_pretrained("NagaYu/deference-keigo")
model = AutoModelForTokenClassification.from_pretrained("NagaYu/deference-keigo")

Results

Validation split of NagaYu/deference-keigo-corpus.

metricPRF1
overall (micro)0.9860.9890.988
direction errors0.9750.9810.978
error typekeyneeds contextPRF1n
Respectful/humble mix-up (direction)direction_swapyes0.9951.0000.998218
Doubled honorific (nijuu keigo)double_keigono1.0001.0001.000179
'go-...-sareru' formgo_sareruno1.0001.0001.000161
'o/go-...-dekiru' formogo_dekiruno1.0001.0001.000135
Respectful form for oneselfself_sonkeigoyes0.8810.9870.93175
Ill-formed honorific chainbad_keigo_linkyes1.0001.0001.00027
Respectful form for one's own side (uchi)uchi_sonkeigoyes0.9380.6520.76923
Inserted 'sa' (sa-ire kotoba)sa_insertionno1.0001.0001.00021

Against other tools

Full pipeline (rules + this model), 559 texts with errors, 152 without, 53 variation cases:

conditiondetection (type)direction errorsno-over-flagmedian
textlint (4 JA presets)0.0%0.0%94.3%2.26 ms
surface rule set42.9%31.7%90.6%0.01 ms
Deference97.9%97.4%100.0%31.33 ms
Deference (int8)98.0%97.6%100.0%25.55 ms

On error types visible in the surface pattern (doubled honorifics, sa-insertion, the go-...-sareru form) the rule set also reaches 100% — no advantage is claimed there. The difference is confined to types that need context.

Variation is not error

Expressions whose acceptability is genuinely divided are held apart and not reported. The guidelines warn against treating usage uniformly by gender or generation (Ch.1 Sec.2-2, p.8), list doubled honorifics established by custom (お伺いする, お召し上がりになる, お見えになる; Ch.2 Sec.2-6(2), p.30), and say that tolerance for させていただく varies by individual (Ch.3 Sec.2-6 Q18).

The training data includes those cases as negatives, and the pipeline applies a variation filter on top of the model's output.

Constrained by the norm

For error types whose truth can be checked on the surface, a model prediction is verified against the rules and dropped if it cannot hold. The model read 「ご報告させていただきます」 as sa-insertion, but 報告する is a suru verb whose causative is 報告させる — the reading is impossible, so it is discarded.

Correction candidates are likewise restricted to forms the rules can generate, so a suggestion can never itself introduce a new divergence.

Limitations

  • Dialects and spoken language are out of scope. Sa-insertion is common in speech; it is treated here from the standpoint of written norms, and the citation says the report does not cover it.
  • Where the actor cannot be read from the text, no direction judgement is made.
  • Trained on synthetic sentences bounded by the generator's lexicon (49 verbs, 35 suppletive forms). Scores here do not by themselves establish performance on real correspondence.
  • uchi_sonkeigo has the smallest support and the weakest score of the context-dependent types; treat its output with more caution than the rest.
  • This is information, not a verdict. Output is phrased as how the guidelines organise the matter, never as a judgement on the writer's Japanese.

Training

python scripts/build_dataset.py --output data/hf
python scripts/train.py --data data/hf --output checkpoints/deference-base     --epochs 3 --batch-size 8 --lr 3e-05     --max-length 192

Variation samples are fed as negatives — that is the mechanism by which the model learns not to flag divided usage.

Source

Adapted from the Council for Cultural Affairs' report Keigo no Shishin (敬語の指針), Agency for Cultural Affairs, 2007. https://www.bunka.go.jp/seisaku/bunkashingikai/kokugo/hokoku/pdf/keigo_tosin.pdf

Content on the Agency's site follows the MEXT website terms of use, stated to be compatible with CC BY and permitting adaptation provided the source is credited; where the material has been edited or adapted that must be stated. This project keeps only short quotations as the basis for each note and does not redistribute the report in full.

Citation

@misc{deference_keigo,
  title  = {Deference: detecting the direction of deference in Japanese honorifics},
  author = {NagaYu},
  year   = {2026},
  note   = {Adapted from Keigo no Shishin, Agency for Cultural Affairs},
  url    = {https://huggingface.co/NagaYu/deference-keigo}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
XLMRobertaForTokenClassification
Ревизия весов
7667f75

0 моделей