CoolFace
Modelpublic

Yousof10/qwen3-8b-arabic-english-ticket-prep

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes8downloads
Model Card

Qwen3-8B — Arabic → English Ticket Preparation (LoRA adapter)

A QLoRA adapter that turns a raw Arabic workplace-maintenance ticket into clean English JSON: it fixes spelling, removes repetition between title and description, splits multiple distinct issues into bullet points, and translates the result.

This repo contains only the LoRA adapter, not the base model weights.

Input / output contract

The model is trained on a single static instruction, with the ticket supplied as compact JSON:

Analyze the following Arabic maintenance ticket. Correct spelling errors, remove repetitions,
separate distinct issues into bullet points, and translate to English. Output the result as a
JSON object containing 'title', 'description', and 'reasoning'.

Input:
{"title": "...", "description": "..."}

It responds with a single JSON object — compact and unfenced, no ``` wrapper:

json
{"title": "...", "description": "...", "reasoning": "..."}

description contains one sentence for a single-issue ticket, or - bullet points on separate lines when the ticket covers several distinct issues. reasoning is a short note on what was corrected and how terms were translated.

Usage

python
from unsloth import FastLanguageModel

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name = "Yousof10/qwen3-8b-arabic-english-ticket-prep",
    max_seq_length = 2048,
    dtype = None,
    load_in_4bit = True,
)
FastLanguageModel.for_inference(model)

INSTRUCTION = (
    "Analyze the following Arabic maintenance ticket. Correct spelling errors, remove "
    "repetitions, separate distinct issues into bullet points, and translate to English. "
    "Output the result as a JSON object containing 'title', 'description', and 'reasoning'."
)
ticket = '{"title": "...", "description": "..."}'

messages = [{"role": "user", "content": f"{INSTRUCTION}\n\nInput:\n{ticket}"}]
inputs = tokenizer.apply_chat_template(
    messages, tokenize=True, add_generation_prompt=True, return_tensors="pt"
).to("cuda")

out = model.generate(input_ids=inputs, max_new_tokens=1024, temperature=0.1, use_cache=True)
print(tokenizer.batch_decode(out)[0].split("<|im_start|>assistant")[-1])

Low temperature (~0.1) is recommended — the task is deterministic extraction, not open generation.

Training

Base modelunsloth/Qwen3-8B-unsloth-bnb-4bit (4-bit QLoRA)
MethodSFT, loss on assistant turns only (train_on_responses_only)
LoRAr=32, alpha=32, dropout=0, rsLoRA enabled
Target modulesq/k/v/oproj, gate/up/downproj
Checkpointstep 300 (≈1.84 epochs), final logged training loss ≈ 0.35
Schedulelr 2e-4, cosine, 50 warmup steps, adamw_8bit, weight decay 0.01
Batch1 per device × 4 gradient accumulation
FrameworkUnsloth + TRL SFTTrainer

Trained on an internal Arabic→English ticket-preparation dataset (650 train / 275 validation rows), human-reviewed. The dataset itself is not public.

Limitations

  • —Not yet evaluated. No format-accuracy, issue-splitting, or semantic-similarity numbers have been measured for this checkpoint. Treat quality as unverified.
  • —Only ~13% of the training rows are multi-issue tickets, so bullet-point splitting is the weakest-supported behavior and the most likely failure mode.
  • —The domain is narrow: retail/branch facility maintenance (doors, tiling, coffee equipment, signage, plumbing). Expect degraded results outside it.
  • —Output is intended to be valid JSON, but is not constrained decoding — always parse defensively.
  • —Earlier checkpoints of this project emitted ``json-fenced, pretty-printed JSON. This checkpoint emits compact unfenced JSON. Parsers that assumed the fenced format should extract from the first { to the last }` instead.