Spoiler detection in book reviews is a challenging text classification task because spoilers are not always identifiable from specific words but depend heavily on the narrative context in which information is revealed. This study compares six text classification models for detecting spoilers in Indonesian-language book reviews from Goodreads, namely Support Vector Machine (SVM), Random Forest, XGBoost, Bidirectional Long Short-Term Memory (BiLSTM), IndoBERT, and XLM-R (RoBERTa). Data were collected through Selenium-based web scraping and GraphQL API from 40 mystery and thriller book titles, resulting in 11,259 reviews with a class imbalance ratio of 1:10.4. All models were evaluated using AUC-ROC, PR-AUC, spoiler F1-score, and spoiler recall as primary metrics, with decision thresholds optimized through each model's validation set. XLM-R achieved the best overall performance with an AUC-ROC of 0.7017, a PR-AUC of 0.2263, and a spoiler F1-score of 0.2903, followed by IndoBERT, SVM, Random Forest, XGBoost, and BiLSTM. Overall, transformer-based models outperformed the traditional machine learning models and BiLSTM across most evaluation metrics. The results also indicate that each model exhibits different precision-recall characteristics, suggesting that model performance should not be evaluated using a single metric alone. These findings can serve as an initial reference for future research on Indonesian-language spoiler detection and support the development of automated spoiler detection systems for content moderation on digital book review platforms
Copyrights © 2026