<!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>Pablo Emilio López-Ávila1,* , Andrea Bethsabe García-Gutiérrez1, Pedro Adair Gallegos-Ávila 1, Ramón Aranda2,3 and Miguel Ángel Álvarez-Carmona1,3</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Centro de Investigación en Matemáticas (CIMAT)</institution>
          ,
          <addr-line>Sede Mérida, Yucatán, Mexico, 97302</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Centro de Investigación en Matemáticas (CIMAT)</institution>
          ,
          <addr-line>Sede Monterrey, Nuevo León, Mexico, 66629</addr-line>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Consejo Nacional de Humanidades, Ciencias y Tecnologías (CONAHCYT)</institution>
          ,
          <addr-line>CDMX, Mexico, 03940</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>This article presents a proposal for author attribute profiling, specifically focusing on gender, profession, and political ideology (both binary and multiclass), using a BETO (transformer architecture for Spanish tasks) model. The model is applied to analyze tweets associated with Spanish authors. Originally designed and utilized in the authors' thesis project for document classification, the main objective is to assess the generalization capability of the proposed architecture across various document classification tasks, outperforming random attribute assignment.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Author profilling</kwd>
        <kwd>Gender</kwd>
        <kwd>Profession</kwd>
        <kwd>Political Ideology</kwd>
        <kwd>Transformers</kwd>
        <kwd>BETO</kwd>
        <kwd>Spanish</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Over the past years, there has been a shift in information collection techniques, with a move
away from relying solely on telephone surveys during election times, and a greater emphasis on
utilizing social networks [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Social networks, especially platforms like Twitter, have become
the primary spaces where individuals share their opinions, engage in debates, and passionately
defend their viewpoints and ideals. In general, the task of determining important aspects of an
author through his/her texts on social networks is known as author profiling [
        <xref ref-type="bibr" rid="ref2 ref3">2, 3</xref>
        ].
      </p>
      <p>
        This article provides a detailed account of how the authors’ proposal was implemented in
their master’s thesis project and evaluates its performance in this specific context. The classifier
utilized in this project is based on the Transformers architecture, specifically a variant known as
BETO [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Through fine-tuning [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], the model’s weights are adjusted to suit the task proposed
at [
        <xref ref-type="bibr" rid="ref6 ref7">6, 7</xref>
        ]. The classification layers function as linear projections, enabling the expansion of
the range of considered characteristics and subsequently contracting them to the number of
classes relevant to each attribute. The proposal achieved an average  1 score of 0.666 across all
the considered attributes, with the poorest performance observed in the case of the multiclass
ideology attribute. Further details regarding this will be discussed in subsequent sections. The
article includes sections dedicated to Dataset Description, Methods, Results, and Conclusions.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Dataset description</title>
      <p>
        The dataset provided in this study [
        <xref ref-type="bibr" rid="ref7 ref8">8, 7</xref>
        ] is an extension of the previous PoliticEs 2022 task.
It encompasses observations gathered from Twitter profiles in Spain between 2020 and 2022.
These profiles include individuals from various categories, such as politicians (government
members, congress members, mayors, former politicians, and collaborators), political journalists
(representing media outlets like ABC, El País, ElDiario, and El Mundo), as well as celebrities.
The selection of these individuals was based on their political ideology, which could be inferred
from factors such as their political party afiliation, editorial stance, or public support for a
specific political party. For each user, the dataset provides the following information:
• Gender: Male or Female (Binary class)
• Profession: Politic, Journalist or Celebrity (Multiclass)
• Binary Ideology: Left or Right
• Multiclass Idelogy: Left, Moderate Left, Moderate Right or Right
      </p>
      <sec id="sec-2-1">
        <title>2.1. Classes Distributions</title>
        <p>The name given to these attributes is Non ideological, this makes reference to elements that
describes the user answering the question ¿Who is posting? (e.g A female journalist)</p>
        <p>Figure 1 shows the Gender on training data set seems to introduce a 67-33 ratio that’s
imbalanced but it’s too early to conclude that Female gender will be problematic. Figure 2
shows information about profession attribute it seems to introduce a 60-30-10 ratio, in this
case the celebrity profession might be often misclassified for any majority class. There are
diferent approaches in order to deal with very Imbalanced classes, the most frequent are
Subsampling and Oversampling techniques, these approaches could be a bit aggressive so
we first tried fitting models using the original data set.</p>
        <p>We called these Political attributes because they’re related to political ideology for both
cases, binary and multiclass.</p>
        <p>For the Binary the training data set seem to introduce a 60 − 40 ratio having the left class as
the majority class (see Figure 3), in practice there’s no problem dealing with these proportions
at the model fitting. The multiclass problem introduces a 35 − 30 − 15 − 10 ratio ((see Figure
4)), having the moderate classes as the majority classes and right as the minority, these
proportions are indeed imbalanced but as the Profession attribute, we’ll wait until face heavy
misclassification problem.</p>
      </sec>
      <sec id="sec-2-2">
        <title>2.2. Wordclouds</title>
        <sec id="sec-2-2-1">
          <title>Most frequent words on binary problem</title>
          <p>If a word as Gobierno on the following wordclouds is bigger than any other word as Madrid,
we can tell that Gobierno has a lot more appearances than Madrid, We also noticed that the
most frequent words on any class are the same such as Gobierno, España, Madrid words than
will not help us to keep the classes away. A finding of interest is that the respective Opposing
ideology appears as one of the most frequent word.</p>
          <p>Most frequent words on Multiclass problem
We can see a similar set of most frequent words as Gobierno, España, Madrid, for
Moderate Left (Figure 7) words such as Periodistas, Mujeres, Justicia and Asturias and finally
Moderate Right (Figure 8) we have words such as Impuesto, Presupuesto, Violencia, an
Familia. These key words can be taken as representation of the class, but the real challenge
will be how to make distinction from moderate classes and non moderate classes</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Methods</title>
      <p>The proposed solution starts preprocessing the content of the tweets, this includes:
• Convert all words in the tweet to lowercase.</p>
      <p>• Remove emojis and non numerical elements.</p>
      <p>
        We tried to preserve as much information from the original documents as we could, after
this We proceeded to use a Fine tuned BETO [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], BETO is a BERT [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] model trained on the
Spanish Unannotated Corpora (SUC) that has been used on diferent NLP tasks.
Begins taking preprocessed tweets to a 512 dimensional Token representation using Word
Piece Tokenization this is the BERT Tokenizer [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], thus:
      </p>
      <p>
        = (, 1, · · · ,  )
Evaluating all these token representation on the BERT model, produces an output of shape:
 _ ×  _  × 768
In this case for Classification task, we must extract the information related to the CLS [
        <xref ref-type="bibr" rid="ref11 ref9">9, 11</xref>
        ]
token this generates a 768 dimensional vector representation for every tweet that contains their
semantic information. Finally we used the information extracted from the CLS in a Classifier
based on Linear Layers (see Figure 9):
      </p>
      <p>• First layer projects 768 element vectors into a 382 dimensional space
• A ReLU activation function between linear layers
• Last layer projects a 382 representation into a Number of classes Space</p>
      <sec id="sec-3-1">
        <title>Training details:</title>
        <p>• 3 epochs
• Batch size of 32 elements
• Adam Optimizer using a learning rate of 5− 5
• Unfreezed BETO weights</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Results</title>
      <p>
        In this competition [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] the proposal’s performance is measured using the macro  1 score per
trait on every class, after this an arithmetic mean of the macro F1 scores is computed, this is the
ifnal score to rank team’s performance, in this time the following are our best results:
      </p>
      <p>Table 1 shows the results obtanied by our methodology for the diferent scenarios. It is
evident that classes such as Gender and Binary Ideology exhibit superior performance compared
to random class assignments. Despite having three categories, the Profession class achieved
remarkable results, nearly on par with binary classification tasks. However, the Multiclass
Ideology category demonstrated the lowest performance, resulting in a decline in the overall
average F1 score.</p>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusions</title>
      <p>In conclusion, this proposal aimed to achieve high-quality BERT representations by employing
diferent tokenization and preprocessing techniques. Overall, the approach yielded satisfactory
results for most classification problems, with the exception of Multiclass Ideology. It is possible
that the limited performance in this category can be attributed to the distribution of the training
dataset. Insuficient examples of the targeted class may have hindered the model’s ability to
classify instances accurately. Additionally, it is plausible that the ’untag’ test dataset contained
a significant number of examples belonging to the minority classes, which could have impacted
the model’s performance.</p>
      <p>To address this issue in future work, we propose employing an approach that involves
generating artificial examples using class-exclusive words. This strategy aims to mitigate the
imbalanced data problem and improve the performance of minority classes.</p>
      <p>
        Another potential factor influencing performance is the length of the merged user tweet,
which may exceed the maximum token limit allowed by BERT (512 tokens). This limitation
could have afected the model’s capture of all relevant information from longer tweets. In
summary, while the proposal achieved satisfactory results overall, there is room for improvement,
particularly in addressing imbalanced data and considering token limitations. Future research
should focus on implementing strategies such as generating artificial examples and exploring
techniques to handle longer tweets efectively. The preliminary analysis reveals that a majority
of the merged tweets contain between 2000 and 2500 words. This poses a challenge since
BERT is unable to handle such lengthy sequence lengths [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. To address this issue in future
endeavors, a potential solution could be implementing a Vote System, as suggested in [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ].
This approach would involve classifying each individual tweet within a user’s collection and
assigning the most frequent (or one of the most frequent) classes found across their tweets.
Furthermore, regarding the proposed Linear classifier , there is potential for improvement by
exploring more sophisticated architectures, such as incorporating LSTM layers. Testing these
more complex structures will help determine whether they outperform traditional approaches
like Linear Layers. Considering alternative architectures can enhance classification performance
and provide valuable insights for future investigations.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A.</given-names>
            <surname>Rao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Spasojevic</surname>
          </string-name>
          ,
          <article-title>Actionable and political text classification using word embeddings and lstm</article-title>
          ,
          <year>2016</year>
          . arXiv:
          <volume>1607</volume>
          .
          <fpage>02501</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>M.</given-names>
            <surname>Á. Álvarez Carmona</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E. Villatoro</given-names>
            <surname>Tello</surname>
          </string-name>
          , M. Montes y Gómez,
          <string-name>
            <given-names>L. Vilaseñor</given-names>
            <surname>Pineda</surname>
          </string-name>
          ,
          <article-title>Author profiling in social media with multimodal information</article-title>
          ,
          <source>Computación y Sistemas</source>
          <volume>24</volume>
          (
          <year>2020</year>
          )
          <fpage>1289</fpage>
          -
          <lpage>1304</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>M.</given-names>
            <surname>Á</surname>
          </string-name>
          .
          <string-name>
            <surname>Álvarez-Carmona</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          <string-name>
            <surname>Villatoro-Tello</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          <string-name>
            <surname>Villaseñor-Pineda</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <article-title>Montes-y Gómez, Classifying the social media author profile through a multimodal representation</article-title>
          ,
          <source>in: Intelligent Technologies: Concepts</source>
          ,
          <string-name>
            <surname>Applications</surname>
          </string-name>
          , and Future Directions, Springer,
          <year>2022</year>
          , pp.
          <fpage>57</fpage>
          -
          <lpage>81</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>J.</given-names>
            <surname>Cañete</surname>
          </string-name>
          , G. Chaperon,
          <string-name>
            <given-names>R.</given-names>
            <surname>Fuentes</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.-H.</given-names>
            <surname>Ho</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Kang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Pérez</surname>
          </string-name>
          ,
          <article-title>Spanish pre-trained bert model and evaluation data</article-title>
          ,
          <source>in: PML4DC at ICLR</source>
          <year>2020</year>
          ,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>M. A.</given-names>
            <surname>Alvarez-Carmona</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Aranda</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Rodriguez-Gonzalez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Fajardo-Delgado</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. G. A.</given-names>
            <surname>Sanchez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Perez-Espinosa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Martinez-Miranda</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Guerrero-Rodriguez</surname>
          </string-name>
          , L. BustioMartinez,
          <string-name>
            <given-names>A. D.</given-names>
            <surname>Pacheco</surname>
          </string-name>
          ,
          <article-title>Natural language processing applied to tourism research: A systematic review and future research directions</article-title>
          ,
          <source>Journal of King</source>
          Saud University-Computer and Information Sciences (
          <year>2022</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>S. M.</given-names>
            <surname>Jiménez-Zafra</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Rangel</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <article-title>Montes-y Gómez, Overview of IberLEF 2023: Natural Language Processing Challenges for Spanish and other Iberian Languages, in: Proceedings of the Iberian Languages Evaluation Forum (IberLEF 2023), co-located with the 39th Conference of the Spanish Society for Natural Language Processing (SEPLN 2023), CEURWS</article-title>
          .org,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>J. A.</given-names>
            <surname>García-Díaz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. M.</given-names>
            <surname>Jiménez-Zafra</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. T.</given-names>
            <surname>Martín-Valdivia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>García-Sánchez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L. A.</given-names>
            <surname>Ureña-López</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Valencia-García</surname>
          </string-name>
          , Overview of PoliticES at IberLEF 2023:
          <article-title>Political ideology detection in Spanish texts</article-title>
          ,
          <source>Procesamiento del Lenguaje Natural</source>
          <volume>71</volume>
          (
          <year>2023</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>J. A.</given-names>
            <surname>García-Díaz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Colomo-Palacios</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Valencia-García</surname>
          </string-name>
          ,
          <article-title>Psychographic traits identification based on political ideology: An author analysis study on Spanish politicians' tweets posted in 2020, Future Generation Computer Systems 130 (</article-title>
          <year>2022</year>
          )
          <fpage>59</fpage>
          -
          <lpage>74</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>J.</given-names>
            <surname>Devlin</surname>
          </string-name>
          , M.-
          <string-name>
            <given-names>W.</given-names>
            <surname>Chang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Lee</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Toutanova</surname>
          </string-name>
          , Bert:
          <article-title>Pre-training of deep bidirectional transformers for language understanding</article-title>
          ,
          <year>2019</year>
          . arXiv:
          <year>1810</year>
          .04805.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>X.</given-names>
            <surname>Song</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Salcianu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Song</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Dopson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Zhou</surname>
          </string-name>
          , Fast wordpiece tokenization,
          <year>2021</year>
          . arXiv:
          <year>2012</year>
          .15524.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>M. A.</given-names>
            <surname>Álvarez-Carmona</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Aranda</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. Y.</given-names>
            <surname>Rodríguez-González</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Pellegrin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Carlos</surname>
          </string-name>
          ,
          <article-title>Classifying the mexican epidemiological semaphore colour from the covid-19 text spanish news</article-title>
          ,
          <source>Journal of Information Science</source>
          (
          <year>2022</year>
          )
          <fpage>01655515221100952</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>S. S.</given-names>
            <surname>Carrasco</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R. C.</given-names>
            <surname>Rosillo</surname>
          </string-name>
          , Loscalis at politices 2022:
          <article-title>Political author profiling using beto and maria</article-title>
          ,
          <source>in: Proceedings of the Iberian Languages Evaluation Forum (IberLEF</source>
          <year>2022</year>
          ).
          <source>CEUR Workshop Proceedings</source>
          , CEUR-WS,
          <string-name>
            <given-names>A</given-names>
            <surname>Coruna</surname>
          </string-name>
          ,
          <year>Spain</year>
          ,
          <year>2022</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>