unitxt icon indicating copy to clipboard operation
unitxt copied to clipboard

Suggestion: Add notion of SubTask

Open elronbandel opened this issue 1 year ago • 1 comments

Today we have tasks such as tasks.classification.mutli_class that are very general by using things like: class_type then we can have sentiment and emotion classification under the same task by using AddFields(fields={"class_type":"sentiment") for sentiment for example.

I suggest to add a concept of SubTask that is also a Task but can be made by filling fields of the Task it inherits from.

For example tasks.classification.mutli_class.sentiment_extraction:

SubTask(parent="tasks.classification.mutli_class", with={"class_type": "sentiment"})

That way you can enjoy both worlds: (1) have very general tasks with templates that can fit many tasks (2) when needed you can create specific template for specific tasks.

elronbandel avatar Mar 20 '24 12:03 elronbandel

I think different tasks have both different defaults and different field names. It's a question of whether adding a new concept will have a significant advantage over just reusing the basic building blocks (metrics, templates classes, post processors).

In general, I think tasks should have the options for default field names (e.g. "text_type": "text")

yoavkatz avatar Mar 20 '24 13:03 yoavkatz