2017-04-22 17:28:00 -05:00

18 lines
412 B
Python

import sys
from textblob import TextBlob
def get_stdin():
buf = ""
for line in sys.stdin:
buf = buf + line
return buf
if(__name__ == "__main__"):
st = get_stdin()
blob = TextBlob(st)
out =""
for sentence in blob.sentences:
out = out + "Polarity: " + str(sentence.sentiment.polarity) + " Subjectivity: " + str(sentence.sentiment.subjectivity) + "\n"
print(out)