yaya36095 commited on
Commit
c839dce
·
verified ·
1 Parent(s): a2f60ee

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +43 -3
README.md CHANGED
@@ -1,3 +1,43 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AI Source Detector
2
+
3
+ ## وصف النموذج
4
+ هذا النموذج يعتمد على معمارية **XLM-RoBERTa** وتم تصميمه لتحديد مصدر النصوص المولدة، مثل التعرف على النصوص التي تم إنشاؤها بواسطة الذكاء الاصطناعي مقابل النصوص الحقيقية المكتوبة بواسطة البشر. يدعم النموذج مهام تصنيف النصوص متعددة اللغات.
5
+
6
+ ---
7
+
8
+ ## التفاصيل التقنية
9
+
10
+ - **المعمارية:** XLMRobertaForSequenceClassification
11
+ - **نوع النموذج:** XLM-RoBERTa
12
+ - **عدد الطبقات المخفية:** 12
13
+ - **عدد رؤوس الانتباه (Attention Heads):** 12
14
+ - **الحجم المخفي:** 768
15
+ - **نوع المشكلة:** Single Label Classification
16
+ - **الإصدار المستخدم من Transformers:** 4.44.2
17
+
18
+ ---
19
+
20
+ ## طريقة الاستخدام
21
+
22
+ ### Python
23
+ ```python
24
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
25
+ import torch
26
+
27
+ # تحميل النموذج والمُرمِّز
28
+ model_name = "yaya36095/ai-source-detector"
29
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
30
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
31
+
32
+ # تحليل النص
33
+ text = "This is a sample text to classify."
34
+ inputs = tokenizer(text, return_tensors="pt")
35
+ outputs = model(**inputs)
36
+
37
+ # النتيجة
38
+ logits = outputs.logits
39
+ predicted_class = logits.argmax(-1).item()
40
+
41
+ # التصنيفات
42
+ id2label = {0: "real", 1: "ai_generated"}
43
+ print(f"The text is classified as: {id2label[predicted_class]}")