nlplab / brat

brat rapid annotation tool (brat) - for all your textual annotation needs
http://brat.nlplab.org
Other
1.8k stars 511 forks source link

Type hierarchy not working in defining attributes and limiting argument types. #1152

Open jyuhuan opened 8 years ago

jyuhuan commented 8 years ago

Suppose I have the following annotation configuration file:

[entities]
!Entity
    Animated
    Thing

[relations]

[events]
!Event
    EventSubtypeA   Agent:Event|Entity, Theme:Event|Entity
    EventSubtypeB   Agent:Event|Entity, Theme:Event|Entity, Patient:Event|Entity

[attributes]
IsReal             Arg:Event|Entity, Value:Yes|No

Ideally, with the type hierarchy defined in the [entities] section, all entities (those of type Animated and Thing) should be able to have an IsReal attribute. However, when I select Thing in the New Annotation dialog, the attribute combo box disappears. I worked around this by choosing an attribute (say, IsReal=No) first, and then clicking Thing. In this way, I could successfully annotate the span as a Thing with an IsReal attribute, but at the same time, I would get this:

image

Similarly, with the type hierarchy defined in the [events] section, an annotation of the type EventSubtypeA should be able to have an EventSubtypeB as its Agent argument, since the Agent argument is only required to be of the super-type, Event. However, I failed to create any link from an EventSubtypeA to an EventSubtypeB.

It seems that, even though users are allowed to define a hierarchy of entities or events, the system does not know that a Thing is an Entity, nor does it know that an EventSubtypeA is an Event.

If this is truly not supported, then what is the point of allowing users to define a type hierarchy?

spyysalo commented 8 years ago

Thanks for noting this issue, I agree that's how it should work, but this isn't implemented yet.

The macros <EVENT> and <ENTITY> should provide a workaround for this case, see http://brat.nlplab.org/configuration.html .

bblakely-anl commented 1 year ago

Hello,

I'm curious if this has been addressed since this discussion. I was not able to find anything in the documentation, examples, or open PRs about this otherwise - but perhaps I've overlooked it.

I'm working with a relatively large ontology (biological classifications, organization types, etc) where having to "|" together lists of entity types in the relation definitions is not feasible, and the usability/performance impact of using "\<ENTITY>" is also undesirable. Is there any way to indicate "This Entity and All Children" in a relation definition?

Thank you!