-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat: Cache Labels for Taxonomy #7383
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
base: develop
Are you sure you want to change the base?
Conversation
👷 Deploy request for heartex-docs pending review.Visit the deploys page to approve it
|
👷 Deploy request for label-studio-docs-new-theme pending review.Visit the deploys page to approve it
|
✅ Deploy Preview for label-studio-storybook canceled.
|
In discussions with Max, it was determined that displaying just the leaf node of a selected taxonomy was not always desirable, as important information about taxonomic hierarchy paths can be lost. I've made an update such that cache_labels will match the formatting schema of the given Taxonomy tag's labeling interface Now Defaults are respected, so And all defaults, ie a basic Defaults are hardcoded and come from Label Interface Taxonomy Params . If the taxonomy control tag is a Custom control tag, naturally it will not have any Labeling Interface configuration to specify its formatting. In this case, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
label_studio/data_manager/actions/cache_labels.py:73
- [nitpick] Consider renaming 'showFullPath' to 'show_full_path' and 'pathSeparator' to 'path_separator' for consistency with Python naming conventions.
showFullPath = 'true'
new commit: I've pre-loaded the label interface tags prior to the tasks and annotations loops. The project's label interface control tags are easily accessible via dict now, should be orders of magnitude more efficient. |
Hey @makseq , I tried following your steps above to setup the situation you described above, but I find myself unable to remove So unfortunately I am unable to test the situation you describe. That said, I think my implementation still works as intended and I am not convinced the label interface config needs to be rechecked on-the-fly. If an annotation is not present in the Have you tested my code against the situation you describe and found it to fail? If yes, I'd love a snapshot of the issue because I can't reproduce your scenario. Also, I'm not sure how the situation you describe above relates to rechecking the label interface config on-the-fly. |
@sbatchelder yes, this situation is not very often and it's a bit tricky to reproduce it. Maybe we can ignore it. I am going to run pytests for it tomorrow. If they pass, we can merge it. |
Could you please merge the latest develop to your branch? It should fix pytests |
Also, you need to fix Linter. To do this, run:
|
See issue #7382
This fix allows for the value(s) of Taxonomy annotations to be displayed by the experimental Cache Labels feature.
Prior to this PR, Cache Labels would create an all-blank column when applied to a Control Tag for a Taxonomy annotation.
With this PR, values selected in a Taxonomy annotation are correctly displayed.
The issue arose from Taxonomy annotation values being returned as a list, as opposed to a str. For Taxonomy type annotations, a list is required for each selected element so as to capture the hierarchical path taken for any given value in a taxonomy tree. In this PR, consideration was taken so as to only show the selected value, and not capture parts of the path leading up to the selected value. One or more selected values, as well as leaf and intermediate/branch values are supported but this fix.
This is a very simple, very small, low risk PR. It is also my first PR with Label Studio, yay!
My thanks to @makseq who pointed me towards the
cache_labels.py
file lines most likely responsible for the blank-taxonomy-cache-labels bug.