Friday, March 11, 2022

Sentiment Analysis

# Positive_Words.py and Negative_Words.py saved in Drive\Resources

from Positive_Words import P

from Negative_Words import N


s1 = "It is easy to use. It took less than a week to understand where everything is in the software. Their customer success team is amazing and there's always someone available for their support team on live chat to help you."

s2 = "The mobile app can be really glitchy and is definitely not user friendly. AmericanAir just landed 3 hours late. Now twenty more minutes at the gate. I have patience but none for incompetence."

s3 = "I've had multiple conversations with your customer support team and they are absolutely worthless. No one has been able to address my issue or process the refund I was promised."

s4 = "There isn't enough focus on solving user problems. The foldable phone (more an expandable tablet), is nice for marketing, but doesn't address major user needs."

s5 = "I love how Zapier takes different apps and ties them together. I still need to further test Zapier to say if its useful for me or not. Zapier is so confusing to me."

s6 = "The older interface was much simpler. Awful experience. I would never buy this product again! I don't think there is anything I really dislike about the product."

s7 = "Hubspot makes my day a lot easier. Your customer service is a nightmare! Totally useless!!"

s = ''

punc = ".!?"


for i in s1:

  if i not in punc:

    s += i


L = s.split()

pos, neg = [], []


for i in L:

  if i in P:

    pos.append(i)

  if i in N:

    neg.append(i)


print(pos)

print(len(pos), "positives\n")

print(neg)

print(len(neg), "negatives")


No comments:

Post a Comment