Spaces:
Running
Running
Use semantic arabic model
Browse files
app.py
CHANGED
@@ -1,7 +1,12 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
# Use a pipeline as a high-level helper
|
3 |
+
from transformers import pipeline
|
4 |
|
5 |
+
pipe = pipeline("text-classification", model="CAMeL-Lab/bert-base-arabic-camelbert-mix-sentiment")
|
|
|
6 |
|
7 |
+
def analyze(message):
|
8 |
+
result = pipe(message)
|
9 |
+
return result
|
10 |
+
|
11 |
+
start = gr.Interface(fn=analyze, inputs="text", outputs="text")
|
12 |
+
start.launch(debug=True)
|