Update app.py
Browse files
app.py
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
pipe = pipeline("text-classification", model="CAMeL-Lab/bert-base-arabic-camelbert-mix-sentiment")
|
| 5 |
+
|
| 6 |
+
def analyze(text):
|
| 7 |
+
result = pipe(text)
|
| 8 |
+
return result
|
| 9 |
+
|
| 10 |
+
demo = gr.Interface(fn=analyze,
|
| 11 |
+
inputs="text",
|
| 12 |
+
outputs="text")
|
| 13 |
+
|
| 14 |
+
demo.launch(debug=True)
|