Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,53 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
datasets:
|
| 4 |
+
- artem9k/ai-text-detection-pile
|
| 5 |
+
base_model:
|
| 6 |
+
- FacebookAI/roberta-base
|
| 7 |
+
---
|
| 8 |
+
---
|
| 9 |
+
language:
|
| 10 |
+
- en
|
| 11 |
+
pipeline_tag: text-classification
|
| 12 |
+
tags:
|
| 13 |
+
- ai-detection
|
| 14 |
+
- roberta
|
| 15 |
+
- generated-text-detection
|
| 16 |
+
license: mit
|
| 17 |
+
widget:
|
| 18 |
+
- text: "Machine learning is a subset of artificial intelligence."
|
| 19 |
+
example_title: "AI Example"
|
| 20 |
+
- text: "I went to the park to walk my dog yesterday."
|
| 21 |
+
example_title: "Human Example"
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
# My AI Text Detector (RoBERTa Base)
|
| 25 |
+
|
| 26 |
+
This model is a fine-tuned version of `roberta-base` trained to distinguish between human-written text and AI-generated text.
|
| 27 |
+
|
| 28 |
+
## Model Details
|
| 29 |
+
- **Developer:** ShivamVN
|
| 30 |
+
- **Base Model:** RoBERTa-base
|
| 31 |
+
- **License:** MIT
|
| 32 |
+
- **Finetuned on:** 80,000 samples from the `artem9k/ai-text-detection-pile` dataset.
|
| 33 |
+
|
| 34 |
+
## How to Use
|
| 35 |
+
|
| 36 |
+
You can use this model directly with the Hugging Face `transformers` library:
|
| 37 |
+
|
| 38 |
+
```python
|
| 39 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 40 |
+
import torch
|
| 41 |
+
|
| 42 |
+
model_name = "ShivamVN/My-Ai-Text-Detector"
|
| 43 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 44 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
| 45 |
+
|
| 46 |
+
text = "Artificial Intelligence is changing the world."
|
| 47 |
+
inputs = tokenizer(text, return_tensors="pt")
|
| 48 |
+
|
| 49 |
+
with torch.no_grad():
|
| 50 |
+
logits = model(**inputs).logits
|
| 51 |
+
|
| 52 |
+
probabilities = torch.softmax(logits, dim=1)
|
| 53 |
+
print(f"AI Probability: {probabilities[0][1].item():.2f}")
|