Truefalsenews / app.py
aymen12's picture
init
5f8bd91
raw
history blame
449 Bytes
import gradio as gr
def predict_fake_or_true_news(text):
text_tfidf = tfidf_vectorizer.transform([text])
prediction = clf.predict(text_tfidf)
return "True" if prediction[0] == 1 else "Fake"
iface = gr.Interface(
fn=predict_fake_or_true_news,
inputs="text",
outputs="text",
live=True,
title="Fake or True News Classifier",
description="Enter a news article text to classify as 'Fake' or 'True'."
)
iface.launch()