/ Модель

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

Контекст
512 токенов
Параметры
153 млн
Лицензия
Apache 2.0
Архитектура
bert · dense
Базовая модель
alephbert-base
Библиотека
transformers
Опубликована
24 мая 2026

alephbert-intent-he

Классификация текстаТекст → label3 профессии
134скачиваний за 30 дней0лайковвеса обновлены2 июн 2026

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

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

Классификатор относит короткие сообщения на иврите из чатов о покупках к одному из 17 намерений.

spivi87 разработал AlephBERT на основе BERT-модели для иврита как учебный проект по классификации намерений. Модель дообучена для отнесения коротких сообщений из чатов о покупках и продуктах к одному из 17 классов: например, запрос на добавление товара, просмотр списка, ссылка на рецепт или действие администратора группы. Она возвращает понятные названия меток и оценки уверенности; принимает текст на иврите, допускает опечатки, эмодзи и небольшую примесь английского. Размер — 153,2 млн параметров, контекст — до 512 токенов, хотя автор рекомендует короткие сообщения длиной до 128 токенов.

Модель предназначена для маршрутизации сообщений в чатах о покупках и может служить отправной точкой для дообучения классификатора на другую тему. В контролируемой оценке на синтетических примерах средние accuracy и macro F1 составили около 0,77 и 0,76; это не подтверждает аналогичную точность на реальных сообщениях. Классы BUG_REPORT и OTHER распознаются слабее, а оценки уверенности не калиброваны. Базовая модель — onlplab/alephbert-base. Лицензия — Apache-2.0.

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

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

Ограничения

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

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

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

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

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

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

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

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

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

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

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

Открыть на Hugging Face

AlephBERT Hebrew Shopping Intent Classifier

סיווג כוונות בעברית

This is a small Hebrew text classifier. You give it a short message like "תוסיף חלב וביצים" ("add milk and eggs") and it tells you what the person wants, out of 17 possible intents (add an item, show the list, clear the list, and so on). It is a fine-tune of AlephBERT, a Hebrew BERT model, and I built it as a learning project.

I am not an ML researcher, and this is not a Hebrew NLP benchmark. It is a worked example of turning one narrow problem into a small fine-tuned model and checking it honestly. The full tutorial and code are in the GitHub repo: github.com/spivi/alephbert-intent-he.

Important limitation: the train and test data are synthetic paraphrases, not real chat traffic. The split avoids leakage by holding out source seeds before paraphrasing, but read the numbers as a controlled experiment, not as proof of real-world accuracy.

Try it

from transformers import pipeline

clf = pipeline("text-classification", model="spivi87/alephbert-intent-he", top_k=3)
clf("תקנה ביצים")
# [{'label': 'GROCERY_REQUEST', 'score': 0.90}, ...]

You get readable label names back (not LABEL_0). The mapping from numbers to names is saved inside config.json. If you would rather run without PyTorch, the GitHub repo has a one-command ONNX export.

There is also a live demo you can try in the browser, with no setup: spivi87/alephbert-intent-he-demo.

What it is for

It sorts short Hebrew messages from a shopping or grocery chat into one of 17 intents: add an item, show the list, clear the list, a recipe link, group admin actions, and so on (the full list is in the table further down).

It also works as a starting point if you want to fine-tune your own Hebrew classifier for a different topic. The weights are already comfortable with short, informal Hebrew that has typos, emoji, and a little English mixed in.

A practical tip: I use about 0.7 as a confidence heuristic in the demo. I did not calibrate the probabilities, so treat it as an operational rule of thumb, not a proven threshold. Below it, fall back to a larger model or treat the message as OTHER.

Results

Mean over 3 training runs (seeds 42, 43, 44), on a held-out test set of 374 messages (22 per intent). The published checkpoint is the seed 42 run.

  • Accuracy: 0.773 ± 0.008
  • Macro F1: 0.763 ± 0.008

Per-intent metrics (seed 42)

IntentPrecisionRecallF1Support
GROCERY_REQUEST0.8000.9090.85122
RECIPE_URL0.9000.8180.85722
LIST_QUERY0.7600.8640.80922
CLEAR_LIST0.7220.5910.65022
REMOVE_ITEM0.7500.8180.78322
PARTIAL_COMPLETION0.9090.9090.90922
GROUP_INFO1.0000.5450.70622
GET_INVITE_CODE0.7861.0000.88022
CREATE_INVITE0.6190.5910.60522
RENAME_GROUP0.9571.0000.97822
LEAVE_GROUP0.7140.9090.80022
NOTIFICATION_SETTINGS0.8570.5450.66722
REVOKE_INVITE0.8080.9550.87522
RECIPE_SEARCH0.8080.9550.87522
UPDATE_QUANTITY1.0000.9550.97722
BUG_REPORT0.3750.2730.31622
OTHER0.6000.6820.63822

The full report and confusion matrix are in EVALUATION.md and confusion_matrix.png.

How it compares to a zero-shot LLM

On the same 374-message test set:

ApproachAccuracyCost per 1,000 messages
Random guessing0.0668$0
Always the most common label0.0588$0
Keyword rules (hand-written)0.2487$0
GPT-4o-mini, zero-shot0.5722about $0.05 (estimate, see note)
AlephBERT fine-tune (this model, seed 42)0.7834$0

On this narrow synthetic grocery-intent task the fine-tune scored higher than my zero-shot GPT-4o-mini baseline on the same split. That does not mean it is a better general Hebrew model. It means that for a narrow, repeated task, a small task-specific model can be cheaper, private, and surprisingly effective. The GPT-4o-mini cost is an estimate for my zero-shot prompt and these short messages; OpenAI bills per token, not per message, so your cost will vary with prompt length, number of labels, and output format.

How it was trained (short version)

The training data is synthetic. I started from a handful of Hebrew example sentences per intent and asked an LLM to rewrite each one into many variations. After testing the first version I found gaps and fed the failures back into the data: "buy X" requests like "תקנה חלב" were misread, and short single-item requests like "תקנה ביצים" were confused with removing an item. I added hand-authored examples to cover the missing phrasings and retrained. No real user messages were used, so there is no private data. A sample is in the GitHub repo, under data/sample.jsonl.

The train/test split happens at the seed level, before the rewriting step. For each intent, 2 seeds are held out completely, and the test set only contains rewrites of those held-out seeds. Splitting after rewriting instead would let rewrites of the same sentence land on both sides, so the model has effectively seen the test questions and the accuracy looks better than it is.

Training settings

SettingValue
Base modelonlplab/alephbert-base
OptimizerAdamW (HF Trainer default)
Learning rate2e-5 (linear warmup, linear decay)
Batch size16 (train) / 32 (eval)
Max sequence length128 tokens
Max epochs10 (early stopping on eval_accuracy, patience 3)
Seeds42, 43, 44 (seed 42 is the published checkpoint)

The full step-by-step instructions are in the GitHub repo.

Labels

IDLabelWhat it means
0GROCERY_REQUESTAdd items to the shopping list
1RECIPE_URLA recipe link: pull the ingredients from it
2LIST_QUERYShow the current shopping list
3CLEAR_LISTMark everything bought and clear the list
4REMOVE_ITEMRemove one item from the list
5PARTIAL_COMPLETIONMark most items bought, except a few
6GROUP_INFOShow the group members and details
7GET_INVITE_CODEGet the existing group invite code
8CREATE_INVITEGenerate a new group invite code
9RENAME_GROUPChange the group name
10LEAVE_GROUPLeave the current group
11NOTIFICATION_SETTINGSToggle notification preferences
12REVOKE_INVITECancel a group invite code
13RECIPE_SEARCHBuild a shopping list for a known dish
14UPDATE_QUANTITYChange the quantity of an item already on the list
15BUG_REPORTReport a problem with the bot
16OTHERA chat or off-topic message, not a shopping action

Good to know before you rely on it

  • It was trained only on shopping and grocery messages. For another topic, treat it as a base to fine-tune, not a finished classifier.
  • BUG_REPORT and OTHER are the weakest classes (F1 around 0.32 to 0.64). Read a low-confidence prediction as "not sure" rather than a firm label.
  • It expects Hebrew, in short messages of up to 128 tokens. A little Hebrew and English mixing is fine.
  • The training data is synthetic, so unusual or very noisy phrasing may be classified less reliably than the test examples.

Credit and license

This model is only a fine-tune. The real work, teaching a model the Hebrew language in the first place, was done by the AlephBERT team at the ONLP Lab, Bar-Ilan University: Amit Seker, Elron Bandel, Dan Bareket, Idan Brusilovsky, Refael Greenfeld, and Reut Tsarfaty. Thank you to them. Their code and models are at github.com/OnlpLab/AlephBERT. If AlephBERT is useful in your own work, please cite their paper.

Base model: onlplab/alephbert-base (Apache 2.0). This fine-tune is released under Apache 2.0 as well.

@inproceedings{seker-etal-2022-alephbert,
    title     = "{A}leph{BERT}: Language Model Pre-training and Evaluation from Sub-Word to Sentence Level",
    author    = "Seker, Amit and Bandel, Elron and Bareket, Dan and Brusilovsky, Idan and Greenfeld, Refael and Tsarfaty, Reut",
    booktitle = "Proceedings of the 60th Annual Meeting of the ACL",
    year      = "2022",
    address   = "Dublin, Ireland",
    publisher = "Association for Computational Linguistics",
    url       = "https://aclanthology.org/2022.acl-long.4",
    pages     = "46--56",
}

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
BertForSequenceClassification
Ревизия весов
c179455

0 моделей