CoolFace
Modelpublic

Ma120/Fake-News-Detection

sourceHugging Facemitupdated 11mo agoView on Hugging Face
1likes
Model Card

📰 Fake News Detector (Professional Pipeline)

هذا نموذج Scikit-learn Pipeline تم تدريبه لتصنيف المقالات الإخبارية إلى "حقيقية (True)" أو "كاذبة (Fake)".

🚀 كيف يعمل؟

يستخدم النموذج Pipeline احترافي يدمج خطوتين في خطوة واحدة:

  1. 1.TF-IDF Vectorizer: لتحويل النص إلى مصفوفة رقمية.
  2. 2.Logistic Regression: لعملية التصنيف.

📈 أداء النموذج

حقق النموذج دقة 96.50% على مجموعة الاختبار. ![Model Accuracy](Model Accuracy.png)

🛠️ كيفية الاستخدام (في Python)

بفضل الـ Pipeline، أصبح الاستخدام بسيطاً جداً:

python
import skops.io as sio

# تحميل ملف الـ Pipeline الواحد
pipeline = sio.load("fake_news_pipeline.skops", trusted=True)

# نص للتجربة
text_to_test = "Your sample news text goes here..."

# التنبؤ مباشرة (الـ Pipeline يتولى التحويل والتنبؤ)
prediction_label = pipeline.predict([text_to_test])[0]
probabilities = pipeline.predict_proba([text_to_test])[0]

label = "True" if prediction_label == 1 else "Fake"
confidence = probabilities[prediction_label]

print(f"Prediction: {label}")
print(f"Confidence: {confidence:.2f}")