Downloads · 30 days
0
nawaf11570/arabic-ai-hybrid-xgboost
arabic-ai-hybrid-xgboost is a machine learning model from nawaf11570. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
The best-performing model from the Arabic AI Text Detection project (CSC361, December 2025) — 93.16% internal accuracy, 86% accuracy on an external test set built from human text and AI outputs never seen during train…
Downloads · 30 days
0
Access
Public
Updated Jul 5, 2026
Repo size
1.8 MB
Likes
0
Public
Click a slice to open those files.
.pkl1.8 MB · 100%
From the Hugging Face model README
The best-performing model from the Arabic AI Text Detection project (CSC361, December 2025) — 93.16% internal accuracy, 86% accuracy on an external test set built from human text and AI outputs never seen during training.
This is not a standard transformers model — it's a scikit-learn/XGBoost pipeline:
linguistic_feature_columns.pkl) and fed to an XGBClassifier.Files:
hybrid_xgb.pkl — the trained XGBClassifier (500 estimators)tfidf_vectorizer.pkl — fitted TfidfVectorizer (char, ngram_range=(2,5), max_features=20000)linguistic_feature_columns.pkl — ordered list of the 13 linguistic feature namesLabels: 0 = Human-written, 1 = AI-generated.
Try it interactively: 🤗 Space · Companion model: arabic-ai-arabert · Full report
Requires a Java runtime (Farasa is Java-based, wrapped by the farasapy Python package).
from huggingface_hub import hf_hub_download
import joblib, numpy as np
repo = "nawaf11570/arabic-ai-hybrid-xgboost"
model = joblib.load(hf_hub_download(repo, "hybrid_xgb.pkl"))
vectorizer = joblib.load(hf_hub_download(repo, "tfidf_vectorizer.pkl"))
feature_columns = joblib.load(hf_hub_download(repo, "linguistic_feature_columns.pkl"))
# see linguistic_features.py in the GitHub repo for extract_linguistic_features()
text = "هذا نص تجريبي لاختبار النموذج."
tfidf_vec = vectorizer.transform([text]).toarray()
ling_feats = extract_linguistic_features(text) # dict of the 13 features
ling_vec = np.array([[ling_feats[c] for c in feature_columns]])
x = np.hstack([tfidf_vec, ling_vec])
proba = model.predict_proba(x)[0]
print("AI-generated" if proba.argmax() == 1 else "Human-written", proba.max())
Full runnable script: scripts/predict_hybrid.py in the GitHub repo.