ananthujay commited on
Commit
4785802
·
1 Parent(s): e03bf74

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -5,8 +5,8 @@ nlp = pipeline("sentiment-analysis")
5
 
6
  def scoring(text):
7
  results = nlp(text)
8
- sentiment = results[0]['label'] # Get the sentiment label (e.g., 'LABEL_1' or 'LABEL_2')
9
- score = results[0]['score'] # Get the sentiment score
10
  return f"Sentiment: {sentiment}, Score: {score}"
11
 
12
  iface = gr.Interface(fn=scoring, inputs="text", outputs="text")
 
5
 
6
  def scoring(text):
7
  results = nlp(text)
8
+ sentiment = results[0]['label']
9
+ score = results[0]['score']
10
  return f"Sentiment: {sentiment}, Score: {score}"
11
 
12
  iface = gr.Interface(fn=scoring, inputs="text", outputs="text")