Developing a WEB application for sentiment analysis using the Flask framework and Python
Introduction. Currently, of great practical and scientific interest is the solution of the problems of determining the moods of user texts transmitted in the information space of the Internet and in other networks. Sentiment analysis is used by researchers and marketers to study user feedback. For example, at Russian Railways, such an analysis can contribute to the study of public opinion in the interests of improving the quality of passenger transportation. Based on the study of public opinion, for example, it is possible to study and improve the quality of education in universities. The purpose of the study is to develop an effective technology for the use of modern tools for developing a Web-application that allows you to analyze the sentiment of user text. Methods and means. The web interface corresponding to the tasks is implemented using the Flask framework, and the training model is based on the use of the Tensor Flow library. Results. The rationale for the full cycle of creating a training model based on open data of Twitter posts using the TensorFlow library has been performed, and the ability to automatically select parameters using the Keras Tuner add in has been implemented. Practical significance. The main distinguishing feature of the developed application is the presence of a user interface that allows you to control the predictive and training blocks of the program without the need to manually launch the corresponding sections of the code. The necessity and convenience of working with a trained model for classifying text through a graphical Web-interface are shown. This approach allows you to reduce the time for performing routine technical manipulations when processing a large amount of data. Having a trained model and an interface for working with it makes it possible to skip the training stages and go directly to the stage of predicting user values. Discussion. When solving the problem, we studied the process of creating a data classification model based on the Tensor Flow module, as well as creating a neural network using the Keras add-on. In the process of training, the best model was selected for the parameter "accuracy on the test sample" using Keras Tuner. A web interface in Flask was developed, which is isolated by a virtual Python runtime. It is advisable to continue further research in the areas of practical use of the results obtained in the interests of improving the quality of training and retraining of personnel at Russian Railways, improving the characteristics of the classification of text data based on the use of text corpora to set up a tone classifier, as well as developing a method for preliminary data cleaning to create a neural network model based on the use of modern and lightweight libraries for the possibility of preliminary preparation of the text for training.