fix: LICENSE resolves to a single entity in the hierarchy (#199) - #207
Merged
Merged
Conversation
…cy-stack#199) LICENSE was defined twice: a canonical leaf under EMPLOYMENT and an alias of GOVERNMENT_ID > PROFESSIONAL_LICENSE. The alias won the raw->canonical map while to_branch() saw the leaf first, so one label reported two branches - and add_alias("LICENSE", x) attached aliases to the EMPLOYMENT leaf while canonicalize() sent them to GOVERNMENT_ID. A license is a government-issued ID: drop the EMPLOYMENT leaf so LICENSE resolves to PROFESSIONAL_LICENSE under GOVERNMENT_ID in every lookup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LICENSEis defined twice in the entity hierarchy: as a leaf underEMPLOYMENT, and as an alias ofGOVERNMENT_ID>PROFESSIONAL_LICENSE. The two lookups disagree, socanonicalize("LICENSE")returns
PROFESSIONAL_LICENSEwhileto_branch("LICENSE")returnsEMPLOYMENT, and which one acaller gets depends on which function it happens to use.
The
EMPLOYMENTleaf is removed frompresidio_evaluator/entity_mapping/definitions.py.PROFESSIONAL_LICENSEunderGOVERNMENT_IDis the better home: it is where the alias alreadypointed, and a professional license is an identifier issued by an authority rather than an employment
attribute.
This changes evaluation results for datasets annotated with a
LICENSElabel, which now score againstthe
GOVERNMENT_IDbranch. That is the point of the fix rather than a side effect, so it is calledout in the changelog rather than left to be discovered.
docs/mapping_scenarios.mddrops theLICENSErow from its table of duplicate aliases, since it isno longer one. The remaining rows there are other instances of the same class and are not touched
here.
Fixes #199