Spaces:
Sleeping
Sleeping
import gradio as gr | |
from simpletransformers.ner import NERModel | |
import string | |
model = NERModel( | |
"albert", #roberta | |
"bgk/lodosalberttr", ignore_mismatched_sizes=True, | |
use_cuda=False | |
) | |
def ner(text, model): | |
trans_table = text.maketrans('', '', string.punctuation) | |
text = " ".join(text.translate(trans_table).split()) | |
text = text.lower() | |
prediction, model_output = model.predict([text]) | |
output = prediction | |
return output | |
demo = gr.Interface(fn=ner, inputs=gr.Textbox(lines=5, placeholder='Enter your input here'), outputs=gr.Textbox(lines=10, placeholder='Sipariş dökümü'),examples=['İki pide ve iki büyük ayran istiyorum, kapıda nakit öderim, evime yollayın...' , 'Bir mantı, iki döner, üç mevsim salata, bir kola ve iki sprite istiyorum, iş yerime gönderin' ], | |
title="Söyle Gelsin", description="Yemek siparişi uygulamamızı kullanabilirsiniz...") | |
demo.launch() |