This question already has an answer here:
I'm interested in knowing what can be learned about people by analyzing the emotional content of the words they use in casual speech or writing. I've heard it being referred to as " ... analysis".
What is the name of text analysis where the person's words are analyzed based on their emotional context?
For example, statements like "life sucks" would be interpreted as negative, while "it's very helpful and I recommend it" as positive.