improved and readable

pull/652/head
Fardin 2 years ago committed by GitHub
parent ac8cb179b8
commit 0b234c2c13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1,7 @@
import random
from textblob import TextBlob
from textblob.np_extractors import ConllExtractor
extractor = ConllExtractor()
def main():
@ -21,6 +22,7 @@ def main():
user_input_blob = TextBlob(user_input, np_extractor=extractor)
np = user_input_blob.noun_phrases
response = ""
if user_input_blob.polarity <= -0.5:
response = "Oh dear, that sounds bad. "
elif user_input_blob.polarity <= 0:

Loading…
Cancel
Save