You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@opennlp.apache.org by "Joern Kottmann (JIRA)" <ji...@apache.org> on 2014/03/12 15:43:43 UTC
[jira] [Commented] (OPENNLP-605) Change GeneratorFactory class to
allow registering custom feature generators
[ https://issues.apache.org/jira/browse/OPENNLP-605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13931824#comment-13931824 ]
Joern Kottmann commented on OPENNLP-605:
----------------------------------------
The first implementation of this is now finished. It would be nice if you could give it a try.
To use it you need to extend the CustomFeatureGenerator. It will pass in all attributes as a Map<String, String> and provide all resources which are passed in via the resource folder option during training.
To have a custom resource the implmentation needs to implement ArtifactToSerializerMapper which defines which serializers should be used for which artifacts.
> Change GeneratorFactory class to allow registering custom feature generators
> ----------------------------------------------------------------------------
>
> Key: OPENNLP-605
> URL: https://issues.apache.org/jira/browse/OPENNLP-605
> Project: OpenNLP
> Issue Type: Improvement
> Components: Name Finder
> Affects Versions: tools-1.5.3
> Reporter: WB
> Fix For: 1.6.0
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> I am trying to setup the OpenNLP NameFinder in a project with an XML feature generator descriptor and some non-standard features. The XML descriptor has support for custom feature generators:
> <generators>
> <cache>
> <generators>
> ...
> <custom class="com.example.MyFeatureGenerator"/>
> </cache>
> </generators>
> However, it is not possible to pass parameters to the custom feature generator, and registering new feature generators is currently not possible due to access restrictions in the opennlp.tools.util.featuregen.GeneratorFactory class. Lifting some access restrictions (private to public) would solve the issue.
> See also: http://stackoverflow.com/questions/19375053/using-custom-feature-generators-with-parameters-in-opennlp
--
This message was sent by Atlassian JIRA
(v6.2#6252)