Spaces:
Sleeping
Sleeping
Update app.py
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(text):
|
| 8 |
+
result = pipe(text)
|
| 9 |
+
return result
|
| 10 |
+
|
| 11 |
+
demo = gr.Interface(fn=analyze, inputs="text", outputs="text")
|
| 12 |
+
demo.launch(debug=True)
|