NAQAAE — Arabic Accreditation Classifier

موديل تصنيف + تشابه للتقارير العربية بنظام الاعتماد NAQAAE.
يُصنّف التقارير إلى: معتمد / مؤجل / غير معتمد

المواصفات

المواصفة القيمة
نوع الموديل Logistic Regression + TF-IDF
الـ Features TF-IDF word(1-2gram) + char(3-4gram) + similarity(4) + numeric(5)
Test Accuracy 87.9%
Val Accuracy 86.6%
نصوص معتمدة للمقارنة 434
Classes غير معتمد / مؤجل / معتمد

طريقة الاستخدام

from huggingface_hub import hf_hub_download
import joblib, scipy.sparse, numpy as np, re
from scipy.sparse import hstack
from sklearn.metrics.pairwise import cosine_similarity

# تحميل الملفات
clf        = joblib.load(hf_hub_download("hazemgalal1/naqaae-similarity-classifier", "classifier.pkl"))
tfidf_word = joblib.load(hf_hub_download("hazemgalal1/naqaae-similarity-classifier", "tfidf_word.pkl"))
tfidf_char = joblib.load(hf_hub_download("hazemgalal1/naqaae-similarity-classifier", "tfidf_char.pkl"))
X_accredited = scipy.sparse.load_npz(hf_hub_download("hazemgalal1/naqaae-similarity-classifier", "X_accredited.npz"))

label_names = ["غير معتمد", "مؤجل", "معتمد"]

def predict(text):
    Xw = tfidf_word.transform([text])
    Xc = tfidf_char.transform([text])
    X_tfidf = hstack([Xw, Xc])
    sims = cosine_similarity(X_tfidf, X_accredited)[0]
    sim_feats = np.array([[sims.max(), sims.mean(),
                           (sims>0.7).mean(), (sims>0.5).mean()]])
    num = np.array([[len(text.split())/500, 0, 1, 0, 1]])
    X = np.hstack([X_tfidf.toarray(), sim_feats, num])
    label = label_names[clf.predict(X)[0]]
    proba = clf.predict_proba(X)[0]
    return label, proba

label, proba = predict("رؤية الكلية معتمدة رسمياً ...")
print(label, proba)

⚠️ تنبيه

هذا الموديل للأغراض الأكاديمية والتعليمية.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support