• Tidak ada hasil yang ditemukan

Hate speech content detection sy. stem on Twitter using K-nearest neighbor method

N/A
N/A
Nguyễn Gia Hào

Academic year: 2023

Membagikan "Hate speech content detection sy. stem on Twitter using K-nearest neighbor method "

Copied!
36
0
0

Teks penuh

THE ROLE OF IT IN INNOVATION ENHANCEMENT

Hate speech content detection sy. stem on Twitter using K-nearest neighbor method

School finder, intelligent recommendation system for elementary school selection

Hate speech content detection system on Twitter using K-nearest neighbor method

Hate Speech Content Detection System on Twitter using K- Nearest Neighbor Method

INTRODUCTION

However, there are many hate speech tweets that have yet to be investigated by the police. This is due to the large number of hate speech tweets in circulation, which makes it difficult for the police to trace the original source or instigators of hate speech. Another factor that contributes to the widespread spread of hate speech is social media users' ignorance of the consequences of the hate speech they post.

The system developed in this research can help Twitter users to first check the tweet to be posted, whether it has the potential to violate certain legal articles, and the consequences if the tweet is still posted. The k-nearest neighbor (KNN) is an instance-based learning method that stores all available data points (examples) and classifies new data points using a similarity measure to classify them. The KNN method works by assigning new unclassified examples to the class containing the majority of its k-nearest neighbors.

When the number of samples in the training dataset is large, this algorithm proves to be very effective in terms of reducing misclassification errors. Another advantage of the KNN method compared to many other supervised learning methods such as support vector machine (SVM), decision tree, neural network, etc. is that it can easily deal with problems with a class size of three or more [3].

RELATED WORKS

Patihullah and Winarko [6] in their research compare the performance of Gated Recurrent Units (GRU) with that of other supervised methods such as Support Vector Machine, Naive Bayes, Random Forest and Logistic Regression. Word2vec was used for feature extraction in their study because it has the ability to learn semantics between words. However, compared to TF and TF-IDF features, using word2vec in comparison methods yields lower accuracy.

In contrast to previous research, Taradhita and Putra [7] propose a convolutional neural network method for classifying hate speech in Indonesian tweets. The KNN method was chosen because it is suitable for problems with class sizes of three or more. Furthermore, if the number of data sets increases, the KNN method can reduce the classification errors [3].

This study uses TF-IDF method for feature extraction because according to research done by Patihullah and Winarko [6], this method provides good accuracy. In addition, this research can specifically tell the user whether or not a tweet is hate speech and what rules are being violated, so the user knows the consequences if the tweet is still posted.

RESEARCH METHODS Collecting and Labeling Data

Preprocessing data

Feature Extraction

Training Data

Formula (2), where Wkj is the value of TF-IDF of a term that matches a term in the query, while Wkq is the TF-IDF value of a term in the query.

Evaluation

RESULTS AND DISCUSSION System Testing

FNTN

TN Accuracy TP

Langkah pertama dalam pra-pemrosesan adalah menghapus simbol-simbol yang biasa ditemukan dalam data tweet, seperti #, @, emotikon, dan tautan situs web. 1 @LsOwien Coba tanya bujang yang melakukan otopsi orang yang katanya meninggal karena menanganinya, mereka tidak berani. Coba suruh bujang yang otopsi orang katanya meninggal karena Coped, kamu gak berani.

The tweets that were used as examples of removing stems and stops are the case folding results in Table 3. 1 coba aja suruh tuh idi kacung who itu autopsy orang yang katanya mati karena coped ga akan berani. After the completion of the pre-processing, the tweet data will be subjected to feature extraction using the TF-IDF method before the training process begins.

This value is derived from the results of the previous accuracy testing, which will be discussed in the next section. After the training process is completed, the system is ready to detect new tweets entered by the user. Users can enter new tweets, which will be tracked by the text area provided by the system.

The detection process starts after the user clicks the "Check" button and the prediction results are displayed below it. The first column contains the entered tweet, the second column contains the detection result, and the last column contains the maximum punishment the user can receive if the tweet contains hate speech. The system also provides a "POST" button, located next to the detection result, where the button functions to post a tweet to our Twitter page.

TABLE 2. Distribution of Tweet Data
TABLE 2. Distribution of Tweet Data

System Validation

Meanwhile, the highest accuracy for Cosine as a distance metric in the KNN method is 67.86% with a value of K=15. Comparison of model validation results for various distance metrics No distance metrics Highest accuracy K-value of KNN. Based on the results of the model validation, the accuracy of the KKN method used in this study is quite good.

However, the accuracy can still be improved by adding the number and variations of the tweet data used for the training process. Furthermore, based on the distribution of tweet data in Table 2, it is necessary to add tweet data to a certain class, so that the number of tweet data in each class is balanced. Another process that can be added to improve the accuracy of the classifier model is the process of converting slang words into standard words.

Slang words are words that are not standardized but are commonly used in everyday life, especially social media activities. Negative slang words were found in the tweet data used in this study, for example the words "jancuk". The four words actually have the same meaning but are written differently, so the system will consider the four words as different entities.

This validation is performed by introducing 100 new tweets that are not in the dataset and that need to be predicted by the system. The difference in accuracy between model validation and user validation lies in the amount of training data used. This proves that the more data used during the training process, the higher the accuracy produced.

TABLE 5. Comparison of Model Validation Results for Several Distance Metrics  No  Distance Metrics Highest Accuracy  K value of KNN
TABLE 5. Comparison of Model Validation Results for Several Distance Metrics No Distance Metrics Highest Accuracy K value of KNN

CONCLUSION

ACKNOWLEDGMENTS

Gambar

FIGURE 1. Hate Speech Tweet That Has Received A Legal Ruling
FIGURE 3. The Flowchart of KNN Method
TABLE 1. Example of Confusion Matrix  Actual Class
TABLE 4. Some Sample Tweets After Stemming and Stop word Removal
+7

Referensi

Dokumen terkait

In addition, the final prediction results were output using the weighted average method of the reciprocal of the state pattern vector matching distance, so as to enhance the

448 The Comparison Of Vehicle Speed Accuracy Using Video Based Mixture Of Gaussian 2 Method and K-.. Nearest Neighbor Method Harris Simaremare 1 , Hadi Melwanda 2

CONCLUSION To classify positive and negative sentiments on Indonesian-language tweets about large-scale social restrictions PSBB by comparing 3 types of distance calculations, namely:

2.The accuracy results of KNN 6 Label using TF-IDF In Figure 2, it can be observed that the highest accuracy is obtained from the data splitting of 80:20, which is 58%.. Previous

Word feature replacement graphic on Baseline + Feature Expansion Based on Figure 4, the SVM classification gets the highest accuracy of 87,41%, obtained using the news data corpus in

Artificial speech detection using image-based features and random forest classifier ABSTRACT The ASV spoof 2015 Challenge was one of the efforts of the research community in the

This study aims to find the different positive responses of women and men toward hate speech using women's and men's language features, stereotyped language that appears in a positive

Naïve Bayes Classifier Evaluation Results Before beginning the testing phase, the model used for classification must be evaluated using training data from 1120 tweets, each of which