Free web interface with real-time detection, no installation or API key required.
1from transformers import BertTokenizer, BertForSequenceClassification
2import torch
3
4# Load model and tokenizer
5model_name = "followsci/bert-ai-text-detector"
6tokenizer = BertTokenizer.from_pretrained(model_name)
7model = BertForSequenceClassification.from_pretrained(model_name)
8model.eval()
9
10# Detect AI text
11text = "Your academic paragraph here..."
12inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
13
14with torch.no_grad():
15 outputs = model(**inputs)
16 probs = torch.nn.functional.softmax(outputs.logits, dim=-1)
17 ai_prob = probs[0][1].item() * 100
18 human_prob = probs[0][0].item() * 100
19
20 print(f"AI-generated probability: {ai_prob:.1f}%")
21 print(f"Human-written probability: {human_prob:.1f}%")
22
23 if ai_prob > 50:
24 print("Prediction: AI-generated")
25 else:
26 print("Prediction: Human-written")
1texts = [
2 "First paragraph...",
3 "Second paragraph...",
4 # ... more texts
5]
6
7inputs = tokenizer(
8 texts,
9 return_tensors="pt",
10 truncation=True,
11 max_length=512,
12 padding=True
13)
14
15with torch.no_grad():
16 outputs = model(**inputs)
17 probs = torch.nn.functional.softmax(outputs.logits, dim=-1)
18
19 for i, prob in enumerate(probs):
20 ai_prob = prob[1].item() * 100
21 print(f"Text {i+1}: AI probability = {ai_prob:.1f}%")
1from transformers import pipeline
2
3classifier = pipeline(
4 "text-classification",
5 model="followsci/bert-ai-text-detector",
6 tokenizer="followsci/bert-ai-text-detector"
7)
8
9result = classifier("Your text here...")
10print(result)
-
Domain Specificity: The model is trained primarily on academic text. Performance may degrade on:
- Casual text or social media content
- Technical documentation
- Creative writing
-
Binary Classification: The model only distinguishes between "human" and "AI" text, without:
- Identifying which AI model generated the text
- Providing confidence intervals
- Detecting partially AI-assisted text
-
Paragraph-Level Detection: The model is optimized for paragraph-level samples:
- Performance on sentence-level or full-document level may vary
- Best results achieved with structured academic paragraphs
-
False Positives: Approximately 0.82% false positive rate means some human-written text may be flagged as AI-generated.
This model is licensed under the MIT License.