-
Notifications
You must be signed in to change notification settings - Fork 399
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
[FEATURE] Add score attribute for suggestions associated to a multi label question #4638
Comments
To accommodate the proposed feature of adding a SDK Modifications
class MultiLabelQuestion(_LabelQuestion):
# Existing attributes...
scores: Optional[Dict[str, float]] = None
@property
def server_settings(self) -> Dict[str, Any]:
settings = super().server_settings
if self.scores:
settings["scores"] = self.scores
return settings
UI Modifications
Considerations
These modifications will enable the Argilla SDK and UI to support the new feature of adding scores to suggestions for For reference, the current structure of the class MultiLabelQuestion(_LabelQuestion):
"""Schema for the `FeedbackDataset` label questions, which are the ones that will
require a label response from the user. This class should be used when the user can
select multiple labels.
Args:
type: The type of the question. Defaults to 'multi_label_selection' and
cannot/shouldn't be modified.
labels: The list of labels of the label question. The labels must be unique, and
the list must contain at least two unique labels. Additionally, `labels` can
also be a dictionary of labels, where the keys are the labels, and the values
are the labels that will be shown in the UI.
visible_labels: The number of visible labels in the UI. Defaults to 20, and must
be 3 or greater.
Examples:
>>> from argilla.client.feedback.schemas.questions import MultiLabelQuestion
>>> MultiLabelQuestion(name="multi_label_question", title="Multi Label Question", labels=["label_1", "label_2"])
"""
type: Literal[QuestionTypes.multi_label_selection] = Field(
QuestionTypes.multi_label_selection.value, allow_mutation=False
) You can find the source code for this class in the Argilla repository. Sources
|
…` and add a missing cardinality validation for value and score attributes (#111) # Description This PR move all suggestion `score` validations to `SuggestionCreateValidator` and add a new one checking that `value` and `score` attributes have the same cardinality. The additional validation will raise an error when a suggestion have a single item inside `value` attribute and a list of items inside `score`. Refs argilla-io/argilla#4638 **Type of change** (Please delete options that are not relevant. Remember to title the PR according to the type of change) - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Refactor (change restructuring the codebase without changing functionality) - [x] Improvement (change adding some improvement to an existing functionality) - [ ] Documentation update **How Has This Been Tested** (Please describe the tests that you ran to verify your changes. And ideally, reference `tests`) - [x] Adding new tests. **Checklist** - [ ] I added relevant documentation - [ ] follows the style guidelines of this project - [ ] I did a self-review of my code - [ ] I made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK) (see text above) - [ ] I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/)
# Description PR with changes for suggestion multi-score support. Refs argilla-io/argilla#4638 **Type of change** (Please delete options that are not relevant. Remember to title the PR according to the type of change) - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Refactor (change restructuring the codebase without changing functionality) - [ ] Improvement (change adding some improvement to an existing functionality) - [ ] Documentation update **How Has This Been Tested** (Please describe the tests that you ran to verify your changes. And ideally, reference `tests`) - [ ] Test A - [ ] Test B **Checklist** - [ ] I added relevant documentation - [ ] follows the style guidelines of this project - [ ] I did a self-review of my code - [ ] I made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK) (see text above) - [ ] I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/)
# Description A small fix causing integration tests to fail. The score validation was not checking that value was also a list so we are adding that check. Refs #4638 **Type of change** (Please delete options that are not relevant. Remember to title the PR according to the type of change) - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Refactor (change restructuring the codebase without changing functionality) - [ ] Improvement (change adding some improvement to an existing functionality) - [ ] Documentation update **How Has This Been Tested** (Please describe the tests that you ran to verify your changes. And ideally, reference `tests`) - [ ] Integration tests should be passing. **Checklist** - [ ] I added relevant documentation - [ ] follows the style guidelines of this project - [ ] I did a self-review of my code - [ ] I made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK) (see text above) - [ ] I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/)
For the new feature adding support for span questions we will give support to specify a
score
for suggestions associated to a span question.For that we are following the next format (PUT to upsert a suggestion):
For this issue we should add
score
attribute for suggestions associated to amulti_label_selection
question too. With this change users can specify ascore
value for every label inside the suggestion.Additional points to research/discuss:
Tasks
The text was updated successfully, but these errors were encountered: