Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for link feature recommendations #4491

Closed
jvdzwaan opened this issue Dec 21, 2023 · 7 comments
Closed

Support for link feature recommendations #4491

jvdzwaan opened this issue Dec 21, 2023 · 7 comments
Assignees
Labels
Milestone

Comments

@jvdzwaan
Copy link

I'm trying to create a recommender for measurements. In our data model, we have layers Measurement and Measurementpart that are linked with a MeasurementPartLink. A measurement has a feature parts, which points to an array of MeasurementPartLinks.

Example:

w.c.Measurement(
    begin=3, 
    end=12, 
    parts=u.c.FSArray(
        elements=[
            webanno_custom_MeasurementPartsLink(
                xmiID=16159, 
                role='value', 
                target=webanno_custom_Measurementpart(
                    xmiID=16038, 
                    begin=17, 
                    end=19, 
                    type=Type(name=webanno.custom.Measurementpart)
                ), 
                type=Type(name=webanno.custom.MeasurementPartsLink)
            )
        ]
    ), 
) 

Is it possible to create a recommender that makes recommendations like this? If so, do you have an example of how to do this?

I created a a hard-coded example that seems to produce the correct data structure (no errors from inception), but it doesn't show up as recommendation in inception.

@reckart
Copy link
Member

reckart commented Dec 21, 2023

Span recommendations are best supported and relation recommendations are somewhat supported. I'm also looking into document-level annotation recommendations atm. However, link-feature recommendations are not supported at all atm. But it is a good point - it would be good to at least open an issue for supporting these in INCEpTION (won't be easy though - so unlikely something to be added soon).

@reckart
Copy link
Member

reckart commented Dec 21, 2023

However, in any case, the recommendation system is currently designed so that every recommender can only predict a single feature on a single layer.

You might be able to model this using multiple recommenders - one for the spans and another one for a relation between the spans. But the spans would need to be on the same layer (no cross-layer relations atm) and the relation would need to be a proper relation layer - not a link feature.

@jvdzwaan
Copy link
Author

Thank you for the very fast response!

If I understand you correctly, we might be able to make it work by changing the data model from link based to relation based. I'll look into that.

I could also open an issue in INCEpTION for supporting link based recommendations, but if cross layer is not possible, I'm not sure how useful that would be. I'll start with doing a bit more research.

@reckart
Copy link
Member

reckart commented Dec 21, 2023

Link features can go across layers - but they are tricky to support in the recommender system atm.

Relations cannot go across layers atm.

@reckart reckart transferred this issue from inception-project/inception-external-recommender Feb 1, 2024
@reckart reckart self-assigned this Feb 1, 2024
@reckart reckart added this to the 31.0 milestone Feb 1, 2024
@reckart
Copy link
Member

reckart commented Feb 1, 2024

@jvdzwaan I have moved the issue from the external recommender module to INCEpTION itself.

@jvdzwaan
Copy link
Author

jvdzwaan commented Feb 2, 2024

Thank you!

@reckart reckart changed the title Recommender for more complex annotations such as measurements Support for link feature recommendations Feb 4, 2024
reckart added a commit that referenced this issue Feb 4, 2024
- Allow recommenders to generate suggestions for link features
- Added unit tests
reckart added a commit that referenced this issue Feb 4, 2024
- Allow recommenders to generate suggestions for link features
- Added unit tests
reckart added a commit that referenced this issue Feb 4, 2024
…for-link-feature-recommendations

#4491 - Support for link feature recommendations
@reckart reckart closed this as completed Feb 4, 2024
reckart added a commit that referenced this issue Feb 5, 2024
* main:
  #4377 - Configure include and exclude patterns for logged events
  #4491 - Support for link feature recommendations
  #4495 - Error marker on annotations with required multi-value features is missing
  No issue: Fix layout
  #4377 - Configure include and exclude patterns for logged events
  #4377 - Configure include and exclude patterns for logged events
  #4377 - Configure include and exclude patterns for logged events
  #4493 - Present project templates to new users who do not have a project yet
  #4377 - Configure include and exclude patterns for logged events
  #4377 - Configure include and exclude patterns for logged events
  #4377 - Configure include and exclude patterns for logged events
  #4377 - Configure include and exclude patterns for logged events
  #4377 - Configure include and exclude patterns for logged events
  #4377 - Configure include and exclude patterns for logged events
  #4377 - Configure include and exclude patterns for logged events

% Conflicts:
%	inception/inception-ui-dashboard/src/main/java/de/tudarmstadt/ukp/inception/ui/core/dashboard/projectlist/ProjectsOverviewPage.java
@reckart
Copy link
Member

reckart commented Feb 5, 2024

@jvdzwaan This will be included in v31. Note though that in order for a link recommendation to appear in the UI, the annotation that has the slot feature as well as the slot filler already need to be present as proper annotations in the document. Only then the link between the two will be shown as a suggestion that can be accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

2 participants