Topic Modeling and Sentiment Analysis of Customers Using Natural Language Processing and Machine Learning Techniques

Document Type : Article

Authors

1 1Department of Textile Engineering, Amirkabir University of Technology, Tehran, Iran.

2 Department of Industrial Engineering and Management Systems, Amirkabir University of Technology.

Abstract

Given that modeling and predicting customer behavior using data science helps companies gain a better understanding of customer behavior, this research focuses on analyzing customer reviews in the women’s clothing domain within e-commerce. We employ machine learning techniques and natural language processing (NLP) to achieve this goal. The machine learning models used include Support Vector Machine, Logistic Regression, Decision Tree, Random Forest, Multinomial Naive Bayes, Complement Naive Bayes, XGBoost, and LightGBM. To extract and vectorize text features from the reviews, we utilize the TF-IDF and Word2vec algorithms. We employ Topic Modeling using the Latent Dirichlet Allocation (LDA) method and k-means clustering. The dataset consists of women’s clothing reviews, with the target variable being customer ratings in those reviews. The study is conducted in binary, three-class, and five-class scenarios. The target variable, which originally has five classes (scores 1 to 5), is categorized into two-class and three-class modes. In the two-class mode, scores below 3 are class zero, while scores of 3 and above are class one. In the three-class mode, scores below 3 are class zero, scores equal to 3 are class one, and scores above 3 are class two. In all three cases, the Random Forest model performs best, achieving an accuracy of 0.98 in the binary case, 0.95 in the three-class case, and 0.91 in the five-class case. After performing the required preprocessing and feature engineering, principal component analysis (PCA) and T SNE are applied. After that, the scatter diagram of the data is drawn and the optimal number of clusters, 3, is estimated using the elbow and silhouette diagrams. In the next step, by removing punctuation marks, stop words and words with fewer than three letters, converting the first letter of the words to lowercase and lemmatization, data cleaning was done. After that, topic modeling was done and each of the topics and words related to them were examined. In the next step, the topics were examined in different clusters.   These analyses provide a comprehensive understanding of the key themes and concerns customers have when considering womenswear items in each of the four topics.

Keywords

Main Subjects


  1.  

    منابع- References

     

    1. Mabrouk, A., Redondo, R.P.D. and Kayed, M., 2021. Seopinion: summarization and exploration of opinion from e-commerce websites. Sensors21(2), pp.636. https://doi.org/10.3390/s21020636.
    2. Huang, H., Asemi, A. and Mustafa, M.B., 2023, July. Sentiment analysis application in e-Commerce: current models and future directions. In International Conference on Electronic Government and the Information Systems Perspective, pp.67-72. https://doi.org/10.1007/978-3-031-39841-4_5.
    3. Kasimu, M., Hellen, N. and Marvin, G., 2023. Explainable sentiment analysis for textile personalized marketing. In The Fourth Industrial Revolution and Beyond: Select Proceedings of IC4IR+, pp.473-488. https://doi.org/10.1007/978-981-19-8032-9_33.
    4. Zainal, S.R.M. and Xiang, C., 2023. Examining women’s e-commerce clothing reviews. International Journal of Business and Technology Management5(1), pp.22-38. Available at: https://myjms.mohe.gov.my/index.php/ijbtm/article/view/21637. Date accessed: 04 aug. 2024.
    5. Lin, X., 2020, April. Sentiment analysis of e-commerce customer reviews based on natural language processing. In Proceedings of the 2020 2nd international conference on big data and artificial intelligence, pp.32-36. https://doi.org/10.1145/3436286.3436293.
    6. Kubrusly, J., Neves, A.L. and Marques, T.L., 2022. A statistical analysis of textual e-commerce reviews using tree-based methods. Open Journal of Statistics12(3), pp.357-372. https://doi.org/10.4236/ojs.2022.123023.
    7. Muniasamy, A. and Bhatnagar, R., 2022. Analyzing online reviews of customers using machine learning techniques. In Rising Threats in Expert Applications and Solutions: Proceedings of FICR-TEAS 2022, pp.485-493. https://doi.org/10.1007/978-981-19-1122-4_51.
    8. Sunil, N. and Shirazi, F., 2023, July. Customer review classification using machine learning and deep learning techniques. In International Conference on Human-Computer Interaction, pp. 581-597. https://doi.org/10.1007/978-3-031-35915-6_42.
    9. Loukili, M., Messaoudi, F. and El Ghazi, M., 2023. Sentiment analysis of product reviews for e-commerce recommendation based on machine learning. International Journal of Advances in Soft Computing & Its Applications15(1). https://doi.org/10.15849/IJASCA.230320.01.
    10. Sharma, H., 2023. Using Topic Modeling for Extracting Customers’ Expectations: a case of women apparel. Business Perspectives and Research, p.22785337221150831. https://doi.org/10.1177/22785337221150831.
    11. Shetty, A.M., Aljunid, M.F., Manjaiah, D.H. and Shaik Afzal, A.M., 2023, July. Hyperparameter optimization of machine learning models using grid search for amazon review sentiment analysis. In International Conference on Data Science and Applications, pp. 451-474. https://doi.org/10.1007/978-981-99-7814-4_36.
    12. Shetty, A.M., Aljunid, M.F. and Manjaiah, D.H., 2023, February. Sentiment exploring on feedback of e-commerce data using machine learning algorithms. In International Conference on Emerging Research in Computing, Information, Communication and Applications, pp.107-129. https://doi.org/10.1007/978-981-99-7622-5_8.
    13. Yabes, I., Aryanti, N., Pradana, R.J., Setiawan, K.E. and Hasani, M.F., 2023, October. Classifying and predicting the rating sentiment of women's e-commerce clothing reviews: a comparative study using SVM, ANN, and BERT Models. In 2023 5th International Conference on Cybernetics and Intelligent System (ICORIS), pp.1-6. https://doi.org/10.1109/ICORIS60118.2023.10352189.
    14. Shashank, S. and Behera, R.K., 2024. Factors influencing recommendations for women's clothing satisfaction: a latent dirichlet allocation approach using online reviews. Journal of Retailing and Consumer Services81, pp.104011. https://doi.org/10.1016/j.jretconser.2024.104011.
    15. Padurariu, C. and Breaban, M.E., 2019. Dealing with data imbalance in text classification. Procedia Computer Science159, pp.736-745. https://doi.org/10.1016/j.procs.2019.09.229.
    16. Mahdikhani, M., 2023. Exploring commonly used terms from online reviews in the fashion field to predict review helpfulness. International Journal of Information Management Data Insights3(1), pp.100172. https://doi.org/10.1016/j.jjimei.2023.100172.
    17. Li, M., Zhao, L. and Srinivas, S., 2023. It is about inclusion! Mining online reviews to understand the needs of adaptive clothing customers. International Journal of Consumer Studies47(3), pp.1157-1172. https://doi.org/10.1111/ijcs.12895.
    18. Shobha Rani, V., Deepthi, K., Ramu, V. and Shirisha, G., 2024, January. Sentiment forecasting in women’s fashion e-Commerce: a machine learning perspective. In International Conference on Multi-Strategy Learning Environment, pp.597-610. https://doi.org/10.1007/978-981-97-1488-9_44.
    19. NICAPOTATO; Women’s e-commerce clothing reviews, 2018. https://www.kaggle.com/datasets/nicapotato/womens-ecommerce-clothing-reviews.
    20. Heng, Y., Gao, Z., Jiang, Y. and Chen, X., 2018. Exploring hidden factors behind online food shopping from amazon reviews: a topic mining approach. Journal of Retailing and Consumer Services42, pp.161-168. https://doi.org/10.1016/j.jretconser.2018.02.006.
    21. Kim, S.W. and Gil, J.M., 2019. Research paper classification systems based on TF-IDF and LDA schemes. Human-centric Computing and Information Sciences9, pp.1-21. https://doi.org/10.1186/s13673-019-0192-7.
    22. Zhong, K., Jackson, T., West, A. and Cosma, G., 2024. Natural language processing approaches in industrial maintenance: a systematic literature review. Procedia Computer Science232, pp.2082-2097. https://doi.org/10.1016/j.procs.2024.02.029.
    23. Vadivel, A., Meena, K., Sumathy, P., Selvaraj, H., Shanmugavadivu, P., & S. G., S., Eds., 2024. Interactive and Dynamic Dashboard: Design Principles,1st Edn., CRC Press. https://doi.org/10.1201/9781003542735.
    24. Cui, M., 2020. Introduction to the k-means clustering algorithm based on the elbow method. Accounting, Auditing and Finance1(1), pp.5-8. https://dx.doi.org/10.23977/accaf.2020.010102.
    25. Januzaj, Y., Beqiri, E. and Luma, A., 2023. Determining the optimal number of clusters using silhouette score as a data mining technique. International Journal of Online & Biomedical Engineering19(4). https://doi.org/10.3991/ijoe.v19i04.37059.
    26. Sarker, I.H., 2021. Machine learning: Algorithms, real-world applications and research directions. SN computer science2(3), pp.160. https://doi.org/10.1007/s42979-021-00592-x.
    27. Pedregosa, F., 2011. Scikit‐learn: Machine learning in python Fabian. Journal of machine learning research12, pp.2825. https://doi.org/10.1002/hbm.25822.
    28. Noor, A. and Islam, M., 2019, July. Sentiment analysis for women's e-commerce reviews using machine learning algorithms. In 2019 10th International conference on computing, communication and networking technologies (ICCCNT), pp.1-6. https://doi.org/10.1109/ICCCNT45670.2019.89444.36.
    29. Chrismanto, A.R., Sari, A.K. and Suyanto, Y., 2023. Enhancing spam comment detection on social media with emoji feature and post-comment pairs approach using ensemble methods of machine learning. https://doi.org/10.1109/ACCESS.2023.3299853.