Jekub / Wapiti

A simple and fast discriminative sequence labeling toolkit ( http://wapiti.limsi.fr )
Other
251 stars 86 forks source link

use labels of previous observeations as features #8

Closed gromgull closed 10 years ago

gromgull commented 10 years ago

Maybe I am missing something, but there is no way to use the label for the previous line as a feature is there?

This would be use useful for IOB2 type tags, to make sure a I-* always follows a N-* .

kmike commented 10 years ago

Hi @gromgull,

If you include a line consisting of a single b (or *) char in your patterns file you'll get basic 1st order transition features; this way the model will learn that e.g. I-PER should be preceeded by B-PER.

Check http://wapiti.limsi.fr/manual.html#patterns for more info. You can also check http://crfpp.googlecode.com/svn/trunk/doc/index.html?source=navbar#templ - the template format is not exactly the same, but I found CRF++ explanation more clear.

It seems there is indeed no way to add a feature that involves a regexp executed over labels.

gromgull commented 10 years ago

Thanks @kmike - that solves it!