On 11/16/2013 04:17 PM, Peyman Faratin wrote:
I'm trying to write my own feature generator for a NER task. I've read the docs
at [1] but I am an example based learner and was wondering if there were any
resources on the end to end chain of how to actually customize a feature
generator and run it. I am in particular looking to implement a feature
generator that maps words onto a small set of patterns (first suggested by [2]).
Yes, you are right we should add a sample to the documentation,
please consider contributing it.
Did you run in any specific problems?
You need to do two things to plug a custom feature generator in:
1. Implement your feature generator, there are a couple of
implementations in opennlp.tools.util.featuregen,
have a look at the code there.
2. Reference it in the feature generator descritpion xml file, e.g. like
this:
<custom class="com.xyz.CustomFeaturegenImpl"/>
HTH,
Jörn