Elamur Research

Comparison Between Traditional Machine Learning Models And Neural Network Models For Vietnamese Hate Speech Detection

Paper · 2020 · Son T. Luu, Hung Nguyen, Kiet Van Nguyen et al.

Summary

A Vietnamese Facebook comment can contain profanity without expressing hatred. It can also attack a person or group in language a simple word filter would miss. The authors treat that distinction as a text classification problem. They compare methods for assigning each comment or post to CLEAN, OFFENSIVE, or HATE, using 20,345 items from the 2019 VLSP shared task. CLEAN is by far the most common label. That imbalance makes it important to ask how well a classifier recognizes each kind of comment, since a large share of correct decisions can come from recognizing ordinary posts.

The study compares approaches that represent text in different ways. Logistic regression and a linear support vector machine, or SVM, use weighted features drawn from sequences of words and characters. A convolutional network called Text-CNN and a bidirectional gated recurrent unit, or GRU, start with pretrained Vietnamese word vectors. Text-CNN searches for patterns across short spans of text. The GRU processes the sequence in both directions, carrying information from neighboring and earlier positions as it goes. All four classifiers use the authors’ cleaned and segmented version of the shared-task data.

Text-CNN leads the comparison with an average macro F1 of 83.04%. Macro F1 gives each label equal weight when combining performance across labels. The strongest traditional classifier, the SVM, reaches 65.10%. Their rates of correctly identifying gold CLEAN items are close. The difference is much clearer on the other labels. Text-CNN correctly recognizes 65.58% of gold OFFENSIVE items on average across the test folds, compared with 28.33% for the SVM. For gold HATE items, the corresponding rates are 73.94% and 50.00%. Logistic regression also recognizes more of the gold OFFENSIVE items than the SVM does, even though it places below the SVM on macro F1.

The error analysis points to profanity in abbreviated spellings and to forms of personal address as possible clues. The authors find examples where a classifier predicts CLEAN in spite of the presence of a profane expression. They connect the difficulty of recognizing OFFENSIVE and HATE to the scarcity of those labels and propose gathering more annotated examples, augmenting the smaller classes, and developing resources tailored to Vietnamese social media. The measured contribution is the comparison of individual classifiers and their errors. A combined classifier remains a proposal.

Deep dive: Comparison Between Traditional Machine Learning Models And Neural Network Models For Vietnamese Hate Speech Detection

A comparison of linear classifiers and neural networks for Vietnamese hate speech detection explains where Text-CNN gains on Facebook comments. · about 33 minutes to read

The problem and its context

Why distinguish offensive language from hate speech?

For the authors, the practical motivation is the growth of online discussion in Vietnam and the difficulty of keeping those discussions welcoming. Social platforms already had rules addressing offensive or racist content. Enforcing such rules across many comments calls for judgments about what a message expresses as well as whether particular words occur in it. The paper studies one part of that problem by asking how reliably automated classifiers can recover the distinctions made by annotators in a shared task.

The task assigns a single label to a whole post or comment. CLEAN covers text without offensive or hateful language under the shared-task definitions. OFFENSIVE covers offensive wording without the kind of attack based on personal or group characteristics used to describe HATE. The HATE description also mentions encouraging hatred and includes references to profanity and offensive wording. The definitions give abusive words a place in the decision while making the target and nature of an attack relevant to the boundary. A profanity match offers a clue to the labels without deciding which one an annotator chose.

This distinction matters when interpreting the authors’ experiment. The category predicted by the classifier is the category defined for the dataset. A classifier encounters a string of text and learns from examples in which an annotator has already made the judgment. It has to find some way of carrying the distinction over to comments it did not train on. If the training data often contain a particular expression in HATE, that expression might help predict the label. A change in whom the expression addresses, or in what the rest of the sentence says about the target, may change the correct answer. The labels therefore ask for more than detecting a list of undesirable words.

Comments on social platforms also depart from the writing that many standard natural language processing tools expect. The authors describe abbreviations, unconventional spellings, slang, emojis, hashtags, and links. Even finding where a word begins and ends can be harder in this setting. A word-based feature depends on how the text was segmented, while a character-based feature can capture part of a spelling independently of the full word. The paper also names dependencies over longer spans as a concern. A local expression may be easy to recognize while clues elsewhere in the comment carry information about how to interpret it.

The imbalance among the labels adds a separate difficulty. CLEAN dominates the dataset, and HATE is the least common label. A learner sees more examples of the ways a post can be clean than examples of the ways a post can express hatred. In evaluation, a measure based only on the fraction of correct decisions can give the majority label great influence. Suppose a classifier frequently assigns CLEAN whenever an unfamiliar abusive expression occurs. Its correct decisions on the more numerous CLEAN items could still make the overall fraction look favorable. The authors use a class-balanced evaluation measure and examine the errors by gold label so that this behavior is visible.

What earlier comparisons had established

The paper places its experiment in a line of work using both explicit text features and neural networks. Waseem and Hovy, for example, presented criteria informed by critical race theory and examined logistic regression with word and character sequences as well as information about users. The lesson relevant to the Vietnamese study is in the design of the comparison. A classifier receives a particular description of the text and associated information, and the choice of what to represent determines what signals it can learn to use. The Vietnamese study takes the text-feature part of this approach and applies it to comments after a common preparation procedure.

Davidson and colleagues addressed the separation of hateful and offensive tweets directly. As the authors describe it, that work used a collection of annotated material from Twitter and found the lexical distinction between hate and offensiveness difficult to make. This is the closest parallel to the Vietnamese label boundary. The presence of an offensive word can be easy to establish, even when its role in the utterance remains harder to judge. Prior work had already made that distinction a classification problem before the authors investigated which methods handled it better on the VLSP data.

Other studies in the paper’s review used weighted word-sequence features or explored how to select features for an SVM. Gaydhani and colleagues applied logistic regression to a collection assembled from several Twitter datasets. Martins and colleagues used an SVM on the Hatebase dataset with features selected through a ranking procedure. These examples show why the paper includes both linear learners. Features that describe short sequences give a simple text classifier some access to combinations of words, and a feature-selection or weighting policy affects the evidence that reaches the classifier. The review by Fortuna and Nunes adds a different kind of context. It compares definitions of hate speech from several kinds of sources and surveys the challenges faced by detection research.

The authors also describe earlier comparisons using convolutional and recurrent networks for toxic-comment classification. One tested convolution with pretrained word vectors and with word representations that started randomly and changed during training. Another compared a convolutional network with a long short-term memory network, or LSTM, across several toxic-comment labels. The distinction between those comparisons matters for the design of the Vietnamese study. One changes how words are represented within a broadly similar architecture. The other changes the architecture that processes them. Both choices can influence classification, so a comparison in which they move together speaks about a complete system configuration.

Imbalance and combination had also been studied before. The paper mentions work on a Wikipedia talk-page dataset that explored data augmentation, meaning the creation of additional training examples, and a combination of convolutional and recurrent classifiers. The Vietnamese experiment takes up both concerns at different stages. It uses the existing data to examine current classifiers and their errors, and it discusses augmentation and combination as possibilities motivated by those errors. This gives the experiment a narrower immediate purpose than developing a new augmentation recipe or training a new combined system.

The shared tasks in the review show how much a benchmark’s question shapes the comparison. The multilingual SemEval task described by the authors considered hate directed at immigrants or women in English and Spanish and separately asked about aggression in hateful tweets. The VLSP task supplies Vietnamese Facebook material with the CLEAN, OFFENSIVE, and HATE labels. The former raises questions about targets and aggression through its own task structure. The latter makes separation of offensive language from hate part of a single decision. Similar terminology can therefore refer to different outputs.

Within the earlier VLSP work, ensembles were already a prominent approach. The authors mention entries that combined systems or explored feature extraction, alongside a bidirectional LSTM and a design drawing on several neural architectures. Their own comparison asks a more diagnostic question about familiar methods. Given the same Vietnamese benchmark and evaluation procedure, which configuration fares best overall, and where do its correct and incorrect decisions fall? The shared-task entries establish the local research context. The head-to-head experiment is grounded in the classifiers the authors trained and evaluated under their own protocol.

The method, step by step

Turning a comment into an input

Both routes through the experiment begin with an annotated comment or post. The annotation supplies the answer for training and the reference answer for evaluation. The learners receive representations of the comment text, and their job at test time is to assign one of the shared-task categories. The difference between the routes is the form of evidence the learners receive. The linear classifiers use weighted features keyed to sequences found in the text. The neural classifiers receive sequences of numerical word vectors and learn how to use those vectors for the category decision.

The authors first remove special material such as emojis and hashtags, along with URLs and digits. They then lower-case the text. Lowercasing brings forms that differ only by capitalization under the same representation. Removing material reduces the number of surface forms that enter the system and restricts the evidence available later. For example, a classifier trained from this input has the remaining words and characters to work with when an emoji in the original comment would have supplied a clue about its tone. The paper uses this cleaning procedure for the comparison as a whole.

The authors use Pyvi for tokenization, the step that identifies units of text to be processed as words. In this experiment, segmentation supplies the word units used by the word-feature extractor and the inputs for looking up neural word vectors. Boundaries therefore matter at several points. A phrase segmented in an unexpected way can produce different word sequences for a linear classifier and different lookup units for the neural classifiers. The character feature extractor offers an additional view of the string, though it still works with the prepared text.

The resulting pipeline has two parallel routes after preparation. Each route produces a prediction for the same kind of annotated item. The split procedure governs which items provide training examples and which supply predictions for evaluation.

From Vietnamese Facebook text to evaluated label predictions

The steps in order.

From Vietnamese Facebook text to evaluated label predictionsStep 1: Start with annotated Facebook comments and posts1. Start with annotated Facebook comments and postsStep 2: Remove selected symbols, links, and digits2. Remove selected symbols, links, and digitsStep 3: Lowercase and segment words with Pyvi3. Lowercase and segment words with PyviStep 4: Form class-proportional training and test folds4. Form class-proportional training and test foldsStep 5: Represent text as features or word vectors5. Represent text as features or word vectorsStep 6: Train each classifier on its training portion6. Train each classifier on its training portionStep 7: Predict labels on the corresponding test portion7. Predict labels on the corresponding test portionStep 8: Average macro F1 and confusion rates across folds8. Average macro F1 and confusion rates across folds

The linear route uses word and character sequences

The linear classifiers use TF-IDF, a way to weight textual features according to their occurrence in an item and how widespread they are in a collection. The term-frequency part reflects occurrence within the text being represented. The inverse-document-frequency part gives a feature less distinguishing weight when it appears throughout the collection. Here the items being represented are whole comments or posts. A common expression can still appear as a feature, but its weight reflects how common it is across items as well as its presence in the one being classified.

The features in these representations are n-grams, contiguous sequences of a selected length. Word n-grams can represent a standalone term or nearby terms in their observed order. This gives the classifier a way to distinguish a short phrase from the evidence carried by its separate words. Character n-grams capture sequences of letters or other surviving characters. They can register fragments of a spelling, including fragments that recur across related forms. Their usefulness in this task is easy to see given the paper’s examples of abbreviated profanity, though the experiment measures the combined feature configuration.

The word analyzer uses the range (1,3), so the feature candidates run from individual words through sequences of three words. Its maximum is 20,000 features. The character analyzer uses the range (3,6) and has a maximum of 40,000 features. The description names a Vietnamese stop-word list for the word analyzer and also mentions stop words in the character configuration. Stop words are words designated for exclusion from a representation. The exact point at which the list affects the character features is left unclear. The reported settings identify the kinds, lengths, and limits of the features available to the linear classifiers. They leave some details of how the feature pipeline was assembled open.

Logistic regression learns how the weighted textual features contribute to a category decision. Each feature can provide evidence for particular labels, with the comment represented by the features that occur in it. Here the authors set the regularization parameter C to 1.0 and report balanced class weights. Regularization governs the tradeoff between fitting the training examples and constraining the learned decision rule. Class weights affect how strongly examples of different labels contribute during learning. In this setting, the reported weighting gives the less common classes greater influence than they would have if each training item made an equal contribution regardless of its label frequency.

The SVM receives the same types of TF-IDF features. A linear SVM learns boundaries in feature space, where each comment is represented by its weighted features. The training criterion emphasizes separating the classes with a margin, so the positions of examples near the decision boundaries matter. The authors use support vector classification with a linear kernel and C set to 1.0. The linear kernel makes the decision depend on a linear relationship among the feature values. A short phrase can still function as a unit of evidence because the feature extractor has already given that phrase a slot of its own.

The shared input representation makes the linear pair a particularly useful comparison. Both learners can draw on short word sequences and character fragments. The experiment changes the learner and includes the reported balanced weighting for logistic regression. The SVM configuration gives its kernel and regularization setting, while its treatment of class weights is unspecified in the paper. Consequently, a difference between the two results describes the two setups the authors tested. Attributing it exclusively to the choice of learning criterion would require holding the weighting policy and other settings fixed.

The neural route begins with Vietnamese word vectors

The other route represents each word by a learned numerical vector. Word embeddings give a learner a distributed description of a word across many coordinates. A network can use relationships among these descriptions when learning how a sequence relates to a category. The paper uses the pretrained Vietnamese word vectors supplied by Grave and colleagues. Their pretraining drew on Common Crawl and Wikipedia and used continuous bag of words, or CBOW, with position weighting and character n-grams. CBOW learns a representation through a word-prediction task based on surrounding words. Position weighting lets those surrounding words contribute differently according to their positions, and character sequences supply information about the forms of words.

The embedding size is 300 in both neural configurations. That size describes the number of coordinates in a word vector. It has a different role from a limit on how many word entries a classifier can handle. For Text-CNN, the experimental configuration separately gives a maximum of 11,221 features for its embedding layer. This is reported as a setting for Text-CNN. The dataset’s total count refers to comments and posts, a separate unit from the entries handled by an embedding layer.

Pretraining and classifier training serve different purposes. The vector resource comes from broad text collections and provides an initial representation of Vietnamese words. Training for the shared task uses labeled Facebook items to learn which patterns help distinguish CLEAN, OFFENSIVE, and HATE. The paper reports use of the pretrained representations in the embedding layers of both architectures. It leaves open whether those vectors were held fixed or updated as the classifiers learned. The distinction matters for reproduction because an updated vector can adapt to the task’s labels, while a fixed vector remains the starting description throughout training.

Character information also enters the two routes at different stages. The linear learner sees weighted character sequences taken from each classified item. The neural learner starts with word vectors whose pretraining made use of character sequences. The first design explicitly supplies features for fragments present in the current text. The second incorporates form information into how words are represented before the classification network processes their sequence. Calling both designs character-aware captures a common motivation, but the learner in each route receives a different kind of evidence.

Text-CNN searches nearby tokens for useful patterns

The convolutional classifier applies filters to spans of the word-vector sequence. A filter learns to respond to a pattern and can apply the same pattern detector at different positions in a comment. A narrow filter can respond to properties of an individual token. A wider filter receives adjacent token vectors together, making it possible to learn responses to combinations of words. The filters are learned from the labeled training examples, so the representation used for the decision can be shaped by the categories the classifier must predict.

The authors configure Text-CNN with 4 convolutional layers, each with 32 filters. The specified filter widths are 1, 2, 3 and 5. These widths determine how much adjacent input an application of a filter examines. The activation is the exponential linear unit, or ELU. An activation transforms the response produced by a layer so that a network can learn relationships beyond a succession of linear transformations. The authors use a dense output layer, meaning its units receive information from the preceding representation, with a sigmoid activation for each output. There is an output for each of the three labels.

A short abusive expression illustrates what this design makes possible. A response to a token can depend on its vector, and a wider response can also depend on the words beside it. During training, recurring patterns can learn to support a particular label. A pattern might depend on a form of address accompanied by an insulting expression, whereas an individual token detector could respond to the insult wherever it occurred. This describes the kinds of evidence the filters can represent. The study’s error analysis deals with the text and the predictions, and it leaves the learned responses of individual filters unexamined.

The specification gives the sizes of the filters and the form of the final layer. Details such as how convolutional responses are combined before the final prediction are left open. That gap matters when trying to reproduce the exact computation. A description of spans explains what the filters examine, while the way their responses are reduced or assembled determines how information from several positions becomes a decision about the entire comment.

The GRU carries information along the sequence

The recurrent classifier uses a gated recurrent unit. A recurrent layer processes a sequence while carrying a numerical state between positions. That state can retain information from tokens already encountered and change when new input arrives. The gates are learned controls over that process. The reset gate controls how prior state contributes when new state is formed. The update gate controls the balance between retained information and newly computed information. This gives the learner a way to preserve some context while letting other details fade as it goes.

The paper contrasts the GRU’s reset and update gates with the input, output, and forget gates of an LSTM and presents the GRU as a simpler recurrent design. The experiment uses a bidirectional GRU with 80 units. Bidirectionality means processing the sequence in both directions, so the representation can draw on tokens encountered from the beginning as well as those encountered from the end. When an expression needs context from later in the sentence, the reverse pass provides a route for that context to contribute. The mechanism offers that capacity without establishing how effectively the trained classifier used it on these comments.

Like Text-CNN, the GRU uses an embedding size of 300 and a dense output layer with sigmoid activations corresponding to the three labels. The classification task requires one final label for each comment. The authors give the form of the output layer, while the training objective and the rule that maps the sigmoid outputs to a single label remain unspecified. Those details would determine how category scores are learned and how close scores are resolved. The reported setup is precise about the recurrent layer and its input and output sizes, and less precise about the training and decision procedure that connects them.

Training and evaluation across folds

The authors describe the training-to-test ratio as 8:2, with 80 percent used for training and 20 percent for testing. They organize evaluation over 5 folds and say each fold preserves the proportions of the three classes. This is stratification. It keeps the balance of labels in the folds broadly comparable so that the already small HATE category is represented throughout the evaluation. Each classifier learns from a training portion and supplies predictions for the corresponding test portion. The authors then average the test scores across folds to obtain the reported result for that classifier.

Stratification addresses the composition of the evaluation partitions. The labels keep roughly the same relative prevalence, so folding still leaves CLEAN as the majority. This differs from class weighting in the learner, which changes the influence of training examples on the decision boundary. It also differs from macro averaging in the metric, which changes how the final class scores contribute to the reported result. Keeping these operations distinct helps explain how a study can give equal attention to labels at evaluation time and still observe a strong tendency to predict CLEAN when a minority-label example is missed.

The paper describes the test portion as the portion used to assess predicted labels. Its terminology does not establish a separate validation set for making training choices. Its fold averages are the unit of comparison used throughout the results. That unit applies to both the headline macro F1 scores and the rates in the confusion analysis, but the averaging procedures summarize different quantities. Macro F1 averages class scores within the evaluation and then across folds. The confusion rates describe the predictions for items of a specified actual class and are also averaged across folds.

Experiments and results

What the benchmark measures

The dataset comes from the 2019 VLSP hate speech detection shared task. It contains 20,345 annotated Facebook posts and comments. The authors describe CLEAN as substantially larger than the other classes, with HATE the smallest. They also say HATE has the largest reported average word-length statistic and OFFENSIVE has the smallest. Their account of how the statistic is calculated describes a vocabulary or word quantity divided by the number of comments of a given label. The phrase “word length” could suggest the length of individual words in characters, so the calculation matters when interpreting that observation. The paper uses the statistic to describe the labeled material, and the precise vocabulary counting convention is unclear.

The immediate baselines are the other classifiers evaluated on the same data under the authors’ protocol. Logistic regression is the second linear configuration, sharing the main feature design with SVM. The bidirectional GRU is the second neural configuration, sharing the pretrained embedding resource with Text-CNN. Together the four configurations let the study compare learners within a route and compare the leading system from each route. The earlier shared-task entries use public or private contest test results, where specified. The authors’ own headline results come from averaging their folds. Those figures answer questions about their respective evaluation partitions.

Macro F1 is central to the comparison. For a given class, precision asks what proportion of the comments assigned that class actually belong to it. Recall asks what proportion of the comments that actually belong to that class are assigned it. F1 combines precision and recall through their harmonic mean and is pulled toward the lower of the two. Macro F1 gives each class’s F1 equal weight. High CLEAN performance therefore earns one class’s contribution, while OFFENSIVE and HATE have their own contributions even though they account for fewer observations.

The confusion analysis uses a complementary view. For each gold label, the authors calculate the percentage of items predicted as each possible label, then average those percentages across the 5 folds. The entry where gold and predicted labels match is the recall for that gold class under this reporting convention. Each off-diagonal entry describes a specific direction of error. Gold OFFENSIVE predicted as CLEAN, for instance, concerns missed offensive comments. A question about how many CLEAN predictions were actually offensive would require conditioning on the predicted label. The distinction is important on skewed data because the source classes for different errors can be very different in size.

Text-CNN leads on macro F1

Text-CNN reaches 83.04% macro F1 on the authors’ VLSP test folds. The SVM, the strongest of the traditional classifiers in the paper’s overall comparison, reaches 65.10% on the same metric. The authors put logistic regression below SVM overall and place GRU below Text-CNN. They characterize the neural configurations as stronger overall in these experiments. The explicit headline scores support a direct comparison of the two family leaders, while the class-level discussion shows why the full ordering is more informative than a single score for each family.

Leading traditional and neural classifiers by macro F1 on VLSP test folds

Text-CNN leads the linear SVM on the class-balanced aggregate.

Leading traditional and neural classifiers by macro F1 on VLSP test foldsLinear SVM: 65.10Linear SVM65.10Text-CNN (this paper): 83.04Text-CNN (this paper)83.04
The numbers
System or settingMacro F1 %
Linear SVM65.10
Text-CNN (this paper)83.04

The headline score tells a reader that the Text-CNN configuration performs better when each of the categories matters to the overall measure. It does not identify which decisions distinguish the systems. Both learn from the same kinds of cleaned inputs at the dataset level, but the available evidence and the decision procedures differ. Looking at the components of their errors locates the advantage behaviorally. It shows whether the main gap is in handling ordinary comments or in assigning the less frequent labels.

CLEAN was the easiest label to recover

For items annotated CLEAN, the SVM’s average correct-label rate across the test folds is 99.23%. Text-CNN reaches 99.21% for the same gold class. Both figures describe recall for CLEAN, and the point estimate is slightly higher for SVM. The paper also reports that the SVM predicts OFFENSIVE for 0.45% of gold CLEAN items and HATE for 0.31%. Those percentages show that the SVM rarely moves a clean example into either of the abuse categories in this evaluation.

Correctly retaining a gold CLEAN item and making a reliable CLEAN prediction are related but distinct questions. An almost intact CLEAN row can coexist with a large number of missed items from other rows. If offensive examples are often pooled into CLEAN, recall for the CLEAN class may still be high because almost all truly clean examples also go there. The row-wise evaluation makes that possibility visible. It gives the CLEAN result its proper interpretation and directs attention to the treatment of the examples an abuse detector is supposed to find.

The closeness of the two CLEAN rates also changes how to read the headline comparison. A reader who sees the macro F1 lead might imagine a broadly similar improvement in each category. For the correctly recognized CLEAN items, that pattern is absent. The substantial differences shown in the paper concern the rates of recognizing OFFENSIVE and HATE and the directions in which missed items go. The macro score gives those effects a place alongside the nearly tied CLEAN recall.

OFFENSIVE reveals the clearest disagreement

On the gold OFFENSIVE row, the SVM correctly predicts the label for 28.33% of items, averaged over test folds. Text-CNN reaches 65.58%, and logistic regression reaches 44.70%. This ordering differs from the traditional pair’s overall ranking. SVM is the stronger traditional classifier on macro F1, while logistic regression is the stronger of the two at recalling gold OFFENSIVE comments. The relative importance of that observation depends on the decision the score is meant to inform. An aggregate across classes and a rate of recovering a specific class measure different aspects of the same evaluation.

OFFENSIVE recall by classifier on VLSP test folds

Text-CNN recovers the most gold OFFENSIVE items, and logistic regression also exceeds SVM.

OFFENSIVE recall by classifier on VLSP test foldsLinear SVM: 28.33Linear SVM28.33Logistic regression: 44.70Logistic regression44.70Text-CNN (this paper): 65.58Text-CNN (this paper)65.58
The numbers
System or settingOFFENSIVE recall %
Linear SVM28.33
Logistic regression44.70
Text-CNN (this paper)65.58

The main direction of error for OFFENSIVE is towards CLEAN. Text-CNN assigns CLEAN to 29.90% of gold OFFENSIVE items and HATE to 4.51%. The paper gives 62.35% for the SVM’s OFFENSIVE-to-CLEAN error in its direct comparison with Text-CNN, then gives 63.72% for that same error in its comparison with logistic regression. In the latter comparison, logistic regression’s rate for the same error is 41.17%. The two SVM values make the exact size of its error uncertain. Either supports the reported ordering on that particular error direction, with SVM sending a larger share of gold OFFENSIVE items to CLEAN than either of the other two classifiers.

The error going from OFFENSIVE to HATE is smaller in the reported profiles. The SVM’s rate for that direction is given as 7.94%, and Text-CNN’s is 4.51%. This is a test of how often an offensive item crosses into the hateful category when it is missed, expressed as a share of all gold OFFENSIVE items. It does not imply that the distinction between the two abusive categories is easy for an incoming comment. A classifier can avoid confusing them with each other in part by more frequently sending uncertain cases to the plentiful CLEAN category. The CLEAN-directed errors are therefore essential to interpreting the apparently lower confusion between the minority labels.

HATE also benefits from Text-CNN

Text-CNN correctly assigns HATE to 73.94% of gold HATE items on average across the test folds. The SVM correctly assigns it to 50.00%. For both classifiers, recall for HATE is higher than recall for OFFENSIVE in the rates the authors report. That ordering is worth noting because HATE is described as the smallest class. Class size is a plausible contributor to difficulty, but class frequency alone does not reproduce the ordering of these recalls. The observable signals of the categories, their definitions, and the behavior of the classifiers all remain relevant.

HATE recall for the leading classifiers on VLSP test folds

Text-CNN recognizes more gold HATE items than the linear SVM.

HATE recall for the leading classifiers on VLSP test foldsLinear SVM: 50.00Linear SVM50.00Text-CNN (this paper): 73.94Text-CNN (this paper)73.94
The numbers
System or settingHATE recall %
Linear SVM50.00
Text-CNN (this paper)73.94

The reported rate for gold HATE predicted as OFFENSIVE is 10.07% for SVM and 5.49% for Text-CNN. The authors also describe the HATE-to-CLEAN error as more common than the HATE-to-OFFENSIVE error for both classifiers. Thus CLEAN is the main destination among mistaken predictions on the HATE row. This is a statement about the distribution of errors. Text-CNN’s correctly classified share of gold HATE items is the largest part of its row.

The paper describes the GRU’s confusion profile as broadly similar in shape to Text-CNN’s, with weaker figures and a lower overall result. This gives a qualitative comparison inside the neural pair. For the traditional pair, the OFFENSIVE row supplies a more specific comparison because the prose reports individual percentages. Together these observations make a case for reading the score and error profile together. A classifier can move up in macro F1 while yielding ground on recall for a particular class, and two classifiers can show a similar distribution of easy and difficult labels at different performance levels.

What the ablations show

The paper has no component-removal ablation. It offers controlled aspects of the classifier comparison, class-by-class confusion analysis, and a qualitative inspection of particular errors.

Comparing learners with an input representation in common

The linear pair shares the broad feature extraction design. Both receive TF-IDF descriptions based on words and characters. This rules out one simple reading of their different OFFENSIVE recalls, that one system had the word view and the other had the character view. Both have access to both kinds of features as described. The difference arises after allowing for the decisions that distinguish their configurations, including the learner and the reported weighting policy. The results tell us that a switch between these configured learners can affect which class is missed, even with the broad text representation held in common.

Balanced weights in logistic regression make class weighting one possible contributor to its greater OFFENSIVE recall. The experiment does not independently vary that choice. The same comparison also changes the objective that determines the boundary between classes. To establish a weighting effect, the study would have needed paired runs of the same learner with the weighting policy changed and other settings held fixed. The paper’s comparison offers a reason to investigate that question. Its measured result remains a difference between the complete linear setups.

The shared pretrained vectors in the neural pair provide a different point of control. The observed ordering between Text-CNN and GRU occurs while both systems use the Vietnamese embedding resource and the same embedding dimension. Text-CNN is configured to examine nearby patterns through filters. The GRU passes state through the sequence in both directions. The comparison suggests that the tested convolutional configuration is a better fit for this benchmark and protocol. It cannot establish that convolution in isolation accounts for the gain, since the architectures differ in configuration and the paper reports no matched variation of the other training decisions.

An especially tempting explanation is that brief abusive phrases carry much of the useful evidence, making local pattern detection enough to produce a strong result. The paper’s examples of abbreviated forms make that hypothesis plausible. The study never links a particular filter width to a class outcome, however. It does not report results after removing the narrow or wide filters, masking nearby words, or changing the span a recurrent classifier can use. The convolutional result and the examples therefore give compatible observations at different levels, with the mechanism left to be tested.

What the confusion matrices diagnose

The confusion matrices are the strongest analysis of how the two leading classifiers behave. CLEAN recall is high for both, with a slight numerical lead for SVM. Text-CNN has the clearer advantage on the correctly identified shares of gold OFFENSIVE and HATE. The main error direction on each of those gold rows is toward CLEAN. This makes the practical distinction between the systems more concrete than the aggregate alone. The SVM is frequently successful on unoffensive material, while the CNN recovers more of the examples carrying the two other labels.

The authors attribute the prevalence of CLEAN-directed mistakes to the imbalance of the dataset. Their observation has a clear basis. CLEAN supplies many of the training examples and also attracts many of the mistaken predictions on the other classes. A causal test would need to vary the balance while keeping the learner and the relevant evaluation conditions comparable. The paper keeps the observed class proportions across folds. Its evidence shows that the imbalance and the error direction coexist under that procedure. It leaves the size of the change achievable by augmentation or reweighting undetermined.

The logistic regression comparison also qualifies the idea of combining systems. Since logistic regression recovers a larger share of OFFENSIVE examples than SVM, its predictions might contain useful information for a combination. A confusion matrix averages cells separately for each classifier. It does not show whether two classifiers miss the same individual items. Even the small CLEAN advantage for SVM could come from many partly overlapping decisions or from a much narrower set of disagreements. An ensemble depends on those overlaps and on how a rule resolves them. The authors’ comparison identifies where such a study might look for complementary decisions.

One way to read the matrices is to ask which ambiguity each error represents. Sending gold OFFENSIVE to CLEAN misses the presence of the offensive category. Sending gold OFFENSIVE to HATE recognizes something closer to abuse but crosses the boundary assigned by the annotator. The mirror direction on gold HATE likewise loses the distinction between the two kinds of labeled abuse. These interpretations follow from the definitions and the destinations of errors. The matrices reveal the frequency of those decisions, while the inspection of examples helps identify text that may contribute to them.

What the examples reveal about profanity and address

The authors discuss cases where comments containing “vl” received a CLEAN prediction even though their gold labels were OFFENSIVE or HATE. They also point to “vkl” and “dcm” as profanity forms that recur in comments from the two minority labels. The examples are informative because these are compact written forms whose social use gives them significance. A representation based on whole words may encounter them as uncommon units, and a character representation can register their spelling. Seeing one in a missed case establishes that its occurrence did not suffice for the classifier’s decision on that item. It does not tell us whether the representation omitted it, weighted it weakly, or encountered other evidence that dominated the decision.

The authors also notice forms of address or personal reference, including “mày,” “thằng,” and “con,” in HATE examples. Their suggestion is to pay more attention to these forms alongside profanity. That pairing is more informative as a research question than a list of unreliable tokens. Profanity can supply evidence of offensiveness, while a reference to a person can help indicate whom the language concerns. The task’s HATE definition gives targeting an important role, so the combination merits attention. A reliable distinction would still depend on what the surrounding language says about the person or group.

These inspections are observations about comments, their annotations, and the predictions made for them. The authors do not report how frequently the cues occur in CLEAN or how often a specific cue leads to error across the entire test set. They also do not change the cues in otherwise comparable examples and measure what happens. The examples therefore support the existence of recognizable false negatives and motivate targeted work on Vietnamese abusive language. They leave open the diagnostic strength of any one expression and the amount of improvement a feature built from it would deliver.

Limitations

The limits identified by the authors

The authors regard the availability of labeled data as a constraint. In their dataset, OFFENSIVE and HATE supply fewer training examples, and the confusion analysis shows that both labels lose some of their examples to CLEAN. The authors propose collecting and annotating more Vietnamese material and using augmentation to increase the examples available for the minority labels. The proposals address related but distinct issues. Collection adds observed language and new annotations. Augmentation modifies or expands what can be learned from available examples. The paper ends with these as directions for future research, so their effects on the reported scores are unmeasured.

Informal writing is another concern the authors carry into their conclusion. Abbreviations, slang, and the flexible way people write comments complicate segmentation and feature extraction. The error cases show how abbreviated profanity can survive the basic cleaning yet still go unrecognized as evidence of an offensive or hateful comment. The authors propose building a Vietnamese profanity dictionary and learning word vectors from Vietnamese hate-speech material on social media. The general pretrained vectors used in the experiment come from Common Crawl and Wikipedia. The proposed resource would draw its representations from material closer to the target writing and vocabulary.

The authors also point to the potential value of combining classifiers. The reported results give that idea a motivation because the leading traditional classifier has a slightly higher CLEAN recall, and logistic regression and the SVM trade places on some measures. The measured evidence concerns the individual prediction systems. A fitted combination, its decision rule, and a test result for it are left for further work. The paper’s best supported system-level conclusion is consequently about the configured Text-CNN, whose overall score and minority-class recalls are stronger than those of the leading linear comparator.

Further limits of the experimental evidence

The scope of the data bounds the comparison. The benchmark is a collection of Vietnamese Facebook comments and posts with the VLSP label definitions. Its folds come from that collection. This gives the authors a common setting for measuring the classifiers’ performance on test examples and permits a meaningful comparison within the benchmark. It leaves transfer to other platforms, other collections of Vietnamese text, and other labeling policies open. Earlier work on other corpora provides context about how the problem has been framed but supplies no direct test of such transfer for these trained classifiers.

The evaluation detail also leaves some reproduction questions. The paper describes the ratio, fold count, and preservation of class proportions. It gives less detail on how the folds were generated and how decisions about settings were made. For instance, the vocabulary and inverse-document-frequency weights can be estimated using only the training portion in each fold, and the reporting leaves the scope of that estimation unspecified. The text establishes the reported protocol at the level of train and test portions. It does not resolve every choice affecting what information enters their representations.

For the neural classifiers, the reported layer configurations describe substantial parts of the architectures. The paper leaves several choices unspecified, including the treatment of the pretrained vectors during training and the rule that turns sigmoid output scores into a final label. The latter matters especially because the task assigns one label per item, while each sigmoid produces its own score. A reproducer needs an explicit rule for choosing among those scores. A different rule can move predictions between labels and change the corresponding confusion rates even if the scores from the network are identical.

There is also a distinction between variation across folds and uncertainty about the ordering. An average indicates how the classifier performed across the chosen partitions. Fold-level values or a variability estimate would help a reader decide how consistently the same ordering appears. The paper emphasizes averages. The near equality on CLEAN gives this omission a concrete consequence. The SVM’s higher point estimate describes the reported experiment, while the reporting does not establish that the small edge is reproducible in another partitioning or run. The larger differences on the minority-label rows are still descriptive results from these folds.

The conflicting SVM figures for OFFENSIVE predicted as CLEAN add a separate reporting uncertainty. The paper’s comparison with Text-CNN assigns that cell 62.35%, and its comparison with logistic regression assigns it 63.72%. The authors’ interpretation that CLEAN attracts many gold OFFENSIVE items survives either figure. A reader using the rate as a numerical baseline would need to resolve which value belongs to the measured cell. This issue is distinct from sampling variability because the two values appear as accounts of the same classifier, gold label, and prediction direction.

What remains open about the source of the gains

The comparison changes several factors at once across the linear and neural routes. The linear classifiers derive occurrence-based word and character features from the comments. The neural classifiers use pretrained word vectors and learn how to process a sequence. The better result for Text-CNN therefore reflects a configuration that changes both representation and classifier. The study leaves the contributions of pretraining, character information, convolutional filters, and other training decisions unquantified. Those factors provide ways to formulate follow-up experiments, but the absolute macro F1 result belongs to the configuration as a whole.

The common preprocessing likewise keeps the measured comparison focused while imposing a shared restriction. Emojis, hashtags, links, and digits are removed before learning. As the authors note, such material is characteristic of the writing on social platforms. It can be difficult to process, and the text surrounding it may carry enough information for classification. How much signal the removed material carried is a question outside this comparison. A controlled investigation of that step would need otherwise comparable runs with the relevant input retained or removed.

The class analysis is richest for recall and particular destinations of errors. It provides a clear view of which gold-label items end up in the wrong category. Overall macro F1 also reflects precision, but the discussion gives less detail about how trustworthy each predicted category is. A moderation setting could care about how often a HATE prediction is correct as well as how frequently hateful material is caught. A label-conditioned confusion rate describes the second concern directly. To evaluate the first under a particular distribution of incoming comments would require examining the full prediction pattern with that distribution in mind.

Finally, class-level averages and selected examples leave particular language and targets unevenly examined. A HATE label can encompass different kinds of attacks under the shared-task definition. A high average recall for that label could coexist with weaker recognition of forms that occur rarely in the sample. The paper analyzes the category as a whole and points to examples involving profanity and personal reference. It does not establish performance for narrower kinds of hate speech or show how much surrounding conversation was relevant to the decisions annotators made. The claims supported by the experiment concern the three benchmark labels on the individual Facebook items given to the classifiers.

What came after

Hate Speech Detection and Classification in Amharic Text with Deep Learning, published in 2024, cites the Vietnamese comparison and studies the classification problem for Amharic text with deep learning. The connection is the task of using learned text classifiers to recognize hate speech in a particular language. The Amharic study brings that question to a different linguistic setting. The citation establishes a link between the studies. Its title establishes the language, task, and broad approach, while details of any reuse of the Vietnamese architectures, labels, or evaluation procedure remain unspecified.

The question that carries across the two studies is how far classification performance depends on the language, its written forms, and the labeled examples available for training and evaluation. The Vietnamese comparison answers that question for a particular Facebook benchmark by showing where its tested classifiers agree and where their error rates diverge. The Amharic work takes up hate speech classification in its own language setting. The documented continuation is therefore at the level of the research problem and the use of neural learning, with the Vietnamese scores tied to the VLSP evaluation that produced them.

Cite

Cite as Son T. Luu, Hung Nguyen, Kiet Van Nguyen and Ngan Luu-Thuy Nguyen. 2020. Comparison Between Traditional Machine Learning Models And Neural Network Models For Vietnamese Hate Speech Detection. RIVF International Conference on Computing and Communication Technologies (RIVF).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.1109/rivf48685.2020.9140745 · arXiv 2002.00759

@inproceedings{luu2020comparison,
  title = {{Comparison Between Traditional Machine Learning Models And Neural Network Models For Vietnamese Hate Speech Detection}},
  author = {Son T. Luu, Hung Nguyen, Kiet {Van Nguyen} and Ngan Luu-Thuy Nguyen},
  booktitle = {RIVF International Conference on Computing and Communication Technologies (RIVF)},
  year = {2020},
  doi = {10.1109/rivf48685.2020.9140745},
  eprint = {2002.00759},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1109/rivf48685.2020.9140745}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/luu-2020-comparison-between-traditional-machine-learning/

References

22 references, from the paper's own bibliography.

  1. X.-S. Vu, T. Vu, M.-V. Tran, T. Le-Cong, and H. T. M. Nguyen, “HSD shared task in VLSP campaign 2019: Hate speech detection for social good,” in Proceedings of VLSP 2019, 2019. OpenAlex ↗ · Scholar ↗
  2. Z. Waseem and D. Hovy, “Hateful symbols or hateful people? predictive features for hate speech detection on twitter,” in Proceedings of the NAACL Student Research Workshop, 2016. our card
  3. T. Davidson, D. Warmsley, M. Macy, and I. Weber, “Automated hate speech detection and the problem of offensive language,” in Proceedings of the Eleventh International Conference on Web and Social Media, 2017. our card
  4. A. Gaydhani, V. Doma, S. Kendre, and L. Bhagwat, “Detecting hate speech and offensive language on twitter using machine learning: An n-gram and tfidf based approach,” in IEEE International Advance Computing Conference, 2018. OpenAlex ↗ · Scholar ↗
  5. P. Fortuna and S. Nunes, “A survey on automatic detection of hate speech in text,” ACM Computing Surveys, vol. 51, pp. 1–30, 2018. our card
  6. R. Martins, M. Gomes, J. J. Almeida, P. Novais, and P. Henriques, “Hate speech classification in social media using emotional analysis,” in 2018 7th Brazilian Conference on Intelligent Systems (BRACIS), 2018. OpenAlex ↗ · Scholar ↗
  7. S. Georgakopoulos, S. Tasoulis, A. Vrahatis, and V. Plagianakos, “Convolutional neural networks for toxic comment classification,” in Proceedings of the 10th Hellenic Conference on Artificial Intelligence, 2018. OpenAlex ↗ · Scholar ↗
  8. R. Sharma and M. Patel, “Toxic comment classification using neural networks and machine learning,” IARJSET, vol. 5, pp. 47–52, 2018. OpenAlex ↗ · Scholar ↗
  9. M. Ibrahim, M. Torki, and N. El-Makky, “Imbalanced toxic comments classification using data augmentation and deep learning,” in 2018 17th IEEE International Conference on Machine Learning and Applications (ICMLA), 2018. OpenAlex ↗ · Scholar ↗
  10. M. Zhang, R. David, L. Graumans, and G. Timmerman, “Grunn2019 at SemEval-2019 task 5: Shared task on multilingual detection of hate,” in Proceedings of the 13th International Workshop on Semantic Evaluation, 2019. OpenAlex ↗ · Scholar ↗
  11. P. H. Quang, N. T. Son, and P. H. Anh, “Automated hate speech detection on vietnamesesocial networks,” in Proceedings of VLSP 2019, 2019. OpenAlex ↗ · Scholar ↗
  12. T. Binh Nguyen, Q. M. Nguyen, T. Hien Nguyen, N. Phuong Pham, T. Loc Nguyen, and Q. Truong Do, “VAIS hate speech detection system: A deep learning based approach for system combination,” in Proceedings of VLSP 2019, 10 2019. OpenAlex ↗ · Scholar ↗
  13. D. Thin, L. S. Lac, and N. L.-T. Nguyen, “NLP@UIT: exploring feature engineer and ensemble model for hate speech detectionat vlsp 2019,” in Proceedings of VLSP 2019, 2019. OpenAlex ↗ · Scholar ↗
  14. H. Do, H. D. Huynh, K. V. Nguyen, N. L.-T. Nguyen, and A. G.-T. Nguyen, “Hate speech detection on vietnamese social media text using the bidirectional-lstm model,” in Proceedings of VLSP 2019, 2019. our card
  15. T. Huynh, V. Nguyen, K. Nguyen, N. Nguyen, and A. Nguyen, “Hate speech detection on vietnamese social media text using the bi-gru-lstm-cnn model,” in Proceedings of VLSP 2019, 2019. OpenAlex ↗ · Scholar ↗
  16. T. Van Huynh, K. Van Nguyen, N. L.-T. Nguyen, and A. G.-T. Nguyen, “Job prediction: From deep neural network models to applications,” arXiv preprint arXiv:1912.12214, 2019. OpenAlex ↗ · Scholar ↗
  17. H. Pham and L.-H. Phuong, “End-to-end recurrent neural network models for vietnamese named entity recognition: Word-level vs. character-level,” in The 15th International Conference of the Pacific Association for Computational Linguistics, 2017. our card
  18. E. Grave, P. Bojanowski, P. Gupta, A. Joulin, and T. Mikolov, “Learning word vectors for 157 languages,” in Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018), 2018. our card
  19. C.-C. Chang and C.-J. Lin, “LIBSVM: a library for support vector machines,” ACM Trans. Intell. Syst. Technol., vol. 2, no. 3, May 2011. OpenAlex ↗ · Scholar ↗
  20. V. A. Ho, D. H.-C. Nguyen, D. H. Nguyen, L. T.-V. Pham, D.-V. Nguyen, K. Van Nguyen, and N. L.-T. Nguyen, “Emotion recognition for vietnamese social media text,” arXiv preprint arXiv:1911.09339, 2019. our card
  21. Z. Zhang and L. Luo, “Hate speech detection: A solved problem? the challenging case of long tail on twitter,” Semantic Web, 2018. OpenAlex ↗ · Scholar ↗
  22. V. V. Asch, “Macro-and micro-averaged evaluation measures,” 2013. OpenAlex ↗ · Scholar ↗