<!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>CNG text classification for authorship profiling task</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Faculty of Computer Science, Dalhousie University jankowsk</institution>
          ,
          <addr-line>vlado</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Magdalena Jankowska</institution>
          ,
          <addr-line>Vlado Kešelj, and Evangelos Milios</addr-line>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2013</year>
      </pub-date>
      <abstract>
        <p>We describe our participation in the Author Profiling task of the PAN 2013 competition. The task objective is to determine the age and the gender of an author of a document. We applied the Common N-Gram (CNG) classifier (Kešelj et al., 2003) to this task. The CNG classifier uses a dissimilarity measure based on the differences in the frequencies of the character n-grams that are most common in the considered documents. To train the classifier, a class is represented by one class document created by concatenating the training documents belonging to the class. A sample document is labelled by the class with the minimum dissimilarity. For the six class classification (combinations of two possible gender labels and three possible age labels) we achieved the accuracy of 0.2814 on the English test dataset and 0.2592 on the Spanish test dataset. Our results are below the medians of the results of the competition participants.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Introduction
Author profiling problem is a problem of determining some characteristics of an
author of a document, such as demographics. The Author Profiling task of the PAN 2013
competition presents the problem of determining the age and the gender of authors. We
tested applying the Common N-Gram (CNG) classifiers proposed by Kešelj et al. [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] to
this task.
The Common N-Gram (CNG) classifier is based on the the differences in the usage
frequencies of the most common character n-grams of the considered documents. Given
training documents for a given class, the classifier concatenates them into one class
document. A sample document to be classified is then compared to each of the class
documents using the CNG dissimilarity measure and the sample is labelled by the class
with the minimum dissimilarity. To calculate the dissimilarity, for each document a
sequence of the most common character n-grams coupled with their frequencies
(normalized by the length of the document) is extracted; such a sequence is called a profile
of the document. The dissimilarity between two documents of the profiles P1 and P2 is
defined as follows:
      </p>
      <p>D(P1, P2) =</p>
      <p>X
(1)
where x is a character n-gram from the union of two profiles, and fPi (x) is the
normalized frequency of the n-gram x in the profile Pi, i = 1, 2 (fPi (x) = 0 whenever x does
not appear in the profile Pi).</p>
      <p>The important parameters of the dissimilarity is the length of the character n-grams
n and the length of the profile L.</p>
      <p>
        The CNG classifier (or its variants) has been successfully applied to the authorship
classification tasks [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>Using the PAN 2013 Author Profiling training corpus provided by the competition
organizers we explored how the parameters of the classifier affect the accuracy of the
classification. The training corpus consists of XML documents with the HTML
content of online conversations. There is English and Spanish subset of the corpus. Each
document is labelled by one of two gender classes: male or female, and one of three
age classes: “10s”, “20s” or “30s”. The combination of these labels yields six distinct
classes for each language. We used part of the training corpus for each class to create
the class document for each class (90% randomly selected documents for each class
with the exception of English “20s” and “30s” classes — both male and female; these
are the largest classes and for the performance reasons we used for the training 20% of
documents from the English “20s” classes and 10% from the English “30s” classes).</p>
      <p>
        In our software we used n-grams in which tokens are utf8-encoded characters. The
package Text::Ngrams [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] was used to extract the n-grams and their frequencies.
      </p>
      <p>In our experiments (with a balanced subset of the remaining documents from the
corpus as test data) using the HTML format of the conversation led to better results
than converting the conversations to text format (which was not suprising, as then the
common character n-grams can capture such features as line breaks and links). Also one
CNG classifier for six classes tended to yield higher accuracy than two separate,
independently trained CNG classifiers: one for the gender classification (with two classes)
and one for the age classification (with three classes).</p>
      <p>Based on our experiments we arrived at the parameters reported in Table1 that we
used in the software submitted for the competition.</p>
      <p>English Spanish
n (n-gram length) 4
L (profile length) 5000
5
5000
format of the data</p>
      <p>html
In the PAN 2013 competition task Author Profiling our method yielded the results
presented in Table 2.</p>
      <p>Total accuracy Gender accuracy Age accuracy Competition rank
English test data
0.2814</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Juola</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Authorship attribution</article-title>
          .
          <source>Found. Trends Inf. Retr</source>
          .
          <volume>1</volume>
          (
          <issue>3</issue>
          ),
          <fpage>233</fpage>
          -
          <lpage>334</lpage>
          (
          <year>Dec 2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Kešelj</surname>
          </string-name>
          , V.: Perl Package Text::Ngrams. http://www.cs.dal.ca/ vlado/srcperl/Ngrams (accessed
          <source>on Feb 1</source>
          ,
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Kešelj</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Peng</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cercone</surname>
          </string-name>
          , N.,
          <string-name>
            <surname>Thomas</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>N-gram-based author profiles for authorship attribution</article-title>
          .
          <source>In: Proceedings of the Conference Pacific Association for Computational Linguistics, PACLING'03</source>
          . pp.
          <fpage>255</fpage>
          -
          <lpage>264</lpage>
          . Dalhousie University, Halifax, Nova Scotia,
          <string-name>
            <surname>Canada</surname>
          </string-name>
          (
          <year>August 2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Stamatatos</surname>
          </string-name>
          , E.:
          <article-title>Author identification using imbalanced and limited training texts</article-title>
          .
          <source>In: Proceeding of the 18th International Workshop on Database and Expert Systems Applications, DEXA'07</source>
          . pp.
          <fpage>237</fpage>
          -
          <lpage>241</lpage>
          (
          <year>September 2007</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>