Feature Expansion Using Word2vec for Hate Speech Detection on Indonesian Twitter with Classification Using SVM and Random Forest
DOI:
https://doi.org/10.30865/mib.v6i2.3855Keywords:
Hate Speech, Feature Expansion, Word2vec, Support Vector Machine(SVM), Random Forest, Indonesian TwitterAbstract
Hate speech is one of the most common cases on Twitter. It is limited to 280 characters in uploading tweets, resulting in many word variations and possible vocabulary mismatches. Therefore, this study aims to overcome these problems and build a hate speech detection system on Indonesian Twitter. This study uses 20,571 tweet data and implements the Feature Expansion method using Word2vec to overcome vocabulary mismatches. Other methods applied are Bag of Word (BOW) and Term Frequency-Inverse Document Frequency (TF-IDF) to represent feature values in tweets. This study examines two methods in the classification process, namely Support Vector Machine (SVM) and Random Forest (RF). The final result shows that the Feature Expansion method with TF-IDF weighting in the Random Forest classification gives the best accuracy result, which is 88,37%. The Feature Expansion method with TF-IDF weighting can increase the accuracy value from several tests in detecting hate speech and overcoming vocabulary mismatches.References
D. A. N. Taradhita and I. K. G. D. Putra, “Hate speech classification in Indonesian language tweets by using convolutional neural network,†J. ICT Res. Appl., vol. 14, no. 3, pp. 225–239, 2021, doi: 10.5614/itbj.ict.res.appl.2021.14.3.2.
K. M. Hana, Adiwijaya, S. Al Faraby, and A. Bramantoro, “Multi-label Classification of Indonesian Hate Speech on Twitter Using Support Vector Machines,†2020 Int. Conf. Data Sci. Its Appl. ICoDSA 2020, no. January 2021, 2020, doi: 10.1109/ICoDSA50139.2020.9212992.
A. P. Sitorus, H. Murfi, S. Nurrohmah, and A. Akbar, “Sensing Trending Topics in Twitter for Greater Jakarta Area,†Int. J. Electr. Comput. Eng., vol. 7, no. 1, pp. 330–336, 2017, doi: 10.11591/ijece.v7i1.pp330-336.
P. P. A. Arsya Monica Pravina, Imam Cholissodin, “Analisis Sentimen Tentang Opini Maskapai Penerbangan pada Dokumen Twitter Menggunakan Algoritme Support Vector Machine (SVM),†J. Pengemb. Teknol. Inf. dan Ilmu Komput., vol. 3, no. 3, pp. 2789–2797, 2019, [Online]. Available: http://j-ptiik.ub.ac.id/index.php/j-ptiik/article/view/4793.
T. T. A. Putri, S. Sriadhi, R. D. Sari, R. Rahmadani, and H. D. Hutahaean, “A comparison of classification algorithms for hate speech detection,†IOP Conf. Ser. Mater. Sci. Eng., vol. 830, no. 3, 2020, doi: 10.1088/1757-899X/830/3/032006.
E. B. Setiawan, D. H. Widyantoro, and K. Surendro, “Feature expansion using word embedding for tweet topic classification,†Proceeding 2016 10th Int. Conf. Telecommun. Syst. Serv. Appl. TSSA 2016 Spec. Issue Radar Technol., 2017, doi: 10.1109/TSSA.2016.7871085.
D. Wiana, “Analysis of the use of the hate speech on social media in the case of presidential election in 2019,†J. Appl. Stud. Lang., vol. 3, no. 2, pp. 158–167, 2019, doi: 10.31940/jasl.v3i2.1541.
F. A. Wenando, “Detection of Hate Speech in Indonesian Language on Twitter Using Machine Learning Algorithm,†PROCEEDING CelSciTech-UMRI 2019, vol. 4, pp. 6–8, 2019.
K. Nugroho et al., “Improving random forest method to detect hatespeech and offensive word,†2019 Int. Conf. Inf. Commun. Technol. ICOIACT 2019, no. July, pp. 514–518, 2019, doi: 10.1109/ICOIACT46704.2019.8938451.
I. Alfina, R. Mulia, M. I. Fanany, and Y. Ekanata, “Hate speech detection in the Indonesian language: A dataset and preliminary study,†2017 Int. Conf. Adv. Comput. Sci. Inf. Syst. ICACSIS 2017, vol. 2018-Janua, no. October, pp. 233–237, 2018, doi: 10.1109/ICACSIS.2017.8355039.
Oryza Habibie Rahman, Gunawan Abdillah, and Agus Komarudin, “Klasifikasi Ujaran Kebencian pada Media Sosial Twitter Menggunakan Support Vector Machine,†J. RESTI (Rekayasa Sist. dan Teknol. Informasi), vol. 5, no. 1, pp. 17–23, 2021, doi: 10.29207/resti.v5i1.2700.
U. G. Student, “Machine Learning Based Sentiment Classification,†vol. 29, no. 3, pp. 1062–1071, 2020.
S. Abro, S. Shaikh, Z. Ali, S. Khan, G. Mujtaba, and Z. H. Khand, “Automatic hate speech detection using machine learning: A comparative study,†Int. J. Adv. Comput. Sci. Appl., vol. 11, no. 8, pp. 484–491, 2020, doi: 10.14569/IJACSA.2020.0110861.
J. Patihullah and E. Winarko, “Hate Speech Detection for Indonesia Tweets Using Word Embedding And Gated Recurrent Unit,†IJCCS (Indonesian J. Comput. Cybern. Syst., vol. 13, no. 1, p. 43, 2019, doi: 10.22146/ijccs.40125.
W. Trisari, H. Putri, R. Hendrowati, and L. Belakang, “Penggalian Teks Dengan Model Bag of Words Terhadap,†vol. 2, no. 1, pp. 129–138, 2020.
S. Qaiser and R. Ali, “Text Mining: Use of TF-IDF to Examine the Relevance of Words to Documents,†Int. J. Comput. Appl., vol. 181, no. 1, pp. 25–29, 2018, doi: 10.5120/ijca2018917395.
M. A. Lestari, P. P. Adikara, and S. Adinugroho, “Rekomendasi Lagu berdasarkan Lirik dan Genre Lagu menggunakan Metode Word Embedding (Word2Vec),†vol. 3, no. 8, pp. 2548–964, 2019, [Online]. Available: http://j-ptiik.ub.ac.id.
Z. Pratama, E. Utami, and M. R. Arief, “Analisa Perbandingan Jenis N-GRAM Dalam Penentuan Similarity Pada Deteksi Plagiat,†Creat. Inf. Technol. J., vol. 4, no. 4, p. 254, 2019, doi: 10.24076/citec.2017v4i4.118.
A. Nurdin, B. Anggo Seno Aji, A. Bustamin, and Z. Abidin, “Perbandingan Kinerja Word Embedding Word2Vec, Glove, Dan Fasttext Pada Klasifikasi Teks,†J. Tekno Kompak, vol. 14, no. 2, p. 74, 2020, doi: 10.33365/jtk.v14i2.732.
T. Mikolov, K. Chen, G. Corrado, and J. Dean, “Efficient estimation of word representations in vector space,†1st Int. Conf. Learn. Represent. ICLR 2013 - Work. Track Proc., no. January 2013, 2013.
irwan budiman, M. R. Faisal, and D. T. Nugrahadi, “Studi Ekstraksi Fitur Berbasis Vektor Word2Vec pada Pembentukan Fitur Berdimensi Rendah,†J. Komputasi, vol. 8, no. 1, pp. 62–69, 2020, doi: 10.23960/komputasi.v8i1.2517.
R. A. Rizal, I. S. Girsang, and S. A. Prasetiyo, “Klasifikasi Wajah Menggunakan Support Vector Machine (SVM),†REMIK (Riset dan E-Jurnal Manaj. Inform. Komputer), vol. 3, no. 2, p. 1, 2019, doi: 10.33395/remik.v3i2.10080.
A. Primajaya and B. N. Sari, “Random Forest Algorithm for Prediction of Precipitation,†Indones. J. Artif. Intell. Data Min., vol. 1, no. 1, p. 27, 2018, doi: 10.24014/ijaidm.v1i1.4903.
K. Antariksa, Y. S. Purnomo WP, and E. Ernawati, “Klasifikasi Ujaran Kebencian pada Cuitan dalam Bahasa Indonesia,†J. Buana Inform., vol. 10, no. 2, p. 164, 2019, doi: 10.24002/jbi.v10i2.2451.
Downloads
Published
Issue
Section
License

This work is licensed under a Creative Commons Attribution 4.0 International License
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under Creative Commons Attribution 4.0 International License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (Refer to The Effect of Open Access).