Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 {"
|
13 |
-
"
|
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.")
|