Spaces:
Sleeping
Sleeping
import gradio as gr | |
from transformers import pipeline | |
# Load model using TensorFlow weights | |
classifier = pipeline("text-classification", model="unitary/unbiased-toxic-roberta") | |
def analyze_bias(text): | |
result = classifier(text) | |
return f"Bias: {result[0]['label']} (Confidence: {result[0]['score'] * 100:.2f}%)" | |
iface = gr.Interface(fn=analyze_bias, inputs="text", outputs="text") | |
iface.launch() | |