inception-project / inception

INCEpTION provides a semantic annotation platform offering intelligent annotation assistance and knowledge management.
https://inception-project.github.io
Apache License 2.0
596 stars 152 forks source link

Accepting recommendations removes previous annotations #2083

Closed david-waterworth closed 3 years ago

david-waterworth commented 3 years ago

Describe the bug Using a span layer (character mode) with a recommender with stacking enabled, accepting a recommendation removes the existing annotation - it appears that the recommendation is not being stacked correctly.

To Reproduce Steps to reproduce the behavior:

Use a NamedEntity Character-level Span layer with Stacking overlap. Use a String Matcher on the value feature Add stacked annotations, to reproduce need a stack consisting of an annotation and a recommendation (see first image below) Accept the annotation, the result is original annotation is overwritten

Expected behaviour Recommendations should stack rather than replace (particularly accepted annotations should not be removed). If there's a (Named Entity) which has been accepted then it probably makes sense to update the value field with the recommended tag. But additional tags should be stacked?

Screenshots If applicable, add screenshots to help explain your problem.

vsd tag has been recomended

image

device tag has been replace with vsd tag

image

Expecting

image

Additional context

When there's are two recommendations they are both displayed, but selecting one removes the other.

Also note the model, device_name and ABB tags are additional context from a read only metadata layer.

Please complete the following information:

reckart commented 3 years ago

Do you have per-label coloring on? If this is using default coloring, it would seem that "vsd" (green) is actually on a completely different layer than "device" and "chilled_water_pump" (yellow).

david-waterworth commented 3 years ago

I'm using "dynamic pastel" So they're on the same layer. The lighter green annotations are on a custom read-only layer which is "static pastel"

reckart commented 3 years ago

So, let's say you have two features and a recommender for each. You'll get one recommendation per feature shown in the UI. If you click the first suggestion, an annotation will be created with the feature set. When you then click the other recommendation, it will be added to the existing annotation, setting the second feature in it.

Let's say you have stacking enabled and you have a existing annotation already. You also have the two recommendations. What would you expect to happen? Would you expect that new annotations are created for each of the suggestions despite them suggesting different features?

david-waterworth commented 3 years ago

Just so I'm clear on terminology I have one NamedEntity layer with a single string feature (value) with overlap set to Stacking only.

So initially the document contains

<type3:NamedEntity xmi:id="1" sofa="1" begin="0" end="6" value="device"/>

The recommender recommends

<type3:NamedEntity begin="0" end="6" value="vsd"/>

I was hoping (with stacking) the result would be

<type3:NamedEntity xmi:id="1" sofa="1" begin="0" end="6" value="device"/>
<type3:NamedEntity xmi:id="2" sofa="1" begin="0" end="6" value="vsd"/>

But instead, it seems to update the value of the existing annotation (I've not actually confirmed that the id is the same, just that the end result is a single entity)

<type3:NamedEntity xmi:id="1" sofa="1" begin="0" end="6" value="vsd"/>

There is a second case I can think of though where what I think is the most logical behaviours is slightly different - so I guess it's complicated.

If we start with a NamedEntity annotation with no value:

<type3:NamedEntity xmi:id="1" sofa="1" begin="0" end="6">

The recommender recommends

<type3:NamedEntity begin="0" end="6" value="vsd"/>

In this case I think it should update the value of the existing annotation

<type3:NamedEntity xmi:id="1" sofa="1" begin="0" end="6" value="vsd">

Having said that I've decided not to progress down the stacking route, at least not initially. I found annotation more complicated.

reckart commented 3 years ago

If there is only a single feature on the annotation, it is straightforward and should be as you describe.

However, if there are multiple features with recommenders, it get more complicated - that is what I was pointing out. Probably try-and-error what works for people and what not.

david-waterworth commented 3 years ago

Yes I see what you mean.