gouwsxander/wikipedia-human-ai
Viewer โข Updated โข 9.97k โข 139 โข 10
How to use gouwsxander/slop-detector-bert with PEFT:
from peft import PeftModel
from transformers import AutoModelForSequenceClassification
base_model = AutoModelForSequenceClassification.from_pretrained("bert-base-cased")
model = PeftModel.from_pretrained(base_model, "gouwsxander/slop-detector-bert")How to use gouwsxander/slop-detector-bert with Transformers:
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("gouwsxander/slop-detector-bert", dtype="auto")A simple model to detect AI-written content.
This model is a PEFT of bert-base-cased.
It was trained on a dataset of scraped paragraphs from Wikipedia, as well as AI rewrites of said paragraphs.
More detail about the training data can be found here.
The basic usage is as follows:
from transformers import pipeline
classifier = pipeline("text-classification", model="gouwsxander/slop-detector-bert")
inputs: str | list[str] | dict[str, str] | list[dict[str, str]] = ...
results = classifier(inputs)
Texts with label LABEL_1 are estimated to be produced by an AI.
You may get a warning about weights being initialized, but these can be ignored.
Base model
google-bert/bert-base-cased
from peft import PeftModel from transformers import AutoModelForSequenceClassification base_model = AutoModelForSequenceClassification.from_pretrained("bert-base-cased") model = PeftModel.from_pretrained(base_model, "gouwsxander/slop-detector-bert")