Joint Optimization of Preprocessing and HDBSCAN Hyperparameters in BERTopic for Indonesian Social Media Text

Sabrina Adnin Kamila, Utami Dyah Syafitri, Cici Suhaeni

Abstract


Public discourse on social media offers higher education institutions a large-scale, real-time source of feedback, yet extracting interpretable themes from short and informal Indonesian text remains methodologically challenging. This study proposed a statistically grounded framework for HDBSCAN hyperparameter optimization in BERTopic topic modeling, applied to Indonesian-language social media discourse about IPB University on X. This study aimed to determine how preprocessing decisions and HDBSCAN hyperparameters jointly shape topic quality, and to benchmark the resulting optimized BERTopic model against a default configuration and an LDA baseline. A total of 21,298 posts collected between August 2023 and August 2025 were processed under three preprocessing scenarios. For each scenario, a grid search over 126 HDBSCAN hyperparameter combinations was evaluated using topic coherence, topic uniqueness, document coverage, and factuality, standardized and analyzed with Principal Component Analysis and qualitative inspection of the intertopic distance map. The optimized models were benchmarked against a default-configuration BERTopic model and a Latent Dirichlet Allocation (LDA) baseline. Results showed that default HDBSCAN settings produced 334 to 367 statistically unstable topics per scenario, whereas optimization increased coherence by 40% to 66% and reduced the topic count to three to six interpretable themes. The excess-of-mass (eom) method consistently outperformed leaf, and the optimal minimum cluster size shifted from 300 to 500 as preprocessing intensity increased, reflecting a direct interaction between preprocessing and clustering. Optimized BERTopic achieved higher coherence than LDA (0.522–0.634 versus 0.506–0.528), while LDA achieved higher topic uniqueness and coverage, a trade-off linked to BERTopic’s outlier-labeling mechanism. Dominant themes across both models concerned admission and campus life, tuition, and campus facilities, with LDA also surfacing IPB University’s agricultural identity. By treating preprocessing and clustering hyperparameters as a jointly optimized rather than separately tuned design space, these findings offer a replicable framework for topic modeling of short, informal Indonesian text and practical insight for social media analytics and data-driven reputation management.

Keywords


BERTopic; HDBSCAN; Hyperparameter Optimization; Topic Modeling; Social Media Analytics.

Full Text:

DOWNLOAD [PDF]

References


Abdelrazek, A., Eid, Y., Gawish, E., Medhat, W., & Hassan, A. (2023). Topic modeling algorithms and applications: A survey. In Information Systems, 112, Article 102131. https://doi.org/10.1016/j.is.2022.102131

Alangari, H., & Algethami, N. (2024). Exploring the effects of pre-processing techniques on topic modeling of an Arabic news article data set. Applied Sciences, 14(23), Article 11350. https://doi.org/10.3390/app142311350

Albalawi, R., Yeap, T. H., & Benyoucef, M. (2020). Using topic modeling methods for short-text data: A comparative analysis. Frontiers in Artificial Intelligence, 3, Article 42. https://doi.org/10.3389/frai.2020.00042

Babalola, O., Ojokoh, B., & Boyinbode, O. (2024). Comprehensive evaluation of LDA, NMF, and BERTopic's performance on news headline topic modeling. Journal of Computing Theories and Applications, 2(2), 268–289. https://doi.org/10.62411/jcta.11635

Bergstra, J., & Bengio, Y. (2012). Random search for hyper-parameter optimization. Journal of Machine Learning Research, 13, 281–305.

Blei, D. M., Ng, A. Y., & Jordan, M. I. (2003). Latent Dirichlet allocation. Journal of Machine Learning Research, 3, 993–1022.

Borčin, M., & Jose, J. M. (2024). Optimizing BERTopic: Analysis and reproducibility study of parameter influences on topic modeling. In Lecture Notes in Computer Science (Vol. 14611, pp. 147–160). Springer. https://doi.org/10.1007/978-3-031-56066-8_14

Brandon, D. (2023). Data mining Twitter for COVID-19 sentiments concerning college online education. Future Business Journal, 9, Article 104. https://doi.org/10.1186/s43093-023-00284-3

Capriotti, P., & Zeler, I. (2023). Analysing effective social media communication in higher education institutions. Humanities and Social Sciences Communications, 10, Article 656. https://doi.org/10.1057/s41599-023-02187-8

Chauhan, U., & Shah, A. (2022). Topic modeling using latent Dirichlet allocation: A survey. ACM Computing Surveys, 54(7), Article 145. https://doi.org/10.1145/3462478

Devlin, J., Chang, M.-W., Lee, K., Toutanova, K. (2019). BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of NAACL-HLT 2019 (Vol. 1, pp. 4171–4186). ACL. https://doi.org/10.18653/v1/N19-1423

Doi, T., Isonuma, M., & Yanaka, H. (2024). Comprehensive evaluation of large language models for topic modeling [Preprint]. arXiv:2406.00697. http://arxiv.org/abs/2406.00697

Egger, R., & Yu, J. (2022). A topic modeling comparison between LDA, NMF, Top2Vec, and BERTopic to demystify Twitter posts. Frontiers in Sociology, 7, Article 886498. https://doi.org/10.3389/fsoc.2022.886498

Farea, A., Tripathi, S., Glazko, G., & Emmert-Streib, F. (2024). Investigating the optimal number of topics by advanced text-mining techniques: Sustainable energy research. Engineering Applications of Artificial Intelligence, 136, Article 108877. https://doi.org/10.1016/j.engappai.2024.108877

Feng, Y., Chen, Z., Zhang, Y., Huang, W., Zhang, X., & He, S. (2025). BERTopic_Teen: A multi-module optimization approach for short text topic modeling in adolescent health. Frontiers in Public Health, 13, Article 1608241. https://doi.org/10.3389/fpubh.2025.1608241

Grootendorst, M. (2022). BERTopic: Neural topic modeling with a class-based TF-IDF procedure [Preprint]. arXiv:2203.05794. https://arxiv.org/abs/2203.05794

Janssens, W., Bogaert, M., & Van Den Poel, D. (2025). A comparative analysis of topic reduction techniques for BERTopic. IEEE Access, 13, 204087–204103. https://doi.org/10.1109/ACCESS.2025.3638956

Laureate, C. D. P., Buntine, W., & Linger, H. (2023). A systematic review of the use of topic models for short text social media analysis. Artificial Intelligence Review, 56(12), 14223–14255. https://doi.org/10.1007/s10462-023-10471-x

Ma, L., Chen, R., Ge, W., Rogers, P., Lyn-Cook, B., Hong, H., Tong, W., Wu, N., & Zou, W. (2025). AI-powered topic modeling: Comparing LDA and BERTopic in analyzing opioid-related cardiovascular risks in women. Experimental Biology and Medicine, 250, Article 10389. https://doi.org/10.3389/ebm.2025.10389

McInnes, L., Healy, J., & Astels, S. (2017). hdbscan: Hierarchical density based clustering. Journal of Open Source Software, 2(11), Article 205. https://doi.org/10.21105/joss.00205

McInnes, L., Healy, J., & Melville, J. (2020). UMAP: Uniform manifold approximation and projection for dimension reduction [Preprint]. arXiv:1802.03426. http://arxiv.org/abs/1802.03426

Medvecki, D., Bašaragin, B., Ljajić, A., & Milošević, N. (2024). Multilingual transformer and BERTopic for short text topic modeling: The case of Serbian. In Lecture Notes in Networks and Systems (Vol. 872, pp. 161–173). Springer. https://doi.org/10.1007/978-3-031-50755-7_16

Mutsaddi, A., Jamkhande, A., Thakre, A., & Haribhakta, Y. (2025). BERTopic for topic modeling of Hindi short texts: A comparative study. In Proceedings of the First Workshop on NLP for Indo-Aryan and Dravidian Languages (pp. 22–32). ACL.

Nan, F., Ding, R., Nallapati, R., & Xiang, B. (2019). Topic modeling with Wasserstein autoencoders. In Proceedings of the 57th Annual Meeting of the ACL (pp. 6345–6381). ACL. https://doi.org/10.18653/v1/P19-1640

Reimers, N., & Gurevych, I. (2019). Sentence-BERT: Sentence embeddings using Siamese BERT-networks. In Proceedings of EMNLP-IJCNLP 2019 (pp. 3982–3992). ACL. https://doi.org/10.18653/v1/D19-1410

Röder, M., Both, A., & Hinneburg, A. (2015). Exploring the space of topic coherence measures. In Proceedings of the Eighth ACM International Conference on Web Search and Data Mining (pp. 399–408). ACM. https://doi.org/10.1145/2684822.2685324

Romero, J. D., Feijoo-Garcia, M. A., Nanda, G., Newell, B., & Magana, A. J. (2024). Evaluating the Performance of Topic Modeling Techniques with Human Validation to Support Qualitative Analysis. Big Data and Cognitive Computing, 8(10). https://doi.org/10.3390/bdcc8100132

Schneijderberg, C., Wieczorek, O., & Steinhardt, I. (2026). Topic modeling with BERTopic. In The Handbook of Qualitative and Quantitative Content Analysis (pp. 558–592). Routledge. https://doi.org/10.4324/9781003496397-21

Suhaeni, C., Mualifah, L. N. A., & Wijayanto, H. (2025a). LDA topic modeling analysis of public discourse on Indonesia's free nutritious meals program (MBG). IJID (International Journal on Informatics for Development), 14(1), 587–600. https://doi.org/10.14421/ijid.2025.5211

Suhaeni, C., Kamila, S. A., Fahira, F., Yusran, M., & Alfa Dito, G. (2025b). Exploring a large language model on the ChatGPT platform for Indonesian text preprocessing tasks. Indonesian Journal of Statistics and Its Applications, 9(1), 100–116. https://doi.org/10.29244/ijsa.v9i1p100-116

Vayansky, I., & Kumar, S. A. P. (2020). A review of topic modeling methods. Information Systems, 94, Article 101582. https://doi.org/10.1016/j.is.2020.101582

Weisser, C., Gerloff, C., Thielmann, A., Python, A., Reuter, A., Kneib, T., & Säfken, B. (2023). Pseudo-document simulation for comparing LDA, GSDMM and GPM topic models on short and sparse text using Twitter data. Computational Statistics, 38(2), 647–674. https://doi.org/10.1007/s00180-022-01246-z

Zimmermann, J., Champagne, L. E., Dickens, J. M., & Hazen, B. T. (2024). Approaches to improve preprocessing for Latent Dirichlet Allocation topic modeling. Decision Support Systems, 185, Article 114310. https://doi.org/10.1016/j.dss.2024.114310




DOI: https://doi.org/10.31764/jtam.v10i4.40667

Refbacks

  • There are currently no refbacks.


Copyright (c) 2026 Sabrina Adnin Kamila, Utami Dyah Syafitri, Cici Suhaeni

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

_______________________________________________

JTAM already indexing:


_______________________________________________

Creative Commons License

JTAM (Jurnal Teori dan Aplikasi Matematika)
is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License

______________________________________________

_______________________________________________

_______________________________________________

JTAM (Jurnal Teori dan Aplikasi Matematika) Editorial Office: