Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
|
5 |
-
"text-
|
6 |
)
|
7 |
|
8 |
|
9 |
def predict_sentiment(text):
|
10 |
-
return
|
11 |
|
12 |
|
13 |
with gr.Blocks() as demo:
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
classifier = pipeline(
|
5 |
+
"text-classification", model="rasyosef/roberta-base-finetuned-sst2"
|
6 |
)
|
7 |
|
8 |
|
9 |
def predict_sentiment(text):
|
10 |
+
return classifier(text)[0]
|
11 |
|
12 |
|
13 |
with gr.Blocks() as demo:
|