how are the stats determined?

i want to know the thought process behind the writing analysis

is there an ai that reads the entires and matches the words to certain emotions? how does it know that i’m thinking of improvement or the present? how does it decide what emotion i’m feeling?

thank you!