Delete app.py
Browse files
app.py
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
#This is a pipeline for text classification using the Arabic MARBERT model for news article classification from Hugging Face.
|
3 |
-
Clasification = pipeline('text-classification', model='Ammar-alhaj-ali/arabic-MARBERT-news-article-classification')
|
4 |
-
#This function will take and input then return the label and the score of that sentence.
|
5 |
-
def classification_fun(news_article):
|
6 |
-
results = Clasification(news_article)
|
7 |
-
return results[0]['label'], results[0]['score']
|
8 |
-
|
9 |
-
my_model = gr.Interface(
|
10 |
-
fn=classification_fun,
|
11 |
-
inputs=gr.Textbox(label="News Articles", lines=10, placeholder="Enter your Article"),
|
12 |
-
outputs=[gr.Textbox(label="Label of the Article"), gr.Number(label="Confidence Score")],
|
13 |
-
)
|
14 |
-
|
15 |
-
my_model.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|