PodcastNER / app.py
sergiopperez's picture
Create app.py
cd5a9e7
raw
history blame
495 Bytes
import gradio as gr
from transformers import pipeline
pipe = pipeline("text2text-generation", model="hackathon-somos-nlp-2023/bertin-gpt-j-6b-ner-es")
def predict(text):
return pipe(f"text: {text}, entities:")["generated_text"]
iface = gr.Interface(
fn=predict,
inputs='text',
outputs='text',
examples=[["Yo hoy voy a hablar de mujeres en el mundo del arte, porque me ha leΓ­do un libro fantΓ‘stico que se llama Historia del arte sin hombres, de Katie Hesel."]]
)
iface.launch()