How to ground NamedEntity

2 views
Skip to first unread message

Alain Désilets

unread,
Nov 16, 2019, 9:07:41 AM11/16/19
to dkpro-core-user
I would like to augment NamedEntity annotations with "grounding" information. For example, for a Time annotation, I might want to add a String field 'standardizedTime' which would be the JSON serialization of a Java Date object. For a Location object, I might add Double fields 'lattitude' and 'longitude'.

What would be the best way to do this?

In a past project where I had control over the definition of the NamedEntity type, I simply defined it so it had an  String feature called 'additionalData'. This feature contained the JSON serialization of a Map<String,Object> in which I could put whatever I wanted.

But since I am now using DKPro, I have to use the DKPRo NamedEntity class which does not seem to have a mechanism for augmenting the annotations with arbitrary data.

Any suggestion?

Thx.

Torsten Zesch

unread,
Nov 17, 2019, 1:36:43 PM11/17/19
to dkpro-c...@googlegroups.com
I would suggest to subclass the DKPro NE type.
This derived type then contains all your special features.
Components that don't know about your type, will see it as a standard DKPro NE and your specific components can jcas.select(myNE.class)

-Torsten
--
You received this message because you are subscribed to the Google Groups "dkpro-core-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
dkpro-core-us...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/dkpro-core-user/6c54534e-7314-4adf-95aa-c88b0a9ee51a%40googlegroups.com <https://groups.google.com/d/msgid/dkpro-core-user/6c54534e-7314-4adf-95aa-c88b0a9ee51a%40googlegroups.com?utm_medium=email&utm_source=footer>.

Richard Eckart de Castilho

unread,
Nov 17, 2019, 2:08:14 PM11/17/19
to dkpro-core-user
On 17. Nov 2019, at 19:36, Torsten Zesch <torste...@gmail.com> wrote:
>
> I would suggest to subclass the DKPro NE type.
> This derived type then contains all your special features.
> Components that don't know about your type, will see it as a standard DKPro NE and your specific components can jcas.select(myNE.class)

A problem here might be that the DKPro Core Named Entity recognizer components do not create this type of annotation. Although, you could probable override the type mapping for most components such that they create your custom type instead of the standard types (cf. PARAM_NAMED_ENTITY_MAPPING_LOCATION of NER components).

In principle, you could redefine the DKPro Core Named Entity type in a custom type system XML file. UIMA will pick up both definitions and merge them. This is how you can add custom features to an existing type. However, you either can only access these new features via the CAS interface (e.g. conveniently via uimaFIT FSUtil.get/setFeature(...)) or you'd have to generate your own JCas classes and use them instead of the pre-generated classes provided by DKPro Core.

Cheers,

-- Richard
Reply all
Reply to author
Forward
0 new messages