Perbandingan Semantic Search Berbasis Sentence-Bert dan TF-IDF pada Pencarian Dokumen Ancaman Siber

Authors

  • Nanda Setiawan Universitas Potensi Utama
  • Johan Universitas Potensi Utama
  • Iswanto Universitas Potensi Utama
  • Roslina Politeknik Negeri Medan

Keywords:

semantic search, Sentence-BERT, TF-IDF, document search, cyber threats

Abstract

The increasing number of cyber threat documents has made the information retrieval process increasingly complex because keyword-based methods are unable to understand semantic relationships between documents. This study aims to compare the performance of the Term Frequency–Inverse Document Frequency (TF-IDF) and Sentence Bidirectional Encoder Representations from Transformers (Sentence-BERT) methods in a cyber threat document retrieval system. The research stages include Importing the CyberBERT Dataset, text preprocessing, building a search model, testing using queries, and evaluating the results based on document relevance and response time. The Dataset used consists of 33 documents processed into vector representations using TF-IDF and 384-dimensional embedding using Sentence-BERT. The results show that both methods are able to return relevant documents to the given query, but produce different document sequences due to differences in text representation approaches. The TF-IDF method has a faster response time of 0.0089 seconds, while Sentence-BERT requires 0.0312 seconds. On the other hand, Sentence-BERT is better able to capture semantic relationships, resulting in more contextual searches. Thus, TF-IDF is superior in terms of efficiency, while Sentence-BERT is more effective in understanding the meaning of documents, making it suitable for semantic search systems in the cyber threat domain.

Downloads

Download data is not yet available.

References

Z. Hu, H. Dai, G. Yang, X. Yi, and W. Sheng, ‘Semantic-Based Multi-Keyword Ranked Search Schemes over Encrypted Cloud Data’, Security and Communication Networks, vol. 2022, pp. 1–15, Apr. 2022, doi: 10.1155/2022/4478618.

R. M. Holis, P. E. P. Utomo, and B. F. Hutabarat, ‘Semantic FAQ Chatbot Using SBERT (Sentence-BERT) and Cosine Similarity for Academic Services’, Brilliance, vol. 5, no. 2, pp. 915–922, Oct. 2025, doi: 10.47709/brilliance.v5i2.7027.

S.-S. Chen, T.-W. Pai, and C.-Y. Sun, ‘EnhanceCTI: Enhanced semantic filtering and feature extraction framework for industry-specific cyber threat intelligence’, Computers & Security, vol. 158, p. 104649, Nov. 2025, doi: 10.1016/j.cose.2025.104649.

I. Lubis, H. Lubis, and I. Nur Wahidah, ‘Implementation of Semantic Search in an Academic Repository Using Sentence-BERT and FAISS’, SinkrOn, vol. 10, no. 2, pp. 1060–1069, Apr. 2026, doi: 10.33395/sinkron.v10i2.15940.

M. A. H. Fathuddin, E. P. Mandyartha, and A. L. Nurlaili, ‘Penerapan Sentence-Bert dan Cosine Similarity untuk Pencarian Semantik Dokumen Skripsi dalam Format PDF’, RRJ, vol. 8, no. 1, pp. 322–337, Oct. 2025, doi: 10.38035/rrj.v8i1.1865.

H. Gusdevi, A. Setyanto, K. Kusrini, and E. Utami, ‘Cosine Similarity-Based Evidences Selection for Fact Verification Using SBERT on the FEVER Dataset’, CogITo Smart Journal, vol. 11, no. 1, pp. 52–66, Jun. 2025, doi: 10.31154/cogito.v11i1.917.52-66.

J. Baek, J. O, S. Jeong, and W. Kim, ‘A Study on Improving the Automatic Classification Performance of Cybersecurity MITRE ATT&CK Tactics Using NLP-Based ModernBERT and BERTopic Models’, Electronics, vol. 14, no. 22, p. 4434, Nov. 2025, doi: 10.3390/electronics14224434.

R. Othman, B. Rossi, and R. Barbara, ‘A Comparison of Vulnerability Feature Extraction Methods from Textual Attack Patterns’, 2024, arXiv. doi: 10.48550/ARXIV.2407.06753.

T. Chakraborty, V. La Gatta, V. Moscato, and G. Sperlì, ‘Information retrieval algorithms and neural ranking models to detect previously fact-checked information’, Neurocomputing, vol. 557, p. 126680, Nov. 2023, doi: 10.1016/j.neucom.2023.126680.

A. L. Alfeo, M. G. C. A. Cimino, and G. Vaglini, ‘Technological troubleshooting based on sentence embedding with deep transformers’, J Intell Manuf, vol. 32, no. 6, pp. 1699–1710, Aug. 2021, doi: 10.1007/s10845-021-01797-w.

A. Esteva et al., ‘COVID-19 information retrieval with deep-learning based semantic search, question answering, and abstractive summarization’, npj Digit. Med., vol. 4, no. 1, p. 68, Apr. 2021, doi: 10.1038/s41746-021-00437-0.

C. Min, Y. Chu, L. Yang, B. Xu, and H. Lin, ‘Locality Preserving Sentence Encoding’, in Findings of the Association for Computational Linguistics: EMNLP 2021, Punta Cana, Dominican Republic: Association for Computational Linguistics, 2021, pp. 3050–3060. doi: 10.18653/v1/2021.findings-emnlp.262.

R. Al Rasyid and D. H. U. Ningsih, ‘Penerapan Algoritma TF-IDF dan Cosine Similarity untuk Query Pencarian Pada Dataset Destinasi Wisata’, jtik, vol. 8, no. 1, pp. 170–178, Jan. 2024, doi: 10.35870/jtik.v8i1.1416.

N. Reimers and I. Gurevych, ‘Making Monolingual Sentence Embeddings Multilingual using Knowledge Distillation’, in Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), Online: Association for Computational Linguistics, 2020, pp. 4512–4525. doi: 10.18653/v1/2020.emnlp-main.365.

G. H. Setiawan and I. M. B. Adnyana, ‘Improving Helpdesk Chatbot Performance with Term Frequency-Inverse Document Frequency (TF-IDF) and Cosine Similarity Models’, JAIC, vol. 7, no. 2, pp. 252–257, Dec. 2023, doi: 10.30871/jaic.v7i2.6527.

Downloads

Published

2026-10-10