Update README.md
Browse files
README.md
CHANGED
@@ -3,69 +3,115 @@ library_name: transformers
|
|
3 |
license: apache-2.0
|
4 |
base_model: answerdotai/ModernBERT-base
|
5 |
tags:
|
|
|
|
|
|
|
|
|
6 |
- generated_from_trainer
|
7 |
model-index:
|
8 |
- name: answerdotai-ModernBERT-base-ai-detector
|
9 |
results: []
|
10 |
---
|
11 |
|
12 |
-
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
13 |
-
should probably proofread and complete it, then remove this comment. -->
|
14 |
-
|
15 |
# answerdotai-ModernBERT-base-ai-detector
|
16 |
|
17 |
-
This model is a fine-tuned version of [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) on the
|
|
|
18 |
It achieves the following results on the evaluation set:
|
19 |
-
- Loss
|
20 |
|
21 |
-
|
22 |
|
23 |
-
|
|
|
|
|
24 |
|
25 |
-
|
26 |
|
27 |
-
|
|
|
|
|
|
|
|
|
28 |
|
29 |
-
|
|
|
|
|
|
|
30 |
|
31 |
-
|
32 |
|
33 |
-
## Training
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
-
|
36 |
|
|
|
|
|
37 |
The following hyperparameters were used during training:
|
38 |
-
- learning_rate: 2e-05
|
39 |
-
- train_batch_size: 16
|
40 |
-
- eval_batch_size: 16
|
41 |
-
- seed: 42
|
42 |
-
- optimizer: Use OptimizerNames.ADAMW_TORCH with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
43 |
-
- lr_scheduler_type: linear
|
44 |
-
- num_epochs: 3
|
45 |
-
- mixed_precision_training: Native AMP
|
46 |
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
|
|
49 |
| Training Loss | Epoch | Step | Validation Loss |
|
50 |
-
|
51 |
-
| 0.0505
|
52 |
-
| 0.0114
|
53 |
-
| 0.0088
|
54 |
-
| 0.0
|
55 |
-
| 0.0068
|
56 |
-
| 0.0
|
57 |
-
| 0.0
|
58 |
-
| 0.0053
|
59 |
-
| 0.0
|
60 |
-
| 0.0
|
61 |
-
| 0.0017
|
62 |
-
| 0.0
|
63 |
-
| 0.0
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
license: apache-2.0
|
4 |
base_model: answerdotai/ModernBERT-base
|
5 |
tags:
|
6 |
+
- text-classification
|
7 |
+
- ai-content-detection
|
8 |
+
- bert
|
9 |
+
- transformers
|
10 |
- generated_from_trainer
|
11 |
model-index:
|
12 |
- name: answerdotai-ModernBERT-base-ai-detector
|
13 |
results: []
|
14 |
---
|
15 |
|
|
|
|
|
|
|
16 |
# answerdotai-ModernBERT-base-ai-detector
|
17 |
|
18 |
+
This model is a fine-tuned version of [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) on the **AI vs Human Text Classification dataset**.
|
19 |
+
|
20 |
It achieves the following results on the evaluation set:
|
21 |
+
- **Validation Loss:** `0.0036`
|
22 |
|
23 |
+
---
|
24 |
|
25 |
+
## **π Model Description**
|
26 |
+
This model is based on **ModernBERT-base**, a lightweight and efficient BERT-based model.
|
27 |
+
It has been fine-tuned for **AI-generated vs Human-written text classification**, allowing it to distinguish between texts written by **AI models (ChatGPT, DeepSeek, Claude, etc.)** and human authors.
|
28 |
|
29 |
+
---
|
30 |
|
31 |
+
## **π― Intended Uses & Limitations**
|
32 |
+
### β
**Intended Uses**
|
33 |
+
- **AI-generated content detection** (e.g., ChatGPT, Claude, DeepSeek).
|
34 |
+
- **Text classification** for distinguishing human vs AI-generated content.
|
35 |
+
- **Educational & Research applications** for AI-content detection.
|
36 |
|
37 |
+
### β οΈ **Limitations**
|
38 |
+
- **Not 100% accurate** β Some AI texts may resemble human writing and vice versa.
|
39 |
+
- **Limited to trained dataset scope** β May struggle with **out-of-domain** text.
|
40 |
+
- **Bias risks** β If the dataset contains bias, the model may inherit it.
|
41 |
|
42 |
+
---
|
43 |
|
44 |
+
## **π Training and Evaluation Data**
|
45 |
+
- The model was fine-tuned on **35,894 training samples** and **8,974 test samples**.
|
46 |
+
- The dataset consists of **AI-generated text samples (ChatGPT, Claude, DeepSeek, etc.)** and **human-written samples (Wikipedia, books, articles)**.
|
47 |
+
- Labels:
|
48 |
+
- `1` β AI-generated text
|
49 |
+
- `0` β Human-written text
|
50 |
|
51 |
+
---
|
52 |
|
53 |
+
## **βοΈ Training Procedure**
|
54 |
+
### **Training Hyperparameters**
|
55 |
The following hyperparameters were used during training:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
+
| Hyperparameter | Value |
|
58 |
+
|----------------------|--------------------|
|
59 |
+
| **Learning Rate** | `2e-5` |
|
60 |
+
| **Train Batch Size** | `16` |
|
61 |
+
| **Eval Batch Size** | `16` |
|
62 |
+
| **Optimizer** | `AdamW` (`Ξ²1=0.9, Ξ²2=0.999, Ξ΅=1e-08`) |
|
63 |
+
| **LR Scheduler** | `Linear` |
|
64 |
+
| **Epochs** | `3` |
|
65 |
+
| **Mixed Precision** | `Native AMP (fp16)` |
|
66 |
+
|
67 |
+
---
|
68 |
|
69 |
+
## **π Training Results**
|
70 |
| Training Loss | Epoch | Step | Validation Loss |
|
71 |
+
|--------------|--------|------|----------------|
|
72 |
+
| 0.0505 | 0.22 | 500 | 0.0214 |
|
73 |
+
| 0.0114 | 0.44 | 1000 | 0.0110 |
|
74 |
+
| 0.0088 | 0.66 | 1500 | 0.0032 |
|
75 |
+
| 0.0 | 0.89 | 2000 | 0.0048 |
|
76 |
+
| 0.0068 | 1.11 | 2500 | 0.0035 |
|
77 |
+
| 0.0 | 1.33 | 3000 | 0.0040 |
|
78 |
+
| 0.0 | 1.55 | 3500 | 0.0097 |
|
79 |
+
| 0.0053 | 1.78 | 4000 | 0.0101 |
|
80 |
+
| 0.0 | 2.00 | 4500 | 0.0053 |
|
81 |
+
| 0.0 | 2.22 | 5000 | 0.0039 |
|
82 |
+
| 0.0017 | 2.45 | 5500 | 0.0046 |
|
83 |
+
| 0.0 | 2.67 | 6000 | 0.0043 |
|
84 |
+
| 0.0 | 2.89 | 6500 | 0.0036 |
|
85 |
+
|
86 |
+
---
|
87 |
+
|
88 |
+
## **π Framework Versions**
|
89 |
+
| Library | Version |
|
90 |
+
|--------------|------------|
|
91 |
+
| **Transformers** | `4.48.3` |
|
92 |
+
| **PyTorch** | `2.5.1+cu124` |
|
93 |
+
| **Datasets** | `3.3.2` |
|
94 |
+
| **Tokenizers** | `0.21.0` |
|
95 |
+
|
96 |
+
---
|
97 |
+
|
98 |
+
## **π€ Model Usage**
|
99 |
+
To load and use the model for text classification:
|
100 |
+
```python
|
101 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
|
102 |
+
|
103 |
+
model_name = "answerdotai/ModernBERT-base-ai-detector"
|
104 |
+
|
105 |
+
# Load model and tokenizer
|
106 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
107 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
108 |
+
|
109 |
+
# Create text classification pipeline
|
110 |
+
classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
|
111 |
+
|
112 |
+
# Run classification
|
113 |
+
text = "This text was written by an AI model like ChatGPT."
|
114 |
+
result = classifier(text)
|
115 |
+
|
116 |
+
print(result)
|
117 |
+
```
|