Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,8 @@ from transformers import pipeline
|
|
4 |
pipe = pipeline(task="sentiment-analysis", model="amaldevc/nlp_sentiment")
|
5 |
|
6 |
def predict(review):
|
7 |
-
|
|
|
8 |
|
9 |
iface = gr.Interface(fn=predict, inputs="text", outputs="text")
|
10 |
iface.launch()
|
|
|
4 |
pipe = pipeline(task="sentiment-analysis", model="amaldevc/nlp_sentiment")
|
5 |
|
6 |
def predict(review):
|
7 |
+
pred = pipe.predict(review)
|
8 |
+
return p["label"] + " with score " + p["score"]
|
9 |
|
10 |
iface = gr.Interface(fn=predict, inputs="text", outputs="text")
|
11 |
iface.launch()
|