DanielDDDS's picture
Update app.py
635e373 verified
raw
history blame contribute delete
725 Bytes
import gradio as gr
from transformers import pipeline
pipe = pipeline(
"token-classification",
model="DanielDDDS/hebrew-recipe-modification-ner",
aggregation_strategy="simple"
)
def predict(text):
if isinstance(text, list):
text = text[0]
preds = pipe(text)
return {"results": preds}
demo = gr.Interface(
fn=predict,
inputs=gr.Textbox(label="Hebrew comment", placeholder="ืืคืฉืจ ืœื”ื—ืœื™ืฃ ื—ืžืื” ื‘ืฉืžืŸ ืงื•ืงื•ืก"),
outputs="json",
title="Hebrew Recipe Modification Extractor",
description="Extract recipe modifications from Hebrew YouTube comments",
api_name="predict" # <--- this line forces the endpoint name
)
demo.queue(max_size=10).launch()