amaldevc commited on
Commit
852da30
·
verified ·
1 Parent(s): bd343e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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
- return pipe.predict(review)
 
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()