Views
No views yet
| Metric | All Settings | No Adversarial |
|---|---|---|
| AUROC | 99.28% | 99.85% |
| TPR @ 5% FPR | 95.79% | 99.65% |
| TPR @ 1% FPR | 90.17% | 98.56% |
| Metric | Score |
|---|---|
| AUROC | 99.69% |
| Accuracy | 97.42% |
| FPR | 2.61% |
| FNR | 2.58% |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4# Load model and tokenizer
5model_path = "Oxidane/tmr-ai-text-detector"
6tokenizer = AutoTokenizer.from_pretrained(model_path)
7model = AutoModelForSequenceClassification.from_pretrained(model_path)
8
9# Predict
10text = "Your text here..."
11inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512, padding=True)
12
13with torch.no_grad():
14 outputs = model(**inputs)
15 logits = outputs.logits
16 probs = torch.softmax(logits, dim=-1)
17
18# Probability that text is AI-generated
19ai_probability = probs[0][1].item()
20print(f"AI probability: {ai_probability:.4f}")
21
22# Binary classification (threshold=0.5)
23is_ai = ai_probability > 0.5
24print(f"Prediction: {'AI-generated' if is_ai else 'Human-written'}")1@misc{tmr-ai-text-detector,
2 title={TMR: Target Mining RoBERTa for AI Text Detection},
3 author={Oxidane},
4 year={2025},
5 url={https://huggingface.co/Oxidane/tmr-ai-text-detector}
6}