Quantifying changes in societal optimism from online sentiment