YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

RoBERTa AI Detection Model

This repository contains a fine-tuned RoBERTa model for AI-generated text detection, created by Christian Mpambira.

Models Included

  1. Original fine-tuned RoBERTa model
  2. TensorFlow converted model
  3. TFLite optimized model (for mobile/edge deployment)

Usage

from transformers import RobertaTokenizer, RobertaForSequenceClassification
import torch

# Load model and tokenizer
tokenizer = RobertaTokenizer.from_pretrained("ChrispamWrites/roberta-ai-detector-20250401_232702")
model = RobertaForSequenceClassification.from_pretrained("ChrispamWrites/roberta-ai-detector-20250401_232702")

# Prepare input text
text = "Your text to analyze for AI detection"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)

# Get prediction
with torch.no_grad():
    outputs = model(**inputs)

probabilities = torch.nn.functional.softmax(outputs.logits, dim=-1)
ai_score = probabilities[0][1].item()  # Assuming label 1 is for AI-generated text

print(f"Probability of AI-generated text: {ai_score:.2%}")

TFLite Model

The TFLite model is available for mobile and edge deployment.

Created on: 2025-04-01

Downloads last month
0
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support