multiplying it by the log of the number of times (sentences)
This is used to account for the fact that manifestos will be a different size. Taking the log means that manifstos with more sentences arent necessarily shown as having higher sentiment. For example, manifesto A has 4 sentences all positive on on 'defence' but manifesto B has 100 sentences and 60 of them are positives on defence. If you didnt take the log, it would seem like manifesto B was more positive towarss defence.