<!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>
      <journal-title-group>
        <journal-title>Suidong Qu[</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Non-contextual Binary Classi cation for Mexican Spanish with XLM and CNN</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Yunnan University</institution>
          ,
          <addr-line>Yunnan</addr-line>
          ,
          <country country="CN">P.R.China</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>0000</year>
      </pub-date>
      <volume>0002</volume>
      <abstract>
        <p>This article rst introduces the development of deep learning in natural language processing in recent years. Then the related work is brie y explained. We participat in the classi cation tasks of MeOffendEs@IberLEF 2021 Subtask 3: Non-contextual binary classi cation of Mexican Spanish. In this task, our work involves categorizing tweets as o ensive or non-o ensive tweets in the O endMEX corpus. The method in this article rst uses XLM to obtain semantic feature information, and then extracts the features again through convolutional neural networks. Focal Loss is used in the model to improve the classi cation e ect. In this task, our team name is Dong. The precision of our model is 0.6050, the recall is 0.5361, and the F1 score is 0.5685.</p>
      </abstract>
      <kwd-group>
        <kwd>Binary Classi cation</kwd>
        <kwd>O ensive Language Detection</kwd>
        <kwd>XLM</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        In recent years, with the rapid development of Internet-based media, a large
number of websites with social services as the main content have emerged, such
as Facebook, Twitter and Weibo. Their birth makes information dissemination
no longer centered on media, but centered on users. The cost for people to share
and obtain information has become very low, but at the same time o ensive
language is also ooding people's vision. O ensive language is text content that
can irritate individuals or groups, including hate language, personal attacks,
harassment, ridicule, etc. In recent years, research related to speech abuse has
received more and more attention. Preventing the abuse of o ensive language
is of great signi cance to maintaining social harmony. The basis for e ectively
avoiding speech abuse is to quickly, automatically and accurately identify o
ensive language. In this binary classi cation task of MeO endEs@IberLEF 2021
[
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ]: Subtask 3 , we need to classify the data set of short texts based on Twitter
as o ensive or non-o ensive tweets in the O endMEX corpus.
      </p>
      <p>Section 2 of this article brie y introduces the progress and current situation
of work related to natural language processing. Section 3 describes the data
set used in this mission. Section 4 illustrates our method, which describes the
preprocessing steps and main structure of the model. Section 5 describes the
adjusted hyper-parameters applicable to this model and our experimental results.
We summarized our work in Section 6.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>
        With the application and development of deep learning in many industrial and
commercial elds and the rapid improvement of computer computing
performance, deep learning models are becoming more and more easily applicable to
various scenarios, including the task of detecting o ensive short texts. Deep
neural networks have a more complex network structure than traditional machine
learning methods, and can dig out high-dimensional feature information from
samples by self-learning the characteristics of samples. In 2017, Thomas
Davidson et al. [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] conducted a research on automatic hate speech recognition based on
Twitter text. Experimental results showed that the e ects of logistic regression
and linear SVM (Support Vector Machines) are signi cantly better than
classiers based on naive Bayes and decision trees. In 2017, Shervin Malmasi et al. [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]
used linear SVM as a classi er to detect hate speech in Twitter text. They used
character-based and vocabulary-based N-Grams features with di erent N values.
In 2016, Zhang et al. [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] used a two-way gated neural network to extract
grammatical and semantic information in Twitter text, and used a pooling operation
to extract contextual features in historical data. In 2017, Pinkesh Badjatiya et
al. [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] used CNN (Convolutional Neural Network) and LSTM (Long Short-Term
Memory) methods to detect hate speech in Twitter text. In 2017, Ji Ho Park
et al. [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] used a hybrid model combining character CNN and word CNN for the
particularity of tweets. In 2019, Shiwei Zhang et al. [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] used a two-way long and
short-term memory network combined with an attention mechanism to detect
mocking comments in tweets. In 2019, Pushkar Mishra et al. [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] used CNN to
detect the abuse of speech in combination with user personal information and
user social information. The model can capture the characteristics of individual
language behavior and group structure. In 2020, Baruah and Das et al. [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] used
pre-training BERT [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] for feature extraction of context and target text. We
participate in this task for Mexican Spanish and propose a method that includes
XLM [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] and CNN models. It can integrate the advantages of two models to
enhance the e ectiveness of the binary classi cation.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Data and Resources</title>
      <p>This task is Subtask 3 in MeO endEs@IberLEF 2021. Our task is to classify
tweets as o ensive or non-o ensive tweets in the O endMEX corpus. The
training data used in our task is provided to each participant by the task organizer.
These data are collected from Mexican Spanish on Twitter and have been tagged.</p>
    </sec>
    <sec id="sec-4">
      <title>System</title>
    </sec>
    <sec id="sec-5">
      <title>Description</title>
      <sec id="sec-5-1">
        <title>Data Preprocessing</title>
        <p>In order to make the model better understand the semantic relationship of
sentences during the training phase, we remove punctuation marks, numbers, and
emoticons during preprocessing. This approach does not a ect the e ect of the
model in this classi cation task, and can reduce the di culty of training the
model. BERT inserts an identi er [CLS] and a separator [SEP] into each
sentence sample during training. Among them, [CLS] is added at the beginning of
the sentence, and [SEP] is added at the end of the sentence. [SEP] separates two
sentences, so that the sample forms a structure of [CLS] + sentence + [SEP].
4.2</p>
      </sec>
      <sec id="sec-5-2">
        <title>Model Description</title>
        <p>Our model includes XLM and CNN models. Since BERT was proposed, it has
proved that the pre-training model is very e ective in processing natural
language understanding tasks, and it has achieved good results in a variety of
natural language processing tasks. We consider that BERT mainly focuses on the
natural language processing tasks of a single language, so in this task we used
Hugging Face's implementation of XLM model. XLM is a Cross-Lingual version
developed by Facebook on the basis of BERT. XLM has the same structure
as BERT, so it is also an encoder composed of multiple Encoder structures in
Transformer [13].</p>
        <p>When training XLM, we use XLM to encode any sentences into a shared
embedding space. The input sequence will be masked. The process is to select
15% of the input sequence for random masking, 80% of which are replaced by
[Mask], 10% are replaced by random words, and the remaining 10% are still
correct words. The Fig.1 below shows the basic structure of the model.</p>
        <p>The focus of this classi cation task is to extract the core semantic information
contained in the sentence. We input the feature information extracted by XLM
into CNN. We initialize it before entering CNN. The CNN layer can e ectively
reduce the number of parameters, thereby reducing the di culty of training,
and at the same time extract low-level local features into higher-level features.
In the convolutional neural network we designed, the Batch size is set to 8, the
size of the convolution kernel is 2, 3, 4, and 5, and the dropout is set to 0.2.
Dropout is added to reduce the possibility of over tting. In order to accelerate
convergence and alleviate the problem of gradient disappearance, we use the
Batch Normalization layer to normalize each batch of data. We use the ReLU
activation function inside the CNN, and use the sigmoid activation function for
the nal output.</p>
        <p>When some previous models used the traditional cross-entropy loss function,
those models ignored the di erence in the degree of optimization of the model
between positive and negative samples. In this task, the proportion of positive
samples and negative samples in the training data set is unbalanced. Therefore,
this model adoptes the Focal Loss function[14] based on the cross-entropy loss
function in ne-tuning. This method can reduce the weight occupied by a large
number of simple negative samples in the process of training and optimization,
and put the model's focus on sparse di cult samples. This method is added to
the classi cation model of this article, and and are set to 2 and 0.75 respectively,
which can improve the classi cation e ect.</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>Hyper-parameters and Results</title>
      <p>In this classi cation task, our model is based on PyTorch. After many
experiments, the training parameter values are shown in Table 1. For this task, our
model is composed of XLM and CNN, and the Adam [15] optimizer is used. In
the internal and output of CNN, we use ReLU activation function and sigmoid
activation function respectively.</p>
      <p>In this task, the scores obtained by our model are shown in Table 2. The
organizer's evaluation indicators for this task are precision, recall and F1 score.
The precision of our model is 0.6050 (ranked 10th, 0.31 lower than the highest
score). The recall is 0.5361 (ranked 9th, 0.16 lower than the highest score). The
F1 score is 0.5685 (ranked 9th, 0.14 lower than the highest score).</p>
      <p>From Table 2 we can see that although our macro precision is not high
compared to model 3, our model has better stability. Comparing madol 1 and
model 2, our macro recall and F1 score are relatively low. We plan to use Focal
Loss to improve macro recall, but the e ect is limited. From the perspective of
the data set, we nd that the amount of o ensive and non-o ensive text is very
di erent. In addition, the semantics of some texts are ambiguous, which can
cause interference. This situation makes our model more biased towards the side
with more data when ne-tuning, and the model may have over- tting during
training. These situations ultimately lead to the model's poor performance in
the test set.</p>
    </sec>
    <sec id="sec-7">
      <title>Conclusion</title>
      <p>This article mainly describes the overall idea and optimization scheme of
noncontextual o ensive detection and classi cation for Mexican Spanish. In the
model implementation, we use the XLM pre-training model as a word vector
model, and construct a convolutional neural network in downstream tasks to
extract deep semantic information. The Focal Loss function is introduced into
the model to improve the classi cation performance. Among these evaluation
indicators, this method is not optimal compared with other methods,
indicating that this model has certain disadvantages. Although the downstream task
captures some local information through CNN, its extraction ability is limited.
In the next stage of research, we can add sentence-level attention information
to improve the detection results. In addition, we consider adjusting the depth
of the CNN in the model and the number of epochs to improve the model's
characterization ability.
13. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser,
L., Polosukhin, I.: Attention is all you need. In: Proceedings of the 31st
International Conference on Neural Information Processing Systems. vol. 30, pp. 5998{
6008 (2017)
14. Lin, T.Y., Goyal, P., Girshick, R., He, K., Dollar, P.: Focal loss for dense object
detection. IEEE Transactions on Pattern Analysis and Machine Intelligence 42(2),
318{327 (2020)
15. Kingma, D., Ba, J.: Adam: A method for stochastic optimization. Computer
Science (2014)
16. Miao, Y., Ji, Y., Peng, E.: Application of cnn-bigru model in chinese short text
sentiment analysis. In: Proceedings of the 2019 2nd International Conference on
Algorithms, Computing and Arti cial Intelligence (2019)</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Montes</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rosso</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gonzalo</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Aragon</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Agerri</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Alvarez-Carmona</surname>
            ,
            <given-names>M.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Alvarez Mellado</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Carrillo-de Albornoz</surname>
          </string-name>
          , J.,
          <string-name>
            <surname>Chiruzzo</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Freitas</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gomez</surname>
            <given-names>Adorno</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            ,
            <surname>Gutierrez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            ,
            <surname>Jimenez-Zafra</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.M.</given-names>
            ,
            <surname>Lima</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Plaza-de Arco</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.M.</given-names>
            ,
            <surname>Taule</surname>
          </string-name>
          , M. (eds.):
          <source>Proceedings of the Iberian Languages Evaluation Forum (IberLEF</source>
          <year>2021</year>
          ) (
          <year>2021</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Plaza-del-Arco</surname>
            ,
            <given-names>F.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Casavantes</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Jair</given-names>
            <surname>Escalante</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            ,
            <surname>Martin-Valdivia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.T.</given-names>
            ,
            <surname>Montejo-Raez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Montes-</surname>
          </string-name>
          y-Gomez,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Jarqu</surname>
          </string-name>
          n-Vasquez,
          <string-name>
            <surname>H.</surname>
          </string-name>
          ,
          <article-title>Villasen~or-</article-title>
          <string-name>
            <surname>Pineda</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          :
          <article-title>Overview of the MeO endEs task on o ensive text detection at IberLEF 2021</article-title>
          .
          <source>Procesamiento del Lenguaje Natural</source>
          <volume>67</volume>
          (
          <issue>0</issue>
          ) (
          <year>2021</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Davidson</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Warmsley</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Macy</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weber</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>Automated hate speech detection and the problem of o ensive language (</article-title>
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Malmasi</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zampieri</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Detecting hate speech in social media (</article-title>
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. Zhang,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Yue</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            ,
            <surname>Fu</surname>
          </string-name>
          , G.:
          <article-title>Tweet sarcasm detection using deep neural network</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Badjatiya</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gupta</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gupta</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Varma</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          :
          <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>
          . pp.
          <volume>759</volume>
          {
          <issue>760</issue>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Ji</surname>
            ,
            <given-names>H.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fung</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>One-step and two-step classi cation for abusive language detection on twitter</article-title>
          .
          <source>In: Proceedings of the First Workshop on Abusive Language Online</source>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Zhang</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhang</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chan</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rosso</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Irony detection via sentiment-based transfer learning</article-title>
          .
          <source>Information Processing Management</source>
          <volume>56</volume>
          (
          <issue>5</issue>
          ),
          <volume>1633</volume>
          {
          <fpage>1644</fpage>
          (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Mishra</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tredici</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yannakoudakis</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shutova</surname>
          </string-name>
          , E.:
          <article-title>Abusive language detection with graph convolutional networks (</article-title>
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Baruah</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Das</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Barbhuiya</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dey</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Context-aware sarcasm detection using bert</article-title>
          .
          <source>In: Proceedings of the Second Workshop on Figurative Language Processing</source>
          (
          <year>2020</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11. Bert:
          <article-title>Pre-training of deep bidirectional transformers for language understanding (</article-title>
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Conneau</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lample</surname>
          </string-name>
          , G.:
          <article-title>Cross-lingual language model pretraining</article-title>
          .
          <source>In: Advances in Neural Information Processing Systems</source>
          . vol.
          <volume>32</volume>
          , pp.
          <volume>7057</volume>
          {
          <issue>7067</issue>
          (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>