Przejdź do głównej zawartości

Bootstrapping the rules for LanguageTool

This post is related to many languages, so I'm posting in English.

Recently, during PALC 2009, I had a talk on unsupervised generation of rules for LanguageTool. The idea is when you have an error corpus (and you can create one based on Wikipedia revision history, by the way, here's a draft of my paper on creating the error corpus from Wikipedia), you can use transformation-based learning techniques to create rules that may be used to boostrap rule creation for new languages in LanguageTool.

Of course, what I have right now, are only quick hacks and script prototypes, but as you can see in my presentation, I'm planning to make the process a bit easier to use. First of all, the extraction of the error corpus from Wikipedia revision history can be fully ported to Java (I will add filters to remove synonym-for-synonym revisions but some of the most frequent changes are used to adapt the text to some editorial conventions, so they would have to be filtered manually). Currently, I'm using two packages for TBL machine-learning: muTBL and fnTBL (both free but not muTBL is not open-source). muTBL is in Prolog, and it has serious memory limitation - but it allows for iterative, incremental learning of rules on the stack. fnTBL is C++ and can process much larger corpora but crashes a lot, and its newest version (1.2) didn't work for me at all. Fortunately, there is a Java implementation of the TBL toolkit that works in GATE, and it's GPL, so it would allow to adapt it for our needs.

With these tools, it should be fairly easy to add some relevant rules for new languages even for people with limited linguistic competence. Yet, some of the rules require using morphosyntactic lexicons, which aren't so easy to create or find.

Of course, the use of TBL is not limited to bootstrapping new rules for new languages - TBL learning can enhance existing rules quite significantly, as I observed. The process is not very time-consuming even with dirty hacks, so I'm quite optimistic about the practical application.

So if anyone wants to help with porting my scripts to Java, just let me know - this way, we'll have the tool a bit faster :)

Komentarze

a nice thing, it will make life easier, it's so much where you get these ideas from xd
Dogadamycie pisze…
wow, uuu i like it! good job my friend
Very interesting entry.
Thanks for the post! I found LanguageTool to be very useful.

Popularne posty z tego bloga

Imiesłów przysłówkowy bez orzeczenia

W zdaniach z imiesłowami przysłówkowymi (-ąc i -wszy), zakończonych znakiem interpunkcyjnym, powinno występować orzeczenie. Dopuszczalne jest opuszczenie orzeczenia w tytule. W tytule nie stosuje się jednak kropek na końcu. Na przykład: Czekając na Godota Czekając na Godota, zabawiali się rozmową. Błąd ten jest tym bardziej rażący w zdaniach, w których występuje zdanie podrzędne: !Czekając na Godota, który nie przychodził. Usterka zostanie wykryta także w błędnie formułowanych pytaniach: !Rozmawiając o sporcie, który sport uprawiasz? W powyższym przykładzie podmiot imiesłowu jest inny od podmiotu pytania (my rozmawiamy, a sport uprawiasz tylko ty). Powinno być: Skoro już mowa o sporcie, którą dyscyplinę uprawiasz?

Gromadzimy błędy językowe

Tu zbieram błędy, które mają być wykrywane regułami. Część z tych błędów można dodać także do list autokorekty w Ooo (a nawet w programie MS Word). Warto pamiętać, że na liście muszą być tylko te błędy, których nie wykryje już korektor pisowni (a zatem błędne formy fleksyjne i proste błędy ortograficzne nie muszą być tutaj umieszczane). Zapraszam do komentowania i uzupełniania tej listy, na pewno nie jest wyczerpująca. Mówiąc krótko, to taki negatywny słownik języka polskiego ;) Nowomowa, ale nie błąd: wychodzić|wyjść * naprzeciw -> popierać *, iść na rękę * wprowadzić kogo w co -> zapoznać kogo z czym [fałszywe alarmy] w przypomnieniu -> przypominając [za dużo fałszywych alarmów] do wojny -> przed wojną [fałszywe alarmy, wiele poprawnych zwrotów] więcej chory -> coraz bardziej chory [rzadkie] widzieć się zmuszonym -> być zmuszonym w uzupełnieniu -> uzupełniając do roku -> przed upływem roku [za dużo fałszywych alarmów] trzymać wagę, firmę, mowę ś

Wikipedia history diff as a revision corpus

(As this is of interest not only to the Polish-speaking community, this post is in English.) Recently, after some discussions on the lingucomponent list at OpenOffice.org on the method of finding frequent typos, I did some experiments on the revision history logs. Background. The developers of grammar checkers, and autocorrect lists, have hard times with finding relevant corpora. Revision history is an excellent source about native speakers perception of linguistic norms. Frequently revised typos are perceived as errors that need to be corrected, so using these typos on autocorrect lists is justified. The same goes for style, grammar and usage errors. Method . Experiments involved three steps: Clean the history dump (??wiki-latest-pages-meta-history.xml), to get only relevant parts of the dump. Using XML tools isn't recommended (I tried XSLT, forget it). Using a simple awk script, I was able to clean the > 30GB dump in an hour or so, and got a >17 GB file. The script is simp