DLJUST at S em E val-2021 Task 7: Hahackathon: Linking Humor and Offense (2021)

Abstract: Humor detection and rating poses interesting linguistic challenges to NLP; it is highly subjective depending on the perceptions of a joke and the context in which it is used. This paper utilizes and compares transformers models; BERT base and Large, BERTweet, RoBERTa base and Large, and RoBERTa base irony, for detecting and rating humor and offense. The proposed models, where given a text in cased and uncased type obtained from SemEval-2021 Task7: HaHackathon: Linking Humor and Offense Across Different Age Groups. The highest scored model for the first subtask: Humor Detection, is BERTweet base cased model with 0.9540 F1-score, for the second subtask: Average Humor Rating Score, it is BERT Large cased with the minimum RMSE of 0.5555, for the fourth subtask: Average Offensiveness Rating Score, it is BERTweet base cased model with minimum RMSE of 0.4822.

## introduction semeval 2021 task7 is constructed to detect and rate the humor and offense inside jokes in the english language @xcite . humor is an essential aspect of strengthening human communication and relations. however, the interpretation of humor differs based on the perceptions of a joke and the context in which it is used. in 2012, the human rights commission found the most commonly reported form of harassment in australia was sexist or offensive jokes @xcite , humor appreciation; is a highly subjective phenomenon as a sense of humor varies from person to person depending on factors such as age, gender, and socio-economic status. in this task, data labels and ratings were collected from a balanced set of age groups from 18-70. moreover, annotators represent a variety of genders, political stances, and income levels. the automatic detection of linguistic elements in natural language texts such as aggression, humor, irony, and sarcasm has drawn attention to research communities @xcite . several studies and experiments have been performed to develop and improve humor detection systems(annamoradnejad, 2021) @xcite @xcite . bert language model(annamoradnejad, 2021) @xcite showcase the highest results compared to all other works. this paper aims to utilize the transformers models; bert base and large @xcite , bertweet @xcite , roberta base and large @xcite , and roberta base irony @xcite for humor detection, humor rating, and offense rating using the dataset obtained from semeval-2021 task7 that contains training, development, and test data. our contributions are: prepossessing text techniques for text tokenization, word segmentation, spell correction, removing the punctuation, encoding, and extracting embeddings. furthermore, training six state-of-theart transformers models and compare its results against the base-line model. we have achieved a 0.9540 f1-score for subtask1-a humor detection using bertweet cased model compared to the first place score, which is 0.9820 f1-score. for subtask1-b average humor score, our rmse result is 0.5555 using bert large cased model, the first place rmse is 0.4959. finally, for subtask2 average offensiveness score, our rmse results is 0.4822 using bertweet cased model, while the first place rmse is 0.4120. this paper's structure is as follows: section 2 reviews related works focused on humor detection in semeval-2020. section 3 presents data exploration, prepossessing, training models, and evaluation metrics. section 4 introduces the experiments and results. section 5 remarks the conclusion and proposes future works. ## related work the previous humor detection task on se-meval2020 task7 was focused on humor rating only without considering if it is offensive or not. however, in semeval2021 task7, the task requires detecting the hidden offense inside jokes. @xcite presented a novel l2-regularization approach with freezing the weights for the first epoch to train and fine-tune the word embedding model, ensemble different language models -bert, xl-net, and roberta, and duplication from each language models, with a weighted average between them. their approach ranked second place in semeval-2020 task 7: "assessing humor in edited news headlines", subtasks 1 and 2. @xcite ) also proposed the bert-flair-based humor detection model (bfhumor) that combined the bert regressor and flair library to predict the funniest values of edited headlines for the same task 7 of semeval 2020; the mode ranked 4th in subtask1 and 12th in the subtask2. meanwhile, pramodith ballapuram 2020 @xcite participated in the same task using a non-ensemble model; he proposed a siamese transformer based approach, coupled with an attention mechanism to make use of contextual embeddings and focus words and their impact against other tokens on generating important features and rating the funniness of the edited headline, he scored fifth place in subtask1 and fourth place in subtask2. ## methodology our methodology of tackling the humor detection problem consists of four phases: data exploration and visualization, data pre-processing, learning models, and evaluation criteria. ## conclusion and future work in this paper, we experimented with a set of stateof-the-art transformers and contextual models for detecting and rating humor and offense in text. our experimental results show that the bertweet large model is the best model for humor binary classification task with a 0.9540 f1 score and offensive rating with 0.4822 rmse, and bert large cased model is the best for humor rating task scored 0.5555 rmse. we plan to enhance the top models using ensemble learning methodology and test out more novel methods.