<!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>Batch Document Filtering Using Nearest Neighbor Algorithm</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ali Mustafa Qamar</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Eric Gaussier</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>General Terms</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Measurement</institution>
          ,
          <addr-line>Performance, Experimentation, Algorithms</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper describes the participation of LIG lab, in the batch filtering task for the INFILE (INformation FILtering Evaluation) campaign of CLEF 2009. As opposed to the online task, where the server provides the documents one by one, all of the documents are provided beforehand in the batch task, which explains the fact that feedback is not possible in the batch task. We propose in this paper a batch algorithm to learn category specific thresholds in a multiclass environment where a document can belong to more than one class. The algorithm uses k-nearest neighbor algorithm for filtering the 100,000 documents into 50 topics. The experiments were run on the English corpus. Our experiments gave us a precision of 0.256 while the recall was 0.295. We had participated in the online task in INFILE 2008 where we had used an online algorithm using the feedbacks from the server. In comparison with INFILE 2008, the recall is significantly better in 2009, 0.295 vs 0.260. However the precision in 2008 were 0.306. Furthermore, the anticipation in 2009 was 0.43 as compared with 0.307 in 2008.</p>
      </abstract>
      <kwd-group>
        <kwd>H</kwd>
        <kwd>3 [Information Storage and Retrieval]</kwd>
        <kwd>H</kwd>
        <kwd>3</kwd>
        <kwd>1 Content Analysis and Indexing</kwd>
        <kwd>H</kwd>
        <kwd>3</kwd>
        <kwd>3 Information Search and Retrieval</kwd>
        <kwd>H</kwd>
        <kwd>3</kwd>
        <kwd>4 Systems and Software</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        The goal of the INFILE (INformation FILtering Evaluation) [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] campaign is to filter 100,000
documents into 50 topics (plus a category ’other’). Out of 50 topics, 30 are related to general
news and events (e.g. national and international affairs, sports, politics etc.), whereas the rest
concern scientific and technical subjects. A document can belong to zero, one or more topics,
each topic being described by a set of sentences. In comparison with INFILE 2009, where there
was only an online task, an additional batch filtering task was added in 2009. As opposed to the
online task, where the server provides the documents one by one to the user, all of the documents
are provided beforehand in the batch task. This explains the fact that feedback is not possible in
the batch task. We had participated in the online task in 2008 [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], and restricted ourselves to the
batch one in 2009.
      </p>
      <p>The k-nearest neighbor (kNN) algorithm is a largely investigated supervised learning algorithm
due to its simplicity and performance. It aims at finding the k nearest neighbors of an example x
(based either on similarity or distance) and then finding the most represented class in the nearest
neighbors in order to classify x. Similarity has deemed to be more appropriate as compared to
distance, specially while dealing with texts. In such case, the cosine measure is used instead of
euclidean or mahanalobis distances.</p>
      <p>In this paper, we develop a batch algorithm to learn category-specific thresholds in a multiclass
environment. Our algorithm uses kNN algorithm along with cosine similarity, in order to filter
the documents into various topics.</p>
      <p>The rest of the paper is organized as follows: Section 2 describes the batch algorithm developed
for the INFILE campaign, experiments and results are discussed in Section 3 while we conclude
in Section 4.
2</p>
      <p>
        Batch Algorithm for the INFILE Campaign
In order to filter the documents into various topics, we use a similarity measure between new
documents and topics, along with a set of thresholds on this similarity that evolve over time. The
similarity between a new document d, to be filtered, and a topic ti can given as:
sim(ti, d) = α ∗ cos(ti, d) +(1 − α) max(d′6=d,d′∈ti)cos(d, d′)
| {z } | {z }
s1(ti,d) s2(ti,d)
(1)
where α ∈ [
        <xref ref-type="bibr" rid="ref1">0,1</xref>
        ]. The similarity given in equation 1 is based on two similarities: one based on a
direct similarity between the new document and the topic (given by s1(ti, d)), and another one
between the new document and the set of documents already assigned to the topic (s2(ti, d). One
might think that only the first similarity would suffice. However, this is not the case since the topics
and the documents do not share the same kind of structure and content. The second similarity
helps us to find documents which are closer to documents which had already been assigned to
a topic. α is used to control the importance of the two similarities. In the beginning, when no
documents are assigned to any topic, only the similarity, s1(ti, d), is taken into account. This
similarity is used to find a certain number of nearest neighbors for each of the document (we used
10 nearest neighbors) which eventually helps us to use the second similarity. A threshold was
used for each of the 50 topics. We now describe the batch algorithm to filter the documents. As
already mentioned, the feedback is not possible in this case since the complete set of documents
is transferred to the user in one go.
      </p>
      <p>Construction of initial set:
for each topic i (i ∈{101,102,...,150}
find 10 nearest neighbors based on s1 = cos(ti, d)
for each nearest neighbor found</p>
      <p>ti ⇐ N N
Assignment of remaining documents to topics:
α = 0.7
for each topic i</p>
      <p>θi = mind∈ti sim(ti, d))
for each document d
for each topic i
if (sim(ti, d) ≥ θi)</p>
      <p>ti ⇐ d
θi = min(θi, mind∈tisim(ti, d))</p>
      <p>
        Yang et al. [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] have described a similar method, whereby they learn category-specific thresholds
based on a validation set. An example is assigned to a particular category only if its similarity
with the category surpasses a certain learned threshold. In contrary, we do not have a validation
set to learn thresholds, however, we create a simulated one, by finding nearest neighbors for each
of the 50 categories.
3
      </p>
    </sec>
    <sec id="sec-2">
      <title>Comparison with Online Campaign 08</title>
      <p>We present here, a detailed comparison between the batch algorithm of 2009 and the online
algorithm developed for the online campaign, 08. For time constraints, we were not able to
participate in the online task this year. The online algorithm is presented below:
Construction of initial set: α = 0.7, θ1 = 0.42
for each new document d
for each topic i (i ∈ {101,102,...,150}
if ( li &lt; 10 )
if (s1(ti, d) &gt; θ1)</p>
      <p>Ask for feedback (if possible) and ti ⇐ d if feedback positive
Assignment of remaining documents to topics:
for each new document d
for each topic i (i ∈{101,102,...,150}
if (sim(ti, d) &gt; θi2)</p>
      <p>ti ⇐ d
θi2 = mind∈tisim(ti, d)
where li represents the number of documents assigned to a topic i. For each topic, two thresholds
are used: the first one (θ1) allows filtering the documents in the early stages of the process (when
only a few documents have been assigned to the topic). The value chosen for this threshold
was 0.42. The second threshold (θ2), however, works with the global similarity, after a certain
number of documents have been assigned to the topic. In addition, the algorithm makes use of
the feedbacks (50 in total), so that only relevant documents are placed in the different topics.</p>
      <p>The main difference between the two algorithms (batch and online) lies in the manner in which
we construct the initial set of documents pertinent to the topics. In batch algorithm, we just rely
on finding the 10 nearest neighbors for each topic, with the assumption that the nearest neighbors
for a topic, would in general, belong to the topic under consideration. However, for the online
algorithm, we use feedbacks if the similarity between a topic ti and a document d, is greater than
a certain threshold (θ1). The rest of the algorithms are almost the same.
4</p>
    </sec>
    <sec id="sec-3">
      <title>Experiments</title>
      <p>
        We have run our algorithm on INFILE English corpus. For all of the documents, stemming was
performed using Porter’s algorithm. This was followed by the removal of stop-words, XML tags
skipping and the building of a document vector (which associates each term with its frequency)
using Rainbow [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. A single run was submitted during the INFILE campaign where α was chosen to
be 0.7. Initially, 10 nearest neighbors were found for each of the document based on the similarity
s1 (between a document and the topic). These documents were subsequently used to find s2.
The experiment was divided into 4 sub-parts, each sub-part being run in parallel to increase the
efficiency. However, this setting meant that the thresholds for the 50 topics were different for the
different sub-parts.
      </p>
      <p>
        There are 1597 documents relevant to one or more topics in the INFILE data. The results for
the different runs were evaluated based on different measures, namely, precision, recall, F-measure,
linear utility, anticipation (added in 2009) and detection cost (see [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] and [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]). Utility is based on
two parameters: importance given to a relevant document retrieved and the cost of a non-relevant
document retrieved. Anticipation measure is designed to give more importance to systems that
can find the first document in a given profile. Figure 1 give us an insight on the number of relevant
documents retrieved during Run 1 and 2. We do not see a significant change for Run 1, in terms of
the number of documents retrieved during the entire process. However, Run 2 returns much more
documents between 10,000-20,000 and 80,000-90,000 documents. The evolution of these measures,
computed at different times in the process, after each 10,000 documents, are given in the Figure 2.
The curve, at the bottom represents the detection cost. Similarly, for Run 1, the curve just
above the one meant for detection cost, describes the anticipation. For Run 1, all of the measures
randomly vary but increase significantly as compared to the initial values (for example, 0.04 in
the beginning vs 0.125 at the end for anticipation, 0.12 to 0.19 for the F-measure etc.) during the
course of the filtering process. For Run 2, all of the measures, except utility and precision (0.18
vs 0.30), randomly vary but remain the same at the end.
      </p>
      <p>Table 1 describes the different runs along with the number of documents retrieved and the
number of relevant documents found. The average score (the values are first computed for each of
the 50 profiles and then averaged) is given in Table 2. We can note that Run 1 has the best recall
(0.295) as compared with the second run. The F-measure for the two runs is roughly the same.
However, Run 2 surpasses Run 1 in terms of average precision. The overall detection cost is very
low in these two runs, with Run 1, being more economical. This is a strong point for these runs.
The linear utility of Run 2 is greater than that of Run 1. On contrary, the anticipation for Run 1
(0.430) is significantly better than that of Run 2 (0.307).</p>
      <p>We can easily conclude from these results, that for the online algorithm, the initial set of
documents can be constructed in the same manner as that for the batch algorithm. In this case,
we can find 10 nearest neighbors for each topic instead of relying on feedbacks from the server.
5</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>We have presented, in this paper, a simple extension of the kNN algorithm using thresholds to
define a batch filtering algorithm. The results obtained can be deemed encouraging as the
Fmeasure equals approximately 20%, for a collection of 100,000 documents and 50 topics, out of
which only 1597 documents are relevant. In comparison with online results of 2008, we have a
much better recall (almost 30% against 26% in 2008) along with a lower detection cost (0.002
vs 0.007) and a much better anticipation (0.430 vs 0.307). Considering the evolution of different
measures, we had observed that the values for all of the measures increase, with the increase in the
number of documents filtered. Furthermore, the comparison between batch and online algorithms
indicate that, while building the initial set of documents, one can use the nearest neighbors for
each topic, rather than relying on feedbacks from the server.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Romaric</given-names>
            <surname>Besancon</surname>
          </string-name>
          , St´ephane Chaudiron, Djamel Mostefa, Olivier Hamon, Ismail Timimi, and
          <string-name>
            <given-names>Khalid</given-names>
            <surname>Choukri</surname>
          </string-name>
          .
          <article-title>Overview of clef 2008 infile pilot track</article-title>
          .
          <source>In Working Notes of the Cross Language Evaluation Forum (CLEF</source>
          <year>2008</year>
          ), Aarhus, Denmark,
          <fpage>17</fpage>
          -
          <issue>19</issue>
          <year>September 2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Romaric</given-names>
            <surname>Besancon</surname>
          </string-name>
          , St´ephane Chaudiron, Djamel Mostefa, Ismail Timimi, and
          <string-name>
            <given-names>Khalid</given-names>
            <surname>Choukri</surname>
          </string-name>
          .
          <article-title>The infile project: a crosslingual filtering systems evaluation campaign</article-title>
          . In ELRA, editor,
          <source>Proceedings of LREC'08</source>
          ,
          <string-name>
            <surname>Morocco</surname>
          </string-name>
          , May
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Vincent</given-names>
            <surname>Bodinier</surname>
          </string-name>
          , Ali Mustafa Qamar, and
          <string-name>
            <given-names>Eric</given-names>
            <surname>Gaussier</surname>
          </string-name>
          .
          <article-title>Working notes for the infile campaign : Online document filtering using 1 nearest neighbor</article-title>
          .
          <source>In Working Notes of the Cross Language Evaluation Forum (CLEF</source>
          <year>2008</year>
          ), Aarhus, Denmark,
          <fpage>17</fpage>
          -
          <issue>19</issue>
          <year>September 2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>A. K.</given-names>
            <surname>McCallum. Bow</surname>
          </string-name>
          :
          <article-title>A toolkit for statistical language modeling, text retrieval, classification</article-title>
          and clustering,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Yiming</given-names>
            <surname>Yang</surname>
          </string-name>
          and
          <string-name>
            <given-names>Xin</given-names>
            <surname>Liu</surname>
          </string-name>
          .
          <article-title>A re-examination of text categorization methods</article-title>
          .
          <source>In SIGIR '99</source>
          , pages
          <fpage>42</fpage>
          -
          <lpage>49</lpage>
          , USA,
          <year>1999</year>
          . ACM Press.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>