Comparison of Machine Learning Models Used for Swedish Text Classification in Chat Messaging

University essay from KTH/Skolan för elektroteknik och datavetenskap (EECS)

Abstract: The rise of social media and the use of mobile applications has led to increasing concerns regarding the content that is shared through these apps and whether they are being regulated or not. One of the problems that can arise due to a lack of regulation is that chat messages that are inappropriate or of profane nature can be allowed to be shared through these apps. Thus, it is vital to detect whenever these types of chat messages are shared through these mobile applications. In addition to that, there should also be detection of chat messages that can lead to the identity of the users being revealed as that is how the app in this thesis project was intended to be used. One of the most popular approaches to detect chat messages of this nature is to use machine learning techniques that can classify text. We were quick to discover that there were not many machine learning models that were built to classify short text messages in the Swedish language, thus the main problem of our thesis was the lack of evaluation and analysis of machine learning models for text classification in the context of the chat messages in Swedish. Thus, the purpose of our project was mainly to find the best performing models for text classification, implement these models and evaluate them to find the best among the ones we found. After the models were created, a hosting server, as well as an API, was required for the text classifying system to compute and communicate the prediction results to the mobile application in real-time. Therefore, the models were containerized and deployed as a REST API that serves requests upon arrival on a cloud server. The goal of this project was to help future work being done on text classification in the Swedish language by providing the results of this thesis to any parties that are interested in our line of work. From our own experience, we realized how challenging it can be to find and choose the best machine learning models when one has no previous data on which can be the best performing one. Thus, we believe that the results of this thesis project will greatly aid future projects in this area. The chosen research methodology was qualitative and dealt with quantitative data. The results we received showed that the BERT model was the best choice among the three models that we compared. With minute adjustments, this model should be more than capable of detecting the type of chat messages that it is required within the mobile application.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)