praveen020's picture
Update app.py
dd38050 verified
raw
history blame contribute delete
610 Bytes
import gradio as gr
from transformers import pipeline
model = pipeline("text-classification", model="distilbert-base-uncased-finetuned-sst-2-english")
def detect_fake_news(text):
result = model(text)[0]
label = result['label']
if label == "NEGATIVE":
return "❌ Fake News"
else:
return "βœ… Real News"
interface = gr.Interface(
fn=detect_fake_news,
inputs=gr.Textbox(lines=7, placeholder="Enter news text here..."),
outputs="text",
title="Fake News Detector",
description="A simple model to classify text as fake or real news."
)
interface.launch()