Many approaches to automatic sentiment analysis begin with a large lexicon of words marked with their prior polarity (also called semantic orientation).
the contextual polarity of the phrase in which a particular instance of a word appears may be quite different from the word's prior polarity.