<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Mining Offensive Language on Social Media</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Alessandro Maisto</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Serena Pelosi</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Simonetta Vietri</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Pierluigi Vitale</string-name>
          <email>pvitaleg@unisa.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Salerno Department of Political, Social and Communication Science Via Giovanni Paolo II</institution>
          ,
          <addr-line>132</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>English. The present research deals with the automatic annotation and classification of vulgar ad offensive speech on social media. In this paper we will test the effectiveness of the computational treatment of the taboo contents shared on the web, the output is a corpus of 31,749 Facebook comments which has been automatically annotated through a lexicon-based method for the automatic identification and classification of taboo expressions.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>Flaming, trolling, harassment, cyberbullying,
cyberstalking, cyberthreats are all terms used for
referring to vulgar and offensive contents shared on
the web. The shapes can be different and the focus
can be on various topics, such as physical
appearance, ethnicity, sexuality, social acceptance and so
forth.</p>
      <p>
        Although taboo language is generally
considered to be the strongest clue of harassment in the
web, it must be clarified that the presence of bad
words in posts does not necessarily indicate the
presence of offensive behaviors. The words
collected in vulgar lexicons, in some cases, are
neutral or even positive. Moreover, profanity can be
used with comical or satirical purposes, and bad
words are often just the expression of strong
emotions
        <xref ref-type="bibr" rid="ref13">(Yin et al., 2009)</xref>
        .
      </p>
      <p>In this paper, we propose a system for the
automatic treatment of vulgar and offensive utterances
in Italian. The strength of our method is that
lexical items are not considered in isolation. Instead,
we recognize the power of the local context of the
words, which can modulate the meaning of words,
phrases and sentences.</p>
      <p>Section 2 briefly illustrates the state of the
art contributions on offensive language modeling.
Next, Section 3 describes the Italian lexical and
grammatical resources for the automatic detection
of taboo language in Italian. Then, Section 4
explains how we tested our method and resources on
a Facebook corpus and describes the results of the
taboo expressions automatic annotation. Finally,
Section 5 reports the future works that will
enhance our research.
2</p>
    </sec>
    <sec id="sec-2">
      <title>State of the Art on the Computational</title>
    </sec>
    <sec id="sec-3">
      <title>Treatment of Offensive Language</title>
      <p>
        As it is anticipated, taboo words are basically
considered a strong clue of online hate speech
        <xref ref-type="bibr" rid="ref12 ref13 ref2 ref4 ref7 ref8">(Chen
et al., 2012; Reynolds et al., 2011; Xu and Zhu,
2010; Yin et al., 2009; Mahmud et al., 2008)</xref>
        .
Nevertheless, the methods that simply match
offensive words stored in blacklists, are clearly not
meant to reach high levels of accuracy.
Consistent with this idea, in the recent years many
studies on offensive cyberbullying and flame detection
integrated the bad words context in their methods
and tools. Chen et al. (2012) exploited a
Lexical Syntactic Feature (LSF) architecture to detect
offensive content and identify potential offensive
users in social media. Xu and Zhu (2010)
proposed a sentence-level semantic filtering approach
that combined grammatical relations with
offensive words. Insulting phrases and derogatory
comparisons of human beings with insulting items or
animals were clues used by Mahmud et al. (2008).
Razavi et al. (2010) proposed an automatic flame
detection method based on the variety of statistical
models and the rule-based patterns. Among the
flame topics that they identified, there are attacks
and abuses that embarrass the readers. Xiang et
al. (2012) learned topic models from a dataset of
tweets through Latent Dirichlet Allocation (LDA)
algorithm. Waseem and Hovy (2016) and Kwok
and Wang (2013) focused on racist and sexist slurs
on Twitter; Waseem and Hovy (2016) made
reference to hate speech expressed without any
derogatory term, and Kwok and Wang (2013) focused
on the relation between the tweet content and the
identity of the user, on the base of which a post
is considered to be racist or not. Badjatiya et al.
(2017) also used Twitter in order to investigate the
application of deep neural network architectures.
3
      </p>
    </sec>
    <sec id="sec-4">
      <title>Lexical and Grammatical Resources</title>
      <p>In this paragraph we will describe the Italian
lexical database and the grammatical rules which have
been used as indicators for the automatic
identification of the taboo language.</p>
      <p>The items of the lexicon are labeled through the
use of the following three main categories:
Trait, that specifies if the taboo expression
is addressed to other users, to events or to
things;
Type, that verifies if an expression is
offensive, if it represents a threat or if it is just
rudeness;
Semantic Field which specifies the taboo
domain (namely sex, sexism, aesthetics,
behavior, homophobia, racism, scatology).</p>
      <p>Such tags have been collected and classified by
a team of four annotators (one linguist and three
Italian native speakers), which annotated the
linguistic resources through an agreement of 92%.</p>
      <p>Taboo words, which were impossible to classify
through a defined semantic field, have been
annotated with the residual category “N.C.”. Our taboo
lexicon is composed of</p>
      <p>
        Simple Words, which include nouns,
adjectives, verbs and adverbs collected from the
Sentiment Lexicon SentIta
        <xref ref-type="bibr" rid="ref6">(Pelosi, 2015)</xref>
        and
manually evaluated with reference to the
categories described above;
Multiword Expressions (MWE), that are
nouns automatically annotated through the
integrated use of the simple words list and ad
hoc regular expressions (e.g. see section 3.2);
Idiomatic Structures, which are verbs +
frozen complement collected from Vietri
(2014) and manually annotated on the
grounds of the hate speech tags.
      </p>
      <p>This choice is due to the fact that in
colloquial and informal situations, a taboo expression
can work simply as intensifier, also for positive
sentences (e.g. it’s fucking nice!). This is why
the words’ semantic orientation must be, case by
case, modulated when occurring into the context
of (semi)frozen structures. Concrete examples are
idiomatic structures that involve concrete nouns
indicating body part (with a vulgar meaning) as
fixed constituents (e.g. essere culo e camicia, “to
be thick as thieves”).
3.1</p>
      <sec id="sec-4-1">
        <title>Simple Vulgar Words</title>
        <p>Our project is grounded on a collection of 342
taboo simple words that include the following
grammatical categories: nouns, verbs, adjectives,
adverbs and exclamations. Nouns count 242
entries, among which 216 are simple words (e.g.
cozza, “mussel”, addressed to ugly women) and
26 are monorematic compounds (e.g rompiballe
“pain in the ass”). Verbs count 72 entries, among
which 27 are verbs indicating bodily predicates
that involve acts of violence, e.g. violentare,
“to rape”, and 21 are pro-complementary and
pronominal verbs (e.g. incazzarsi “to get mad”).
Adjectives count 16 entries (e.g. cazzuto
“diehard”), adverbs 4 entries (e.g. incazzosamente
“grumpily”) and exclamations 8 entries (e.g.
vaffanculo “fuck off”).
3.2</p>
      </sec>
      <sec id="sec-4-2">
        <title>Taboo Multiword Structures</title>
        <p>The simple words listed in our database, especially
the ones with an uncertain semantic orientation
(see “N.C. in Figure 1”), can be part of frozen or
semi-frozen expressions that can make clear, for
each occurrence, the actual meaning of the words
in context.</p>
        <p>Idioms are particularly interesting in a work on
online harassment, because they are open to
wordplays and trolls. Indeed, it must be reported a
higher than expected presence of idiomatic
structures in our corpus. Nevertheless, their
syntactic flexibility and the lexical variations make them
very difficult to automatically locate, if compared
with other multiword expressions. A very
typical Italian example is cazzo “dick”, with its, more
or less vulgar, stilistic and regional variants (e.g.
minchia, pirla, cavolo “cabbage”, cacchio “dang”,
mazza “stick” , tubo “pipe”, corno “horn”, etc...).
The context systematically gives the word
under examination a clear connotation. Examples
are (negative) adverbial and adjectival expressions
(e.g. a cazzo, “fucked up”); (emphatic)
exclamations and interrogative forms (e.g. che cazzo “what
the hell”); intensification of negations (e.g. non V
un cazzo, “don’t V shit”).</p>
      </sec>
      <sec id="sec-4-3">
        <title>Multiwords Expressions. With Multiwords Ex</title>
        <p>pressions, we mean sequences of simple words
separated by blanks, characterized by semantic
atomicity, restriction of distribution, shared and
established use and lack of ambiguity. In this
research, we automatically located and annotated
MWEs through the combined use of the taboo
simple words that trigger the recognition and a set
of regular expressions (based on part of speech
patterns) that locate the MWEs (e.g. culo rotto,
“lucky” from the simple noun culo and the
pattern NA). Other MWEs are those ones related to
idioms (see next paragraph, e.g. rottura di palle
“nuisance”). The regular expressions used to
identify the taboo MWEs are summarized below:
Taboo Noun + Preposition + Noun (NPN)
Noun + Preposition + Taboo Noun (NPN)
Taboo Noun + Adjective (NA)
Noun + Taboo Adjective (NA)
Adjective + Taboo Noun (AN)</p>
        <p>Taboo Adjective + Noun (AN)</p>
      </sec>
      <sec id="sec-4-4">
        <title>Idiomatic Expressions. Among the possible id</title>
        <p>iomatic structures, the present research focuses on
those idioms (verb and at least one frozen
complement) which have vulgar nouns of body part as
frozen complement.</p>
        <p>
          The lexical resources used in this research are
composed of 52 items that include 28 ordinary
verb structures (e.g. girare le palle “to bust the
balls”) and 23 support verb idioms (avere culo “to
be lucky”). The classes to whom they belong
          <xref ref-type="bibr" rid="ref9">(Vietri, 2014)</xref>
          are various and can be in systematic
correlation, as it happens with girare le palle/avere
le palle girate, “to bust the balls/to have the balls
busted”.
        </p>
        <p>The idioms under examination can be also
related to some derived nominals in
-tore,-trice,ura,-ata (e.g. rottura di palle “pain in the arse”)
and/or with VC compounds (verb + fixed
constituent e.g. rompipalle “ball-buster”). These
compounds occur in the corpus as both simple
words and multiword units.</p>
        <p>
          The automatic recognition of taboo idioms,
similar to MWEs, start from the nouns indicating
vulgar body parts, and proceed with another
lexical anchor that is associated to the idiom in the
lexical resources (e.g. girare le palle “to piss off” is
annotated in the corpus when the tool locates at the
same time palle e girare with a maximum distance
of three word forms). This procedure streamlines
the automatic recognition of the idioms,
guaranteeing high levels of recall in spite of the large
variety of syntactic transformations that the frozen
structure can go through (causative constructions,
infinitive forms preceded by da, dislocation,
modification, among others
          <xref ref-type="bibr" rid="ref9">(Vietri, 2014)</xref>
          ).
4
        </p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Experiment and Evaluation</title>
      <p>The linguistic resources described so far have
been tested on a large corpus of
User-GeneratedContents scraped by Facebook. We chose an
Italian Facebook page called Sesso Droga e
Pastorizia, which became popular for its explicit and
offensive contents. The page has been shut down
the 10/03/2017 for the social network policy
violation; therefore, the page’s administrators
created a set of connected pages in order to continue
the activity in case of temporal or definitive
closing. For our experimentation, posts and comments
have been extracted from three pages
correspondent to the following indices:
sessodrogapastorizia1, sessodrogapastorizia3 and
sessodrogapastoriziariserva. The corpus includes 31,749
comments published between 28 March 2017 and 13
April 2017 by over 20 thounsand users, replying
to 122 status. We extracted 2,797 taboo
expressions with a Recall of 97% and a Precision of 83%
by applying dictionaries and grammars to the
generated corpus1.</p>
      <p>Figure 1 represents a bubble chart which
illus1The Recall has been evaluated on the entire corpus of
over 31,000 comments, while the Precision has been
calculated on the extracted 2,700+ sentences.
trates the distribution of Semantic Fields and Types
of the extracted words. The fields are listed in the
horizontal axis. The vertical axis and the size of
the circles describe together the frequency of the
extracted items. Finally, the colors of the circles
represent the words’ types.</p>
      <p>As far as MWEs are concerned, we extracted
134 idioms; moreover 597 MWEs have been
annotated as NPN structures, 213 as NA and 175 as
AN. Among the most frequent MWEs we
mention some items which were already listed into the
dictionaries (e.g. 9 occurrences of testa di cazzo,
“dickhead”; 7 occurrences of pezzo di merda,
“piece of shit”).</p>
      <p>Also new vulgar structures belonging to various
fields have been automatically located through our
strategy (e.g. 51 occurrences of cazzo duro,
“hardon” from the field sex; 3 occurrences of gran troia
“total slut” from the sexism field; 2 occurrences of
busta di piscio “box of piss” from the scat field).</p>
      <p>The extracted patterns underline the relevance
of the local context in the disambiguation of some
words which have classified N.C. as simple words,
because of their ambiguity out of the context. An
example is cazzo which, alone, did not receive any
field or type label, but as a MWE clearly belongs
to defined categories. Cazzo duro belongs to the
sex field. Cazzo di + Noun “this fucking + N” is
a generic offense (e.g. cazzo di pagina “this
fucking page”) and cazzo di + Taboo Noun represents
an intensification of the expressed offensive term
(e.g. cazzo di zingaro “this fucking gypsy”).
5</p>
    </sec>
    <sec id="sec-6">
      <title>Conclusion</title>
      <p>In this paper we described an experiment on the
detection and classification of offenses, threats and
insults shared through User Generated Contents.</p>
      <p>As a matter of fact, in May 2016, the European
Commission, together with companies like
Facebook, Twitter, YouTube and Microsoft, underlined
the relevance of these topics by presenting a code
of conduct2 which aimed to constrain the virality
of illegal online violence and hate speech, with
a special focus on utterances fomenting racism,
xenophobia and terrorist contents. The negative
impact of such practices is not limited to
individuals, but strongly affects the freedom of expression
and the democratic discourse on the Web.</p>
      <p>Our research focused on a particular Facebook
page, which became famous in Italy for the
number of times it has been shut down due to its
disturbing content. More than 31,000 users’
comments downloaded from this page have been
automatically annotated according to a dataset of taboo
expressions, in the form of simple words and
multiword expressions. This operation has led to a
hate speech annotated corpus which distinguishes
eight harassment semantic fields, four types of
insult and four hate targets (traits). The evaluation
of the experiment performances confirmed the
hypothesis that the local context of words represents
an essential feature for an effective hate speech
mining on the web.</p>
      <p>
        In future works we will test the interaction of
the taboo item located in the corpus with some
Italian Contextual Valence Shifters
        <xref ref-type="bibr" rid="ref5">(Maisto and
Pelosi, 2014)</xref>
        in order to verify if the sentence
context of the insult indicators affects the semantic
orientation of the items into an Opinion Mining
2http://ec.europa.eu/justice/
fundamental-rights/files/hate_speech_
code_of_conduct_en.pdf
view.
      </p>
      <p>Furthermore, it would be interesting to
verify the efficacy of our resources and our method
on different domains, Political Communication,
among others.</p>
      <p>In the end, just because the automatic
extraction has been done in this paper on a very
polarized corpus, future analyses will focus on testing
the reliability of this research on more neutral
collections of texts.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <given-names>Pinkesh</given-names>
            <surname>Badjatiya</surname>
          </string-name>
          , Shashank Gupta, Manish Gupta, and
          <string-name>
            <given-names>Vasudeva</given-names>
            <surname>Varma</surname>
          </string-name>
          .
          <year>2017</year>
          .
          <article-title>Deep learning for hate speech detection in tweets</article-title>
          .
          <source>In Proceedings of the 26th International Conference on World Wide Web Companion</source>
          , pages
          <fpage>759</fpage>
          -
          <lpage>760</lpage>
          . International World Wide Web Conferences Steering Committee.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <given-names>Ying</given-names>
            <surname>Chen</surname>
          </string-name>
          , Yilu Zhou, Sencun Zhu, and
          <string-name>
            <given-names>Heng</given-names>
            <surname>Xu</surname>
          </string-name>
          .
          <year>2012</year>
          .
          <article-title>Detecting offensive language in social media to protect adolescent online safety</article-title>
          .
          <source>In Privacy, Security, Risk and Trust (PASSAT)</source>
          ,
          <source>2012 International Conference on and 2012 International Confernece on Social Computing (SocialCom)</source>
          , pages
          <fpage>71</fpage>
          -
          <lpage>80</lpage>
          . IEEE.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <given-names>Irene</given-names>
            <surname>Kwok</surname>
          </string-name>
          and
          <string-name>
            <given-names>Yuzhou</given-names>
            <surname>Wang</surname>
          </string-name>
          .
          <year>2013</year>
          .
          <article-title>Locate the hate: Detecting tweets against blacks</article-title>
          .
          <source>In AAAI.</source>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <given-names>Altaf</given-names>
            <surname>Mahmud</surname>
          </string-name>
          , Kazi Zubair Ahmed, and
          <string-name>
            <given-names>Mumit</given-names>
            <surname>Khan</surname>
          </string-name>
          .
          <year>2008</year>
          .
          <article-title>Detecting flames and insults in text</article-title>
          .
          <source>In Proceedings of the Sixth International Conference on Natural Language Processing</source>
          . BRAC University.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <given-names>Alessandro</given-names>
            <surname>Maisto</surname>
          </string-name>
          and
          <string-name>
            <given-names>Serena</given-names>
            <surname>Pelosi</surname>
          </string-name>
          .
          <year>2014</year>
          .
          <article-title>A lexicon-based approach to sentiment analysis. the italian module for nooj</article-title>
          .
          <source>In Proceedings of the International Nooj 2014 Conference</source>
          , University of Sassari, Italy. Cambridge Scholar Publishing.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <given-names>Serena</given-names>
            <surname>Pelosi</surname>
          </string-name>
          .
          <year>2015</year>
          .
          <article-title>Sentita and doxa: Italian databases and tools for sentiment analysis purposes</article-title>
          .
          <source>In Proceedings of the Second Italian Conference on Computational Linguistics CLiC-it</source>
          <year>2015</year>
          , pages
          <fpage>226</fpage>
          -
          <lpage>231</lpage>
          . Accademia University Press.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <given-names>Amir</given-names>
            <surname>Razavi</surname>
          </string-name>
          , Diana Inkpen, Sasha Uritsky, and
          <string-name>
            <given-names>Stan</given-names>
            <surname>Matwin</surname>
          </string-name>
          .
          <year>2010</year>
          .
          <article-title>Offensive language detection using multi-level classification</article-title>
          .
          <source>Advances in Artificial Intelligence</source>
          , pages
          <fpage>16</fpage>
          -
          <lpage>27</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <given-names>Kelly</given-names>
            <surname>Reynolds</surname>
          </string-name>
          , April Kontostathis, and
          <string-name>
            <given-names>Lynne</given-names>
            <surname>Edwards</surname>
          </string-name>
          .
          <year>2011</year>
          .
          <article-title>Using machine learning to detect cyberbullying</article-title>
          .
          <source>In Machine Learning and Applications and Workshops (ICMLA)</source>
          ,
          <year>2011</year>
          10th International Conference on, volume
          <volume>2</volume>
          , pages
          <fpage>241</fpage>
          -
          <lpage>244</lpage>
          . IEEE.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <given-names>Simonetta</given-names>
            <surname>Vietri</surname>
          </string-name>
          .
          <year>2014</year>
          .
          <article-title>Idiomatic Constructions in Italian: A Lexicon-grammar Approach</article-title>
          , volume
          <volume>31</volume>
          . John Benjamins Publishing Company.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <string-name>
            <given-names>Zeerak</given-names>
            <surname>Waseem</surname>
          </string-name>
          and
          <string-name>
            <given-names>Dirk</given-names>
            <surname>Hovy</surname>
          </string-name>
          .
          <year>2016</year>
          .
          <article-title>Hateful symbols or hateful people? predictive features for hate speech detection on twitter</article-title>
          .
          <source>In SRW@ HLT-NAACL</source>
          , pages
          <fpage>88</fpage>
          -
          <lpage>93</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          <string-name>
            <given-names>Guang</given-names>
            <surname>Xiang</surname>
          </string-name>
          , Bin Fan, Ling Wang,
          <string-name>
            <surname>Jason Hong</surname>
            , and
            <given-names>Carolyn</given-names>
          </string-name>
          <string-name>
            <surname>Rose</surname>
          </string-name>
          .
          <year>2012</year>
          .
          <article-title>Detecting offensive tweets via topical feature discovery over a large scale twitter corpus</article-title>
          .
          <source>In Proceedings of the 21st ACM international conference on Information and knowledge management</source>
          , pages
          <fpage>1980</fpage>
          -
          <lpage>1984</lpage>
          . ACM.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          <string-name>
            <given-names>Zhi</given-names>
            <surname>Xu</surname>
          </string-name>
          and
          <string-name>
            <given-names>Sencun</given-names>
            <surname>Zhu</surname>
          </string-name>
          .
          <year>2010</year>
          .
          <article-title>Filtering offensive language in online communities using grammatical relations</article-title>
          .
          <source>In Proceedings of the Seventh Annual Collaboration</source>
          , Electronic Messaging, Anti-Abuse and Spam Conference.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          <string-name>
            <given-names>Dawei</given-names>
            <surname>Yin</surname>
          </string-name>
          , Zhenzhen Xue, Liangjie Hong,
          <string-name>
            <surname>Brian D Davison</surname>
            ,
            <given-names>April</given-names>
          </string-name>
          <string-name>
            <surname>Kontostathis</surname>
            , and
            <given-names>Lynne</given-names>
          </string-name>
          <string-name>
            <surname>Edwards</surname>
          </string-name>
          .
          <year>2009</year>
          .
          <article-title>Detection of harassment on web 2.0</article-title>
          .
          <source>In Proceedings of the Content Analysis in the WEB</source>
          , volume
          <volume>2</volume>
          , pages
          <fpage>1</fpage>
          -
          <lpage>7</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>