<!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>Journal of Machine
Learning Research 12 (2011) 2825-2830.</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <article-id pub-id-type="doi">10.26342/2022-68-3</article-id>
      <title-group>
        <article-title>ELiRF-VRAIN at PoliticES-IberLEF2023: Dealing with Long Texts in Transformer-based Systems for User Profiling</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Vicent Ahuir</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Lluís Felip Hurtado</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Fernando García-Granada</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Emilio Sanchis</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Valencian Research Institute for Artificial Intelligence (VRAIN), Universitat Politècnica de València</institution>
          ,
          <addr-line>Camino de Vera s/n, 46022 Valencia.</addr-line>
          <country country="ES">Spain</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2023</year>
      </pub-date>
      <volume>30</volume>
      <fpage>0000</fpage>
      <lpage>0001</lpage>
      <abstract>
        <p>In this paper, we present our approach to the PoliticES 2023 task. This shared task aims to extract user information from tweets in Spanish. We have developed systems based mainly on Deep Neural Networks (Transformers) to address the problem of binary and multiclass classification. Using pre-trained Transformer-based language models in this shared task poses an input length challenge because the amount of text per user significantly exceeds the input capabilities of common Transformer-based models. Our systems deal with input length problems by dividing the input into subsamples and performing the classification using a voting scheme. The results show the adequacy of our systems for the proposed task.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Transformers</kwd>
        <kwd>User Profiling</kwd>
        <kwd>Voting Classification</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        PoliticES 2023 is a shared task that aims to extract user information from tweets in Spanish.
There is a growing interest in this type of analysis of user profiles and the correlation between
some personality traits and political ideology, especially in the field of social networks. This task
was initiated last year in IberLEF 2022, and was called PoliticES 2022 [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]; although a previous
dataset was generated in 2020, the PoliCorpus 2020 dataset [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. For this new edition of the
shared task of 2023 [3], the participants will work with clusters of texts written by diferent
users, but with the same traits. As the clusters can be considered a kind-of meta-users, the
organization posed a user profiling challenge that consisted of political ideology identification
(binary and multiclass classification), gender identification (binary), and profession identification
(multiclass) of a set of texts that belong to users with the same traits. In political ideology, it is
distinguished between left and right in binary classification, and, for multiclass classification,
left/right or a moderate stand for each wing. In gender, it is distinguished between men and
women. Lastly, politicians, journalists, and celebrities are distinguished on the identification of
the profession.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Dataset</title>
      <p>
        The dataset[4] defined for this task is an extension of the PoliCorpus 2020 dataset [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], and the
corpus used for the PoliticES 2022 shared task [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The data was collected from 2020, and 2022
from the Twitter accounts of politicians, political journalists, and celebrities in Spain using the
UMUCorpusClassifier [5].
      </p>
      <p>The politicians’ accounts were selected from:
(1) members of the government of Spain,
(2) members of the Congress and Senate of Spain,
(3) mayors of some important cities in Spain,
(4) presidents of the autonomous communities,
(5) former politicians, and
(6) collaborators afiliated with political parties.</p>
      <p>Journalists were selected from diferent Spanish news media, such as ABC, El País, ElDiario,
El Mundo, or La Razón, among others.</p>
      <p>The organizers created clusters of texts, mixing some of these extracted tweets. Each cluster
groups 80 tweets written by diferent users that share all the traits under evaluation and are
selected, favoring the diversity, including texts from diferent dates and topics. Every cluster is
labeled with gender (male, female), profession (politician, journalist), and two types of political
ideology: binary (left, right) and multiclass (left, moderate_left, moderate_right, right).</p>
      <p>The dataset is composed of approximately 2800 diferent clusters. The training and test sets
will be released (80%-20%), that is, 2250 clusters for training and 547 for testing. Cluster size
approximately varies between 6000 and 21 600 words for the training set and 8100 and 21 600
words for the test set.</p>
    </sec>
    <sec id="sec-3">
      <title>3. System architecture and Fine-tuning model process</title>
      <p>In this work, we wanted to evaluate the capabilities of Transformers-based [6] systems for the
task of user profiling. However, as mentioned in the previous section, each training sample
is made up of the text of 80 tweets from users with the same traits. This involves much more
text than pre-trained models based on Transformers can handle. To deal with this problem,
it was decided to divide each training sample into a set of subsamples with a size that would
ift in the input layer of the Spanish pre-trained models that have shown better performance,
MarIA [7] and BETO [8] available at HuggingFace [9] public hub. This can lead to mislabeling
of some training subsamples, but we thought the benefits of using the whole dataset outweigh
the drawbacks. In the inference stage, from a test sample a set of subsamples are generated that
are individually labeled by the system. The final decision is made using a simple voting scheme.
For each task, the most voted class is selected. Due to time limits, it has not been possible to
test other more prominent voting techniques.</p>
      <p>The decision of which pre-trained model to use and the strategy to generate the subsamples
was made through a previous validation process.</p>
      <p>For choosing the pre-trained model for each classification subtask, we nfie-tuned MarIA and
BETO pre-trained models for the diferent classification subtasks, and measured the performance
of each classification model with the validation set. All the BETO-based models obtained slightly
better results than MarIA-based ones. For this reason, it was decided to use BETO for all
the ongoing experimentation. Regarding the strategy to split each sample, to generate each
subsample, the largest number of complete tweets that do not exceed a previously determined
maximum number of words are grouped sequentially. We tested the maximum word length in
the range of 300 to 500. The best results were achieved with subsamples that did not exceed 450
words.</p>
      <p>In most of the models trained for this shared task, a search process for the best hyperparameter
configuration was carried out. To do this hyperparameter optimization, the optuna library was
used. Table 1 summarizes the hyperparameters search space.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Run configuration details</title>
      <p>During the challenge, we published a total of 7 runs. Most of those runs followed the system
architecture detailed in Section 3. However, Run2 was created with a classic approach using a
Linear Support Vector Machine (SVM), and the input text was vectorized as a Bag of Words of
up to 4-grams weighted with TF-IDF. This run was developed using the library Scikit-learn [10]
and can be seen as a baseline for classical machine learning approaches.</p>
      <p>To perform the fine-tuning of the pre-trained models, a stratified split of the training corpus
was made. 90% of the corpus was used to fini-tune the models and the remaining 10% was used
for the selection of the best epoch and the best hyperparameter configurations. Due to the size
of the corpus, the stratified split could only be done taking into account the gender, profession
and ideology-binary labels. In addition, to have greater variability in the learned models, two
diferent random partitions were performed using the same stratified strategy but two diferent
random seeds. In this way, it was possible to learn diferent models with two diferent partitions.
• Run1: BETO models fine/tuned individually for each task with hyperparameter search
only in multiclass tasks, profession and ideology-m, using the first random partition.
• Run4: BETO models fine-tuned individually for each task with hyperparameter search in
all tasks using the second random partition.</p>
      <p>• Run6: For each task, the best model from Run1 and Run4 is selected.</p>
      <p>Table 2 shows the hyperparameters used for Run1 and Run4. Since only these two runs
introduce diferent fine-tuned models, we chose only to list them for simplicity. The rest of the
runs were based on selecting a set of models from Run1 and Run4.</p>
      <p>The use of diferent models for the ideology-binary and ideology-multiclass tasks can produce
discrepancies in the labeling. For instance, for the same sample, the binary classifier can
label a sample with the right label while the multiclass classifier can label this sample as
left or moderated_left. To avoid this, we create an Ideology Discrepancy Correction (IDC)
procedure, where the political wing (left or right) is synchronized between the binary and the
multiclass labels. Thus, the binary classifier was prioritized on the ideology identification, and
the multiclass label was overwritten by the binary one when there were discrepancies between
them. For instance, if a sample if binary classified with the right label, and multiclass identified
as left, IDC procedure changes the multiclass label to moderated_right. Three additional runs
were obtained by applying the IDC procedure to the previous runs. By doing it this way, we
can quantify the impact of the IDC on the system’s performance. The additional runs were:
• Run3: Applying the IDC procedure to the output of Run1.
• Run5: Applying the IDC procedure to the output of Run4.</p>
      <p>• Run7: Applying the IDC procedure to the output of Run6.</p>
    </sec>
    <sec id="sec-5">
      <title>5. Experiments and Results</title>
      <p>Overall, our solution achieved the best performance of the challenge in two of the four
classification tasks and in the average system performance. Interstingly, our approach had
the best results in the binary classification tasks (Genre and Ideology) but achieved second or
third place in multiclass tasks (Profession and Ideology). In the Ideology task, our best run
achieved nearly the same score as the best run. However, the diferences between our run
and the best run were more significant in the Profession task. Only by the results, we can not
conclude whether our approach has some limitations in multiclass classification tasks posed by
this challenge or whether it is just circumstantial.</p>
    </sec>
    <sec id="sec-6">
      <title>6. Conclusions</title>
      <p>In this paper, we have presented a user profiling approach to infer gender, profession, and
political ideology from tweets written in Spanish. Our system contains Spanish
Transformerbased models that were fine-tuned for each classification subtask. The fine-tuning process was
done with a hyperparameter search, which helped to increase the overall system performance. A
dificulty posed by the challenge was the overall text length of the user’s text when
Transformersbased models are used due to the input length limitations of these models. We addressed these
limitations by splitting the input into subsamples, classifying them, and performing a voting
process to determine the final label for each sample. Also, we resolved discrepancies between
the binary ideology classification and the ideology multiclass one, which further increased the
system’s performance. Our solution took first place in most classification tasks and reached the
best overall performance in the challenge, indicating our approach’s adequacy for the proposed
tasks. In future work, we will explore some variations of the architecture, for example including
adapter, and in the fine-tuning process. It is also interesting study other possibilities for tackling
with the length of the input texts, for example, by modifying the voting mechanism.</p>
    </sec>
    <sec id="sec-7">
      <title>Acknowledgments</title>
      <p>This work is partially supported by MCIN/AEI/10.13039/501100011033, by the "European Union"
and “NextGenerationEU/MRR”, and by “ERDF A way of making Europe” under grants
PDC2021120846-C44 and PID2021-126061OB-C41. It is also partially supported by the Spanish Ministerio
de Universidades under the grant FPU21/05288 for university teacher training.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <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. Martín</given-names>
            <surname>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</surname>
          </string-name>
          <string-name>
            <surname>López</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R. Valencia</given-names>
            <surname>García</surname>
          </string-name>
          , Overview of PoliticES 2022:
          <article-title>Spanish Author Profiling for Political Ideology</article-title>
          ,
          <source>Procesamiento del Lenguaje Natural</source>
          <volume>69</volume>
          (
          <year>2022</year>
          )
          <fpage>265</fpage>
          -
          <lpage>272</lpage>
          . doi:https: //doi.org/10.26342/2022-69-23.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <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-list>
  </back>
</article>