Downloads · 30 days
31
0% of all-time downloads
shahxeebhassan/bert_base_ai_content_detector
bert_base_ai_content_detector is a text classification model from shahxeebhassan. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This model is a fine-tuned BERT model for AI content detection.
Downloads · 30 days
31
0% of all-time downloads
All-time downloads
11K
Public
Parameters
109M
438 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
This model is a fine-tuned BERT model for AI content detection.
The model was trained on a <span style="color: blue;">dataset</span> of over 100,000 sentences, each labeled as either AI-generated or human-written. This approach allows the model to predict the nature of each individual sentence, which is particularly useful for highlighting AI-written content within larger texts.
The model achieved an accuracy of 90% on the validation & test set.
import torch
from transformers import BertTokenizer, BertForSequenceClassification
tokenizer = BertTokenizer.from_pretrained("shahxeebhassan/bert_base_ai_content_detector")
model = BertForSequenceClassification.from_pretrained("shahxeebhassan/bert_base_ai_content_detector")
inputs = tokenizer("Distance learning will not benefit students because the students are not able to develop as good of a relationship with their teachers.", return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
probabilities = torch.softmax(logits, dim=1).cpu().numpy()
predicted_label = probabilities.argmax(axis=1)
print(f"Predicted label for the input text: {predicted_label[0]}")