Development of a Software Module for Sentiment Analysis of Text Reviews Based on a Naive Bayesian Classifier for a Pharmacy Information System
И.А. Щукарев, Vadim Moshkin, Kirill V. Svyatov · 2024
An effective way to increase profits and strengthen the profitability of a pharmacy is to implement the principles of automation and management of pharmacist activities using information systems. Companies use machine learning algorithms to adjust their strategy, study customer attitudes towards their organization through feedback analysis, and enhance the company's image. However, manual processing of incoming reviews requires significant time and effort from the pharmacist. The article proposes to automate this type of activity using the naive Bayesian classifier algorithm implemented using Python. To train the classifier, a custom corpus of tagged review texts with two categories was created; the total number of reviews was about 500. A parser written in Python was used to search for reviews. As part of the preliminary processing of the review text, the following were performed: lemmatization, removal of punctuation marks, the procedure for converting the text to lowercase, tokenization, and removal of stop words, and the Bag of Words method was chosen as a method of text vectorization. According to the numerical experiments, the highest accuracy of the classifier was achieved with a training and test sample ratio of 80/20, without stop words. When using the classifier, the analysis of 100 reviews will take eight times less time compared to reading them by a person. The classifier itself can be presented as a separate application or as a module of the information system. Thus, the growing number of positive reviews for a company is an indicator of its successful work and the number of satisfied customers, and the growth of the image will increase customer confidence in the company and lead to an increase in sales.