Downloads · 30 days
23
3% of all-time downloads
thejosango/nuha-ajp-trinary-onnx
nuha-ajp-trinary-onnx is a text classification model from thejosango. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
nuha-ajp-trinary-onnx is a lightweight, ONNX-optimised Arabic text classifier that categorises Jordanian social media comments into three classes based on the NUHA methodology for online gender-based violence (OGBV).…
Downloads · 30 days
23
3% of all-time downloads
All-time downloads
906
Public
Parameters
78.5M
2 GB on disk
Likes
0
Public
Click a slice to open those files.
.onnx314 MB · 33%
From the Hugging Face model README
nuha-ajp-trinary-onnx is a lightweight, ONNX-optimised Arabic text classifier that categorises Jordanian social media comments into three classes based on the NUHA methodology for online gender-based violence (OGBV). It fine-tunes nuha-ajp-mlm — a domain-adapted Arabic BERT — with a reduced 4-layer architecture for efficient CPU inference, and is exported to ONNX. It shares the same classification task and labels as nuha-ajp-trinary but is optimised for production deployment. This is the model powering the NUHA analysis platform.
| Label | Meaning |
|---|---|
Not Online Violence | Comments that are not hate speech |
Offensive Language | Hate speech characterised by irony or sarcasm |
Gender Based Violence | Direct hate speech targeting gender — the primary focus of NUHA |
This model was developed as part of a pilot proof-of-concept for the NUHA project by the Jordan Open Source Association (JOSA).
For the full-depth (12-layer) version of this classifier, see nuha-ajp-trinary.
from optimum.onnxruntime import ORTModelForSequenceClassification
from transformers import AutoTokenizer, pipeline
model = ORTModelForSequenceClassification.from_pretrained("thejosango/nuha-ajp-trinary-onnx")
tokenizer = AutoTokenizer.from_pretrained("thejosango/nuha-ajp-trinary-onnx")
classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
result = classifier("اخرسي يا غبية")
print(result)
# [{'label': 'Gender Based Violence', 'score': ...}]
For batch inference:
comments = ["يعطيكم العافية", "أنتِ ساحرة", "اخرسي يا غبية"]
results = classifier(comments)
for comment, result in zip(comments, results):
print(f"{result['label']} ({result['score']:.2f}): {comment}")
If you need the full PyTorch model (for fine-tuning or non-ONNX inference), use nuha-ajp-trinary directly.
At inference time, apply the following normalisation to input text before passing it to the model:
[رابط] token[مستخدم] token[بريد] tokenEvaluated on the validation split of thejosango/nuha-ajp-dataset (methodology configuration):
| Metric | Value |
|---|---|
| F1 (macro) | 0.5363 |
| Precision | 0.6660 |
| Recall | 0.5188 |
See nuha-ajp-trinary for full training details and evaluation discussion.
This model was developed as part of an initial pilot study. Performance metrics reflect the complexity of the task and the proof-of-concept nature of this system.