SarahMarzouq's picture
Update app.py
eb28c00 verified
raw
history blame
735 Bytes
import gradio as gr
#This is a pipeline for text classification using the Arabic MARBERT model for news article classification from Hugging Face.
Clasification = pipeline('text-classification', model='Ammar-alhaj-ali/arabic-MARBERT-news-article-classification')
#This function will take and input then return the label and the score of that sentence.
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()