rev2004 / cleartk

Automatically exported from code.google.com/p/cleartk
0 stars 0 forks source link

flag to exclude original features in FeatureFunctionExtractor #389

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'd like to show how one could collect features corresponding to the covered 
text of an annotation after its been lower cased using the 
LowerCaseFeatureFunction.  I would expect that I could use the 
FeatureFunctionExtractor with something like this:

extractor = new FeatureFunctionExtractor<Token>(extractor, new 
LowerCaseFeatureFunction());

But this extractor returns two features for each annotation it is given.  Any 
objections to adding a constructor that includes a boolean that determines 
whether or not to return the original features (in this case the covered text 
feature?)  Should be backwards compatible.

[Steve's Reply]
I object to boolean parameters, since when reading a method
invocation, you never know what "true" or "false" means. If you want
to make an enum, I might be okay with that.

That said, I wonder if you really want to use an extractor here? Why
not just invoke the feature function(s) directly?

Original issue reported on code.google.com by phi...@ogren.info on 27 Oct 2013 at 5:07

GoogleCodeExporter commented 9 years ago
That's a good point.  I think an enum would be fine here.  

To me the scenario above seems very reasonable if you decide that having 
lowercased covered text features only is better than having both the covered 
text features and the lowercased covered text features.  

Original comment by phi...@ogren.info on 27 Oct 2013 at 5:10

GoogleCodeExporter commented 9 years ago
I think I was confused by your "collect features ... after its been lower 
cased". I thought you meant you wanted to apply more FeatureFunctions after the 
lower casing, in which case wrapping it in a FeatureFunctionExtractor seems 
like the wrong thing to do.

I'm okay with adding an enum to the FeatureFunctionExtractor constructor that 
allows for ADD (the current behavior) and REPLACE (your desired behavior).

Original comment by steven.b...@gmail.com on 27 Oct 2013 at 6:46

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 8ed2eb674e12.

Original comment by phi...@ogren.info on 31 Oct 2013 at 5:01