Humor Detection in Persian:
A Transformers-Based Approach
Fateme Najafi-Lapavandani
Faculty of Mathematics & Computer Science
Amirkabir University of Technology
Tehran, Iran
fatemenajafi135@gmail.com
Mohammad Hassan Shirali Shahreza
Faculty of Mathematics & Computer Science
Amirkabir University of Technology
Tehran, Iran
hshirali@aut.ac.ir
Received: 5 May 2022 – Revised: 25 August 2022 - Accepted: 27 November 2022
Abstract—Humor is a linguistic device that can make people laugh, and in the case of expressing opinions, it can
transform a phrase's polarity. Humorous sentences presenting ideas and criticism, occasionally using informal forms,
have made their way to social media platforms like Twitter in almost every domain. Persian speakers likewise express
their opinions through humorous tweets on Twitter. As one of the early efforts for detecting humor in Persian, the
current research proposes a model by fine-tuning a transformer-based language model on a Persian humor detection
dataset. The proposed model has an accuracy of 84.7% on the test set. Moreover, This research introduced a dataset of
14,946 automatically-labeled tweets for humor detection in Persian.
Keywords: Humor Detection; Sentiment Analysis; Natural Language Processing; Deep learning; Persian language
Article type: Research Article
© The Author(s).
Publisher: ICT Research Institute
I. INTRODUCTION
Using humor in speech or text is a way of
expressing opinions that may have a different sense
than what it seems because its creative characteristics
prevent the correct understanding of the text.
Social networks and online stores have increased
with the growth of using the Internet. And it becomes
common to publish opinions on these networks, write
reviewes about products on websites, or post ideas
about different domains. Owner of these websites are
Corresponding Author
interested to analyzing the opinions and feelings of
users in these cases. Because these opinions are
sometimes mixed with humor, irony, and sarcasm, the
effectiveness of sentiment analysis is affected.
In the Cambridge Dictionary, humor is defined as
“the ability to be amused by something seen, heard, or
thought about, sometimes causing you to smile or
laugh, or the quality in something that causes such
amusement.” [1] Irony is defined as “the use of words
that are the opposite of what you mean, as a way of
being funny” and “a type of usually humorous
expression in which you say the opposite of what you
[ Downloaded from ijict.itrc.ac.ir on 2023-07-07 ]
1 / 7