Spaces:
Runtime error
Runtime error
Update sentiment-analyser.py
Browse files- sentiment-analyser.py +6 -6
sentiment-analyser.py
CHANGED
@@ -28,10 +28,10 @@ if submit:
|
|
28 |
# st.write(str(resultf[0]['label']) + ": " + str(resultf[0]['score']))
|
29 |
# st.write(str(resultf[1]['label']) + ": " + str(resultf[1]['score']))
|
30 |
# st.write(str(resultf[2]['label']) + ": " + str(resultf[2]['score']))
|
|
|
|
|
|
|
|
|
|
|
31 |
else:
|
32 |
-
label
|
33 |
-
score = resultf[0]['score']
|
34 |
-
if (label == 'POSITIVE') or (label =='Positive') or (label =='positive'):
|
35 |
-
st.success(f'{label} sentiment (score: {score})')
|
36 |
-
else:
|
37 |
-
st.error(f'{label} sentiment (score: {score})')
|
|
|
28 |
# st.write(str(resultf[0]['label']) + ": " + str(resultf[0]['score']))
|
29 |
# st.write(str(resultf[1]['label']) + ": " + str(resultf[1]['score']))
|
30 |
# st.write(str(resultf[2]['label']) + ": " + str(resultf[2]['score']))
|
31 |
+
# else:
|
32 |
+
label = resultf[0]['label']
|
33 |
+
score = resultf[0]['score']
|
34 |
+
if (label == 'POSITIVE') or (label =='Positive') or (label =='positive'):
|
35 |
+
st.success(f'{label} sentiment (score: {score})')
|
36 |
else:
|
37 |
+
st.error(f'{label} sentiment (score: {score})')
|
|
|
|
|
|
|
|
|
|