from transformers import pipeline import torch import gradio as gr def sentiment_predict(sentences): pipe = pipeline("sentiment-analysis", model=repository_id, device=0, return_all_scores=True) return pipe(sentences) css_code='body{background-image:url("https://media.istockphoto.com/id/1256252051/vector/people-using-online-translation-app.jpg?s=612x612&w=0&k=20&c=aa6ykHXnSwqKu31fFR6r6Y1bYMS5FMAU9yHqwwylA94=");}' demo = gr.Interface( fn=sentiment_predict, inputs= gr.Textbox(label="sentence", placeholder=" Enter the sentence "), outputs=[gr.Textbox(label="entity name")], title="Arabic Named Entity Recognition", description= "This is Arabic Named Entity Recognition System, it takes an arabian sentence as input and returns every entity name within it", css = css_code ) demo.launch()