On Sat, Dec 15, 2018 at 1:15 PM Marshall Schor <m...@schor.com> wrote:
> I guess the question is why have a new type? The answer to that could > motivate > what properties the solution should have. > > What you propose is fine, but in some ways is not a new type, in that it > doesn't > seem to have many of the properties UIMA types have. > If that is OK in your application, then that's fine. > I guess I didn't make that explicit, but I was thinking that DynamicallyTypedAnnotation would be a subclass of Annotation. So it would inherit all the properties and capabilities of Annotation. > > > If not, please say more about what properties of types you want to > have, > that this approach might not satisfy. > Well, basically I want to be able to new types that have new attributes at runtime, without having to recompile the code. I also want the ability to select annotations based on the type name, without having to recompile the code. The reason I need this is that I am building a web app that will allow non-dev users to train models to recognize new types of entities, without having to write java code. Maybe this is already possible with UIMA, but all the examples I have seen where new types are defined involves writing XML code and using Eclipse to recompile the app. In my context, this sounds impractical because the app would have to somehow recompile and redeploy itself on Tomcat (and I don't even know if that's possible). With the approach I propose, the user would just provide a name for the new type, as well as a list of attribute names. The system would then create instances of the new type like this: HashMap<String,Object> attrs = new HashMap<String,Object>() attrs.put("attName1" null); .... attrs.put("attNameN" null); DynamicTypedAnnotation ann = new DynamicTypedAnnotation(typeName, attrs) Alain >