How is polarity calculated for a sentence ??? (in sentiment analysis)
<p>How is polarity of words in a statement are calculated....like </p>

<p>"i am successful in accomplishing the task,but in vain" </p>

<p>how each word is scored? (like - successful- 0.7 accomplishing- 0.8 but - -0.5
vain - - 0.8) 
how is it calculated ? how is each word given a value or score?? what is the thing that's going behind ? As i am doing sentiment analysis I have few thing to be clear so .that would be great if someone helps.thanks in advance </p>