File size: 352 Bytes
11a86bb
d76e377
 
11a86bb
d76e377
11a86bb
d76e377
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import gradio as gr
# Use a pipeline as a high-level helper
from transformers import pipeline

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

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

start = gr.Interface(fn=analyze, inputs="text", outputs="text")
start.launch(debug=True)