<!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>Two Attempts to Predict Author Gender in Cross-Genre Settings in Dutch</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Eduardo Brito</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Rafet Sifa</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Christian Bauckhage</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Fraunhofer IAIS, Fraunhofer Center for Machine Learning</institution>
          ,
          <addr-line>Sankt Augustin</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper describes the systems designed by the Fraunhofer IAIS team at the CLIN29 shared task on cross-genre gender detection in Dutch. We show two alternative classi cation approaches: a rather standard one consisting of feature engineering and a random forest classi er; and an alternative one involving a LSTM classi er. Both are enhanced by a LDA model trained on stems. We considered various features such as frequency of function words, parts-of-speech and sentiment among others. We achieved 53.77% average accuracy in the cross-genre settings.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>The CLIN29 shared task is de ned as predicting the gender of the author of
collections of texts in Dutch. The organizers provided a labeled dataset from three
di erent genres according to their source: "Twitter", "Youtube" and "News".
For each of these genres, we were asked to predict the gender of the respective
author by means of two di erent models: one trained with the text collection of
the same genre (in-genre setting) and one trained with anything but text from
the same genre (cross-genre setting).</p>
      <p>We decided to design a common machine learning pipeline (per presented
system) that works for all the settings. Thus, all the models are learned by
applying the same pipeline and they only di er by their respective training data.
This pipeline is described in section 3. Due to the shared task motivation of
exploring approaches for cross-genre settings, we focused on tuning the pipeline
components by evaluating each con guration on the three cross-genre settings
exclusively, virtually ignoring intra-genre evaluations for hyperparameter tuning.</p>
      <p>Finally, our experiments suggested that two di erent architectures were the
best to tackle this shared task: one based on term frequency of function words
and topic modelling; and another based on recurrent neural network using
features of di erent nature. Since we were allowed to submit two di erent runs
per setting, we provided predictions from both systems for each of the de ned
Copyright c 2019 for this paper by its authors. Use permitted under Creative
Commons License Attribution 4.0 International (CC BY 4.0)
settings. Although both approaches reached similar accuracy values in the
crossvalidations that we performed on the training dataset, the evaluation on the nal
test dataset shows that our rst approach can generalize better on the evaluated
genres.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>
        There is already a certain tradition on research on the broader area of author
pro ling, which includes detection of other author characteristics of the author
such as their age, as we can see at the PAN shared task series1. However, most of
the research has been performed for text in English. In particular, we could only
nd previous work on cross-genre author gender detection in Dutch at the PAN
2016 shared task
        <xref ref-type="bibr" rid="ref11">(Rangel et al., 2016)</xref>
        . Most of the features that our models use
are inspired by the best performing systems presented for that challenge.
      </p>
      <p>
        Syntactic features such as part-of-speech (POS) and syntactic dependency
relations can predict author gender
        <xref ref-type="bibr" rid="ref6">(Company, 2016)</xref>
        . Due to their independence
from the semantic content, we considered them suitable for cross-genre settings.
Hence, we incorporated both of them in the second approach that we present.
      </p>
      <p>Chen et al. (2018) showed that emoji usage in twitter highly depends on
the gender of the author. However, emojis appear mostly on social media and
they hardly exist in the "News" genre. Hence, we decided to remove all emojis
and emoticons in order to prevent over tting in cross-genre settings: our aim
was to test the same set of features in all settings at the cost of eventually
underperforming at in-genre settings.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Experimental Setup</title>
      <p>Our two systems consist of three main processes: topic modeling, feature
extraction and classi cation. An overview of the pipeline can be visualized in gure
1.
3.1</p>
      <sec id="sec-3-1">
        <title>Topic modeling</title>
        <p>Data: The topic modeling module takes two external corpora as input:
{ NLCOW142: the Dutch web corpus from the COW initiative (Schfer and</p>
        <p>Bildhauer, 2012; Schfer, 2015).
{ Wikipedia: A Dutch Wikipedia dump from 2018-10-013.</p>
        <p>Filtering: In order to comply with the cross-genre setting rules of not using
any text coming from the genre where it is evaluated, we ltered out all
documents from NLCOW14 whose URL contains the string "twitter" or "youtube".
1 https://pan.webis.de
2 https://github.com/rsling/cow , https://github.com/rsling/texrex
3 https://linguatools.org/tools/corpora/wikipedia-monolingual-corpora/</p>
        <p>Since the concept of genre is rather de ned by the data source than by the text
content, we consider that this approach su ces to discard all texts belonging to
the "twitter" and "youtube" genres: each of these genres comes from a single
data source.</p>
        <p>In contrast to the other genres, "News" may come from diverse data sources
which we cannot reliably lter out by just checking the document URL against
a blacklist in the same way that we did for the NLCOW14 corpus. Therefore, we
selected the Wikipedia corpus for the topic modelling part of the two "News"
settings.</p>
        <p>
          Preprocessing: From each document, a set of words is ltered out, namely:
stop words, emoticons, emojis, URLs and words starting with the characters
'#'and '@' (typical for Twitter hashtags and mentions respectively). Then, each
word token is both lemmatized and stemmed consecutively. Word tokenization
and lemmatization are performed with the help of the Frog parser
          <xref ref-type="bibr" rid="ref3">(Bosch et al.,
2007)</xref>
          available via LaMachine4 while stemming is achieved with NLTK
          <xref ref-type="bibr" rid="ref1">(Bird
et al., 2009)</xref>
          .
        </p>
        <p>
          Model training: We train latent Dirichlet allocation (LDA) models
          <xref ref-type="bibr" rid="ref2">(Blei
et al., 2003)</xref>
          with 50 topics on a document basis using the respective Gensim
software package
          <xref ref-type="bibr" rid="ref12">(Rehurek and Sojka, 2010)</xref>
          . That is, each document is assigned
a 50-dimensional vector at the end of this process.
3.2
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>Feature extraction</title>
        <p>The labeled data from the three genres goes through a similar preprocessing
as described for topic modeling. However, instead of being lemmatized and</p>
        <sec id="sec-3-2-1">
          <title>4 https://proycon.github.io/LaMachine/</title>
          <p>stemmed, non-function words are normalized into some special tokens. Namely,
words which are parsed as nouns, verbs, adjectives and special words are
substituted by a token related to their POS. Additionally, tokens recognized as
ordinals, hours, dates and other types of numbers are normalized to respective
tokens as well.</p>
          <p>The feature vector used for classi cation is dependent on the system:
System 1 We create feature vectors based on function words. In our
preprocessed text, only function words and normalized tokens are left. For each
document, we compute the logarithm of the term frequency vector normalized with
respect to the L1-norm as proposed by Diederich et al. (2003).</p>
          <p>
            Since we assume that their usage frequency vary depending on the context
where they appear, we concatenate a 50-dimensional vector inferred from the
trained LDA model in order to provide contextual information to the model.
System 2 We decided to try also a neural network architecture based on a
long short-term memory (LSTM) classi er
            <xref ref-type="bibr" rid="ref9">(Hochreiter and Schmidhuber, 1997)</xref>
            .
Since some dependencies across words within a document may also be
characteristic from a speci c gender
            <xref ref-type="bibr" rid="ref5">(Chen et al., 2018)</xref>
            , the LSTM should capture their
relevancy for classi cation. For this architecture, we understand a document as
a sequence of words. We transform each document into a sequence of vectors
relative to the word tokens of each document. Per sentence, we also add two
additional tokens marking the start and the end of the sentence respectively.
          </p>
          <p>Each of these vectors contains:
{ A coarse-grained POS tag (e.g. verb).
{ A ne-grained POS tag (e.g. 1st person, singular, present).
{ Position of the word within the sentence.
{ Relative position of the word (position / sentence length)
{ Position distance of the word respect to the parent word (in the syntax
dependency tree) within the sentence.
{ Polarity score.</p>
          <p>{ Subjectivity score.</p>
          <p>For each vector, we append a 50-dimensional vector inferred by the respective
LDA model from the document where the respective word resides in the same
fashion that we do for system 1.</p>
          <p>
            The POS tags are based on the Corpus Gesproken Nederlands (CGN) tags
            <xref ref-type="bibr" rid="ref16">(Van Eynde, 2004)</xref>
            obtained by the Frog parser. For each parsed CGN tag, we
split the string into the part before the brackets, which is our coarse-grained POS
(e.g. "WW" for verbs); and the part within the brackets, which constitutes our
ne-grained POS tag (e.g. "pv,tgw,ev" for nite verb, present tense, singular).
          </p>
          <p>
            The polarity and subjectivity scores are obtained from the Pattern software
package
            <xref ref-type="bibr" rid="ref14 ref15">(Smedt and Daelemans, 2012)</xref>
            .
          </p>
          <p>In order to have a document representation of xed size, we restrict each
representation to a sequence of 100 vectors. If a document has less than 100
vectors, we prepend zero vectors until we reach the xed size.
Setting Max depth
Twitter in-genre 5
Twitter cross-genre 4
News in-genre 11
News cross-genre 8
Youtube in-genre 10</p>
          <p>Youtube cross-genre 5
For both systems, the training data depends on the evaluated setting: for the
in-genre settings, only the provided examples from the same genre are used to
generate the feature vectors; for the cross-genre settings, the examples for the
not evaluated genres are fetched. Additionally, each feature vector includes a
topic vector inferred by the respective topic model. For instance, the training
set the for "In-genre Twitter" setting consists of the preprocessed "Twitter"
examples plus a topic vector derived from a topic model trained on the NLWAC
corpus, whereas the training set for the "Cross-genre Twitter" setting is made
out of the preprocessed "News" and "Youtube" examples (plus the respective
topic vectors).</p>
          <p>
            System 1 We train a random forest classi er
            <xref ref-type="bibr" rid="ref4">(Breiman, 2001)</xref>
            for each of the
dened settings by means of its scikit-learn implementation
            <xref ref-type="bibr" rid="ref10">(Pedregosa et al., 2011)</xref>
            on the generated vectors from the feature extraction module and the labels from
the given dataset. All classi ers have identical hyperparameter con gurations
(namely 2001 estimators, log2 of the number of features as maximum features,
minimum number of samples required to split an internal node, 2 minimum
number of samples required to be at a leaf node) but a di erent maximal depth of
the trees, which is detailed in table 1. We found no signi cant improvement by
having other setting-speci c hyperparameters.
          </p>
          <p>
            System 2 Per setting, we train the following recurrent neural network
architecture with Keras5:
{ A bidirectional LSTM layer with 50 hidden units with 0.5 dropout ratio for
the linear transformations of the inputs and the recurrent state respectively.
{ A dropout layer with 0.5 ratio
{ A softmax layer
The architecture is trained by a Nesterov Adam optimizer
            <xref ref-type="bibr" rid="ref8">(Dozat, 2016)</xref>
            with a
categorical crossentropy loss function.
          </p>
        </sec>
        <sec id="sec-3-2-2">
          <title>5 https://keras.io/</title>
          <p>Setting
In-genre
Twitter
News
Youtube
Average
Cross-genre
Twitter
News
Youtube
Average
As we can see from table 2, system 1 performs consistently better than system
2 in all settings. This is an unexpected result considering that the latter learns
from a wider range of features. It is possible that the amount of training examples
might have not su ced for the second approach to work better than the rst
one because LSTM classi ers require considerably more labeled examples than
random forest classi ers.</p>
          <p>Another surprising result is that the accuracy in the cross-genre setting is
higher than in the in-genre one in the case of the "News" datasets. This is
probably to the much larger size of the training dataset for the cross-genre
setting (34,744 examples from "Twitter" and "Youtube") than for the in-genre
setting (1,832 examples from "News"). Therefore, system 1 may still perform
better if it had a larger training dataset.</p>
          <p>Our models show that they can only predict author gender for only a (small)
part of the evaluated text collections. Hence, we suspect that most pieces of text
do not have any genre-independent characteristics that can be reliably used to
predict the gender of the author, although in some of them this may be possible.
Therefore, we remain uncertain about whether it is feasible (in general) to predict
author gender by using features that are independent from the text genre.</p>
        </sec>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <given-names>Steven</given-names>
            <surname>Bird</surname>
          </string-name>
          , Ewan Klein, and
          <string-name>
            <given-names>Edward</given-names>
            <surname>Loper</surname>
          </string-name>
          .
          <year>2009</year>
          .
          <article-title>Natural language processing with Python: analyzing text with the natural language toolkit . "</article-title>
          <string-name>
            <surname>O'Reilly Media</surname>
          </string-name>
          ,
          <source>Inc.".</source>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>David M Blei</surname>
            , Andrew Y Ng, and
            <given-names>Michael I</given-names>
          </string-name>
          <string-name>
            <surname>Jordan</surname>
          </string-name>
          .
          <year>2003</year>
          .
          <article-title>Latent dirichlet allocation</article-title>
          .
          <source>Journal of machine Learning research 3</source>
          (Jan):
          <volume>993</volume>
          {
          <fpage>1022</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Antal van den Bosch</surname>
            , Bertjan Busser, Sander Canisius, and
            <given-names>Walter</given-names>
          </string-name>
          <string-name>
            <surname>Daelemans</surname>
          </string-name>
          .
          <year>2007</year>
          .
          <article-title>An e cient memory-based morphosyntactic tagger and parser for Dutch</article-title>
          .
          <source>LOT Occasional Series</source>
          <volume>7</volume>
          :
          <fpage>191</fpage>
          {
          <fpage>206</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <given-names>Leo</given-names>
            <surname>Breiman</surname>
          </string-name>
          .
          <year>2001</year>
          .
          <article-title>Random forests</article-title>
          .
          <source>Machine learning 45(1):</source>
          <volume>5</volume>
          {
          <fpage>32</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <given-names>Zhenpeng</given-names>
            <surname>Chen</surname>
          </string-name>
          , Xuan Lu, Wei Ai,
          <string-name>
            <given-names>Huoran</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Qiaozhu</given-names>
            <surname>Mei</surname>
          </string-name>
          , and Xuanzhe Liu.
          <year>2018</year>
          .
          <article-title>Through a gender lens: Learning usage patterns of emojis from largescale android users</article-title>
          .
          <source>In Proceedings of the 2018 World Wide Web Conference . International World Wide Web Conferences Steering Committee, Republic and Canton of Geneva</source>
          , Switzerland, WWW '
          <volume>18</volume>
          , pages
          <fpage>763</fpage>
          {
          <fpage>772</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          Juan Soler Company.
          <year>2016</year>
          .
          <article-title>Use of discourse and syntactic features for gender identi cation</article-title>
          .
          <source>In STAIRS . pages</source>
          <volume>215</volume>
          {
          <fpage>220</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <given-names>Joachim</given-names>
            <surname>Diederich</surname>
          </string-name>
          , Jorg Kindermann, Edda Leopold, and
          <string-name>
            <given-names>Gerhard</given-names>
            <surname>Paass</surname>
          </string-name>
          .
          <year>2003</year>
          .
          <article-title>Authorship attribution with support vector machines</article-title>
          .
          <source>Applied intelligence</source>
          <volume>19</volume>
          (1
          <issue>-2</issue>
          ):
          <volume>109</volume>
          {
          <fpage>123</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <given-names>Timothy</given-names>
            <surname>Dozat</surname>
          </string-name>
          .
          <year>2016</year>
          .
          <article-title>Incorporating nesterov momentum into adam</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <given-names>Sepp</given-names>
            <surname>Hochreiter</surname>
          </string-name>
          and Jurgen Schmidhuber.
          <year>1997</year>
          .
          <article-title>Long short-term memory</article-title>
          .
          <source>Neural computation 9(8):</source>
          <volume>1735</volume>
          {
          <fpage>1780</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <string-name>
            <given-names>F.</given-names>
            <surname>Pedregosa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Varoquaux</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Gramfort</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Michel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Thirion</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Grisel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Blondel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Prettenhofer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Weiss</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Dubourg</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Vanderplas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Passos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Cournapeau</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Brucher</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Perrot</surname>
          </string-name>
          , and
          <string-name>
            <given-names>E.</given-names>
            <surname>Duchesnay</surname>
          </string-name>
          .
          <year>2011</year>
          .
          <article-title>Scikit-learn: Machine learning in Python</article-title>
          .
          <source>Journal of Machine Learning Research</source>
          <volume>12</volume>
          :
          <fpage>2825</fpage>
          {
          <fpage>2830</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          <string-name>
            <given-names>Francisco</given-names>
            <surname>Rangel</surname>
          </string-name>
          , Paolo Rosso, Ben Verhoeven, Walter Daelemans,
          <string-name>
            <given-names>Martin</given-names>
            <surname>Potthast</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Benno</given-names>
            <surname>Stein</surname>
          </string-name>
          .
          <year>2016</year>
          .
          <article-title>Overview of the 4th author pro ling task at PAN 2016: cross-genre evaluations</article-title>
          .
          <source>In Working Notes Papers of the CLEF</source>
          <year>2016</year>
          <article-title>Evaluation Labs</article-title>
          . CEUR Workshop Proceedings/Balog, Krisztian [edit.]; et al..
          <source>pages</source>
          <volume>750</volume>
          {
          <fpage>784</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          <string-name>
            <given-names>Radim</given-names>
            <surname>Rehurek</surname>
          </string-name>
          and
          <string-name>
            <given-names>Petr</given-names>
            <surname>Sojka</surname>
          </string-name>
          .
          <year>2010</year>
          .
          <article-title>Software Framework for Topic Modelling with Large Corpora</article-title>
          .
          <source>In Proceedings of the LREC 2010 Workshop on New Challenges for NLP Frameworks . ELRA</source>
          , Valletta, Malta, pages
          <volume>45</volume>
          {
          <fpage>50</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          <string-name>
            <given-names>Roland</given-names>
            <surname>Schfer</surname>
          </string-name>
          .
          <year>2015</year>
          .
          <article-title>Processing and querying large web corpora with the COW14 architecture</article-title>
          . In Piotr Baski, Hanno Biber, Evelyn Breiteneder, Marc Kupietz, Harald Lngen, and Andreas Witt, editors,
          <source>Proceedings of Challenges in the Management of Large Corpora 3 (CMLC-3)</source>
          . UCREL, IDS, Lancaster.
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          <string-name>
            <given-names>Roland</given-names>
            <surname>Schfer</surname>
          </string-name>
          and
          <string-name>
            <given-names>Felix</given-names>
            <surname>Bildhauer</surname>
          </string-name>
          .
          <year>2012</year>
          .
          <article-title>Building large corpora from the web using a new e cient tool chain</article-title>
          .
          <source>In Nicoletta Calzolari (Conference Chair)</source>
          , Khalid Choukri, Thierry Declerck, Mehmet Uur Doan, Bente Maegaard, Joseph Mariani, Asuncion Moreno, Jan Odijk, and Stelios Piperidis, editors,
          <source>Proceedings of the Eight International Conference on Language Resources and Evaluation (LREC'12)</source>
          .
          <source>European Language Resources Association (ELRA)</source>
          , Istanbul, Turkey, pages
          <volume>486</volume>
          {
          <fpage>493</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          <string-name>
            <surname>Tom De Smedt and Walter Daelemans</surname>
          </string-name>
          .
          <year>2012</year>
          .
          <article-title>Pattern for python</article-title>
          .
          <source>Journal of Machine Learning Research</source>
          <volume>13</volume>
          (Jun):
          <year>2063</year>
          {
          <year>2067</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          <string-name>
            <surname>Frank Van Eynde</surname>
          </string-name>
          .
          <year>2004</year>
          .
          <article-title>Part of speech tagging and lemmatizing of the Corpus Gesproken Nederlands (Spoken Dutch Corpus)</article-title>
          .
          <source>KU Leuven .</source>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>