Skip to content
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

Added defaults to tasks #921

Merged
merged 7 commits into from
Jun 24, 2024
Merged

Added defaults to tasks #921

merged 7 commits into from
Jun 24, 2024

Conversation

pawelknes
Copy link
Collaborator

Added a new field to the Task class named defaults which sets default values of an instance for chosen fields in both inputs and outputs.

For #893 issue and discussions in #908

Signed-off-by: Paweł Knes <pawel.knes@ibm.com>
Copy link
Member

@yoavkatz yoavkatz left a comment

Choose a reason for hiding this comment

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

@pawelknes - can you also make some changes to actual tasks so they work with only needed data (such as "text_type" should default to "text", "text_a_type" should default to "first text" , "text_a_type" should default to "second text")

Then you can also remove the default from the actual cards.

unitxt/prepare/tasks/classification.py
unitxt/prepare/tasks/generation.py
unitxt/prepare/tasks/rewriting.py

@pawelknes
Copy link
Collaborator Author

@pawelknes - can you also make some changes to actual tasks so they work with only needed data (such as "text_type" should default to "text", "text_a_type" should default to "first text" , "text_a_type" should default to "second text")

Then you can also remove the default from the actual cards.

unitxt/prepare/tasks/classification.py unitxt/prepare/tasks/generation.py unitxt/prepare/tasks/rewriting.py

I've added default values you mentioned as well as some others which I found quite common across different cards

Copy link
Member

@elronbandel elronbandel left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Copy link
Member

@yoavkatz yoavkatz left a comment

Choose a reason for hiding this comment

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

Hi @pawelknes - I think in some cases , we can not add defaults although they are the common values (defaults, should make sense in all cases). See details in the comments below.

Signed-off-by: Paweł Knes <pawel.knes@ibm.com>
Signed-off-by: Paweł Knes <pawel.knes@ibm.com>
Removed default topic as "type_of_class"
Signed-off-by: Paweł Knes <pawel.knes@ibm.com>
@pawelknes pawelknes merged commit 6b1d93d into main Jun 24, 2024
8 checks passed
@pawelknes pawelknes deleted the adding-defaults-to-tasks branch June 24, 2024 09:13
gitMichal pushed a commit that referenced this pull request Jul 15, 2024
* Added defaults to tasks

Signed-off-by: Paweł Knes <pawel.knes@ibm.com>

* added common defaults to card definitions

Signed-off-by: Paweł Knes <pawel.knes@ibm.com>

* Added missing json files

Signed-off-by: Paweł Knes <pawel.knes@ibm.com>

* Update prepare/tasks/classification.py

Removed default topic as "type_of_class"

* updated json file

Signed-off-by: Paweł Knes <pawel.knes@ibm.com>

---------

Signed-off-by: Paweł Knes <pawel.knes@ibm.com>
Co-authored-by: Yoav Katz <68273864+yoavkatz@users.noreply.github.com>
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.

3 participants