File size: 955 Bytes
7b754c2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | ---
language:
- en
license: apache-2.0
tags:
- text-classification
- ai-detection
- roberta
- lora
pipeline_tag: text-classification
---
# Finetuned RADAR — AI Text Detector
Fine-tuned version of [TrustSafeAI/RADAR-Vicuna-7B](https://huggingface.co/TrustSafeAI/RADAR-Vicuna-7B)
(RoBERTa classifier) via LoRA for binary AI-generated text detection.
## Usage
```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_id = "elisabeth-pl-pl/Finetuned-RADAR-binary-classification"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
text = "Your text here"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
logits = model(**inputs).logits
pred = logits.argmax(-1).item()
print("machine" if pred == 0 else "human")
```
## Labels
- `0` — machine-generated
- `1` — human-written
|