Spaces:
Runtime error
Runtime error
Jeffrey Rathgeber Jr
commited on
te3sblob test again
Browse files
app.py
CHANGED
|
@@ -18,7 +18,8 @@ st.write('According to Pipeline, input text is ', preds[0]['label'], ' with a co
|
|
| 18 |
|
| 19 |
# textblob
|
| 20 |
polarity = TextBlob(textIn).sentiment.polarity
|
| 21 |
-
|
|
|
|
| 22 |
if polarity < 0:
|
| 23 |
sentiment = 'Negative'
|
| 24 |
elif polarity == 0:
|
|
@@ -26,5 +27,5 @@ elif polarity == 0:
|
|
| 26 |
else:
|
| 27 |
sentiment = 'Positive'
|
| 28 |
|
| 29 |
-
st.write('According to textblob, input text
|
| 30 |
|
|
|
|
| 18 |
|
| 19 |
# textblob
|
| 20 |
polarity = TextBlob(textIn).sentiment.polarity
|
| 21 |
+
subjectvitity = TextBlob(textIn).sentiment.subjectivity
|
| 22 |
+
sentiment = ''
|
| 23 |
if polarity < 0:
|
| 24 |
sentiment = 'Negative'
|
| 25 |
elif polarity == 0:
|
|
|
|
| 27 |
else:
|
| 28 |
sentiment = 'Positive'
|
| 29 |
|
| 30 |
+
st.write('According to textblob, input text is ', sentiment, ' and a subjectvitity score (from 0 being objective to 1 being subjective) of ', subjectvitity)
|
| 31 |
|