Open GoogleCodeExporter opened 8 years ago
These issues are candidates for version 1.3.0.
Original comment by richard.eckart
on 7 May 2011 at 5:31
Original comment by richard.eckart
on 4 Jan 2012 at 10:51
I think I understand better now what this issue means for ClearTK. I am not
sure though what I should think about your approach. It seems to me that UIMA's
External Resources might be a better approach. Have you ever considered that?
Original comment by richard.eckart
on 4 Jan 2012 at 10:57
I'm not sure how External Resources would solve this problem. Let me give you
an example, and maybe you can elaborate.
A CleartkAnnotator has a parameter, dataWriterFactoryClassName, which specifies
a class that allows you to configure whether you want SVMlight-style data,
Mallet-style data, OpenNLP-style data, etc. CleartkAnnotator reads that
parameter, and creates the class from it via uimaFIT's
InitializableFactory.create, which calls initialize on the data writer factory
object passing it the UimaContext. This call to initialize is crucial because,
for example, the libSVM data writer takes a cutoff parameter (which trims
low-frequency features) that it reads from the UimaContext. So there's no way
to tell from CleartkAnnotator.class that the data writer factory is going to
take some additional parameters.
How would you solve this problem using External Resources?
Original comment by steven.b...@gmail.com
on 6 Jan 2012 at 1:27
Currently I would write something like this in ClearTK:
createPrimitiveDescription(
ExamplePosAnnotator.class,
ExamplePosAnnotator.PARAM_DATA_WRITER_FACTORY_CLASS_NAME, ViterbiDataWriterFactory.class.getName(),
ViterbiDataWriterFactory.PARAM_OUTPUT_DIRECTORY, modelDir.getAbsolutePath(),
ViterbiDataWriterFactory.PARAM_DELEGATED_DATA_WRITER_FACTORY_CLASS, DefaultMaxentDataWriterFactory.class.getName());
When using external resources, you would write it like this:
createPrimitiveDescription(
ExamplePosAnnotator.class,
ExamplePosAnnotator.PARAM_DATA_WRITER_FACTORY, createExternalResourceDescription(
ViterbiDataWriterFactory.class,
ViterbiDataWriterFactory.PARAM_OUTPUT_DIRECTORY, modelDir.getAbsolutePath(),
ViterbiDataWriterFactory.PARAM_DELEGATED_DATA_WRITER_FACTORY, createExternalResourceDescription(
DefaultMaxentDataWriterFactory.class.getName())));
Mind though that the latter form uses nested external resources that are
currently not supported in this form by uimaFIT at this moment, but will be
once issue 109 is complete. I have a working prototype already.
With the current version of uimaFIT in trunk (revision 721) only the following
form without the nested createExternalResourceDescription() would be possible:
createPrimitiveDescription(
ExamplePosAnnotator.class,
ExamplePosAnnotator.PARAM_DATA_WRITER_FACTORY, createExternalResourceDescription(
ViterbiDataWriterFactory.class,
ViterbiDataWriterFactory.PARAM_OUTPUT_DIRECTORY, modelDir.getAbsolutePath(),
ViterbiDataWriterFactory.PARAM_DELEGATED_DATA_WRITER_FACTORY_CLASS, DefaultMaxentDataWriterFactory.class.getName()));
Original comment by richard.eckart
on 7 Jan 2012 at 9:34
And with the external resource descriptions, you could tell if the user forgot
to specify ViterbiDataWriterFactory.PARAM_DELEGATED_DATA_WRITER_FACTORY_CLASS?
Assuming so, is there any way we (ClearTK) can easily support both syntaxes for
backwards compatibility? We'd then deprecate the old syntax and anyone still
using it would also get the warning you've proposed here, and encourage
everyone to use the new syntax.
Original comment by steven.b...@gmail.com
on 12 Jan 2012 at 2:20
Checking if the user forgot to specify a parameter is a different check than
the one suggested in this issue. Checking for presence of settings is normally
done by UIMA itself when the component is instantiated. uimaFIT would only need
to do that if UIMA itself would not already throw an error at instantiation
time. It is a check that cannot be done when creating a descriptor, because
the the parameters or resource bindings of the descriptor might still be
changed after it has been created.
Regarding to support both syntaxes: in principle yes, but that would disable
the checking if the user has forgotten to specify a resource, because all the
resources would need to be declared as optional - they might not be present if
a user chooses to use the current syntax instead of the external resources.
Original comment by richard.eckart
on 12 Jan 2012 at 8:49
So basically if we went the backwards compatibility route, we'd get warnings
from uimaFIT if the user specified a parameter that didn't apply to the
annotator or any of its external resources, but we'd lose the UIMA errors for a
missing required parameter (so we'd have to manually inspect the two variables
and throw an appropriate exception in initialize). Is that right?
Original comment by steven.b...@gmail.com
on 12 Jan 2012 at 2:51
Original comment by richard.eckart
on 7 Jan 2013 at 4:51
Original issue reported on code.google.com by
pvogren@gmail.com
on 1 May 2010 at 3:01