Content-Based Screening of Gambling and Pornographic Pages in a URL Shortener Using Naive Bayes
Main Article Content
Abstract
URL shorteners hide the destination of a link and can be used to spread online gambling and pornographic content. Blacklists catch only known addresses, so a step that reads the destination page before the short link is created is attractive. This study describes such a service and evaluates its classifier, which converts the page title, description, keywords, and body text to TF-IDF features (1–3-grams, 120 features) and assigns safe, gambling, or pornography with Naive Bayes; harmful pages are refused. The dataset had 2,167 pages, an undisclosed share of them template-based synthetic text, split 70:30 with augmentation on the training part only. On 644 test pages accuracy was 93.63% (95% CI 91.5–95.3%), macro F1-score 0.9375, and Cohen’s kappa 0.904, yet five-fold cross-validation gave only 0.8335 ± 0.0235, a gap the source does not explain. As a filter, the classifier let 31 of 423 harmful pages pass (7.3%) and blocked 7 of 221 safe pages (3.2%). The safe class comes from English-language sites, so the classifier may partly separate languages and sources instead of content. No baseline, latency measurement, or test on real shortened links was performed. The results support the feasibility of content-aware screening with a lightweight model and define the checks needed before it is trusted as a safeguard.
Downloads
Article Details
Section

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
How to Cite
References
[1] F. Maggi, A. Frossi, S. Zanero, G. Stringhini, B. Stone-Gross, C. Kruegel, and G. Vigna, “Two years of short URLs internet measurement: Security threats and countermeasures,” in Proc. 22nd Int. Conf. World Wide Web (WWW), Rio de Janeiro, Brazil, 2013, pp. 861–872.
[2] J. Ma, L. K. Saul, S. Savage, and G. M. Voelker, “Beyond blacklists: Learning to detect malicious web sites from suspicious URLs,” in Proc. 15th ACM SIGKDD Int. Conf. Knowl. Discov. Data Min., Paris, France, 2009, pp. 1245–1254, doi: 10.1145/1557019.1557153.
[3] D. Sahoo, C. Liu, and S. C. H. Hoi, “Malicious URL detection using machine learning: A survey,” arXiv:1701.07179, 2017.
[4] F. Sebastiani, “Machine learning in automated text categorization,” ACM Comput. Surv., vol. 34, no. 1, pp. 1–47, Mar. 2002, doi: 10.1145/505282.505283.
[5] T. Joachims, “Text categorization with support vector machines: Learning with many relevant features,” in Machine Learning: ECML-98, Lecture Notes in Computer Science. Berlin, Germany: Springer, 1998, pp. 137–142, doi: 10.1007/BFb0026683.
[6] R. Geirhos et al., “Shortcut learning in deep neural networks,” Nat. Mach. Intell., vol. 2, no. 11, pp. 665–673, Nov. 2020, doi: 10.1038/s42256-020-00257-z.
[7] S. Gururangan, S. Swayamdipta, O. Levy, R. Schwartz, S. Bowman, and N. A. Smith, “Annotation artifacts in natural language inference data,” in Proc. 2018 Conf. North Amer. Chapter Assoc. Comput. Linguist.: Human Lang. Technol., vol. 2, 2018, pp. 107–112, doi: 10.18653/v1/N18-2017.
[8] G. Salton and C. Buckley, “Term-weighting approaches in automatic text retrieval,” Inf. Process. Manag., vol. 24, no. 5, pp. 513–523, 1988, doi: 10.1016/0306-4573(88)90021-0.
[9] F. Pedregosa et al., “Scikit-learn: Machine learning in Python,” J. Mach. Learn. Res., vol. 12, pp. 2825–2830, 2011.
[10] J. Wei and K. Zou, “EDA: Easy data augmentation techniques for boosting performance on text classification tasks,” in Proc. 2019 Conf. Empirical Methods Nat. Lang. Process. 9th Int. Joint Conf. Nat. Lang. Process. (EMNLP-IJCNLP), 2019, arXiv:1901.11196.
[11] G. C. Cawley and N. L. C. Talbot, “On over-fitting in model selection and subsequent selection bias in performance evaluation,” J. Mach. Learn. Res., vol. 11, pp. 2079–2107, 2010.
[12] S. Varma and R. Simon, “Bias in error estimation when using cross-validation for model selection,” BMC Bioinformatics, vol. 7, Art. no. 91, 2006, doi: 10.1186/1471-2105-7-91.
[13] L. D. Brown, T. T. Cai, and A. DasGupta, “Interval estimation for a binomial proportion,” Stat. Sci., vol. 16, no. 2, pp. 101–133, May 2001, doi: 10.1214/ss/1009213286.
[14] Q. McNemar, “Note on the sampling error of the difference between correlated proportions or percentages,” Psychometrika, vol. 12, no. 2, pp. 153–157, Jun. 1947, doi: 10.1007/BF02295996.
[15] T. G. Dietterich, “Approximate statistical tests for comparing supervised classification learning algorithms,” Neural Comput., vol. 10, no. 7, pp. 1895–1923, Oct. 1998, doi: 10.1162/089976698300017197.
[16] Y. Bengio and Y. Grandvalet, “No unbiased estimator of the variance of K-fold cross-validation,” J. Mach. Learn. Res., vol. 5, pp. 1089–1105, 2004.
[17] A. Niculescu-Mizil and R. Caruana, “Predicting good probabilities with supervised learning,” in Proc. 22nd Int. Conf. Mach. Learn. (ICML), 2005, pp. 625–632, doi: 10.1145/1102351.1102430.
[18] C. Guo, G. Pleiss, Y. Sun, and K. Q. Weinberger, “On calibration of modern neural networks,” in Proc. 34th Int. Conf. Mach. Learn. (ICML), 2017, arXiv:1706.04599.
[19] F. Koto, A. Rahimi, J. H. Lau, and T. Baldwin, “IndoLEM and IndoBERT: A benchmark dataset and pre-trained language model for Indonesian NLP,” in Proc. 28th Int. Conf. Comput. Linguist. (COLING), 2020, pp. 757–770, doi: 10.18653/v1/2020.coling-main.66.
[20] B. Wilie et al., “IndoNLU: Benchmark and resources for evaluating Indonesian natural language understanding,” in Proc. 1st Conf. Asia-Pacific Chapter Assoc. Comput. Linguist. and 10th Int. Joint Conf. Natural Lang. Process., 2020, pp. 843–857, doi: 10.18653/v1/2020.aacl-main.85.
[21] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, “BERT: Pre-training of deep bidirectional transformers for language understanding,” in Proc. 2019 Conf. North Amer. Chapter Assoc. Comput. Linguist.: Human Lang. Technol. (NAACL-HLT), vol. 1, Minneapolis, MN, USA, 2019, pp. 4171–4186, doi: 10.18653/v1/N19-1423.
[22] S. Kaufman, S. Rosset, C. Perlich, and O. Stitelman, “Leakage in data mining: Formulation, detection, and avoidance,” ACM Trans. Knowl. Discov. Data, vol. 6, no. 4, pp. 1–21, Dec. 2012, doi: 10.1145/2382577.2382579.
[23] J. Bergstra and Y. Bengio, “Random search for hyper-parameter optimization,” J. Mach. Learn. Res., vol. 13, pp. 281–305, 2012.
[24] R. J. Connor, “Sample size for testing differences in proportions for the paired-sample design,” Biometrics, vol. 43, no. 1, p. 207, Mar. 1987, doi: 10.2307/2531961.