jevhakim / README.md
Jarbas's picture
Jevhakim decision-model demo
ca1b4bc verified
|
Raw History Blame Contribute Delete
3.91 kB
---
title: Jevhakim
emoji: ⚖️
colorFrom: green
colorTo: gray
sdk: gradio
sdk_version: 6.28.0
python_version: "3.12"
app_file: app.py
short_description: Typed decisions for Arabic text, MSA and dialects
startup_duration_timeout: 1h
license: cc-by-nc-sa-4.0
models:
- TigreGotico/jevhakim-4b
- TigreGotico/jevhakim-0.8b
- Qwen/Qwen3.5-0.8B-Base
- Qwen/Qwen3.5-4B-Base
datasets:
- TigreGotico/jevhakim-decisions
tags:
- decision-model
- arabic
- arabic-dialects
---
# Jevhakim
Jevhakim is a decision model for Arabic, both Modern Standard Arabic and the dialects. It reads a state, which is a
text or a JSON object, and a set of typed questions about it. It returns a probability for each option of each
question in one forward pass. It does not generate text.
This Space runs two models on ZeroGPU, in bf16. Pick one with the model selector.
[Jevhakim-4B](https://huggingface.co/TigreGotico/jevhakim-4b) is more accurate, and
[Jevhakim-0.8B](https://huggingface.co/TigreGotico/jevhakim-0.8b) is smaller. Both are
[Kev](https://github.com/jaredpalmer/kev) fine-tuned on the
[TigreGotico/jevhakim-decisions](https://huggingface.co/datasets/TigreGotico/jevhakim-decisions) dataset.
## Request shape
A request follows Kev's System One format (`POST /v1/systemone`). Keys are English code identifiers: the state's
field names, the question ids and the option names. Values are Arabic.
```json
{
"state": {"message": "اتخصم مني فلوس الباقة مرتين الشهر ده، وعايز الفلوس ترجعلي."},
"questions": {
"category": {"type": "choice", "instructions": "إلى أي قسم ينتمي هذا الطلب؟",
"criteria": {"billing_payment": "الفواتير والدفع", "home_internet": "الإنترنت المنزلي", "devices": "الأجهزة"}},
"needs_human": {"type": "noul", "instructions": "هل يحتاج هذا الطلب إلى موظف بشري؟"},
"urgency": {"type": "score", "instructions": "كم هو ملحّ طلب العميل؟",
"criteria": ["غير مستعجل", "مستعجل قليلًا", "مستعجل", "عاجل جدًا"]}
}
}
```
There are three question types. A `choice` question picks one of its named options, and each option can have a
description. A `noul` question is yes or no, and the answer is p(yes). A `score` question picks a level on an ordered
list, and the answer is the expected level.
The **Questions** tab builds a request from a form. The **Raw JSON** tab takes a raw JSON request and shows the raw
JSON answer. The same two functions are on the Gradio API as `/decide` and `/systemone`.
## Measured results
On the test split of 141,217 questions, Jevhakim-4B has accuracy 0.765, ECE 0.061 and Brier score 0.328.
Jevhakim-0.8B has accuracy 0.661, ECE 0.063 and Brier score 0.438. Stock Kev-0.8B has accuracy 0.503. On the
evaluation-only sources, which give no training rows, the accuracy is 0.727 for Jevhakim-4B, 0.585 for Jevhakim-0.8B
and 0.490 for stock Kev-0.8B.
## How it runs
The Space installs Kev from GitHub at commit `1f04cfa28e6a708485b28a9585010b9e436b776e` and loads the model with
Kev's own loader, as `python -m kev.serve --run TigreGotico/jevhakim-0.8b` does. The probabilities use the calibration
temperature stored in the model's `head.pt`.
`JEVHAKIM_MODELS` names the models to serve, for example `JEVHAKIM_MODELS=Jevhakim-0.8B`. Off ZeroGPU,
`JEVHAKIM_DEVICE_4B` and `JEVHAKIM_DEVICE_08B` place each model, for example `JEVHAKIM_DEVICE_4B=cpu`.
## Licence and limits
The models and the dataset are under CC BY-NC-SA 4.0, for non-commercial research only. Several training sources are
research-only. The instruction wording is model-written Modern Standard Arabic that no native speaker has reviewed. Do
not use the model for decisions with legal, medical, financial or employment consequences without human review.