File size: 475 Bytes
a35c507
a542a96
a35c507
 
a542a96
 
 
 
 
 
 
db4b82e
 
929741d
a542a96
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
from transformers import pipeline


pipe = pipeline("text-classification", model="CAMeL-Lab/bert-base-arabic-camelbert-mix-sentiment")

def analyze(text):
    result = pipe(text)
    return result

demo = gr.Interface(fn=analyze,
                    inputs=gr.Textbox([label="أدخل النص هنا"]),
                    outputs=gr.Textbox([label='النتائج']),
                    title = "تصتنيف المشاعر")

demo.launch(debug=True)