BiasZap / app.py
AlexOuellet's picture
Update app.py
735348f verified
raw
history blame contribute delete
407 Bytes
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()