AjayPlus's picture
Upload 4 files
8bbef8b verified
raw
history blame contribute delete
426 Bytes
import gradio as gr
from transformers import pipeline
clf = pipeline("text-classification", model="AjayPlus/propaganda-detector-v2")
def predict(text):
return clf(text)
with gr.Blocks() as demo:
with gr.Row():
input_text = gr.Textbox(label="Enter a sentence")
output_json = gr.JSON(label="Prediction")
input_text.submit(predict, input_text, output_json)
demo.queue()
demo.launch(show_api=True)