Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,18 +6,16 @@ def analyze_sentiment(text):
|
|
6 |
sentiment = blob.sentiment.polarity
|
7 |
if sentiment > 0:
|
8 |
color = "green"
|
9 |
-
label = "Positive"
|
10 |
elif sentiment < 0:
|
11 |
color = "red"
|
12 |
-
label = "Negative"
|
13 |
else:
|
14 |
color = "yellow"
|
15 |
-
label = "Neutral"
|
16 |
return color, label
|
17 |
|
18 |
def sentiment_analysis(text):
|
19 |
-
color
|
20 |
-
return "<h2 style='color:{}; text-align:center;'>{} Sentiment</h2>".format(color, label)
|
|
|
21 |
|
22 |
iface = gr.Interface(
|
23 |
fn=sentiment_analysis,
|
|
|
6 |
sentiment = blob.sentiment.polarity
|
7 |
if sentiment > 0:
|
8 |
color = "green"
|
|
|
9 |
elif sentiment < 0:
|
10 |
color = "red"
|
|
|
11 |
else:
|
12 |
color = "yellow"
|
|
|
13 |
return color, label
|
14 |
|
15 |
def sentiment_analysis(text):
|
16 |
+
color = analyze_sentiment(text)
|
17 |
+
# return "<h2 style='color:{}; text-align:center;'>{} Sentiment</h2>".format(color, label)
|
18 |
+
return "<i class="fa-brands fa-font-awesome" style="color: {};"></i>".format(color, label)
|
19 |
|
20 |
iface = gr.Interface(
|
21 |
fn=sentiment_analysis,
|