Skip to content

feat: add filter_by method to the ArgillaTrainer #4120

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

Merged

Conversation

plaguss
Copy link
Contributor

@plaguss plaguss commented Nov 2, 2023

Description

This PR adds the functionality to filter by response_status on the ArgillaTrainer:

from argilla import SortBy

trainer = ArgillaTrainer(
    dataset=remote_feedback_dataset,
    task=task,
    framework=framework,
    filter_by={"response_status": ["submitted"]},
    sort_by=[SortBy(field="metadata.my-metadata", order="asc")]
)

Closes #3646 and #4096

Type of change

(Please delete options that are not relevant. Remember to title the PR according to the type of change)

  • New feature (non-breaking change which adds functionality)
  • Refactor (change restructuring the codebase without changing functionality)
  • Improvement (change adding some improvement to an existing functionality)

How Has This Been Tested

(Please describe the tests that you ran to verify your changes. And ideally, reference tests)

  • tests/integration/client/feedback/test_trainer.py::test_trainer_with_filter_by_and_sort_by

Checklist

  • I added relevant documentation
  • I followed 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 (see text above)
  • I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/)

@plaguss plaguss marked this pull request as ready for review November 2, 2023 16:33
@plaguss plaguss changed the title Feat/filter by argilla trainer feat: add filter_by method to the ArgillaTrainer Nov 2, 2023
Copy link

codecov bot commented Nov 2, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

see 269 files with indirect coverage changes

📢 Thoughts on this report? Let us know!.

Copy link
Contributor

@davidberenstein1957 davidberenstein1957 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor remarks. Perhaps we can add the sort_by and could you mention it in the docs too?

@plaguss
Copy link
Contributor Author

plaguss commented Nov 6, 2023

Let's add the docs

@davidberenstein1957 davidberenstein1957 merged commit 34c1644 into argilla-io:develop Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] add filter_by method to the ArgillaTrainer
2 participants