| { |
| "paper_id": "E99-1047", |
| "header": { |
| "generated_with": "S2ORC 1.0.0", |
| "date_generated": "2023-01-19T10:37:33.617632Z" |
| }, |
| "title": "#-TBL Lite: A Small, Extendible Transformation-Based Learner", |
| "authors": [ |
| { |
| "first": "Torbj6rn", |
| "middle": [], |
| "last": "Lager", |
| "suffix": "", |
| "affiliation": { |
| "laboratory": "", |
| "institution": "Uppsala University", |
| "location": {} |
| }, |
| "email": "torbjorn.lager@ling.uu.se" |
| } |
| ], |
| "year": "", |
| "venue": null, |
| "identifiers": {}, |
| "abstract": "This short paper describes-and in fact gives the complete source for-a tiny Prolog program implementing a flexible and fairly efficient Transformation-Based Learning (TBL) system:", |
| "pdf_parse": { |
| "paper_id": "E99-1047", |
| "_pdf_hash": "", |
| "abstract": [ |
| { |
| "text": "This short paper describes-and in fact gives the complete source for-a tiny Prolog program implementing a flexible and fairly efficient Transformation-Based Learning (TBL) system:", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Abstract", |
| "sec_num": null |
| } |
| ], |
| "body_text": [ |
| { |
| "text": "Transformation-Based Learning (Brill, 1995) is a well-established learning method in NLP circles. This short paper presents a 'light' version of the #-TBL system -a genera/, logically transparent, flexible and efficient transformation-based learner presented in (Lager, 1999) . It turns out that a transformation-based learner, complete with a compiler for templates, can be implemented in less than one page of Prolog code.", |
| "cite_spans": [ |
| { |
| "start": 30, |
| "end": 43, |
| "text": "(Brill, 1995)", |
| "ref_id": "BIBREF1" |
| }, |
| { |
| "start": 262, |
| "end": 275, |
| "text": "(Lager, 1999)", |
| "ref_id": "BIBREF0" |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Introduction", |
| "sec_num": "1" |
| }, |
| { |
| "text": "The point of departure for TBL is a tagged initialstate corpus and a correctly tagged training corpus. Assuming the part-of-speech tagging task, corpus data can be represented by means of three kinds of clauses: wd(P,W) is true iff the word W is at position P in the corpus tag(P,A) is true iff the word at position P in the corpus is tagged A tag(A,B,P) is true iff the word at P is tagged A and the correct tag for the word at P is B", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "#-TBL Rules &= Representations", |
| "sec_num": "2" |
| }, |
| { |
| "text": "Although this representation may seem a bit redundant, it provides exactly the kind of indexing into the data that is needed3 A decent Prolog system can deal with millions of such clauses.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "#-TBL Rules &= Representations", |
| "sec_num": "2" |
| }, |
| { |
| "text": "1 Assuming a Prolog with first argument indexing. The #-TBL systems are implemented in SICStus Prolog.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "#-TBL Rules &= Representations", |
| "sec_num": "2" |
| }, |
| { |
| "text": "The object of TBL is to learn an ordered sequence of transformation rules. Such rules dictate when -based on the context -a word should have its tag changed. An example would be \"replace tag vb with nn if the word immediately to the left has a tag dr.\" Here is how this rule is represented in the #-TBL rule/template formalism:", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "#-TBL Rules &= Representations", |
| "sec_num": "2" |
| }, |
| { |
| "text": "tag:vb>nn <-tag:dr@[-1].", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "#-TBL Rules &= Representations", |
| "sec_num": "2" |
| }, |
| { |
| "text": "Conditions may refer to different features, and complex conditions may be composed from simpler ones. For example, here is a rule saying \"replace tag rb with j j, if the current word is \"only\", and if one of the previous two tags is dr.\":", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "#-TBL Rules &= Representations", |
| "sec_num": "2" |
| }, |
| { |
| "text": "tag:rb>jj <-wd:only@[O] ~ tag:dt~[-l,-2].", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "#-TBL Rules &= Representations", |
| "sec_num": "2" |
| }, |
| { |
| "text": "Rules that can be learned in TBL are instances of templates, such as \"replace tag A with B if the word immediately to the left has tag C\", where A, B and C are variables. In the/~-TBL formalism:", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "#-TBL Rules &= Representations", |
| "sec_num": "2" |
| }, |
| { |
| "text": "t3(A,B,C) # tag:A>B <-tag:C~[-l].", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "#-TBL Rules &= Representations", |
| "sec_num": "2" |
| }, |
| { |
| "text": "Positive and negative instances of rules that are instances of this template can be generated by means of the following clauses: pos (t3(A,B,C)) :dif(A,B),tag(A,B,P),Pl is P-l,tag(Pl,C).", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "#-TBL Rules &= Representations", |
| "sec_num": "2" |
| }, |
| { |
| "text": "neg(t3(A,B,C)) :tag(A,A,P),P1 is P-l,tag(Pi,C).", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "#-TBL Rules &= Representations", |
| "sec_num": "2" |
| }, |
| { |
| "text": "Tied to each template is also a procedure that will apply rules that are instances of the template:", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "#-TBL Rules &= Representations", |
| "sec_num": "2" |
| }, |
| { |
| "text": "app(t3(A,B,C)) :-(tag(A,X,P), Pl is P-l, tag(Pl,C), retract (tag(A,X,P)), retract (tag(P,A)), assert(tag(B,X,P)), assert(tag(P,B)), fail ; true).", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "#-TBL Rules &= Representations", |
| "sec_num": "2" |
| }, |
| { |
| "text": "To write clauses such as the above by hand for large sets of templates would be tedious and prone to errors. Instead, Prolog's term expansion facility, and a couple of DCG rules, can be used to compile templates into Prolog code, as follows: ", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The #-TBL Template Compiler", |
| "sec_num": "3" |
| }, |
| { |
| "text": "The #-TBL Lite Learner", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "4", |
| "sec_num": null |
| }, |
| { |
| "text": "Given corpus data, compiled templates, and a value for Threshold, the predicate tbl/1 implements the /~-TBL main loop, and writes a sequence of rules to the screen: ; crue ).", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "4", |
| "sec_num": null |
| }, |
| { |
| "text": "The call to the setof-bagof combination generates a frequency listing of all positive instances of all templates, based on which the call to bestof/4 then selects the rule with the highest score, tbl/1 terminates if the score for that rule is less than the threshold, else it applies the rule and goes on to learn more rules from there. ).", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "4", |
| "sec_num": null |
| }, |
| { |
| "text": "To compute the rule with the highest score, bestof/4 traverses the frequency listing, keeping track of a leading rule and its score. The score of a rule is calculated as the difference between the number of its positive instances and its negative instances. When the list of rules is empty or the number of positive instances of the most frequent rule in what remains of the list is less than the leading rules score, the leader is declared winner.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "4", |
| "sec_num": null |
| }, |
| { |
| "text": "The following procedure implements the counting of negative instances in an efficient way:", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "4", |
| "sec_num": null |
| }, |
| { |
| "text": "count0 (G,M,N) :- ( bb_put(c,O), G, bb_get(c,NO), N is NO+l, bb_puZ(c,N), N > M -> fail ;", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "4", |
| "sec_num": null |
| }, |
| { |
| "text": "bb_get (c, N) ).", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "4", |
| "sec_num": null |
| }, |
| { |
| "text": "The By comparison, it took Brill's C-implemented context-rule learner 90 minutes, 185 minutes, and 560 minutes, respectively, to train on these corpora, producing similar sequences of rules. Thus #-TBL Lite is an order of magnitude faster than Brill's learner. The full #-TBL system presented in (Lager, 1999) is even faster, uses less memory, and is in certain respects more general. Small is beautiful, however, and the light version may also have a greater pedagogical value. Both versions can be downloaded from http ://www. ling. gu. se/~lager/mutbl, html.", |
| "cite_spans": [ |
| { |
| "start": 296, |
| "end": 309, |
| "text": "(Lager, 1999)", |
| "ref_id": "BIBREF0" |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "p-TBL Lite Performance", |
| "sec_num": "5" |
| } |
| ], |
| "back_matter": [], |
| "bib_entries": { |
| "BIBREF0": { |
| "ref_id": "b0", |
| "title": "The #-TBL System: Logic Programming Tools for Transformation-Based Learning", |
| "authors": [ |
| { |
| "first": "Torbjsrn", |
| "middle": [], |
| "last": "Lager", |
| "suffix": "" |
| } |
| ], |
| "year": 1999, |
| "venue": "Proceedings of CoNLL-99", |
| "volume": "", |
| "issue": "", |
| "pages": "", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Lager, TorbjSrn. 1999. The #-TBL System: Logic Programming Tools for Transformation- Based Learning, In: Proceedings of CoNLL-99, Bergen.", |
| "links": null |
| }, |
| "BIBREF1": { |
| "ref_id": "b1", |
| "title": "Transformation-Based Error-Driven Learning and Natural Language Processing: A Case Study in Part of Speech Tagging. Computational Linguistics", |
| "authors": [ |
| { |
| "first": "Eric", |
| "middle": [], |
| "last": "Brill", |
| "suffix": "" |
| } |
| ], |
| "year": 1995, |
| "venue": "", |
| "volume": "", |
| "issue": "", |
| "pages": "", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Brill, Eric. 1995. Transformation-Based Error- Driven Learning and Natural Language Process- ing: A Case Study in Part of Speech Tagging. Computational Linguistics, December 1995. 2Available from http://www, cs. jhu. edu/~brill.", |
| "links": null |
| } |
| }, |
| "ref_entries": { |
| "FIGREF0": { |
| "uris": null, |
| "type_str": "figure", |
| "num": null, |
| "text": "ID) :-(G3,fail;true))]) :pos((A<-Cs),Ll,[]), list2goal(Li,Gl), neg((A<-Cs),L2,[]), list2goal(L2,G2), app((A<-Cs),L3,[]), list2goal(L3,G3). pos((F:A>B<-Cs)) --> {G =.. [F,A,B,P]},[dif(A,B),G], cond(Cs,P). neg((F:A>_<-Cs)) --> {G =.. [F,A,A,P]}, [G], cond(Cs,P). app ( (F: A>B<-Cs) ) --> {G1 =.. [F,A,X,P], G2 =.. [F,P,A], G3 =.. [F,B,X,P], G4 =.. [F,P,B]}, [GI], cond(Cs,P), [retract(Gl), retract(G2), assert(G3), assert(G4)]. cond((C~Cs),P) --> cond(C,P), cond(Cs,P). cond(FA\u00a9Pos,PO) --> pos(Pos,PO,P), feat(FA,P). pos(Pos,P0,P) --> [member(0ffset,Pos), P is P0+0ffset]. feat(F:A,P)--> {G =.. [F,P,A]}, [G]." |
| }, |
| "FIGREF1": { |
| "uris": null, |
| "type_str": "figure", |
| "num": null, |
| "text": "Rule,L\" (bagof (. ,pos (Rule) ,L), length(L,N), N >= Threshold) ,FL), reverse (FL, RevFL), bestof (RevFL, dummy, Threshold, Winner), dif (Winner, dummy) -> write(Winner) ,nl, app (Winner), tbl (Threshold)" |
| } |
| } |
| } |
| } |