File size: 426 Bytes
4ad21ea 7ff1d07 4ad21ea |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
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=[inputs="text", label="input text here"],
outputs="text",
title = "sentiment")
demo.launch(debug=True) |