argilla-io / argilla

Argilla is a collaboration tool for AI engineers and domain experts to build high-quality datasets
https://docs.argilla.io
Apache License 2.0
3.91k stars 368 forks source link

define a more abstract and flexible implementation of `token-attribution` #2321

Closed davidberenstein1957 closed 11 months ago

davidberenstein1957 commented 1 year ago

Is your feature request related to a problem? Please describe. Currently, token attributions can only be set with a fixed color and opacity based on the score between -1(red) and 1 (blue).

Describe the solution you'd like OLD

TokenAttributions(
     token="good", attributions={"label": "ENTITY_NAME"}
)

NEW I would like to see something like, where the label is shown on hover.

TokenAttributions(
     token="good", attributions={"label": "ENTITY_NAME", "opacity": 0.5, "color": "#FFFFFF"}
)

Describe alternatives you've considered Only using red and blue.

Additional context N.A.

tomaarsen commented 1 year ago

Is there any motivation for not going for the following signature?

TokenAttributions(
     token="good", label="ENTITY_NAME", opacity=0.5, color="#FFFFFF"
)

This ought to have better usability due to IDE autocompletions/suggestions.

davidberenstein1957 commented 1 year ago

@tomaarsen that suggestion is even better.

davidberenstein1957 commented 1 year ago

Perhaps this needs some additional review in general because it feels a bit buggy.

For some reason, by providing attributions without label that matches the prediction, records are visible without any text. @dvsrepo was it supposed to be the case that each label could have its own attributions? This doesn't seem to work within the UI.

image

from the UI, maybe it would be possible to show something like

image
davidberenstein1957 commented 1 year ago

Okay, it currently only works if the first label align with the token attribution label for some reason.

image

image

dvsrepo commented 1 year ago

@frascuchon can give more details about the data model. I think it was more or less prepared in terms of data model to be able to define attributions for each predicted class in the multi-label setting. But this was not at all supported by the UI. In the UI the assumption is: you provide a predicted class (single-label, multiclass scenario), and you add the attributions for that predicted class. If you don't put the attribution for the predicted class is buggy. I was fighting with this a few days ago.

This feature would benefit from a full revision

dvsrepo commented 1 year ago

Okay, it currently only works if the first label align with the token attribution label for some reason.

image

image

I think in the UI the logic is looking at the predicted_as field which is a computed field from the predictions and in the single-label scenario is that with the highest score, and maybe just the first predicted label if all are zero But I could be wrong :-) and it's confusing

davidberenstein1957 commented 1 year ago

Yes the assigned labels are only shown for the highest corresponding prediction score.

davidberenstein1957 commented 1 year ago

@jfcalvo @frascuchon these are the highlight discussed/mentioned during the feedback task discussion

davidberenstein1957 commented 1 year ago

https://github.com/argilla-io/argilla/issues/2785

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] commented 11 months ago

This issue was closed because it has been inactive for 30 days since being marked as stale.