Skip to content

#5113 - Recommendations for multi-value features on document-level annotations broken#6010

Merged
reckart merged 2 commits into
release/40.xfrom
bugfix/5113-Recommendations-for-multi-value-features-on-document-level-annotations-broken
May 6, 2026
Merged

#5113 - Recommendations for multi-value features on document-level annotations broken#6010
reckart merged 2 commits into
release/40.xfrom
bugfix/5113-Recommendations-for-multi-value-features-on-document-level-annotations-broken

Conversation

@reckart
Copy link
Copy Markdown
Member

@reckart reckart commented May 5, 2026

What's in the PR

  • Rewrote MetadataSuggestionSupport.hideSpanSuggestionsThatMatchAnnotations to read existing feature values via FeatureSupportRegistry and iterate over Iterable values, so multi-valued features (e.g. StringArray) are properly compared against suggestion labels instead of falling through getFeatureValueAsString and never matching.
  • Injected FeatureSupportRegistry into MetadataSuggestionSupport and wired it through DocumentMetadataLayerSupportAutoConfiguration.
  • Added MetadataSuggestionVisibilityCalculationTest covering single-value match/no-match, singleton hide-all, learning-record rejection, and the previously broken multi-value match/no-match cases.
  • Updated MetadataSuggestionExtractionTest and added inception-feature-string test dependency for the new visibility test.

How to test manually

  • See issue description

Automatic testing

  • PR includes unit tests

Documentation

  • PR updates documentation

@reckart reckart added this to the 40.4 milestone May 5, 2026
@reckart reckart self-assigned this May 5, 2026
@reckart reckart added the 🐛 Bug Something isn't working label May 5, 2026
@reckart reckart added this to Kanban May 5, 2026
@github-project-automation github-project-automation Bot moved this to 🔖 To do in Kanban May 5, 2026
@reckart reckart requested a review from Copilot May 5, 2026 19:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to fix recommendation visibility for document-level metadata when the target feature is multi-valued (e.g. StringArray), so suggestions whose labels already exist in the annotation are properly hidden.

Changes:

  • Refactors MetadataSuggestionSupport.hideSpanSuggestionsThatMatchAnnotations to read values via FeatureSupportRegistry and compare against iterable feature values.
  • Wires FeatureSupportRegistry into MetadataSuggestionSupport and its Spring auto-configuration.
  • Adds/updates unit tests to cover visibility behavior for single- and multi-valued metadata features.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
inception/inception-layer-docmetadata/src/test/java/de/tudarmstadt/ukp/inception/annotation/layer/document/recommender/MetadataSuggestionVisibilityCalculationTest.java Adds focused unit tests for suggestion visibility, including multi-value cases.
inception/inception-layer-docmetadata/src/test/java/de/tudarmstadt/ukp/inception/annotation/layer/document/recommender/MetadataSuggestionExtractionTest.java Updates test wiring for the new MetadataSuggestionSupport constructor dependency.
inception/inception-layer-docmetadata/src/main/java/de/tudarmstadt/ukp/inception/annotation/layer/document/recommender/MetadataSuggestionSupport.java Implements multi-value-aware matching via FeatureSupportRegistry and updates constructor.
inception/inception-layer-docmetadata/src/main/java/de/tudarmstadt/ukp/inception/annotation/layer/document/config/DocumentMetadataLayerSupportAutoConfiguration.java Injects FeatureSupportRegistry into the MetadataSuggestionSupport bean.
inception/inception-layer-docmetadata/pom.xml Adds inception-feature-string as a test dependency to support new tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@reckart reckart force-pushed the bugfix/5113-Recommendations-for-multi-value-features-on-document-level-annotations-broken branch from 2c7054d to ba3c25f Compare May 6, 2026 05:39
…notations broken

- Rewrote `MetadataSuggestionSupport.hideSpanSuggestionsThatMatchAnnotations` to read existing feature values via `FeatureSupportRegistry` and iterate over `Iterable` values, so multi-valued features (e.g. `StringArray`) are properly compared against suggestion labels instead of falling through `getFeatureValueAsString` and never matching.
- Injected `FeatureSupportRegistry` into `MetadataSuggestionSupport` and wired it through `DocumentMetadataLayerSupportAutoConfiguration`.
- Added `MetadataSuggestionVisibilityCalculationTest` covering single-value match/no-match, singleton hide-all, learning-record rejection, and the previously broken multi-value match/no-match cases.
- Updated `MetadataSuggestionExtractionTest` and added `inception-feature-string` test dependency for the new visibility test.
@reckart reckart force-pushed the bugfix/5113-Recommendations-for-multi-value-features-on-document-level-annotations-broken branch from ba3c25f to 755bbbe Compare May 6, 2026 18:36
@reckart reckart requested a review from Copilot May 6, 2026 18:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

…notations broken

- Return early from `hideSpanSuggestionsThatMatchAnnotations` when there are no suggestions or no annotations
- Short-circuit singleton mode with a single `hideAll` per suggestion group, skipping the feature-support lookup and per-value iteration
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

@reckart reckart merged commit a29fcc7 into release/40.x May 6, 2026
8 checks passed
@reckart reckart deleted the bugfix/5113-Recommendations-for-multi-value-features-on-document-level-annotations-broken branch May 6, 2026 19:24
@github-project-automation github-project-automation Bot moved this from 🔖 To do to 🍹 Done in Kanban May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 🍹 Done

Development

Successfully merging this pull request may close these issues.

2 participants