guychuk commited on
Commit
135ca0b
·
verified ·
1 Parent(s): 105edba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -9,8 +9,8 @@ model2 = pipeline("sentiment-analysis", model="mr8488/distilroberta-finetuned-fi
9
  def analyze_sentiment(input_text):
10
  result1 = model1(input_text)[0]
11
  result2 = model2(input_text)[0]
12
- return {"Model 1": f"{result1['label']} ({result1['score']:.2f})",
13
- "Model 2": f"{result2['label']} ({result2['score']:.2f})"}
14
 
15
  # Create the Gradio interface
16
  iface = gr.Interface(fn=analyze_sentiment, inputs="text", outputs="text", title="Sentiment Analysis", description="Enter a sentence to analyze its sentiment using two different models.")
 
9
  def analyze_sentiment(input_text):
10
  result1 = model1(input_text)[0]
11
  result2 = model2(input_text)[0]
12
+ return {"mrm8488": f"{result1['label']} ({result1['score']:.2f})",
13
+ "mr8488": f"{result2['label']} ({result2['score']:.2f})"}
14
 
15
  # Create the Gradio interface
16
  iface = gr.Interface(fn=analyze_sentiment, inputs="text", outputs="text", title="Sentiment Analysis", description="Enter a sentence to analyze its sentiment using two different models.")