CIAZIZ commited on
Commit
d76e377
·
verified ·
1 Parent(s): 11a86bb

Use semantic arabic model

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -1,7 +1,12 @@
1
  import gradio as gr
 
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- demo.launch()
 
 
 
 
 
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)