delarosajav95 commited on
Commit
3637457
·
verified ·
1 Parent(s): b7594f9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -4,7 +4,7 @@ from transformers import pipeline
4
  pipe = pipeline(model="delarosajav95/tw-roberta-base-sentiment-FT-v2")
5
  #function that Gradio will use to classify
6
  def classify_text(inputs):
7
- result = pipe(inputs, top_k=None)
8
  output = []
9
  label_mapping = {"LABEL_0": "Negative", "LABEL_1": "Neutral", "LABEL_2": "Positive"}
10
  for i, predictions in enumerate(result):
@@ -26,7 +26,7 @@ iface = gr.Interface(
26
  outputs=output_box,
27
  live=True,
28
  title="Sentiment Analysis for User Opinions & Feedback",
29
- flagging_mode="never",
30
  )
31
 
32
  # Launch the interface
 
4
  pipe = pipeline(model="delarosajav95/tw-roberta-base-sentiment-FT-v2")
5
  #function that Gradio will use to classify
6
  def classify_text(inputs):
7
+ result = pipe(inputs, return_all_scores=True)
8
  output = []
9
  label_mapping = {"LABEL_0": "Negative", "LABEL_1": "Neutral", "LABEL_2": "Positive"}
10
  for i, predictions in enumerate(result):
 
26
  outputs=output_box,
27
  live=True,
28
  title="Sentiment Analysis for User Opinions & Feedback",
29
+ allow_flagging="never",
30
  )
31
 
32
  # Launch the interface