Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.8.3
-
None
-
None
Description
NameFinder provides many kinds of feature generator (factories). Users can define their config via XML which looks like:
<generators> <cache> <generators> <window prevLength = "2" nextLength = "2"> <tokenclass/> </window> <window prevLength = "2" nextLength = "2"> <token/> </window> <definition/> <prevmap/> <bigram/> <sentence begin="true" end="false"/> </generators> </cache> </generators>
If a user wants to implement their own feature generator, he can use <custom .../>, but if he wants to have two or more feature generators at once, he may be able to implement it by providing a wrapper feature generator which wraps two or more feature generators that he originally wants to have, but it is not good.
I'd like to suggest that we make the config format more flexible like below:
<generator class="opennlp.tools.util.featuregen.AggregatedFeatureGeneratorFactory"> <args> <generator class="opennlp.tools.util.featuregen.CachedFeatureGeneratorFactory"> <args> <generator class="opennlp.tools.util.featuregen.AggregatedFeatureGeneratorFactory"> <args> <generator class="opennlp.tools.util.featuregen.WindowFeatureGeneratorFactory"> <args> <int name="prevLength">2</int> <int name="nextLength">2</int> <generator class="opennlp.tools.util.featuregen.TokenClassFeatureGeneratorFactory"/> </args> </generator> <generator class="opennlp.tools.util.featuregen.WindowFeatureGeneratorFactory"> <args> <int name="prevLength">2</int> <int name="nextLength">2</int> <generator class="opennlp.tools.util.featuregen.TokenFeatureGeneratorFactory"/> </args> </generator> </args> </generator> </args> </generator> </args> </generator>
If <args>...</args> is too noisy, I'm thinking another format as well:
<generator class="opennlp.tools.util.featuregen.AggregatedFeatureGeneratorFactory"> <generator class="opennlp.tools.util.featuregen.CachedFeatureGeneratorFactory"> <generator class="opennlp.tools.util.featuregen.AggregatedFeatureGeneratorFactory"> <generator class="opennlp.tools.util.featuregen.WindowFeatureGeneratorFactory"> <int name="prevLength">2</int> <int name="nextLength">2</int> <generator class="opennlp.tools.util.featuregen.TokenClassFeatureGeneratorFactory"/> </generator> <generator class="opennlp.tools.util.featuregen.WindowFeatureGeneratorFactory"> <int name="prevLength">2</int> <int name="nextLength">2</int> <generator class="opennlp.tools.util.featuregen.TokenFeatureGeneratorFactory"/> </generator> </generator> </generator> </generator>
Attachments
Issue Links
- Blocked
-
OPENNLP-1161 avoid using concrete tag names of XML config in GeneratorFactory.extractArtifactSerializerMappings()
- Closed
- blocks
-
OPENNLP-1159 avoid letting users specify AggregatedFeatureGeneratorFactory in XML config
- Resolved
-
OPENNLP-1160 avoid letting users specify CachedFeatureGeneratorFactory in XML config
- Resolved
- links to