Skip to content

fix(analyzer): allow GLiNER labels to be scoped per recognizer#2154

Open
ultramancode wants to merge 1 commit into
data-privacy-stack:mainfrom
ultramancode:fix/gliner-requested-labels
Open

fix(analyzer): allow GLiNER labels to be scoped per recognizer#2154
ultramancode wants to merge 1 commit into
data-privacy-stack:mainfrom
ultramancode:fix/gliner-requested-labels

Conversation

@ultramancode

Copy link
Copy Markdown
Contributor

Change Description

When multiple GLiNERRecognizer instances use different entity_mapping values and thresholds, entities from an analyze request are currently added as ad-hoc labels to every selected GLiNER recognizer.

As a result, an entity can pass the threshold of a recognizer that was not configured to handle it.

This change adds an include_requested_entities_as_labels option to GLiNERRecognizer and its YAML configuration.
The option defaults to true to preserve the existing behavior. When set to false, only the recognizer's configured GLiNER labels are sent to the model.

Issue reference

Related to #1760, specifically the runtime threshold edge case and backward-compatible opt-out proposed by @hexsm
in this comment.

Checklist

  • I have reviewed the contribution guidelines
  • I agree to follow this project's Code of Conduct
  • I confirm that I have the right to submit this contribution and that it does not knowingly contain proprietary or confidential code.
  • My code includes unit tests
  • All unit tests and lint checks pass locally
  • My PR contains documentation updates / additions if required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant