Social media analysis is a fast growing research area aimed at extracting useful information from social media. This paper presents a methodology aimed at discovering the behavior of social media users during election campaigns characterized by the competition of political parties. The methodology analyzes the posts published by social media users through an automatic incremental procedure based on feed-forward neural networks. Specifically, starting from a minimum amount of classification rules (a small subset of the hashtags that are notoriously in favor of specific factions), the methodology iteratively increases the inferred knowledge by generating new classification rules. These rules are then used to determine the polarization of social media users towards a party. The proposed methodology has been applied on a case study that analyze the polarization of a large number of Twitter users during the 2018 Italian general election. The achieved results are very close to the real ones and are significantly more accurate than the average of the opinion polls, revealing the high accuracy and effectiveness of the proposed approach.