scieee AI-readable full text Open interactive document viewer

Mètriques per a la detecció d'esdeveniments en app reviews

Moonsammy, Leandra

Abstract

User reviews in app stores contain valuable user feedback useful for app developers and stakeholders. However, it is impractical to manually read this high-volume data as popular apps can receive thousands of reviews per day. This master's thesis proposes a machine learning pipeline for automatically detecting significant software-based events from user reviews of mobile apps. The pipeline involves preprocessing raw reviews, aggregating data weekly, extracting relevant metrics like review count, rating, polarity, and count and percentage of negative, neutral and positive reviews, as well as training machine learning classifiers on two manually annotated truth sets to identify events from 10 microblogging Android apps spanning one year. Each model was trained on two truth sets: reviews of all ratings and positively-rated reviews only. Out of four trained models: Multilayer Perceptron, Naive Bayes, Support Vector Machines and Random Forest, the Multilayer Perceptron and Random Forest models achieved high F1 scores of 97\% and 93\% on the all ratings truth set and 53\% and 87\% on the positive only truth set respectively. Through qualitative assessment via summarization, the detected events provided actionable insights for app developers about bugs, performance issues, feature requests, and user feedback. The findings demonstrate the effectiveness of leveraging machine learning techniques for extracting valuable information from large volumes of app reviews to support development efforts.

Full text

id187531   MÈTRIQUES PER A LA DETECCIÓ D'ESDEVENIMENTS EN APP REVIEWS LEANDRA MOONSAMMY Thesis supervisor QUIMMOTGERDELAENCARNACION(DepartmentofServiceandInformationSystemEngineering) Degree Master'sDegreeinDataScience Master's thesis Facultat d'Informàtica de Barcelona (FIB) Universitat Politècnica de Catalunya (UPC) - BarcelonaTech 02/07/2024  Abstract User reviews in app stores contain valuable user feedback useful for app developers and stakeholders. However, it is impractical to manually read this high-volume data as popular apps can receive thousands of reviews per day. This master’s thesis proposes a machine learning pipeline for automatically detecting significant software-based events from user reviews of mobile apps. The pipeline involves preprocessing raw reviews, aggregating data weekly, extracting relevant metrics like review count, rating, polarity, and count and percentage of negative, neutral and positive reviews, as well as training machine learning classifiers on two manually annotated truth sets to identify events from 10 microblogging Android apps spanning one year. Each model was trained on two truth sets: reviews of all ratings and positively-rated reviews only. Out of four trained models: Multilayer Perceptron, Naive Bayes, Support Vector Machines and Random Forest, the Multilayer Perceptron and Random Forest models achieved high F1 scores of 97% and 93% on the all ratings truth set and 53% and 87% on the positive only truth set respectively. Through qualitative assessment via summarization, the detected events provided actionable insights for app developers about bugs, performance issues, feature requests, and user feedback. The findings demonstrate the effectiveness of leveraging machine learning techniques for extracting valuable information from large volumes of app reviews to support development efforts. Keywords: mobile apps ·market analysis ·machine learning ·user reviews ·event detection ·microblogging Contents Abstract i 1 Introduction 1 1.1 Motivation................................... 1 1.2 Maincontributions .............................. 2 1.3 Thesisorganization.............................. 3 2 Background 5 2.1 Machine learning software system design . . . . . . . . . . . . . . . . . . 5 2.1.1 Statistical models . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1.2 Deep learning models . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.2 Evaluation................................... 13 2.3 Deployment .................................. 15 2.3.1 Virtual machine deployment . . . . . . . . . . . . . . . . . . . . . 15 2.3.2 Container deployment . . . . . . . . . . . . . . . . . . . . . . . . 16 3 Research method 17 3.1 Goal and Research questions . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.2 ResearchPlan................................. 18 4 State of the art review 20 4.1 Review-based event detection . . . . . . . . . . . . . . . . . . . . . . . . 22 4.2 Review-based competition analysis . . . . . . . . . . . . . . . . . . . . . 26 i 5 System design 30 5.1 Taskdefinition ................................ 30 5.2 PipelineOverview............................... 30 5.3 Datapreprocessing .............................. 31 5.4 Dataaggregation ............................... 33 5.5 Metricextraction ............................... 33 5.6 EventDetection................................ 36 6 Evaluation methodology 38 6.1 Datasetdescription.............................. 38 6.2 TruthSetAnnotation............................. 40 6.3 Evaluation................................... 44 7 Results and analysis 45 7.1 Descriptive feature analysis . . . . . . . . . . . . . . . . . . . . . . . . . 45 7.2 Event detection performance . . . . . . . . . . . . . . . . . . . . . . . . . 47 7.3 Qualitative assessment using summarization . . . . . . . . . . . . . . . . 52 7.3.1 Testset ................................ 52 7.3.2 Inference................................ 55 8 Discussion 60 9 Conclusions 65 9.1 Threatstovalidity .............................. 65 9.2 Futurework.................................. 66 9.3 Conclusion................................... 67 Appendix 72 ii List of Figures 2.1 Five-fold cross validation [15] . . . . . . . . . . . . . . . . . . . . . . . . 7 2.2 Decision tree for differentiating between animals [15] . . . . . . . . . . . 8 2.3 Two-class classification dataset in which classes are not linearly separable [15]....................................... 10 2.4 Two-class classification dataset in three-dimensional scatter plot [15] . . . 10 2.5 MLP with a single hidden layer [15] . . . . . . . . . . . . . . . . . . . . . 12 2.6 The hyperbolic tangent activation function and the rectified linear activationfunction[15] ............................... 13 3.1 Gantt chart for the thesis research plan . . . . . . . . . . . . . . . . . . . 18 5.1 System design of the pipeline . . . . . . . . . . . . . . . . . . . . . . . . 31 5.2 Example of preprocessing steps applied to a review . . . . . . . . . . . . 37 7.1 All ratings truth set: MLP Confusion Matrix and ROC curve . . . . . . . 49 7.2 Random Forest feature importance for both truth sets . . . . . . . . . . . 51 1 Mean and standard deviation bar plot of both truth sets . . . . . . . . . 72 2Correlation heatmap of both truth sets: Visualizes the pairwise correlations between features, with darker shades indicating stronger positive (red) or negative (blue) correlations. The diagonal elements represent the correlation of each feature with itself, which is always 1. . . . . . . . . . . 73 3All ratings truth set: Histogram distribution of features. The xaxis represents the feature values, while the y-axis shows the count of data pointforeachvalue. ............................. 74 iii 4 Positive truth set: Histogram distribution of features. . . . . . . . . . . 75 5All ratings truth set: Box plot of features displaying the median (central line), interquartile range (box), and outliers (individual points). The box represents the middle 50% of the data, while the whiskers extend to the minimum and maximum values, excluding outliers. . . . . . . . . . 76 6 Positive truth set: Box plot of features . . . . . . . . . . . . . . . . . . . 77 7All ratings truth set: Pairs plot of features providing a matrix of scatter plots to display the pairwise relationships between features. The diagonal elements display the univariate distribution of each feature. . . . 78 8 Positive truth set: Pairs plot of features . . . . . . . . . . . . . . . . . . 79 9 All ratings truth set: MLP Confusion Matrix and ROC curve . . . . . . . 80 10 Positive truth set: MLP Confusion Matrix and ROC curve . . . . . . . . 80 11 All ratings truth set: SVM Confusion Matrix and ROC curve . . . . . . . 81 12 Positive truth set: SVM Confusion Matrix and ROC curve . . . . . . . . 81 13 All ratings truth set: Random forest Confusion Matrix and ROC curve . 82 14 Positive truth set: Random forest Confusion Matrix and ROC curve . . . 82 15 All ratings truth set: Naive Bayes Confusion Matrix and ROC curve . . . 83 16 Positive truth set: Naive Bayes Confusion Matrix and ROC curve . . . . 83 17 Random Forest feature importance for both truth sets . . . . . . . . . . . 84 18 MLP learning curve for both truth sets . . . . . . . . . . . . . . . . . . . 85 19 SVM learning curve for both truth sets . . . . . . . . . . . . . . . . . . . 86 20 Random forest learning curve for both truth sets . . . . . . . . . . . . . . 87 21 Naive Bayes learning curve for both truth sets . . . . . . . . . . . . . . . 88 iv List of Tables 2.1 Kernel functions and their respective formulas . . . . . . . . . . . . . . . 11 4.1 Best performing classifiers and their usage in papers . . . . . . . . . . . . 23 4.2 Most frequently used metrics in papers . . . . . . . . . . . . . . . . . . . 25 4.3 Most frequently used data preprocessing techniques in papers . . . . . . 26 6.1 Number of reviews for each app in the dataset . . . . . . . . . . . . . . . 39 6.2 Number of Annotated Events and Non-events . . . . . . . . . . . . . . . 42 7.1 All Ratings Truth Set: Summary Statistics of Features . . . . . . . . . . 46 7.2 Positive Truth Set: Summary Statistics of Features . . . . . . . . . . . . 47 7.3 Best parameters for each classifier chosen through grid search . . . . . . 48 7.4 Results displaying performance scores per truth set . . . . . . . . . . . . 49 v Chapter 1 Introduction 1.1 Motivation We live in the digital age. A person without a smartphone is seldom found in today’s society. With the rise of smartphones, mobile applications (from this point forward referred to as ”apps”) have become part of daily life. These apps have to be constantly maintained and updated to ensure their success and to keep up with changes in the app market, a market that earns millions of dollars in revenue [13]. App developers constantly look for ways to improve their apps and gain an advantage over their competitors. One of the most relevant ways to do this is to leverage the research and scientific area of feedback analysis to gain insights from users [9, 4], the people using the app directly. According to Stronstad et al., if feedback from reviews is implemented, there is a 77% probability of increasing the app ratings [18], and therefore, user satisfaction with the app. This is significant to app developers as users are not likely to download an app if it has an average rating that is less than 3 stars [1]. App stores such as the Google Play Store1and the Apple App Store2host over 5 million apps [5] and provide mediums for direct user feedback. However, the volume of reviews received on a daily basis can be very high, especially for popular applications that can receive thousands of reviews per day [18] (i.e. Facebook receives more than 10,000 1https://play.google.com/store/games?hl=en&pli=1 2https://www.apple.com/app-store/ 1 reviews in Google Play per day [7]). According to Chen et al., only 35% of reviews contain useful information for developers, therefore it is impractical to manually read each review to determine what is happening with an application [8, 4]. Therefore, automatically analyzing user reviews is an open research problem [4]. It is a very complex task since it involves textual data, which can commonly contain noise such as non-English words, repetitive words, and misspelled words [7]. Such tasks require data-mining and Natural Language Processing (NLP) techniques. Numerous research has aimed to address this challenge by classifying individual reviews into categories such as feature request, bug report or other (e.g. [12, 9, 17, 19]). However, there are still some issues that may be overlooked, and therefore human in the loop is needed. These techniques may also not be sufficient for specific types of events or information not modelled at design time. This master’s thesis aims to address this research problem by proposing a pipeline to reduce the scope of data by automatically analyzing user reviews and identifying significant events using machine learning.3Two recent studies in this field are employed (i.e. [18, 14]) and one of them uses machine learning [18]. Detecting events requires the data to be aggregated by a time granularity (i.e. daily, weekly, monthly, etc.) for which metrics are extracted (e.g. review count, review ratings, review polarity, etc.) to train a machine learning classifier. Considering a weekly time granularity as in the case of this master’s thesis, an event is defined by Stronstad et al. [18] as follows: An event is a weekly aggregate of user reviews where the metric statistics indicate that the reviews may contain important insights for application developers or product owners, such as highly desired feature requests or commonly reported issues, which should be included in the product backlog due to their significance. These weeks are referred to as events. 1.2 Main contributions The main contributions of this master’s thesis are: 3Source code is available at: https://github.com/lmoonsammy/TFM-Moonsammy-2024.git 2 Ensemble of Decision Trees Machine learning models can also be combined to create more robust models, called ensembles. Random Forests consist of multiple decision trees. In the random forests model, each tree is unique, and therefore it mitigates the overfitting issue of a single decision tree since results are averaged. It is one of the most commonly used machine learning algorithms, often performing well without extensive parameter tuning, and does not require scaling of the data. However, they do not perform as well with high-dimensional sparse data, unlike Naive Bayes. In order to build the classifier the number of trees has to be decided. A bootstrap sample of the data is taken, where samples are drawn randomly with replacement. Therefore the dataset will be as large as the original, but it will not contain about one-third of the data. Bagging (i.e. bootstrap aggregating) consists of training multiple models on different bootstrapped samples to improve the predictions. Instead of considering all features in each node when creating a decision tree, a random subset of features is considered. The default value of the maximum number of features in scitkit-learn3is the square root of the number of features for classification and log2of the number of features for regression. This is repeated in each node, allowing different random subsets to be used. This ensures that all trees in the random forest are unique. This randomness allows the model to consider much more possibilities than a single tree alone. Each tree in the random forest makes a ”soft prediction” indicating the probability of each outcome label. For classification, the average of the probabilities are taken and the class with the highest probability is predicted [15]. For regression, the probabilities are averaged to get the final prediction. Support Vector Machines (SVMs) Linear models, which are models that predict using a linear function of the input features, can be used for both regression and classification. For classification, the linear binary classifier aims to separate the two classes using a line, plane or hyperplane, called the 3https://scikit-learn.org/stable/modules/generated/sklearn.ensemble. RandomForestClassifier.html 9 decision boundary. One of the most common algorithms is linear support vector machines. However, this approach is very limited as the data may not be linearly separable (example displayed in Figure 2.3). Figure 2.3: Two-class classification dataset in which classes are not linearly separable [15] Mapping the data in a higher dimension allows the data to be separated as shown in Figure 2.4. However, this approach is costly computationally and it is hard to know how many features need to be created from the existing ones. Kernelized SVMs aim to solve this issue using the kernel trick which allows the classifier to learn the data in a higher-dimensional space without having to compute the new, very large representation [15]. Kernel functions give the similarity between the data points that have been modified with new features, without having to compute the additional features. Figure 2.4: Two-class classification dataset in three-dimensional scatter plot [15] The most common kernel functions are displayed in Table 2.1. The polynomial kernel calculates all possible polynomials up to a specific degree of the original features. The radial basis function (RBF) kernel (the Gaussian kernel) represents an infinite-dimensional 10 Kernel function Dimensions Formula Linear Same as original space (identity function) k(x,y) = ⟨x,y⟩ Polynomial m+d d(m: original space dimension, d: the degree of the polynomial) k(x,y)=(c+⟨x,y⟩)d Radial Basis Functions Infinite k(x,y) = exp −∥x−y∥2 2σ2with σ > 0 Table 2.1: Kernel functions and their respective formulas feature space and considers polynomials of every degree, although the importance of the features decreases for higher degrees. The SVM learns the importance of each training data point to represent the decision boundary that separates the two classes. The training points that lie on the border between classes are called support vectors. To make a prediction, the algorithm calculates the distance between the new data point and each of the support vectors. The classification decision is then made by combining these distances with the importance of the support vectors, which was determined during the training phase. The kernelized SVMs implemented in scitkit-learn4involve two parameters: gamma (1 divided by number of features by default) which controls the width of the Gaussian kernel to determine the scale of measuring the closeness of points, and C (1 by default) which is a regularization parameter that limits the importance of each point [15]. Therefore, a small gamma parameter results in models of low complexity and smooth decision boundaries, and a small Cparameter results in a restrictive model where the influence of data points is limited. SVMs often perform well on both high and low-dimensional data, however they are very sensitive to parameter tuning and the scale of data. As a resolution, data is commonly normalized, which is re-scaling the data between 0 and 1). 4https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html 11 2.1.2 Deep learning models Neural Networks Neural Networks, commonly known as deep learning, are known as the state-of-the-art in machine learning performance and one of the best performing algorithms, once tuned correctly. They are effective in many machine learning tasks, however they need to be customized for each use case to achieve optimal performance. Neural networks can learn valuable information from high volume data because of their ability to have very complex models, however, this also requires longer training times. Neural networks are also sensitive to the scaling of the data and expect the features to have similar patterns of variation. Therefore, standardization is usually done which re-scales the data to have a mean of 0 and a variance of 1. This thesis focuses on multilayer perceptrons (MLPs), vanilla feed-forward neural networks for classification. This model has weights (set randomly then learned from the data) between every input and every hidden unit (makes up the hidden layer) and one between every unit in the hidden layer and the output [15]. A diagram of a MLP with a single hidden layer is displayed in Figure 2.5. Figure 2.5: MLP with a single hidden layer [15] The rectified linear unit (ReLU or rectifying nonlinearity) or the tangens hyperbolicus (tanh) is applied to the result of the weighted sum for each hidden unit. The result is then used in the weighted sum that computes the output, ˆy. These two functions allow 12 the MLP to learn more complex functions than a linear model and are displayed in Figure 2.6. ReLU cuts off values below 0, while tanh saturates to -1 and +1 for low and high input values respectively. In the implementation of scitkit-learn5, the ReLU function is used by default and the number of nodes in the hidden layer (100 by default) is an important parameter set by the user. Having a high number of nodes in the hidden layer as well as multiple hidden layers allows for the model to handle more complex data. The complexity of a neural network can be controlled by using a l2 penalty as a form of regularization to shrink the weights towards zero. This is the (alpha parameter which is 0.0001 by default. The default algorithm used is adam which works well in general but is sensitive to data scaling. Some other algorithms are lbfgs which is robust but may take longer training times, and sgd which has many additional parameters. Figure 2.6: The hyperbolic tangent activation function and the rectified linear activation function [15] 2.2 Evaluation There are several metrics that are used to evaluate the performance of a binary classification model, the ones used in this thesis are defined in this section. Common notations used are true positive (TP), true negative (TN), false positive (FP) and false negative (FP). In binary classification, there is a positive and negative class. The positive class is the desired outcome. In the case of this thesis, the task is a binary classification to classify 5https://scikit-learn.org/stable/modules/generated/sklearn.neural_network. MLPClassifier.html 13 a set of reviews as an event (positive), or a non-event (negative). ”True” indicates that the data point was classified correctly, while ”false” indicates that it was not classified correctly. One of the most commonly used metrics is accuracy. This refers to the count of correct predictions divided by the count of all samples as displayed in Equation 2.1. Accuracy = TP + TN TP + TN + FP + FN (2.1) Precision (also known as positive predictive value (PPV)) measures how many of the predicted positive samples are indeed positive and is defined in Equation 2.2. This is useful when limiting the false positives is crucial. For example, when predicting whether a new drug will be effective in treating a disease in clinical trials, this model would need a high precision [15]. Precision = TP TP + FP (2.2) Alternatively, recall (also known as sensitivity, hit rate, or true positive rate (TPR)) measures how many of the positive samples are included in the positive predictions and is defined in Equation 2.3. This is particularly useful when false negatives need to be avoided, as in the case of diagnosing cancer patients. A false negative would be fatal as it is crucial to identify all cancer patients. Recall = TP TP + FN (2.3) The f-measure (also known as f1-score) measures the harmonic mean of precision and recall. According to Berry et al., weighting precision and recall proved to be a better evaluation metric than an unweighted f-measure or precision alone [2]. This is defined in Equation 2.4. The f-measure is often the best metric to use when dealing with unbalanced datasets as it summarizes both precision and recall. F-measure = 2·precision ·recall precision + recall (2.4) 14 The receiver operating characteristics curve (ROC curve) is a visual metric that shows the false positive rate (FPR) against the recall (true positive rate (TPR)). The false positive rate is the number of false positives out of all negative samples. The ideal ROC curve has high recall while keeping a low false positive rate, which produces a curve close to the top left of the plot. The area under the ROC curve (AUC) allows the ROC curve to be summarized into a single number by evaluating the probability that a positive class randomly picked will have a higher score than a negative class randomly picked. A perfect score of 1 means that all positive points have a higher score. AUC is also a good metric for unbalanced datasets. 2.3 Deployment Once a machine learning model has been trained and evaluated, it needs to be deployed in a production environment to serve predictions to end-users or systems. Models are frequently deployed through placing the model on server(s), making it available as a Representational State Transfer application programming interface (REST API ) in the form of a web service, or Google’s Remote Procedure Call (gRPC) service [3]. 2.3.1 Virtual machine deployment A common approach is to deploy the model as a web service on a virtual machine in a cloud environment. The user request containing the input data is received, the machine learning system is called on that input data, and the output of the machine learning system is transformed into the output JavaScript Object Notation (JSON) or Extensible Markup Language (XML) string [3]. A load balancer distributes incoming requests across multiple virtual machines (running in parallel) to handle high loads. Virtual machines can be added or removed manually or through an autoscaling group that adjusts the number of instances based on demand. In Python, a web application framework like Flask6or FastAPI 7is typically used to implement a REST API web service. 6https://flask.palletsprojects.com/en/3.0.x/ 7https://fastapi.tiangolo.com/ 15 The architecture of the software system is simple, however, it comes with the overhead of maintaining servers (physical or virtual) and the computational overhead of running multiple operating systems in a virtualized environment. Network latency and higher costs compared to other deployment options are additional drawbacks. 2.3.2 Container deployment A more modern and resource-efficient approach is to deploy the model in a containerized environment [3]. Containers provide an isolated runtime environment while sharing the host operating system, unlike virtual machines that run their own operating system instances. The model and web service are packaged into a container, typically a Docker8 container, which is then orchestrated across a cluster of physical or virtual servers using a container orchestration system like Kubernetes9. Deployment in a container has the advantage of being more resource-efficient compared to deployment on a virtual machine [3]. It allows the possibility to automatically scale with scoring requests and enables the scale-to-zero concept. The idea of scale-to-zero is that a container can be reduced to zero replicas when idle and brought back up if there is a request to serve, leading to lower resource consumption and cost savings [3]. One drawback is that containerized deployment is generally seen as more complicated and requires expertise in container technologies [3]. However, it offers benefits in terms of resource efficiency, scalability, and cost optimization, making it a popular choice for deploying machine learning models in production environments. 8https://www.docker.com/ 9https://kubernetes.io/ 16 Chapter 3 Research method 3.1 Goal and Research questions The goal of this project is to automatically detect app-related events through machine learning techniques by developing a machine learning software system based on reviewbased metrics from mobile app marketplaces. These metrics are based on statistical measures such as frequency of publication, review length, polarity, rating, number and percentage of negative, positive, and neutral user reviews (based on sentiment), number and percentage of negative-rating reviews and number and percentage of positive-rating reviews. The system will integrate, expose and deploy multiple ML models for finetuning, evaluation and model inference, using a self-annotated data set of relevant events within the microblogging app market. The research questions are defined as follows: RQ1. How accurately can important events related to app issues and features be detected from app reviews using machine learning? RQ2. How does a machine learning approach for event detection compare with a statistical approach with respect to its effectiveness? RQ3. How does the rating of reviews affect the performance of event detection? In order to answer these research questions, the objectives are as follows: 17 A. To research the state of the art of mobile app review event detection. B. To collect and consolidate the metrics that will be used. C. To annotate a ground truth set for training the classifier. D. To design and implement a pipeline for extracting and aggregating review-based metrics. E. To develop and evaluate machine learning models for event classification using the extracted metrics. F. To compare the performance of the machine learning approach with a statistical approach for event detection. G. To investigate the impact of review ratings on the effectiveness of event detection. H. To use a summarization technique for presenting detected events for qualitative analysis. 3.2 Research Plan Figure 3.1: Gantt chart for the thesis research plan 18 five categories of user decisions and performed three classification tasks: argumentative or non-argumentative reviews, argumentative or decision reviews, and a multi-class approach to classifying decision reviews into the five categories. Argumentative reviews are recognized by both a claim and premise/reason, and reviews that provide a reason for a user’s thoughts can be useful for improvement. They found that 43% of the dataset contained argumentative reviews, similar to the 35% of informative reviews in AR-Miner [4]. For classifying argumentative reviews in task 1, the highest F-measure of 91% was obtained. After experimenting with four different classification algorithms, Random Forest proved to be the best-performing, with Naive Bayes being the worst. Three types of features were considered: structural (related to token statistics), lexical (related to word types and positions), and contextual (related to sentence context). The rating metric of the review was excluded to assess the performance of these features. Features and metrics play a crucial role in the performance of a machine learning algorithm. Global, local, structural, lexical, and contextual features were studied, and the top three features are shown in Table 4.2. Preprocessing the data also improves the quality of what is fed into a classifier. The most common preprocessing techniques include removing stopwords (commonly used English words that are insignificant in context), non- ASCII characters, non-English words, and alphanumeric characters. Lemmatization and stemming are techniques aimed at returning words to their root, with stemming removing prefixes and lemmatization returning words to their original base form. Lemmatization was found to be more popular than stemming, as shown in Table 4.3. After preprocessing, reviews are tokenized by converting sentences into single words (tokens). Length considers the number of words in the review, and Term Frequency-Inverse Document Frequency (TF-IDF) considers the importance of a word with respect to the entire corpus. The most frequent techniques are shown in Table 4.3. Top Metrics Num. of papers References Rating of review 8 [18], [14], [12], [9], [1], [4], [19], [6] Sentiment/polarity 5 [18], [14], [12], [9], [6] Bag of words 3 [12], [11], [19] Table 4.2: Most frequently used metrics in papers 25 Top data preprocessing techniques Num. of papers References Removing stopwords 5 [12], [9], [4], [18], [1] Lemmatization 5 [12], [18], [1], [11], [7] Removing non-ASCII/English/alphanumeric char. 4 [18], [1], [4], [13] Stemming 4 [9], [18], [4], [13] Length 3 [11], [12], [9] Tf-idf 3 [11], [1], [13] Tokenization 3 [11], [1], [4] Table 4.3: Most frequently used data preprocessing techniques in papers McIlroy et al. [13] studied classifying reviews into more than one category, as reviews can sometimes contain multiple issues. They focused on 1-2 star reviews to concentrate on negative issues and found that only 30% of reviews mention more than one issue individually. Manually, 14 issues were identified and used for classification. Using Support Vector Machine (LibSVM), the best-performing algorithm, they were able to classify reviews with a precision and recall of 66% and 65%, respectively. Evaluation is frequently done by manually annotating data to create a truth set in order to get performance scores such as precision, recall and f-measure. Data is split into train and test sets, and k-fold cross-validation is performed. Qualitative analyses are also conducted using specific use-case scenarios and surveys. Few papers utilize visualization or summarization of app issues. However, current approaches to review-based event detection still face challenges, such as dealing with sarcasm, irony, or ambiguity in user reviews. These issues can make it difficult for machine learning algorithms to accurately classify reviews or detect events. Future research could focus on developing techniques to address these challenges in order to to enhance the effectiveness and practicality of review-based event detection. 4.2 Review-based competition analysis Motger et al. [14] provides a foundational basis for this thesis, serving as a seed for further exploration and development in the area of review-based competition analysis. According to Motger et al., automatically analyzing reviews for an app is a complex task, and thus there is very little research available on analysing reviews for multiple apps to 26 be used for competition analysis [14]. Therefore, this is an open research problem. In recent years, several studies have investigated the use of user reviews for competitive analysis of mobile apps, aiming to provide app developers with insights to improve their apps in relation to their competitors ([17], [1], [14]). These studies have employed various approaches, ranging from rule-based methods to deep learning techniques, to extract valuable information from user reviews and support app developers in making data-driven decisions. Shah et. al. [17] presented RevSum, a solution that analyzes reviews of a reference app in comparison to competing apps. A bag-of-word classification model is used to classify reviews into feature evaluation, bug report, and feature request. A key aspect of RevSum is its utilization of a recently proposed rule-based approach called SAFE, in contrast to the machine learning techniques that are the primary focus of this paper. Assi et al. [1] introduced FeatCompare, which consists of a neural network model called Global-Local sensitive Feature Extractor (GLFE). FeatCompare compares the use of global and local features, providing a more nuanced understanding of user opinions across different app categories. The approach first filters out informative reviews using AR-miner [4] and then creates categories for apps such as weather, news, or music. FeatCompare extracts features related to the specific type of app (local) and high-level features related to any type of app (global), allowing for a more comprehensive analysis of user feedback. The evaluation of FeatCompare using a truth set of 480 annotated reviews from five groups of competing apps demonstrates the effectiveness of incorporating both global and local features. The authors found that using these different types of features improved the performance of their results, achieving an F-measure up to 79% for five different categories of apps. Furthermore, a qualitative evaluation in the form of a case study and a survey revealed that more than 70% of app developers find FeatCompare to be beneficial. The comparative table generated by FeatCompare, which displays user opinions on features across apps in the same market segment, provides app developers with actionable insights for improving their apps in relation to their competitors. 27 Motger et al. [14] take a different approach to review-based competition analysis by employing a statistical method to automatically detect events and correlations between apps in the microblogging market segment. In contrast to FeatCompare, which focuses on extracting and comparing app features, Motger et al. [14] adopt a more holistic view, considering the app as a whole and analyzing the evolution of user reviews over time. The pipeline involves review collection, metric extraction, statistical analysis, and event summarization. Data was aggregated using a weekly granularity compared to daily in [18]. Baseline metrics are extracted from historical reviews, and deviations from these metrics are considered events. The event monitoring statistics include average value, average difference, standard deviation, and correlation between metrics. To detect potentially correlated events, the analysis identifies when two apps experience a high correlation (negative or positive) during the same time window. The case study conducted by Motger et al. [14] on the ”Twexit” event, which involved the acquisition of Twitter by Elon Musk, demonstrates the potential of their approach in detecting significant events and correlations between apps. By collecting one year of data from ten microblogging apps and analyzing metrics such as review count, review rating, and review polarity, the study identified 104 events, with 35 of them being potentially correlated events. 71% of the potentially correlated events occur during a four week time period after the ”Twexit” event happens. The use of ChatGPT (gpt3.5-turbo model) for summarizing reviews during triggered events provides further insights into the nature of these events, such as users migrating from Twitter to Mastodon. The study by Motger et al. [14] also categorizes the detected events into three main types: software-based events related to app functionality, context-based events related to external factors affecting app usage, and the emergence of new competitors. By identifying the stakeholders who would benefit from this analysis, including app providers, consultants, and users, the study highlights the potential impact of review-based competition analysis on app development and market dynamics. However, the authors acknowledge that the cause and effects of these events are not studied in detail, presenting an opportunity for future research. 28 In comparison, Shah et al. [17] and Assi et al. [1] focus on extracting and comparing app features and user opinions across competing apps. While Shah et al. [17] use a rulebased approach on prefiltered relevant reviews, Assi et al. [1] employ an unsupervised deep learning method. Motger et al. [14], on the other hand, take a more comprehensive approach by considering the app as a whole and analyzing the evolution of user reviews over time to detect significant events and correlations between apps. In conclusion, review-based competition analysis is an emerging area of research that holds great promise for supporting app developers in understanding and improving their apps in relation to their competitors. The studies discussed in this section demonstrate the potential of various approaches, from rule-based methods to deep learning techniques, in extracting valuable insights from user reviews. As the field continues to evolve, future research should focus on several key areas, including further validation of these approaches on larger and more diverse datasets, handling the cause and effects of detected events, and developing user-friendly tools that integrate these analysis techniques. By addressing the limitations of current approaches, exploring new techniques, and making insights more accessible and actionable for app developers and other stakeholders, researchers can unlock the full potential of review-based competition analysis in fostering data-driven decision-making and helping app developers stay competitive in the dynamic mobile app landscape. 29 Chapter 5 System design 5.1 Task definition The task of this thesis is to develop a system that can automatically detect significant events related to software-based issues from user reviews of mobile apps. The dataset includes a collection of raw user reviews from app repositories. These reviews are then preprocessed and aggregated over a specific time window (weekly). From the aggregated data, various metrics are extracted, such as review count, review polarity, review rating, length, and count and percentage of positive/neutral/negative reviews (based on polarity and rating). These metrics serve as features for training machine learning models to classify each time window as an event or a non-event. The output of the system is a binary classification (event/non-event) for each time window, along with a qualitative assessment of the detected events through summarization techniques. The primary use case is to provide app developers with actionable insights into significant issues, feature requests, and market dynamics based on user feedback, enabling them to prioritize development efforts and stay competitive in the market. 5.2 Pipeline Overview The system design of this paper involves five steps: data preprocessing, data aggregation, metric extraction, event detection and evaluation as shown in Figure 5.1. The first 4 steps 30 are described in the following sections and the last step is described in Chapter 6. Figure 5.1: System design of the pipeline 5.3 Data preprocessing The first step of the pipeline is data preprocessing. Cleaning the data is a crucial step that ensures that the metrics are computed in a uniformed and accurate way for training the machine learning classifier. The preprocessing steps taken are as follows: •Lowercasing: All text is converted to lowercase to ensure consistency. •Removing non-ASCII characters and non-alphanumeric characters: Characters that are not ASCII or alphanumeric (English letters and numbers) are removed. This helps to remove noise in the data. •Tokenization: The text is split into tokens to execute more preprocessing steps. For tokenization, the word tokenize function from the nltk.tokenize module of 31 the Natural Language Toolkit (NLTK)1was used, which is a popular open-source library for natural language processing tasks in Python. •Removing stopwords: Words that are commonly used in the English language but do not provide significant context such as ’the’ and ’is’ are removed. This reduces the volume of data to focus on meaningful terms. •Lemmatization: Words are returned to their original base form to ensure uniformity. For lemmatization, the WordNetLemmatizer from the nltk.stem module of NLTK2was used. As discussed in the State of the Art (see Chapter 4), Lemmatization is a more frequent preprocessing step used in research publications. It was chosen over stemming for this reason. •Removing empty reviews: All empty reviews are removed to ensure that redundant data is not used. These preprocessing steps ensure that the raw reviews are transformed into quality data for the rest of the pipeline. Two files are saved: the preprocessed reviews of all ratings and the preprocessed reviews of positive ratings (4 or more). To illustrate the outcome of the preprocessing steps, consider the following example review: My account was locked saying that ”I did not meet the age requirement”, although I did. After sending forms, and various emails, it is still locked. I still cannot reinstate my account. I would kindly ask the support team to look into this matter as soon as possible. Figure 5.2 shows the result of applying each preprocessing step to the example review. In the figure, you can observe how the review text is transformed after each preprocessing step, culminating in a cleaned and processed version that is ready for subsequent steps in the pipeline. 1https://www.nltk.org/api/nltk.tokenize.html 2https://www.nltk.org/api/nltk.stem.WordNetLemmatizer.html?highlight=wordnet 32 5.4 Data aggregation After preprocessing, the next step is to aggregate the data. This allows the data to be in a format suitable for event detection. When detecting events, the time frame can be daily, weekly, monthly, etc. By aggregating the data, this allows patterns and changes to be detected over time. In this case, events such as the “Twexit” event can be detected and analyzed for the impact on the microblogging app market. Unlike a daily granularity in [18], a weekly data aggregation was chosen, similar to [14]. The weekly data aggregation ensures that there are a reasonable amount of reviews within each timeframe, as there are some apps with less than 300 reviews within the one year span of data. It also allowed a longer timeframe to be covered when annotating the truth set, which is discussed in Section x. The data is aggregated weekly during the metric extraction script, which is discussed in the next section. 5.5 Metric extraction Computing the metrics is one of the most important steps in the pipeline, as it determines the quality of the data that will train the machine learning classifier. The selection of these metrics were driven by the most frequently used features discussed in the State of the Art (see Chapter 4). The following metrics were computed: •Review count: This refers to the amount of reviews published within the weekly time frame. Fluctuations of this metric can be a good gauge for detecting changes in the app market and user engagement. The review count is computed by iterating through the reviews of each app and checking if the review’s timestamp falls within the current time window. If it does, the count is incremented for that time window and app. •Review rating: This refers to the average rating of the app on a weekly basis. 33 Shifts in this metric can indicate changes in user satisfaction such as embracing new updates or experiencing bug issues. The rating is between [1,5], with 0 indicating the absence of reviews. The review rating is calculated by summing the individual review scores for reviews within the current time window and app, and dividing by the total number of reviews for that time window and app. •Review polarity: This refers to sentiment analysis for each review using the TextBlob3Python library. The polarity is represented by float values within the range of [-1,1] where -1, 0 and 1 represent very negative, neutral, and very positive, respectively. The average polarity during the weekly timeframe is recorded for each app. The review polarity is computed by iterating through the reviews within the current time window and app, calculating the polarity score for each review, summing the scores, and dividing by the total number of reviews. •Length: This refers to the average number of words in each review for the weekly time frame. If users are writing longer or shorter reviews this an help to identify when significant events or issues may be occurring. It also measures the level of user engagement when providing feedback. The review length is calculated by iterating through the reviews within the current time window and app, counting the number of words in each review if the review text is not empty, and summing the counts. The sum is then divided by the total number of reviews within that time window and app. •Count and percentage of negative, positive, and neutral user reviews (based on polarity): This refers to the number of negative, positive and neutral reviews there are based on the review polarity metric. Reviews less than 0 are considered negative, reviews greater than 0 are considered positive, and reviews with 0 are neutral. The counts are computed by iterating through the reviews within the current time window and app, and incrementing the respective count (negative, positive, or neutral) based on the polarity score. The percentages are 3https://textblob.readthedocs.io/en/dev/ 34 ’Identify and summarize the most significant event raised by this set of reviews extracted from mobile app repositories.’ This allows Claude to give a summarization of the most significant events occurring within the set of reviews, with a zero-shot learning context. This process was done twice, as two truth sets were annotated: positive reviews with a rating of 4 or more, and the complete set of reviews to assist with [RQ3] of evaluating the effect of review ratings on event detection (See Chapter 3). We decided that the minimum number of reviews required to be considered an event is 3. One is not enough as it might be completely isolated, and two is an even number so it does not allow to solve issues concerning disparity of criteria. Therefore three as the first odd number greater than one is established as the minimum. If the summarization reports that the issue is raised by at least one review, then it is considered an event. This is due to the fact the frequency and amount of reviews are not considered as a direct factor of an event, allowing minor events reported from a subset of reviews to be detected. Individual reviews are checked and the annotation is based solely on the summarization for all cases. This ensures uniformity. It was observed that there are events that strike when they happen and then they keep being reported in upcoming weeks. The first time an event is reported is what is considered the origin. But from a review perspective, this event is still having an impact, so it is ’alive’.” Transitivity or temporality is not considered in the reviews as a metric, therefore, whether an event has occurred or not cannot be assessed. Initially, all three types of events were considered but this led to an unbalanced truth set (75% classified as events). As a potential mitigation action to this risk, this paper focuses exclusively on software-based events. Therefore, an event is considered only if it is software-based. This allows the identification of bug reports and feature requests which are a significant factor in the success of an app ([12, 9]. The number of events found in both of the truth sets is displayed in Table 6.2. An example summary and review for each truth set of an annotated software-based 41 Truth Set Events Non-events Positive reviews (rating 4 or more) 22 50 All reviews 46 26 Table 6.2: Number of Annotated Events and Non-events event is shown below: During the week of October 20 - 26, 2022, Twitter users report multiple issues with the app functionalities after an update in the all ratings truth set. Twitter: Oct 20-26 2022 (all ratings truth set) ”Based on the reviews provided, it appears that a recent update to the Twitter mobile app has caused some significant issues for many users. The most common problems mentioned include: App crashes and freezing: Several users report that after updating to the latest version, the Twitter app crashes or closes unexpectedly, especially when trying to open direct messages (DMs). Notification issues: Some users mention that they are not receiving DM notifications properly, or that notifications disappear when they try to click on them. Comment viewing problems: One user reports being unable to view others’ comments on tweets, with the app opening the keyboard for writing a comment instead of displaying existing comments. Mention functionality not working: A user notes that when trying to mention someone, no usernames appear, even when entering the complete username. Changes to the home feed: A few users complain that after the update, their home feed no longer shows tweets related to their interests or any tweets at all. In summary, the most significant event appears to be a problematic update to the Twitter mobile app that has introduced various bugs and issues, primarily related to app stability, notifications, comment viewing, and core functionalities like mentioning other users and the relevance of the home feed content.” 42 ”When opening app today, it starts to load, I can see that I have notifications, but then screen closes with ’Unfortunately Twitter has stopped’ message? Uninstalled and created a new account, still won’t open on my Android tablet, opens ok on my Android phone, both Samsung. Same issue today again (26.10.22) after updating. Tried restart and shut down, then restarting, still not working.” Similarly, during the week of November 10-16, 2022, Mastodon users encounter technical issues after the ’Twexit’ event described in Section 6.1. These annotated softwarebased events are examples of valuable user feedback that app developers need to be aware of. Mastodon: Nov 10-16 2022 (positive truth set) ”Based on the set of reviews provided, it appears that there was a significant surge in new users signing up for Mastodon, likely due to issues or dissatisfaction with Twitter. Several reviews mention coming from Twitter or refer to Twitter as ”the bird app.” This sudden influx of new users seems to have caused some technical issues and confusion: Some users had trouble signing up or logging in, occasionally getting error messages like ”403.” A few reviews mention that joining a Mastodon server was not intuitive for new users. There were server capacity and performance issues, likely due to the rapid increase in users. Some reviews mention ”hitches” and delays that are chalked up to this growth. [...] In summary, the key event is a large migration of users from Twitter to Mastodon, causing some temporary sign-up and performance issues. [...] The influx reveals some areas for improvement in onboarding, features and scalability.” ”At first I couldn’t log in using the app. I made my account through their website and I can’t use the account I made in the app. This should be intuitive. But when I try to log in, I’m asked to create a new account. Welp, I just needed to be mindful of the server I joined.” 43 6.3 Evaluation Performance metrics such as accuracy, precision, recall, f-measure and AUC are used to evaluate each classifier as discussed in Section 2.2. After the models are trained and fine-tuned on the annotated truth set, the best classifier is chosen and evaluated on the test set, and is selected based on the highest F1 score during 5-fold cross validation. This model is then used for inference on new data (the next 8 weeks), where the aggregated metrics for subsequent weeks are provided as input, and the model predicts whether each week represents an event or a non-event. All tests are performed on both the complete truth set (containing all reviews) and the positive truth set (containing only reviews with ratings of 4 or higher) to assess the impact of review ratings on event detection performance. After predictions are made, a random subset of 50 reviews are extracted for each week of the detected events from the selected classifier. These review subsets will be summarized by Claude AI using the same methodology described in Section 6.2 to make the events suitable for human assessment. Prompt engineering will be used with a zero-shot learning approach. This step can provide valuable information to app developers about the predicted events. Based on the F1 score, the best performing classifier was the Multilayer Perception classifier, and this was chosen to be evaluated on the test set. The metrics (as defined in Section 5.5) for the next 8 weeks, December 01, 2022 to January 25, 2023 were computed and fed to the Multilayer Perceptron classifier for predicting. 44 Chapter 7 Results and analysis 7.1 Descriptive feature analysis Descriptive feature analysis was conducted on both truth sets to compare their statistics and unveil possible patterns when considering reviews of different ratings. The summary statistics for the positive truth set (containing 26,051 reviews) and the truth set with all ratings (containing 38,654 reviews) are shown in Table 7.2 and Table 7.1 respectively. As expected, the count and percentage of negative reviews are 0 and the average review polarity is 27% higher in the positive truth set. The variability in negative features between both truth sets is visualized in Figure 1 (see Appendix) which shows the mean and distribution of each feature as a bar plot. However, the positive truth set still contained some negative sentiments with an average percentage of 2.85% and a count of ˜10 reviews. This is 80% less average reviews containing negative sentiments compared to the truth set with all ratings that have an average percentage of 12.4% and a count of ˜60 reviews. While the positive review count remains the same in both truth sets, the positive review percentage for the all ratings truth set is lower, displaying the influence of negative and neutral reviews. The positive sentiment average count is 17% higher in the all ratings truth set, indicating that reviews with a rating of 3 or less still contain positive sentiments. The average number of words in a review is ˜22% lower in the positive set, and the maximum is 25 compared to 47 in the all ratings set, indicating that reviews 45 with lower ratings may contain more detailed feedback. The histogram distribution of all features for each dataset is displayed in Figures 3 and 4 (see Appendix). In both cases, the review count feature shows a right-skewed distribution, indicating that many of the apps have low review counts, while a few apps have significantly higher counts. This right skewness can account for more popular or widely-used apps in the dataset such as Twitter that generate a large volume of user feedback. There were outliers for all of the count metrics in both truth sets and the interquartile range was smaller for most metrics in the positive truth set. The box plot for each feature is displayed in Figures 5 and 6 (see Appendix). Table 7.1: All Ratings Truth Set: Summary Statistics of Features Feature Mean Std Min Max negative review count 157.537500 381.939055 0.000000 1939.000000 negative review percentage 35.436562 27.468945 0.000000 100.000000 negative sentiment count 59.725000 145.179328 0.000000 668.000000 negative sentiment percentage 12.437523 15.370323 0.000000 100.000000 neutral sentiment count 128.612500 347.033887 0.000000 1732.000000 neutral sentiment percentage 19.028799 16.661586 0.000000 66.666667 positive review count 325.637500 893.709468 0.000000 4200.000000 positive review percentage 45.813438 30.847564 0.000000 100.000000 positive sentiment count 294.837500 770.765055 0.000000 3595.000000 positive sentiment percentage 49.783678 28.814001 0.000000 100.000000 review count 483.175000 1255.365939 0.000000 5597.000000 review polarity 0.187016 0.150316 -0.175000 0.700000 review rating 2.742218 1.534594 0.000000 5.000000 review word count 8.671156 7.638856 0.000000 47.000000 For the all ratings truth set, the review word count is mostly correlated with the negative review percentage and negative sentiment percentage, whereas in the positive truth set it is mostly correlated with the positive sentiment percentage. The review rating is strongly correlated with the positive review percentage and positive sentiment percentage in both truth sets, but the correlation is stronger in the positive truth set. This correlation heatmap is displayed in Figure 2 (see Appendix). The pairs plot in Figures 7 and 8 (see Appendix) also give valuable insights about the pairwise relationships between features. A positive correlation can be seen between review rating and review polarity in the all ratings truth set, indicating that higher ratings are related with more positive 46 Table 7.2: Positive Truth Set: Summary Statistics of Features Feature Mean Std Min Max negative review count 0.000000 0.000000 0.000000 0.000000 negative review percentage 0.000000 0.000000 0.000000 0.000000 negative sentiment count 9.975000 26.222019 0.000000 124.000000 negative sentiment percentage 2.852084 4.889674 0.000000 33.333333 neutral sentiment count 69.875000 201.279664 0.000000 915.000000 neutral sentiment percentage 12.566946 13.302233 0.000000 50.000000 positive review count 325.637500 893.709468 0.000000 4200.000000 positive review percentage 76.250000 42.823600 0.000000 100.000000 positive sentiment count 245.787500 668.841842 0.000000 3215.000000 positive sentiment percentage 60.830970 35.957497 0.000000 100.000000 review count 325.637500 893.709468 0.000000 4200.000000 review polarity 0.295738 0.193164 0.000000 0.800000 review rating 3.689922 2.079179 0.000000 5.000000 review word count 6.707783 6.238864 0.000000 25.000000 sentiments. Overall, this descriptive feature analysis compared the characteristics and distributions of features between the positive truth set and the all ratings truth set for app reviews. There were notable differences in the summary statistics, feature distributions, outliers, and correlations between the two datasets. The all ratings truth set displayed a wider range of reviews and variability in feature values, showing a more comprehensive view of user opinions. Meanwhile, the positive truth set, limited to highly-rated reviews, displayed stronger correlations and less dispersion in feature values. 7.2 Event detection performance Results are based on the performance of four classifiers: Naive Bayes (NB), Support Vector Machines (SVM), Random Forest (RF) and Multilayer Perceptron (MLP) Neural Networks, with respect to both truth sets: reviews with all ratings, and reviews with ratings of 4 or more. The best parameters chosen through grid search for each classifier is shown in Table 7.3. The models performed better in general on the all ratings truth set compared to the positive truth set, as displayed in Table 7.4. The algorithm chosen as the best performing 47 Table 7.3: Best parameters for each classifier chosen through grid search Classifier Parameter Truth set All ratings Positive ratings SVM C 10 10 gamma 1 0.001 preprocessing MinMaxScaler() None RF max depth 10 5 min samples leaf 2 1 min samples split 2 5 n estimators 50 100 preprocessing None None MLP activation relu tanh alpha 0.0001 0.0001 hidden layer sizes (50, 50) (100,) learning rate init 0.01 0.1 preprocessing None None model in both cases is the MLP classifier, achieving a test f-measure of 91% in the all ratings truth set and 46% in the positive truth set. As stated in Section 6.3, the criteria of the best model is the algorithm that achieves the highest cross validation f-measure. The random forest classifier followed closely behind, achieving 95% test f-measure in the all ratings truth set and 80% in the positive truth set. The random forest classifier also achieved the highest test accuracy of 93% in the all ratings truth set. Although the MLP classifier was chosen as the best classifier, some models had better performance on the test set. For instance, the positive truth set had the highest test f-measure score of 80% and test accuracy of 87%, achieved by both SVM and random forest classifiers. The all ratings truth set had the highest test f-measure of 95% and test accuracy of 93% by random forest. However, this could be attributed to an outlier caused by the specific set of reviews used in the training of these models. The distribution of the positive reviews truth set had less events, containing only 5 events and 10 non-events in the test set, compared to 10 events and 5 non-events in the all ratings truth set. For the all ratings truth set, the MLP classifier was able to successfully predict all 10 events and 3 out of 5 non-events as shown in Figure 9 (see Appendix) which displays the confusion matrix. The Naive Bayes also successfully classified all events in both truth sets, but only classified 1 out of 4 and 4 out of 10 events in the all ratings 48 Table 7.4: Results displaying performance scores per truth set Classifier Truth set CV F1 Test F1 Test Acc. Classification Report Class 0 Class 1 Overall Prec. Rec. Prec. Rec. Prec. Rec. MLP Positive 0.58 0.46 0.53 0.71 0.50 0.38 0.60 0.60 0.53 All 0.95 0.91 0.87 1.00 0.60 0.83 1.00 0.89 0.87 SVM Positive 0.55 0.80 0.87 0.90 0.90 0.80 0.80 0.87 0.87 All 0.91 0.87 0.80 1.00 0.40 0.77 1.00 0.85 0.80 RF Positive 0.52 0.80 0.87 0.90 0.90 0.80 0.80 0.87 0.87 All 0.91 0.95 0.93 1.00 0.80 0.91 1.00 0.94 0.93 NB Positive 0.54 0.62 0.60 1.00 0.40 0.45 1.00 0.82 0.60 All 0.84 0.83 0.73 1.00 0.20 0.71 1.00 0.81 0.73 and positive truth sets respectively as shown in Figures 15 and 16 (see Appendix). The random forest classified all instances correctly in both truth sets except one non-event classified as an event, shown in Figures 13 and 14 (see Appendix). The SVM classifier classified 9 out of 10 events correctly in the positive truth set, classifying more instances correctly than the all ratings truth set, as displayed in Figures 12 and 11 (see Appendix). Figure 7.1: All ratings truth set: MLP Confusion Matrix and ROC curve The AUC score represents the capability of a model to distinguish between classes. The Naive Bayes had the lowest AUC score in the all ratings truth set of 0.6 (see Figure 15 (see Appendix) almost indicating random guessing, while the Random Forest had an 49 AUC score of 0.9 in the all ratings truth set and 0.95 in the positive truth set (see Figure 16 in Appendix) indicating better capability of discriminating between events and nonevents. The MLP classifier obtained an AUC of 0.55 in the positive truth set and 0.8 in the all ratings truth set, displayed in Figures 10 and 9 (see Appendix). The learning curve also gives insights into the fitting during the training of the model. The Naive Bayes and MLP classifiers have the smallest gap between training and test scores in both truth sets (see Figures 18 and 21 in Appendix), indicating good generalization of the models. The SVM and Random Forest learning curves has some gaps between training and test scores indicating potential overfitting, shown in Figures 19 and 20 (see Appendix). The feature importance plot in Figure 17 (see Appendix) reveals the most important features for event detection in the Random Forest algorithm. The review count and positive sentiment count metrics were in the top 3 most important features for both truth sets. The negative review count and review word count were also included for the all ratings truth set and positive truth set respectively. The percentages metrics along with the review rating were among the lowest metrics in the feature importances. As discussed Chapter 2, this does not mean that these features are not particularly important, but that this data may be included in other metrics (e.g. the count metrics). 50 Summarization 7.3.10: Hive Social Dec 01 - 07 2022 (all ratings truth set) ’[...] Experiencing major technical problems and outages that are preventing users from being able to use the app properly or at all. Some of the key issues raised in the reviews include: The app is very slow, laggy, crashes frequently or does not load content at all on many devices, especially Android. Users are unable to create new accounts, sign in to existing accounts, see their profiles/feeds, upload photos/posts or edit their profiles. There seems to have been a major outage or the servers were taken down, resulting in the app being essentially non-functional for many users. There are concerns around potential security breaches and negligence in handling user data. The developers appear to be unresponsive to support requests and not communicating well about the issues.. [...]’ Summarization 7.3.11: Mastodon Dec 01 - 07 2022 (all ratings truth set) ’[...] The most significant issue raised seems to be difficulties with the login and account setup process in the Mastodon mobile app. Multiple users expressed frustration with being unable to log in to their existing accounts, getting stuck in loops trying to log in or set up a new account, and confusion over how to choose a server instance or mastodon to join. Some key points highlighting this login/setup issue: Several reviews mention being stuck on the confirmation email page or not receiving confirmation emails to complete signup. Others say the ”Log In” button just takes them through the sign up flow instead of allowing them to log into an existing account. There is confusion over having to pick a server/instance before signing up and what the different instances represent. A few users uninstalled and reinstalled the app trying to resolve login issues to no avail. Commenters indicate the login process is overly complex compared to other apps where you just enter email/username and password. Some state they can’t get the app to authorize their account credentials at all after initially being able to access their account. [...]’ Similarly, for the positive truth set, 55 events and 25 non-events were predicted. There 57 are many instances predicted as events that are also present in the all ratings truth set. For instance, 80% (4 out of 5) of the events predicted during the week of December 1st - 7th, 2022 was also predicted as events in the all ratings truth set. Summarization 7.3.12 expresses users migrating to Mastodon due to the ’Twexit’ event, along with technical issues and suggestions for improvements. Summarization 7.3.12: Mastodon Dec 08 - 14 2022 (positive truth set) ’[...] A few reviews mention issues or desired improvements, like being able to edit posts, better hashtag and instance/server handling, and adding translation/local server icons. [...] Overall, the reviews reflect people’s interest in Mastodon as a decentralized, community-driven alternative to Twitter, particularly in light of Elon Musk’s acquisition of Twitter and concerns about its direction. [...]’ The following examples also express technical issues experienced by Counter Social and Truth Social users during the week of December 8th - 14th, 2022 in Summarizations 7.3.13 and 7.3.14 respectively. Summarization 7.3.13: Counter Social Dec 08 - 14 2022 (positive truth set) ’[...] While the app is generally appreciated, some users have encountered bugs and issues, such as the profile picture disappearing and the need to force stop the app. Users suggest improvements like introducing a topic feed similar to Twitter, where users can select and follow different topics of interest, as well as the ability to receive phone notifications and insert GIFs. [...]’ Summarization 7.3.14: Truth Social Dec 08 - 14 2022 (positive truth set) ’[...] There were some initial hiccups with account creation/verification that were later resolved. [...] The reviews depict Truth Social’s Android launch as a welcome development for Trump supporters seeking an uncensored social platform aligned with conservative values and able to counteract what they view as liberal bias on other major social networks.’ 58 Overall, both truth sets were able to successfully identify some events during inference. Some of the detected software-based events also included context-based and new competitor events. 59 Chapter 8 Discussion This chapter discusses the overall insights obtained from this thesis in relation to the research questions defined in Section 3.1. RQ1. How accurately can important events related to app issues and features be detected from app reviews using machine learning? According to the results obtained, machine learning classifiers are able to perform software-based event detection with relatively high accuracy. The Multilayer Perceptron (MLP) classifier, the best chosen model for both truth sets was able to accurately identify events with 87% accuracy in the all ratings test set. A recall of 100% was also achieved indicating that all positive events available in the truth set were correctly detected. However, the performance of this model varied significantly in both truth sets. The MLP classifier obtained a lower accuracy of 53% in the positive truth set and a recall of 60%, classifying 2 events as non-events. This suggests that training the model with positive reviews only (ratings greater than or equal to 4) can negatively impact the effectiveness of an app review event detection model. The MLP classifier being chosen as the best model in both truth sets confirms the state of the art performance of neural networks (deep learning) due to its ability to capture non-linear complex patterns in the data. Another notable machine learning algorithm is the Random Forest classifier which was able to classify events with 93% accuracy in both truth sets. The Random 60 Forest model also achieved a recall of 100% in both truth sets, indicating that all positive events available in the truth set were correctly detected. The Random Forest feature importances reveal that the review count and positive sentiment count metrics play a significant role in classifying events effectively. The high performance of the Random Forest model could be attributed to its ability to handle high-dimensional data and reduce overfitting through its ensemble models. Combining outputs of 100 trees in the case of this thesis also allows the model to be less sensitive to noise and increases robustness. The bagging method (discussed in Section 2.1.1) also improves the model’s ability to generalize well to new data. It was also an interesting finding that one third of the incorrectly classified events were a different type of event such as context-based and new competitor. The qualitative assessment through summarization done in Section 7.3 reveals further insights into the events detected by the best chosen model. The MLP classifier was able to detect bug reports, issues with updates, login/signup issues, user interface issues, feature requests and even the user’s opinions of the app developers. This plays a significant role in app developers knowing when updates still contain bugs and what improvements they can make to the app to also potentially gain an advantage over their competitor. RQ2. How does a machine learning approach for event detection compare with a statistical approach with respect to its effectiveness? The machine learning approach utilized in this thesis achieved promising performance in detecting software-based events from app reviews. The Multilayer Perceptron (MLP) classifier, chosen as the best model, obtained an F1 score of 91% on the all ratings test set, indicating its effectiveness in accurately classifying event and non-event weeks. The qualitative assessment using summarization also demonstrated the ability of the MLP classifier to identify various types of software-based issues, such as bugs, performance problems, and feature requests from user reviews. In contrast, the statistical approach used by Motger et al. [14] focuses on detecting 61 events and correlations between apps by analyzing deviations from baseline metrics (e.g., review count, rating, polarity) and identifying periods of high correlation between apps. The statistical approach does not directly classify individual weeks as events or non-events but rather identifies significant deviations from historical patterns and correlations between apps, which could indicate potential events or market dynamics. One advantage of the statistical approach is its ability to detect different types of events, including software-based events, context-based events (e.g., external factors affecting app usage), and the emergence of new competitors. However, it does not explicitly categorize or label these events as such. In terms of effectiveness, the machine learning approach demonstrated a more direct and quantitative measure of performance in classifying specific weeks as events or non-events, with the MLP classifier achieving a high F1 score on the test set. The statistical approach, however, relies on qualitative analysis and interpretation of the identified deviations and correlations to infer potential events and market dynamics. While it provides valuable insights into cross-app relationships and market trends, it does not offer a direct performance measure for event detection. As this thesis utilized the same dataset and time aggregation as the paper by Motger et al., the findings of this thesis and the paper by Motger et al. show some similarities. For instance, Motger et al. [14] references the event of users migrating from Twitter to Mastodon as a preferred alternative during the week of October 27, 2022, which was also seen in an annotated software-based event mentioned in Section 6.2 during the week of November 10, 2022 (2 weeks later). This shows that this significant event was still occuring after the acquisition of Twitter by Elon Musk. This is also confirmed in Summarization 7.3.1, where a predicted event in the all ratings truth set for the week of November 3, 2022 mentions users praising Mastodon as a promising Twitter alternative. The trigger event of the case study, the ”Twexit” event was detected in both the statistical and machine learning approaches, although context-based events were not directly considered in this thesis. This also suggests that these types of events (software-based, new competitor and 62 context-based) may be correlated with each other as one may influence another. For example, the influx of users to Mastodon caused significant overload and server issues in the app. Another similarity is seen by Truth Social being influenced by public figures such as Donald Trump, as mentioned in the paper by Motger et al. and also seen in Summarization 7.3.2 as a classified event during inference of the positive truth set. According to the detected events reported in the paper by Motger et al., during the week of November 3, 2022, Mastodon had an event, which was also confirmed in this thesis using machine learning methods. However, there are some differences such as software-based events for GETTR being detected during the week of November 17, 2022 and October 17, 2022, and for MeWe October 06, 2022, which was not detected using the statistical methods. This suggests that the statistical methods may have some limitations in detecting events that machine learning techniques may not encounter due to learning from a labelled dataset. RQ3. How does the rating of reviews affect the performance of event detection? In this thesis, two models were developed using a truth set of reviews inclusive of all ratings, and a truth set including positive ratings only. The models were trained, tested and given new data to assess inference using the respective reviews (reviews with all rating scores or positively-rated reviews only). The performance metrics used including f-measure, recall, precision and accuracy reveal that the all ratings truth set performed significantly better in app review event detection than the truth set with positively-rated reviews only. This finding is consistent across all of the developed models, with the f-measure being significantly higher on the all ratings truth set. The best model, the MLP classifier achieved an f-measure of 91% in the all ratings test set as opposed to 46% in the positive truth set. The descriptive feature analysis in Section 7.1 also describes the differences in the metrics obtained for both truth sets, which gives insights into how both types of models were trained differently. The all ratings truth set had a wider range of review characteristics, due to the proportion of negative and neutral reviews included as opposed to the positively-rated reviews truth set. The diverse user feedback suggests 63 that providing more comprehensive information for models to learn from equips them to better identify patterns and anomalies indicative of events. The qualitative assessment in Section 7.3 also reveals that the detected events in the positively-rated truth set were not as descriptive or comprehensive as in the all ratings truth set. Reviews with lower ratings are more likely to contain critical feedback and complaints, which allows the machine learning models to be better equipped to identify events directly relevant to app functionality and user experience. The complementary process with negative review annotation would be required future work to complement this thesis, as it was disregarded due to the effort required in manual annotation processes. 64 Chapter 9 Conclusions 9.1 Threats to validity This thesis provides valuable insights into the use of machine learning for event detection from app reviews, however, there are several limitations and threats to validity that should be acknowledged. The annotation process for creating the truth sets relied on a subset of 50 randomly selected reviews per week, summarized using Claude AI. Although this approach aimed to capture the most significant events, it potentially overlooked relevant information present in the remaining reviews. The weekly aggregation of data also may not capture events occurring at a finer daily granularity. The focus on software-based events exclusively, by excluding context-based and new competitor events could also leave out relevant information. The annotations were also performed by a single individual, introducing the risk of subjectivity and potential biases in the labeling process. The use of Claude AI for generating summaries may introduce biases or limitations inherent to the model itself. The summaries were created through a zero-shot learning approach, which means they were generated without any specific training on the task of event detection from app reviews. This could potentially cause the summaries to overlook context-specific information relevant for accurately identifying events. There were also no explicit feature selection techniques employed in this study. The 65 machine learning models relied on the provided set of metrics, which may not represent the most informative or discriminative features for event detection. Incorporating LDA as a metric to define the most popular topic in a set of reviews (from the replication package by Gao et al. [7]) was attempted but there was an error integrating it into the system design of this thesis. Also, the presence of class imbalance in the truth sets, particularly in the positive-rated truth set, could have impacted the performance of the machine learning models. 9.2 Future work Future work could involve analyzing the entirety of reviews during event annotation, to mitigate the limitation of only using random subsets of reviews. The annotations for longer time periods could also be done to increase the amount of training data provided to the model and potentially improve performance. A daily time granularity could also be considered to lower the volume of reviews that are considered an event, and capture more detailed events. Involving multiple annotators and establishing annotation agreement measures could enhance the reliability and validity of the truth sets. Software-based events were focused on to overcome class imbalance and prioritize events directly relevant to app functionality, future research could explore techniques for detecting and differentiating between various types of events, as they may provide valuable insights for different stakeholders. Transformer-based models could also be included for future work as it could potentially improve the model’s performance. Utilizing feature selection methods and more features such as LDA for topic content could potentially improve model performance and interpretability. Techniques for handling class imbalance, such as oversampling or undersampling, were not explored in this study because of the small dataset size, but could be investigated in future work. Having negatively-rated reviews as a complementary truth set to the positively-rated reviews could provide additional insights and improve the overall event detection performance. 66 (a) All ratings truth set (b) Positive truth set Figure 2: Correlation heatmap of both truth sets: Visualizes the pairwise correlations between features, with darker shades indicating stronger positive (red) or negative (blue) correlations. The diagonal elements represent the correlation of each feature with itself, which is always 1. 73 Figure 3: All ratings truth set: Histogram distribution of features. The x-axis represents the feature values, while the y-axis shows the count of data point for each value. 74 Figure 4: Positive truth set: Histogram distribution of features. 75 Figure 5: All ratings truth set: Box plot of features displaying the median (central line), interquartile range (box), and outliers (individual points). The box represents the middle 50% of the data, while the whiskers extend to the minimum and maximum values, excluding outliers. 76 Figure 6: Positive truth set: Box plot of features 77 Figure 7: All ratings truth set: Pairs plot of features providing a matrix of scatter plots to display the pairwise relationships between features. The diagonal elements display the univariate distribution of each feature. 78 Figure 8: Positive truth set: Pairs plot of features 79 Figure 9: All ratings truth set: MLP Confusion Matrix and ROC curve Figure 10: Positive truth set: MLP Confusion Matrix and ROC curve 80 Figure 11: All ratings truth set: SVM Confusion Matrix and ROC curve Figure 12: Positive truth set: SVM Confusion Matrix and ROC curve 81 Figure 13: All ratings truth set: Random forest Confusion Matrix and ROC curve Figure 14: Positive truth set: Random forest Confusion Matrix and ROC curve 82