<!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>Style-based distance features for author profiling</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Erwan Moreau</string-name>
          <email>moreaue@cs.tcd.ie</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Carl Vogel</string-name>
          <email>vogel@cs.tcd.ie</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>CNGL and Computational Linguistics Group</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Computational Linguistics Group Centre for Computing and Language Studies School of Computer Science and Statistics Trinity College Dublin Dublin 2</institution>
          ,
          <country country="IE">Ireland</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2013</year>
      </pub-date>
      <abstract>
        <p>In this paper we present the approach we took in our participation to the PAN 2013 Author Profiling task. It is an adaptation of our system submitted for author identification, assuming that a profile category (authors belonging to the same gender and age group categories) can be analyzed in the same way as an author's style.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>In this author profiling task, we are provided with a training set of 236,000 authors for
English and 75,900 authors in Spanish. We are given the gender (two categories) and
the age group (three categories) of the author. The task consists in predicting the gender
and age group of any new document.</p>
      <p>Our participation in this task is an adaptation of the one we did for the author
identification task3. Thus our participation was intended as a test to see if the two tasks can
be tackled in a similar way, rather than a proper specific approach to solve this task.
Nevetheless we were aware that there are major differences between the two tasks:
– The dataset consists in very noisy data, including HTML tags and various other
problems (for example some documents contain only noise); some documents seem
to consist in commercials or spam, which is likely not to reflect the writing style of
the supposed author;
– The dataset is very big;
– More importantly, this is classical classification task with 6 possible labels, all of
which being represented in the data, as opposed to the author identification task
where no negative evidence can be used;
– Our approach relies on the assumption that a category (gender and age) can be
treated in the same way as a single author. In particular it relies on the fact the
distribution of a given n-gram among different documents in the same category is
regular (in general); this means that our approach can not (at least it is not intended
to) take into account several subgroups in a given category.</p>
      <sec id="sec-1-1">
        <title>3 See our paper in the same volume.</title>
        <p>Similarly to what we did in the author identification task, we aim to compute
finegrained features which correspond to distances between the unknown document and a
reference category according to a particular n-gram pattern (e.g. POS trigrams). Only
one such feature at most can be used for the same pair category/pattern in the final set
of features which is provided to the supervised learning algorithm.</p>
        <p>In §2 we detail how the potential features are computed; then in §3 we explain how
we had to settle for non optimal final models due to some major issue in our system;
finally we present and discuss our results in §4.
2</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Features</title>
      <p>We consider a fixed set of 15 n-grams patterns which contains tokens unigrams, bigrams
and trigrams, characters unigrams, trigrams and 5-grams, POS4 unigrams to trigrams,
and several combinations of tokens and POS, some of which including skip-grams. For
each pattern, we aim to select the set of n-grams which is the most likely to characterize
the category.
2.1</p>
      <sec id="sec-2-1">
        <title>Categories</title>
        <p>We call categories the six target profiles (two classes for gender three classes for age
group). Additionally we also consider the “superset categories” which consist in all the
writers in the same gender category and all the writers in the same age category.</p>
        <p>A very basic pre-processing is applied to the data, which consists mainly in
removing any meta-data (HTML tags etc.). Each category is represented by the documents
of all authors belonging to this category. However we had to restrict the data in every
category to a randomly selected subset of at most 5,000 authors for efficiency reasons.
Moreover, for the same reason, we had to keep only at most 12,000 distinct n-grams by
discarding the least frequent ones in the category if needed.
2.2</p>
      </sec>
      <sec id="sec-2-2">
        <title>Selecting category-specific n-grams</title>
        <p>We had observed in the author identification task that the more frequent a particular
ngram is, the most likely it is to follow a normal-shaped distribution accross documents
by the same author. We assume, maybe wrongly, that this also holds accross documents
in the same category (at least for some n-grams). This is why we use various statistics
applied to the (relative) frequency of each n-gram, such as the mean, standard deviation,
median and other quantiles, but also for instance the difference between the minimum
and maximum or between first and third quantile. Such values are expected to provide a
range against which an observed value can be compared in order to quantify how close
the use if this n-gram in the unknown document is w.r.t the category.</p>
        <p>For each n-grams pattern, the selection of the potentially representative subset of
n-grams is done by:
4 Part-Of-Speech tagging was done using TreeTagger
(http://www.cis.unimuenchen.de/ schmid/tools/TreeTagger) for English and Spanish, and the AUEB tagger
for Greek (http://nlp.cs.aueb.gr/software.html).
1. Filtering the n-grams based on one of the statistics above. A typical fitering step
would be to select the n-grams for which the minimum frequency by document is
higher than some threshold t &gt; 0, but a few other possibilities have been tested.
2. Selecting the n-grams corresponding to the N highest or lowest values for one the
statistics above. For instance the n-grams which have the smallest range between
the first and third quartile are expected to characterize the category in the sense that
for the authors in this category, the use of these n-grams is rather stable accross
documents, while in the same time excluding possible outliers in the distribution.</p>
        <p>
          We have also used the other categories into account by measuring how the
distribution of a selected n-gram for the given category differ from its distribution in documents
in the other categories. This was done by comparing the distributions using simple
measures like average overlap/difference and the Bhattacharrya distance [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ] (and a few
variants).
2.3
        </p>
      </sec>
      <sec id="sec-2-3">
        <title>Comparing a document to a category</title>
        <p>With the above method we can select a set of n-grams whose frequency distributions are
supposed to represent the category. The value which will be used as feature in the
supervised training stage is a distance between the questionned document and the category,
as represented by these n-grams. Other n-grams in the unknown document are ignored,
but their cumulated global frequency is indirectly taken into account in the
frequencies of the selected n-grams (which are lower if there are many/frequent non-selected
n-grams in the document for example).</p>
        <p>Various classical distance measures have been used, like Euclidean, Cosine, 2,
but also some ad-hoc measures which assume that the reference distribution is normal:
for instance the probability of the frequency in the unknown document to belong to this
distribution according to the Cumulative Distribution Function, or the simple difference
between this frequency and the mean, as well as other variants involving the ranges
between quantiles. Additionally it was possible to compute the final value for these
ad-hoc measures according to different means: arithmetic, geometric or harmonic.
3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Training: what was planned and what was actually done</title>
      <p>In the following we call distance configuration a unique set of parameters which
describe a selection and a distance method, such that applying the different steps described
by these parameters to a task (a category as reference data and an input document) gives
only one final value (which can be used as the value of the feature for this instance).
Such parameters include for example the threshold and the statistic to which it is applied
for a filtering step, or a distance identifier and possibly its corresponding parameters for
a distance method.</p>
      <p>
        The supervised learning stage consists in specifying a global configuration with the
following parameters:
– a random subset of pairs category/n-grams patterns;
– for each pattern in the subset, a random distance configuration selected randomly;
– A classification algorithm with its parameters, selected randomly from a set of 20
possible cases. The possible algorithms are SVM [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], logistic regression [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ],
decision trees [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] and Naive Bayes [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], with variants depending on their parameters.
      </p>
      <p>Initially we intended to use an ad-hoc algorithm in order to select the best global
configuration. This algorithm follows the principle of genetic algorithms, that is, gets
incrementally closer to the optimal parameters by selecting a population at first randomly
and then favoring the parameters which gave the best results in the next generation. But
the algorithm failed to converge to an optimal solution. Due to the time constraints, we
had to settle for the best configuration that the algorithm had found then, although it
was unlikely to be optimal.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Results and discussion</title>
      <p>21 teams participated in the author profiling task. Our system obtained an accuracy of
0.2395 in English (rank 19, best system: 0.3894) and 0.2539 in Spanish (rank 14, best
system: 0.4208).</p>
      <p>As explained in §3, these bad results are not surprising since the system that we
submitted runs a configuration which is only the best case among random
configurations. At the time of writing we have not fully investigated this yet. We think that this is
probably a bug that we did not find, but do not exclude the possibility of a design flaw.</p>
      <p>Additionally there are several other potential problems with our approach:
– The initial assumption to consider a category in the same way as a single author: if
there is no such consistency among the authors who belong to the same category,
our features are unlikely to work very well;
– Because of the inefficiency of our prototype, we had to ignore large parts of the
training data in building the categories, which can also explain a loss in precision.
– The noisiness of the data and the unsophisticated cleaning step.</p>
      <sec id="sec-4-1">
        <title>We intend to study these issues as future work.</title>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgments</title>
      <p>This research is supported by the Science Foundation Ireland (Grant 12/CE/I2267) as
part of the Centre for Next Generation Localisation (www.cngl.ie) funding at Trinity
College, University of Dublin.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Bhattacharyya</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>On a measure of divergence between two statistical populations defined by their probability distributions</article-title>
          .
          <source>Bulletin of Cal. Math. Soc</source>
          .
          <volume>35</volume>
          (
          <issue>1</issue>
          ),
          <fpage>99</fpage>
          -
          <lpage>109</lpage>
          (
          <year>1943</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2. John, G.,
          <string-name>
            <surname>Langley</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Estimating continuous distributions in bayesian classifiers</article-title>
          .
          <source>In: In Proceedings of the Eleventh Conference on Uncertainty in Artificial Intelligence</source>
          . pp.
          <fpage>338</fpage>
          -
          <lpage>345</lpage>
          . Morgan Kaufmann (
          <year>1995</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Keerthi</surname>
            ,
            <given-names>S.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shevade</surname>
            ,
            <given-names>S.K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bhattacharyya</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Murthy</surname>
            ,
            <given-names>K.R.K.</given-names>
          </string-name>
          :
          <article-title>Improvements to platt's SMO algorithm for SVM classifier design</article-title>
          .
          <source>Neural Comput</source>
          .
          <volume>13</volume>
          (
          <issue>3</issue>
          ),
          <fpage>637</fpage>
          -
          <lpage>649</lpage>
          (
          <year>Mar 2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Landwehr</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hall</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Frank</surname>
          </string-name>
          , E.:
          <article-title>Logistic model trees</article-title>
          .
          <source>Mach. Learn</source>
          .
          <volume>59</volume>
          (
          <issue>1-2</issue>
          ),
          <fpage>161</fpage>
          -
          <lpage>205</lpage>
          (May
          <year>2005</year>
          ), http://dx.doi.org/10.1007/s10994-005-0466-3
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Quinlan</surname>
            ,
            <given-names>J.R.</given-names>
          </string-name>
          :
          <source>C4</source>
          .
          <article-title>5: programs for machine learning</article-title>
          . Morgan Kaufmann Publishers Inc., San Francisco, CA, USA (
          <year>1993</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>