<!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>Wikipedia Vandalism Detection Through Machine Learning: Feature Review and New Proposals</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Santiago M. Mola Velasco</string-name>
        </contrib>
      </contrib-group>
      <pub-date>
        <year>2010</year>
      </pub-date>
      <abstract>
        <p>Wikipedia is an online encyclopedia that anyone can edit. In this open model, some people edits with the intent of harming the integrity of Wikipedia. This is known as vandalism. We extend the framework presented in (Potthast, Stein, and Gerling, 2008) for Wikipedia vandalism detection. In this approach, several vandalism indicating features are extracted from edits in a vandalism corpus and are fed to a supervised learning algorithm. The best performing classifiers were LogitBoost and Random Forest. Our classifier, a Random Forest, obtained an AUC of 0.92236, ranking in the first place of the PAN'10 Wikipedia vandalism detection task.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>[...] any addition, removal, or change of content made in a deliberate attempt
to compromise the integrity of Wikipedia. [...] Common types of vandalism are
the addition of obscenities or crude humor, page blanking, and the insertion of
nonsense into articles.</p>
      <p>Any good-faith effort to improve the encyclopedia, even if misguided or
illconsidered, is not vandalism. Even harmful edits that are not explicitly made
in bad faith are not vandalism.
(Wikipedia contributors, 2010a)</p>
      <p>
        The Wikipedia community maintains a project for studying vandalism
        <xref ref-type="bibr" rid="ref11 ref12 ref7">(Wikipedia
contributors, 2010b)</xref>
        and develops bots for automatic detection and reversion. Currently,
      </p>
      <p>
        Thanks to the PAN’10 organizers, to the reviewers, to Dmitry Chichkov for his contributions
to the PAN’10 group and to Sandra García Blasco for her support and ideas.
the most prominent active bot in the English Wikipedia is ClueBot, a rule-based
system.
        <xref ref-type="bibr" rid="ref3">(Carter, 2010)</xref>
        ClueBot’s rules rely on length increment of the edit and a scoring
system based on regular expressions checking vulgarisms, grammar, etc. This system
achieves a precision near to 1 but a very low recall. Similar systems can be found in
other Wikipedias, such as AVBOT
        <xref ref-type="bibr" rid="ref10">(Rodríguez Posada, 2010)</xref>
        in the Spanish edition.
      </p>
      <p>
        <xref ref-type="bibr" rid="ref8">(Potthast, Stein, and Gerling, 2008)</xref>
        defined Wikipedia vandalism detection as a
classification task, proposed a set of discriminating features and provided evaluation
of them based on machine learning. Our work is founded in that definition, extending
the set of features proposed in their work. We have built a system trying to reproduce
previous results, and afterwards, extended it with a new range of features and tuning of
previous ones.
      </p>
      <p>
        We have used the PAN-WVC-10 corpus
        <xref ref-type="bibr" rid="ref7">(Potthast, 2010)</xref>
        . The training set of this
corpus comprises 15000 annotated edits, 924 of which are labeled as vandalism. Our
goal is building a vandalism classifier using this corpus.
      </p>
      <p>The rest of the paper is structured as follows. In Section 2 of this article, we will
describe the preprocessing we have applied to the data. In Section 3 we discuss all
edit features that we have used. In Section 4 we present the classifiers we have used.
In Section 5 we will evaluate our features and classifiers and present the classifier we
have used for the PAN’10 result submission. Finally, we will present our conclusions in
Section 6.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Preprocessing</title>
      <p>In our feature framework, we have defined different representations of edits to use in
different features. In this section we will describe these representations and the steps to
construct them.</p>
      <p>First, we defined a tokenization function. A token can be a word, a number, a
punctuation mark or a wiki-syntax element. When describing features, we will consider a
word as any of these tokens. The following symbols are considered independent
tokens: ., ,, :, ;, ", «, », ’, |, ?, !, =, (, ), *, [[, ]], [. ], {{, }}, { and }.</p>
      <p>We also need to produce diffs between the old and new revisions of an edit. To that
end, we used google-diff-match-patch.1</p>
      <p>Using these funcions, we define the following representations of edit text:
– Old text and new text. The old and new without any preprocess.
– Case-sensitive inserted words. The set of inserted words.
– Inserted words. The set of inserted words, and converted to lowercase.
– Concatenated inserted words. All inserted words concatenated and separated with
spaces. This is defined both case-sensitive and insensitive.
– Inserted text. Inserted lines as reported by the diff algorithm.</p>
      <p>1Available at google-diff-match-patch. Behaviour of different parameters of the
diff function has not been studied yet. The parameters used were Patch_Margin set to 0,
Diff_EditCost to 6 and Match_Distance to 500.</p>
    </sec>
    <sec id="sec-3">
      <title>Edit Features</title>
      <p>
        In this section, we describe our set of features. Features based on dictionaries will be
explained separately. Features marked with were already defined in
        <xref ref-type="bibr" rid="ref8">(Potthast, Stein,
and Gerling, 2008)</xref>
        and those marked with y are modifications of features also defined
in that work.
      </p>
      <p>Anonymous Wether the editor is anonymous or not.</p>
      <p>
        Vandals are likely to be anonymous. This feature is used in a way or another in
most antivandalism working bots such as ClueBot and AVBOT. In the
PAN-WVC10 training set
        <xref ref-type="bibr" rid="ref7">(Potthast, 2010)</xref>
        anonymous edits represent 29% of the regular edits
and 87% of vandalism edits.
      </p>
      <p>Comment length Length in characters of the edit summary.</p>
      <p>Long comments might indicate regular editing and short or blank ones might
suggest vandalism, however, this feature is quite weak, since leaving an empty
comment in regular editing is a common practice.</p>
      <p>Upper to lower ratioy Uppercase to lowercase letters ratio, i.e., 1+jupperj .
1+jlowerj
Vandals often do not follow capitalization rules, writing everything in lowercase or
in uppercase.
1+jupperj
Upper to all ratioy Uppercase letters to all letters to ratio, i.e., 1+jlowerj+jupperj .
Digit ratio Digit to all characters ratio, i.e., 11++jdjaigllijtj .</p>
      <p>This feature helps to spot minor edits that only change numbers, which might help
to find some cases of subtle vandalism where the vandal changes arbitrarily a date
or a number to introduce misinformation.</p>
      <p>Non-alphanumeric ratio Non-alphanumeric to all characters ratio, i.e., 1+jnonalphanumericj .
1+jallj
An excess of non-alphanumeric characters in short texts might indicate excessive
use of exclamation marks or emoticons.</p>
      <p>Character diversity Measure of different characters compared to the length of
inserted text, given by the expression length differe1nt chars .</p>
      <p>This feature helps to spot random keyboard hits and other non-sense. It should take
into account QWERTY keyboard layout in the future.</p>
      <p>Character distributiony Kullback-Leibler divergence of the character distribution of
the inserted text with respect the expectation. Useful to detect non-sense.</p>
      <p>Compressibilityy Compression rate of inserted text using the LZW algorithm. 2</p>
      <p>Useful to detect non-sense, repetitions of the same character or words, etc.</p>
      <p>Size increment Absolute increment of size, i.e., jnewj joldj.</p>
      <p>The value of this feature is already well-established. ClueBot uses various
thresholds of size increment for its heuristics, e.g., a big size decrement is considered an
indicator of blanking.</p>
      <p>Size ratio Size of the new revision relative to the old revision, i.e., 11++jjnoeldwjj .</p>
      <p>Complements size increment.</p>
      <p>
        2LZW was chosen after evaluating the behaviour of LZW, gzip and bzip2, although, an
exhaustive comparison is still pending. We used the TIFF LZW algorithm
        <xref ref-type="bibr" rid="ref1">(Adobe Developers
Association, 1992)</xref>
        as implemented in python-lzw 0.01 by Joe Bowers, available at http:
//www.joe-bowers.com/static/lzw/.
      </p>
      <p>Average term frequency Average relative frequency of inserted words in the new
revision.</p>
      <p>In long and well-established articles too many words that do not appear in the rest
of the article indicates that the edit might be including non-sense or non-related
content.</p>
      <p>Longest word Length of the longest word in inserted text.</p>
      <p>Useful to detect non-sense.</p>
      <p>Longest character sequence Longest consecutive sequence of the same character in
the inserted text.</p>
      <p>Long sequences of the same character are frequent in vandalism (e.g.
aaggggghhhhhhh!!!!!, soooooo huge).</p>
      <p>Size increment and ratio are closely related to all features, as can be seen in ClueBot
and AVBOT source code, where thresholds for these measures are coded deep into most
heuristics. This should be considered when building a classifier.</p>
      <p>Upper to all, upper to lower, digit and non-alphanumeric ratios were computed
using case-sensitive concatenated inserted words. These could also be computed using a
diff or computing the difference of their values in the old and new text. Each method
produces different results. We chose only inserted words for efficiency.</p>
      <p>
        Antivandalism bots use lists of regular expressions with weights in order to
compute a vandalism score. In
        <xref ref-type="bibr" rid="ref8">(Potthast, Stein, and Gerling, 2008)</xref>
        a similar approach is
described, where vulgarism frequency and impact are considered. Vulgarism frequency
is the frequency of vulgarisms in an edit text relative to all words in the edit. Vulgarism
impact is the percentage by which an edit increases the number of vulgarisms in the
text. In the same way, pronoun frequency and impact were defined.
      </p>
      <p>We have defined features analogous to vulgarism frequency and vulgarism impact,
for different categories of words:
Vulgarisms Vulgar and offensive words, e.g., fuck, suck, stupid.</p>
      <p>Pronouns First and second person pronouns, including slang spellings, e.g., I, you, ya.
Biased Colloquial words with high bias, e.g., coolest, huge.</p>
      <p>Sex Non-vulgar sex-related words, e.g., sex, penis, nipple.</p>
      <p>Bad Hodgepodge category for colloquial contractions (e.g. wanna, gotcha), typos (e.g.</p>
      <p>dosent), etc.</p>
      <p>All A meta-category, containing vulgarisms, pronouns, biased, sex-related and bad
words.</p>
      <p>Good Words rarely used by vandals, mainly wiki-syntax elements (e.g. __TOC__,
&lt;ref&gt;)</p>
      <p>Word counters were computed using the inserted words in lowercase. In future
work, it would be desirable to consider caseness and style. For example, dick is very
likely to be slang for penis and DICK is a strong indicator of vandalism, but Dick is
more likely to be the diminutive for Richard or a surname. Our current system does not
make this distinction.</p>
    </sec>
    <sec id="sec-4">
      <title>Classification</title>
      <p>
        Classification has been conducted using the Weka framework
        <xref ref-type="bibr" rid="ref5">(Hall et al., 2009)</xref>
        . After
preliminary evaluations, we have tried to choose classifiers which fullfil all or most
of the following conditions: a) require little or no preprocessing of data, b) require
little parameter adjustment, c) do implicit feature selection, d) are resistant to noise and
outliers and e) are resistant to severe class imbalance.
      </p>
      <p>
        Our baseline classifier is C4.5 decision tree
        <xref ref-type="bibr" rid="ref9">(Quinlan, 1993)</xref>
        which is a well-established
algorithm and, to some extent, fullfils our criteria. LogitBoost
        <xref ref-type="bibr" rid="ref4">(Friedman, Hastie, and
Tibshirani, 2000)</xref>
        and Random Forest
        <xref ref-type="bibr" rid="ref2">(Breiman, 2001)</xref>
        are attractive because of their
implicit feature selection, generalization properties and a low number of parameters.
We expect Random Forest to properly exploit relations between features such as those
described in Section 3. Random Forest has another interesting property: it uses an
internal test error estimation known as out of bag error which makes cross-validation
prescindible.
      </p>
      <p>
        We also chose Support Vector Machines (SVM) because of its resistance to class
imbalance
        <xref ref-type="bibr" rid="ref6">(Japkowicz and Stephen, 2002)</xref>
        , however, SVM has been discarded for
inclusion in the PAN’10 results because of its high computational demands and amount
of parameter to adjust.
5
      </p>
    </sec>
    <sec id="sec-5">
      <title>Evaluation</title>
      <p>The following measures have been evaluated in every experiment: Precision, Recall,
F-Measure and Area Under ROC Curve (AUC).</p>
      <p>In Table 1 we can see the performance of a C4.5 decision tree built for each feature.
The C4.5 algorithm, considering only one feature and with severe class imbalance, will
often produce a majority class classifier. In order to prevent this, we changed the weight
of vandalism edits so the cost of a misclassified vandalism edit to be 10 times higher
than a misclassified regular edit. This is meant to be orientative, not an accurate ranking
of features.</p>
      <p>In Table 2 we can see the performance of all the classifiers considering all features.
Every classifier has been evaluated with 10-fold cross-validation. Parameters used for
classifiers were: 3
C4.5 minimum number of instances per leaf is 6, Laplace smoothing is used for
predicted probabilites.</p>
      <p>LogitBoost 100, 500 and 1000 boost iterations. The weak classifier is a Decision</p>
      <p>Stump.</p>
      <p>Random Forest 100, 500 and 1000 iterations.</p>
      <p>LogitBoost and Random Forest perform similarly in this task. Random Forest
improves F-Measure and AUC as we increase the number of iterations. While LogitBoost
shows slightly better performance than Random Forest, its results are less stable and
3Any omitted parameter uses default parameters in Weka. For more information, check Weka
API documentation at http://weka.sourceforge.net/doc.stable/.
decrease while increasing number iterations, suggesting a problem of overfitting. This
is, presumably, because of LogitBoost’s sensitiveness to noise and outliers.</p>
      <p>Our final classifier was a Random Forest of 1000 trees, each one built while
considering 5 random features4, obtaining an AUC of 0.92236 when evaluated with the
PAN-WVC-10 testing corpus.
6</p>
    </sec>
    <sec id="sec-6">
      <title>Conclusions</title>
      <p>
        In this work, we revisited
        <xref ref-type="bibr" rid="ref8">(Potthast, Stein, and Gerling, 2008)</xref>
        approach on Wikipedia
vandalism detection, tuning some features and introducing others. We further explored
features based on word lists, expanding them beyond vulgarisms and improving results
by creating new categories. We performed a brief comparison of different supervised
learning techniques for this task. Random Forest and LogitBoost produced good results.
      </p>
      <p>Our final classifier, a Random Forest, obtained an AUC of 0.92236, which was
ranked in the first place in PAN’10 for the vandalism detection task. Precision and recall
on the training test were 0.861 and 0.568, respectively. This is far better than current
antivandalism systems in terms of F-Measure, but it has neither precision near to 1,
which is required for a bot in order to operate autonomously, nor a recall high enough
to be used as a filtering system for human editors. In any case, our results suggest
that this machine learning based approach is a suitable path for the next-generation
antivandalism bots.</p>
      <p>Future work might include a more exhaustive feature evaluation; building bigger
word lists using free lexical resources such as Wiktionary and WordNet and infer their
weights; introducing a feature for detecting random keyboard hits considering QWERTY
keyboard layout; introducing heuristics from current antivandalism bots and experiment
with measures based on ngram language models.</p>
      <p>4That is, log2 M + 1, where M is the number of features.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <given-names>Adobe</given-names>
            <surname>Developers Association</surname>
          </string-name>
          ,
          <year>1992</year>
          .
          <source>TIFF Revision 6</source>
          .0:
          <string-name>
            <surname>Final. Adobe Systems</surname>
            <given-names>Incorporated</given-names>
          </string-name>
          , June.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>Breiman</surname>
            ,
            <given-names>Leo. 2001. Random</given-names>
          </string-name>
          <string-name>
            <surname>Forests</surname>
          </string-name>
          .
          <source>Machine Learning</source>
          ,
          <volume>45</volume>
          (
          <issue>1</issue>
          ):
          <fpage>5</fpage>
          -
          <lpage>32</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Carter</surname>
          </string-name>
          , Jacobi.
          <year>2010</year>
          .
          <article-title>ClueBot and Vandalism on Wikipedia</article-title>
          . http://www.acm. uiuc.edu/~carter11/ClueBot.pdf.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <surname>Friedman</surname>
            , Jerome,
            <given-names>Trevor</given-names>
          </string-name>
          <string-name>
            <surname>Hastie</surname>
            , and
            <given-names>Robert</given-names>
          </string-name>
          <string-name>
            <surname>Tibshirani</surname>
          </string-name>
          .
          <year>2000</year>
          .
          <article-title>Additive Logistic Regression: a Statistical View of Boosting</article-title>
          .
          <source>Annals of Statistics</source>
          ,
          <volume>28</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <surname>Hall</surname>
            , Mark, Eibe Frank, Geoffrey Holmes, Bernhard Pfahringer,
            <given-names>Peter</given-names>
          </string-name>
          <string-name>
            <surname>Reutemann</surname>
          </string-name>
          , and
          <string-name>
            <surname>Ian</surname>
            <given-names>H.</given-names>
          </string-name>
          <string-name>
            <surname>Witten</surname>
          </string-name>
          .
          <year>2009</year>
          .
          <article-title>The WEKA Data Mining Software: an Update</article-title>
          .
          <source>SIGKDD Explorations</source>
          ,
          <volume>11</volume>
          (
          <issue>1</issue>
          ):
          <fpage>10</fpage>
          -
          <lpage>18</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>Japkowicz</surname>
            , Nathalie and
            <given-names>Shaju</given-names>
          </string-name>
          <string-name>
            <surname>Stephen</surname>
          </string-name>
          .
          <year>2002</year>
          .
          <article-title>The Class Imbalance Problem: A Systematic Study</article-title>
          .
          <source>Intelligent Data Analysis</source>
          ,
          <volume>6</volume>
          (
          <issue>5</issue>
          ):
          <fpage>429</fpage>
          -
          <lpage>449</lpage>
          , February.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <surname>Potthast</surname>
          </string-name>
          , Martin.
          <year>2010</year>
          .
          <article-title>Crowdsourcing a Wikipedia Vandalism Corpus</article-title>
          .
          <source>In 33rd Annual International ACM SIGIR Conference. ACM, July.</source>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <surname>Potthast</surname>
            , Martin,
            <given-names>Benno</given-names>
          </string-name>
          <string-name>
            <surname>Stein</surname>
            , and
            <given-names>Robert</given-names>
          </string-name>
          <string-name>
            <surname>Gerling</surname>
          </string-name>
          .
          <year>2008</year>
          .
          <article-title>Automatic vandalism detection in wikipedia</article-title>
          . In Craig Macdonald, Iadh Ounis, Vassilis Plachouras, Ian Ruthven, and Ryen W. White, editors,
          <source>Advances in Information Retrieval</source>
          , volume
          <volume>4956</volume>
          of Lecture Notes in Computer Science. Springer, Berlin, Heidelberg, chapter
          <volume>75</volume>
          , pages
          <fpage>663</fpage>
          -
          <lpage>668</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>Quinlan</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Ross</surname>
          </string-name>
          .
          <year>1993</year>
          .
          <article-title>C4.5: programs for machine learning</article-title>
          . Morgan Kaufmann Publishers Inc., San Francisco, CA, USA.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <string-name>
            <given-names>Rodríguez</given-names>
            <surname>Posada</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Emilio</given-names>
            <surname>José</surname>
          </string-name>
          .
          <year>2010</year>
          .
          <article-title>AVBOT: detección y corrección de vandalismos en Wikipedia</article-title>
          . NovATIca, (
          <volume>203</volume>
          ):
          <fpage>51</fpage>
          -
          <lpage>53</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          <article-title>Wikipedia contributors</article-title>
          . 2010a. Wikipedia:Vandalism. In Wikipedia, The Free Encyclopedia. http://en.wikipedia.org/w/index.php?title= Wikipedia:Vandalism&amp;oldid=
          <fpage>366579916</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          <article-title>Wikipedia contributors</article-title>
          . 2010b.
          <article-title>Wikipedia:WikiProject Vandalism studies</article-title>
          . In Wikipedia, The Free Encyclopedia. http://en.wikipedia.org/ w/index.php?title=Wikipedia:WikiProject_Vandalism_ studies&amp;oldid=
          <fpage>365253014</fpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>