We employ the sentiment analyzer in Stanford CoreNLP (Manning et al., 2014) to do so.
we first invoke CoreNLP to output the probability of each rating in {1, 2, 3, 4, 5} for a sentence, then we take the sum of the probabilitymultiplied ratings as the sentence rating.