Jeffrey Rathgeber Jr commited on
Commit
5e3871d
·
unverified ·
1 Parent(s): 23ec77b

te3sblob test again

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
- sentiment = TextBlob(textIn).sentiment
 
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 has a subjectivity score of ', sentiment, ' and a polarity score of ', polarity)
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