<!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>Proximity based one-class classification with Common N-Gram dissimilarity for authorship verification task</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Faculty of Computer Science, Dalhousie University</institution>
        </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 Identification task of the PAN 2013 competition. This competition task presents participants with a set of authorship verification problems. In each such a problem, one is given a set of documents written by one author and a sample document; the task is to answer the question whether or not the sample document was written by the same author as the remaining documents. We approach this problem by proposing a proximity based method for one-class classification (based on an idea similar to the k-center boundary method) that applies the Common N-Gram (CNG) dissimilarity measure. The CNG dissimilarity is based on the differences in the frequencies of the character n-grams that are most common in the considered documents. Our method compares the dissimilarity between the sample document and each document from the target set of documents of known authorship to the maximum dissimilarity between this target document and all other documents from the set; thresholding is applied to arrive at the classification of the sample document. Our method yielded F1 of 0.659 on the whole competition test dataset and the competition ranking 5th (shared) of 18 (according to the results announced on June 12, 2013).</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Authorship verification problem is a type of authorship attribution problem, in which
given a set of documents written by one author, and a sample document, one is to answer
the question whether or not the sample document was written by the same author as
the remaining documents. The PAN 2013 competition Authorship Identification task
provides a testbed for the authorship verification solutions. The test dataset consists of
authorship verification problems for text documents in English, Greek and Spanish.</p>
      <p>We approach this task with an algorithm based on the idea of proximity based
methods for one-class classification, (similar to the idea of the k-center boundary algorithm)
that applies the Common N-Gram (CNG) dissimilarity measure.
being equal to the number of all documents in the target set (i.e., written by the given
author). The k-center algorithm uses equal radius sphere boundaries around the
target documents and compares the sample document to the closest target document; we
propose a different classification condition based on the comparison for each target
document the maximum dissimilarity between it and any other target document to the
dissimilarity between it and the sample document.</p>
      <p>Let A = {d1, ..., dk}, k ≥ 2, be a set of documents written by a given author
(we will later describe how we deal with a situation when only one such document is
provided). We will call these documents target documents. Let u be a sample document
which authorship we are to verify, that is to classify it as either belonging to the target
class (written by the same author as the documents from A) or not.</p>
      <p>Our algorithm calculates for each target document di the maximum dissimilarity
between this document and all other target documents Dmax(di, A) as well as the
dissimilarity between this document and the sample document D(di, u), and finally the
dissimilarity ratio r(di, u, A) = DmDa(xd(id,ui,)A) . (thus r(di, u, A) &lt; 1 means that there
exists in the target set a document more dissimilar to di than u, while r(di, u, A) &gt; 1
means that all the target documents are more similar to di than u). As the measure of
dissimilarity between the sample document u and the entire target set A we take the
average of the dissimilarity ratio: M (u, A) = Pi=1,...,kk r(di,u,A) . We apply a threshold θ on
the value of M (u, A) and classify u as belonging to the target class iff M (u, A) &lt;= θ.</p>
      <p>Notice that the dissimilarity between the documents does not need to be an l2
distance, not even a metric distance (i.e., does not need to fulfil the triangle inequality), as
is in fact the case for the dissimilarity measure we have chosen.</p>
      <p>
        For the dissimilarity measure between documents we use the Common N-Gram
(CNG) dissimilarity, proposed by Kešelj et al. [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. It is based on the differences in the
in usage frequencies of the most common character n-grams of the considered
documents. 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
x∈(P1∪P2)
fP1 (x) − fP2 (x) !
fP1 (x)+fP2 (x)
2
2
(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 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 dissimilarity (or its variants) applied in a k-Nearest Neighbour
classification scheme (Common N-gram classifier) were successfully applied to the authorship
classification tasks [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </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="ref4">4</xref>
        ] was used to extract the n-grams and their frequencies. To
select the three parameters: n (length of the character n-grams), L (length of the
profile) and θ (threshold for the average dissimilarity ratio), we performed experiments on
training datasets of authorship verification in English and Greek, with the objective to
maximize the accuracy. We used the training dataset provided for the PAN 2013
Authorship Identification task [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] as well as two other datasets which we compiled using
existing datasets for other authorship classification tasks, namely the corpus for the
Traditional Authorship Attribution subtask of the the PAN 2012 competition [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] (in
English) and the modern Greek dataset B created by Stamatos et al. [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Table 1 presents
the parameters values we selected for the competition (for Spanish we used the same
parameters as for English).
      </p>
    </sec>
    <sec id="sec-2">
      <title>English and Spanish Greek</title>
      <p>n (n-gram length)
L (profile length)
6
2000
θ (threshold) if at least two taget documents are given 1.02
θ (threshold) if a single target document is given
1.06
7
2000
1.008
1.04</p>
      <p>Our method requires at least two target documents. In cases when only one target
document is provided, we split it exactly in half to create two documents. As in this case
these two documents are most likely very similar to each other as they originate from a
single document, we performed additional experiments on our training datasets (for the
previously selected values of n and L) for the cases with a single target document, to
arrive at somewhat higher values of the threshold θ for such a case, reported in Table 1.</p>
      <p>As our method is based on the ratios of dissimilarities between documents, we took
care that the documents in a given problem are always represented by profiles of the
same length (by adding a condition that if a profile of a given length cannot be created
for some documents within a given problem instance because there is not enough
distinct character n-grams in the documents, then the length of all profiles in the instance
is shortened accordingly). Similarly, we found out that cutting all documents in a given
problem instance to the length of the shortest document tend to increase the accuracy
of the method, so we applied this prepossessing.</p>
      <p>As our method uses the ranking value to which a threshold is applied, it is possible
to represent this value as a confidence score in the range from 0 (corresponding to
classifying as not belonging to the target class) to 1 (corresponding to classifying as
belonging to the target class) to provide them as part of the answers in the competition.
To calculate such confidence scores we linearly scaled the average dissimilarity ratio
M (u, A) using the threshold θ, so that the value of the average dissimilarity ratio equal
to θ corresponds to the score 0.5, values greater than θ correspond to the scores between
0 and 0.5, and values less than θ correspond to the scores between 0.5 and 1 (a cutoff
of 0.1 is applied, i.e. all values of M (u, A) &lt; θ − cutof f are mapped to the score 1,
and all values of M (u, A) &gt; θ + cutof f are mapped to the score 0).</p>
      <p>Results
In the PAN 2013 competition task Author Identification our method yielded the
results presented in Table 2 (according to the results announced on June 12, 2013). As
in the competition it was possible to withdraw an answer for a problem, the recall
and precision are defined as follows: recall = #correct_answers/#problems, precision
= #correct_answers/#answers. The F1 measure is the harmonic mean of the precision
and recall. As we provided the answers for all problems, in our case the F1 measure is
equivalent to the accuracy, i.e., to the fraction of all problems that have been correctly
classified.</p>
      <p>F1</p>
      <p>All test data</p>
    </sec>
    <sec id="sec-3">
      <title>English test data Greek test data</title>
    </sec>
    <sec id="sec-4">
      <title>Spanish test data</title>
      <p>0.733</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <source>Pan</source>
          <year>2012</year>
          ,
          <article-title>task: Author identification</article-title>
          . http://www.uni-weimar.de/medien/webis/research/events/pan-12/pan12-web/authorship.
          <source>html (accessed on Apr 2</source>
          ,
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <source>Pan</source>
          <year>2013</year>
          ,
          <article-title>task: Author identification</article-title>
          . http://www.uniweimar.de/medien/webis/research/events/pan-13/pan13-web/author-identification.
          <source>html (accessed on Feb 19</source>
          ,
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <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="ref4">
        <mixed-citation>
          4.
          <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="ref5">
        <mixed-citation>
          5.
          <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="ref6">
        <mixed-citation>
          6.
          <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 id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Stamatatos</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kokkinakis</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fakotakis</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          :
          <article-title>Automatic text categorization in terms of genre and author</article-title>
          .
          <source>Comput. Linguist</source>
          .
          <volume>26</volume>
          (
          <issue>4</issue>
          ),
          <fpage>471</fpage>
          -
          <lpage>495</lpage>
          (
          <year>Dec 2000</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Tax</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>One Class Classification</article-title>
          .
          <source>Ph.D. thesis</source>
          , Delft University of Technology (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Ypma</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ypma</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Duin</surname>
            ,
            <given-names>R.P.</given-names>
          </string-name>
          :
          <article-title>Support objects for domain approximation</article-title>
          .
          <source>In: Proceedings of Int. Conf. on Artificial Neural Networks</source>
          . pp.
          <fpage>2</fpage>
          -
          <lpage>4</lpage>
          (
          <year>1998</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>