{'fraction_non_alphanumeric': 0.026374859708193043, 'fraction_numerical': 0.010101010101010102, 'mean_word_length': 5.0646258503401365, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Emotion and polarity prediction from Twitter

Classification of public information from microblogging and social networking services could yield interesting outcomes and insights into the social and public opinions towards different services, products, and events. Microblogging and social networking data are one of the most helpful and proper indicators of public opinion. The aim of this paper is to classify tweets to their classes using cross validation and partitioning the data across cities using supervised machine learning algorithms. Such an approach was used to collect real time Twitter microblogging data tweets towards mentioning iPad and iPhone in different locations in order to analyse and classify data in terms of polarity: positive or negative, and emotion: anger, joy, sadness, disgust, fear, and surprise. We have collected over eighty thousand tweets that have been pre-processed to generate document level ground truth and labelled according to Emotion and Polarity. We also compared some approaches in order to measures the performance of K-NN, Nave Bayes, and SVM classifiers. We found that the K-NN, Nave Bayes, SVM, and ZeroR have a reasonable accuracy rates, however, the K-NN has outperformed the Nave Bayes, SVM, and ZeroR based on the achieved accuracy rates and trained model time. The K-NN has achieved the highest accuracy rates 96.58% and 99.94% for the iPad and iPhone emotion data sets using cross validation technique respectively. Regarding partitioning the data per city, the K-NN has achieved the highest accuracy rates 98.8% and 99.95% for the iPad and iPhone emotion data sets respectively. Regarding the polarity data sets using both cross validation and partitioning data per city, the K-NN achieved 100% for the all polarity datasets.