Modeling individual and collective opinion in online social networks