<?xml version="1.0"?><!DOCTYPE article SYSTEM "/project/take/software/searchbench_offline_processing/paperxml_generator/aclextractor/src/python/../resource/dtd/paperxml.dtd"><article><header><firstpageheader><page local="1" global="99"/><title>Sense and Deduction: The Power of Peewees Applied to the SENSEVAL-2 Swedish Lexical Sample Task</title><author surname="Lager" givenname="Torbjörn"><org  name="Uppsala University" country="Sweden" city="Uppsala"/></author><author surname="Zinovjeva" givenname="Natalia"><org  name="Yale University" country="USA" city="New Haven"/></author></firstpageheader><frontmatter><p><b>Sense and Deduction: The Power of Peewees Applied to the </b>Senseval-2 <b>Swedish Lexical Sample Task</b></p><p><b>Torbjörn Lagerf </b>and <b>Natalia Zinovjeva$</b></p><p>f Department of Linguistics, Uppsala University JHapax Information Systems AB, Stockholm</p></frontmatter><abstract>This paper describes our use of Prolog Word Experts (PWEs) in the Senseval-2 competi­tion. We explain how we specify our PWEs as sequences of transformation rules and how they can be trained on sense tagged corpus data. We give a semantics of PWEs by translating them into first order predicate logic, and we describe how PWEs can be compiled into Prolog pro­cedures. We finally present our results for the Swedish lexical sample task: 63% (fine-grained score) for our best PWE, and a second place in the ranking. </abstract></header><body><section number="1" title="Introduction"><p>Word experts are small expert system-like mod­ules for processing a particular target word based on neighboring words. Typically, a word expert uses rules that test the identity and rela­tive position of words in the context in order to infer the role of the target word in the passage (Berleant, 1995). In this paper, we describe the development of various kinds of word experts in a logic programming framework, dealing with word sense disambiguation in the context of the Senseval<b>-2 </b>competition.</p><p>In a logic programming framework, the task of engineering a word (sense) expert can be specified as follows. Given a suitable represen­tation of a text, we want to define a predicate <b>sense/2 </b>such that <b>sense</b>(P,S) is true iff the word at position P in the text has the sense S. In the remainder of the paper, we will refer to this kind of word expert as a Prolog Word Expert (or PWE for short - "Peewee" to its friends). This is to distinguish it from other kinds of word ex­perts, and to emphasize the fact that it is 'pro­grammed in logic'.</p></section><section number="2" title="The Anatomy of a Peewee"><subsection number="2.1" title="Peewee Specifications"><p>In the present paper, a word expert's knowledge will be expressed, not as Prolog clauses defining <b>sense/2 </b>directly, but as a sequence of transfor­mation rules. For example, here is how we spec­ify a word expert which is able to disambiguate occurrences of <i>interest:<footnote anchor="1"/></i></p><p><b>worcLexpert sense :=</b> <b>sense:</b><b>add 6 &lt;- word:interest®[0] o sense:6&gt;1 &lt;- word: in@[l] o sense: 1&gt;5 &lt;- word: '</b><i>%'Q</i><b>[-1] o end.</b></p><p>The first rule works as a default rule, which sim­ply assigns the most frequent sense to the word <i>interest </i>(6 in this case). If no other rules apply, this is the tag that the word will eventually get. The other rules dictate when - based on the context - a word should have its tag changed. The second rule is to be read "replace the tag for sense 6 with the tag for sense 1, if the next word is in". The third rule says "replace the tag for sense 1 with the tag for sense 5, if the pre­vious 'word' is '%'." The o-symbol is a compo­sition operator, and <b>(R </b>o <b>Rs) </b>basically means that the output of applying the rule <b>R </b>forms the input to the application of the rules <b>Rs. </b>Thus, rules are strictly order-dependent. Note, for ex­ample, that the third rule is applicable only if the second rule is.</p><p>Needless to say, the above rules are not at all sufficient for the task of disambiguating all uses of <i>interest </i>But the number of rules can be increased, and typically a word expert will</p><p><b>xThis word was of course not used the Swedish task, but is used here for expository reasons. The sense tags are numbers: 1="readiness to give attention", 5= "a company share", 6= "money paid for the use of money", etc.</b></p><page local="2" global="100"/><p>have access to anything between just a handful of rules and several hundred ones.<footnote anchor="2"/></p></subsection><subsection number="2.2" title="Peewee Logic"><p>Interestingly, a sequence of transformation rules can be translated into a set of axioms, expressed in first-order predicate logic, defining relation­ships between positions in a text, word forms, and senses (Lager, 2000; Lager &amp; Nivre, 2001). For example, the meaning of the rules from the previous section can be spelled out as follows:</p><doubt alpha="51.7" length="29" tooSmall="False" monospace="0.0">"ip[w (pointer est)—►S\(p}6)}</doubt><doubt alpha="53.8" length="93" tooSmall="False" monospace="0.0">Vpo,Pi[Si(po,6)Api=p0+lAw(pi,in) —&gt; S2(po,l)} Vpo,pi,x[Si(p0,x)Api=p0+lA-vw(pi,in)-&gt;S2(po,x)]</doubt><doubt alpha="46.2" length="93" tooSmall="False" monospace="0.0">Wp0,p1[S2(poA)APi=Po-lAiy(pi,%)-+ S3(po,5)]Vp0,Pi,x[5'2(po,^) A pi-po-1A-iw(pi,%)—&gt; S3(po,aO]</doubt><doubt alpha="25.0" length="24" tooSmall="False" monospace="0.0">Vx,p[53(p,a;) -* ^(p,^)]</doubt><p>The idea is that for each rule in the sequence a new predicate <i>Si </i>is introduced, where the sub­script indicates where in the sequence the rule belongs. Semantically, <i>Si </i>relates a position to a sense, and the formulas define this predicate in terms of the predicate <i>Si~\ </i>plus a number of other predicates. Each <i>Si </i>corresponding to a replacement rule is defined by two sentences -one stating the conditions under which a sense tag is replaced with another sense tag, the other one stating the conditions under which the old sense tag is kept.</p><p>Given a suitable logical representation of a text, such as and given a suitable constructive proof method, the exact identity of the sense of an occurrence of the word <i>interest </i>- say the word at position 12 - will follow as a logical consequence of the theory formed by taking the union of the pre­vious two sets of formulas. For example, the formula <i>3x[S(12,x)] </i>is a theorem, for which we can construct (only) the example <i>x </i>—» 5, and we have thus formally proved that this partic­ular occurrence of <i>interest </i>means "a share in a company" .<footnote anchor="3"/></p><doubt alpha="51.6" length="153" tooSmall="False" monospace="0.0">w(l,Sue) w(2,developed)w(3,an)w(4, interest)u&gt;(5,m)w(6,computers) w(7,and) w(8, bought) w(9,an)w(10,11.5)w(ll,%) w(12,interest) w(131in) w(14, Microsoft)</doubt><footnote label="2">A demo of a more potent PWE is available at: http : //www. ling. gu. se/~lager/Home/pwe..ui. html</footnote><footnote label="3">The theory can be used in other ways too. Searching</footnote><p>What we have here is something that we like to think of as <i>word sense disambiguation as de­duction, </i>in analogy to the ideas of <i>parsing as deduction </i>due to Pereira and Warren (1983).</p></subsection><subsection number="2.3" title="The Peewee Compiler"><p>Since the above formulas have already logic pro­gramming form, it is straightforward to trans­late them into Prolog. For example, the second and the third formulas can be translated as fol­lows:<footnote anchor="4"/></p><p><b>s2(P0,l) :- sl(P0,6), PI is PO+i, w(Pl,in). s2(P0,X) :- sl(PO.X), PI is P0+1, \+ w(Pi,in).</b></p><p>To write Prolog procedures such <i>as</i><i> </i>these by hand for many rules would be tedious and prone to errors. Fortunately, since the formalism for transformation rules is compositional, it was straightforward to write a compiler<footnote anchor="5"/> that gener­ates word expert procedures from word expert specifications automatically.</p></subsection><subsection number="2.4" title="Peewee Training"><p>There is an obvious choice of learning method for training Prolog Word Experts, namely Transformation-Based Learning (Brill, 1995). Of course, the fact that transformation rules can be learned from tagged corpora was a major rea­son for using them in the first place. The //-TBL system - described in detail in (Lager, 1999) -uses the search and database capabilities of the Prolog programming language to implement a generalized form of transformation-based learn­ing. Through its support of a compositional rule/template formalism and 'pluggable' algo­rithms, the //-TBL system can easily be tailored to different learning tasks.<footnote anchor="6"/></p><p>Rules that can be learned in Transformation-Based Learning are instances of rule templates. For example, the second of the rules in our ex­ample PWE specification is an instance of the following template:</p><p><b>sense:A&gt;B &lt;~ word:CO[1].</b></p><p><b>for a word token with a particular sense (say 5) becomes a matter of constructively proving 3p[S(p,5)].</b></p><footnote label="4">There are equivalent but more efficient ways to rep­resent these clauses in Prolog (cf. Lager, 2000).</footnote><footnote label="5">Download the compiler from the PWE homepage at: http : //www. ling. gu. se/~lager/pwe. html</footnote><footnote label="6">The //-TBL system is available from: http : //www. ling. gu. se/~lager/mutbl. html</footnote><page local="3" global="101"/><p>The template is to be read "replace the tag for sense <b>A </b>with the tag for sense B if the word im­mediately to the right is C", where <b>A, </b>B and C are variables. Learning is a matter of repeatedly in­stantiating rule templates in training data, scor­ing rules on the basis of counts of positive and negative evidence of them, selecting the highest scoring rule on the basis of this ranking, and applying it to the training data.</p></subsection></section><section number="3" title="Pee wees at Senseval -2"><p>The lexical sample task for Swedish in Senseval-2 involved 40 lemmas: 20 nouns, 15 verbs and 5 adjectives. Together they repre­sented 145 senses and 304 sub-senses. 8,718 annotated instances were provided as training material and 1,525 unannotated instances were provided for testing. Furthermore, a lexicon - the GLDB (Gothenburg Lexical Database) -complete with morphological information, defi­nitions, language examples, etc. was available.</p><p>Our team explored three approaches. For each lemma, we trained:</p><p>• PWE-smpl: a simple PWE capable of ar­riving at a single sense for each instance of that lemma in the testing material.</p><p>• PWE-disj: a committee of PWEs (i.e. a set of PWEs) capable of arriving at (pos­sibly) multiple senses for each instance of that lemma, by collecting the individual re­sults into a set.</p><p>• PWE-vote: a committee of PWEs capable of arriving at a single sense for each in­stance of that lemma, by applying a simple voting procedure.</p><p>As it turned out, the second of these approaches produced a rather unimpressive result, and we will therefore spend very little time discussing it. Indeed, had we been able to run the scor­ing software ourselves (which we were not), we would have left them outside the competition altogether.</p><subsection number="3.1" title="The Simple Peewees"><p>For the training of our simplest form of sense disambiguation expert, the following set of seven templates was used:</p><p><b>sense:A&gt;B &lt;- word:CO[-1] . sense :A&gt;B &lt;- word:C0[-l,-2] .</b></p><p><b>sense:A&gt;B &lt;- word:C0[l].</b></p><p><b>sense:A&gt;B &lt;- word:CO[1,2].</b></p><p><b>sense:A&gt;B &lt;- word:C0[l] &amp; word:DO[2].</b></p><p><b>sense:A&gt;B &lt;- word:C0[-l] &amp; word:DO[-2].</b></p><p><b>sense:A&gt;B &lt;- word:C0[-l] &amp; word:D0[l].</b></p><p>The idea was to exploit a fact noted by many researchers in the field: that the sense of an occurrence of a word can fairly successfully be determined from just looking at the two previ­ous words and the two following words (cf. Ide &amp;; Veronis, 1998). The choice of the above set of templates is based on a fairly thorough trail-and-error process and works well for most words that we have tried.</p></subsection><subsection number="3.2" title="The Peewee Committees"><p>The idea here was to train five different PWEs for each lemma, and then to use a simple vot­ing mechanism to arrive at a final decision. The PWEs were different only in that they used different sets of templates during the train­ing. Templates looking forwards only, templates looking backwards only, and templates looking both forwards and backwards. Furthermore, one member in each committee was trained for using a bag-of-words approach to disambigua­tion, based on templates of the following form:</p><p><b>sense:A&gt;B &lt;- inBag:W0[0].</b></p><p><b>sense:A&gt;B &lt;- inBag:W10[0] &amp; inBag:W20[0].</b></p><p>Finally, one PWE in each committee had access to a list of words extracted from the language examples provided by the GLDB.</p></subsection><subsection number="3.3" title="The Procedure"><p>In this section we describe the actions that we took in order to submit our entry in the compe­tition.</p><p>• In a preparatory step, the XML formatted training data was parsed and subsequently converted into the format required by the /i-TBL system.</p><p>• The training was performed, and resulted in one PWE specification per lemma. Training took between 5 seconds and a cou­ple of minutes per lemma, depending on the amount of training data available for the lemma in question.</p><p>• The PWE specifications were compiled into a set of PWE procedures, by means of the PWE compiler.</p><page local="4" global="102"/><p>• Simple procedures were written to print the results to a file in the prescribed format, and the PWEs were then run on the test data. This took only a couple of seconds for the whole test corpus.</p></subsection><subsection number="3.4" title="Results"><p>In the following table we show the results of our entry in the competition, copied from the Senseval-2 homepage.<footnote anchor="7"/></p><p>Five groups and altogether eight systems par­ticipated in the Swedish lexical sample task. In terms of ranking, our PWE-vote came in sec­ond, after Yarowski's JHU system, and before the Göteborg team's best entry. However, we hasten to add that the step from Yarowski's (nearly 70%, fine grained evaluation) to our re­sults is a very significant 7%, and that the step down to Göteborg 's result is very small and probably statistically insignificant. Our simple Peewees shared the fourth place with Resnik et al.'s UMD-SST.</p><p>As can be seen from the table, the PWE com­mittees did slightly better than a single simple PWE. It is however dubious whether the small difference was really worth the trouble. It is quite possible that training a single PWE on the <i>combination </i>of corpus data and the exam­ples from the GLDB would have lead to a result almost as good, and with less work.</p></subsection></section><section number="4" title="Conclusion"><p>It seems we can conclude that an ap­proach to word sense disambiguation based on Transformation-Based Learning is compet­itive with approaches based on Memory-Based Learning as used by the Göteborg team, and support vector machine (SVM) learning, used by the University of Maryland team.  This is good news for those aiming at building NLP sys­tems in which transformation rules play a major role.</p><footnote label="7">Note that the coarse-grained evaluation was not ap­plicable to the Swedish task. Also, it should be noted that our results in the first round of evaluation were slightly worse than the results reported here. However, this was due to a spelling error which could be corrected by the conference organizers and thus did not involve any resubmission of test results.</footnote><p>As we have seen, there is meaning in the life of Peewees, and sound mathematical meaning at that! Also, given the link between first order logic and a logic programming language such as Prolog, the implementation follows very di­rectly from the specification. The existence of a compiler from Peewee specifications into Pro­log procedures makes Peewees very convenient to work with in a Prolog environment.</p></section><section number="5" title="Acknowledgements"><p>We thank the senseval-2 organizers for mak­ing all this possible, and in particular Jerker Järborg and Dimitrios Kokkinakis in Göteborg for their work on preparing for the Swedish lex­ical sample task.</p><table class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>System</p></td><td class="cell"><p>Evaluation</p></td><td class="cell"><p>Accuracy (%).</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>PWE-smpl</p></td><td class="cell"><p>Fine</p></td><td class="cell"><p><b>61.1</b></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p>Mixed</p></td><td class="cell"><p>66.8</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>PWE-vote</p></td><td class="cell"><p>Fine</p></td><td class="cell"><p>63.0</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p>Mixed</p></td><td class="cell"><p>68.6</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table></section><references><p>Berleant, D. (1995) Engineering "Word Ex­perts" for Word Disambiguation. <i>Natural Language Engineering, </i>1(4).</p><p>Brill, E. (1995) Transformation-Based Error-Driven Learning and Natural Language Pro­cessing: A Case Study in Part of Speech Tag­ging. <i>Computational Linguistics </i>21.</p><p>Ide, N. and Véronis, J. (1998) Introduction to the Special Issue on Word Sense Disambigua­tion: The State of the Art. <i>Computational Linguistics </i>24(1).</p><p>Lager, T. (1999) The /x-TBL System: Logic Programming Tools for Transformation-Based Learning. In <i>Proceedings of CoNLL '99, </i>Bergen, Norway.</p><p>Lager, T. (2000) A Logic Programming Ap­proach to Word Expert Engineering. In <i>Pro­ceedings of ACIDCA 2000: Workshop on Corpora and Natural Language Processing, </i>Monastir, Tunisia, March 22-24 2000.</p><p>Lager, T. and Nivre, J. (2001) Part of Speech Tagging from a Logical Point of View. In de Groote, P., Morrill, G., Retor, C. (eds.) <i>Logical Aspects of Computational Linguistics. </i>Springer-Verlag, LNAI. VOL. 2099.</p><p>Pereira, F. and Warren, D. H. D. (1983) Pars­ing as Deduction, In <i>Proceedings of the 21th Meeting of the ACL.</i></p></references></body></article>