|
import gradio as gr |
|
|
|
Clasification = pipeline('text-classification', model='Ammar-alhaj-ali/arabic-MARBERT-news-article-classification') |
|
|
|
def classification_fun(news_article): |
|
results = Clasification(news_article) |
|
return results[0]['label'], results[0]['score'] |
|
|
|
my_model = gr.Interface( |
|
fn=classification_fun, |
|
inputs=gr.Textbox(label="News Articles", lines=10, placeholder="Enter your Article"), |
|
outputs=[gr.Textbox(label="Label of the Article"), gr.Number(label="Confidence Score")], |
|
) |
|
|
|
my_model.launch() |