File size: 467 Bytes
ea35547 329d2d4 df79284 ea35547 329d2d4 df79284 329d2d4 df79284 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import gradio as gr
from transformers import pipeline
pipe = pipeline("text-classification", model="hackathon-pln-es/electricidad-base-generator-fake-news")
def predict(text):
return pipe(text)[0]["text-classification_text"]
title = "Detección de FakeNews en Español"
iface = gr.Interface(
fn=predict,
inputs=[gr.inputs.Textbox(label="text", lines=3)],
outputs='text',
title=title,
examples=[["España desaparece"]]
)
iface.launch(debug=True)
|