Skip to content

Releases: IBM/unitxt

Unitxt 1.7.0

05 Mar 14:11
Compare
Choose a tag to compare

What Changed in Unitxt 1.7.0

This release introduces a few significant changes that modify existing conventions:

  1. Instructions renamed to system_prompts

This means that from now on, to define a new system-level instruction, you can use this code:

system_prompt = TextualSystemPrompt( # <<<< Class name has changed
    "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n"
)

add_to_catalog(system_prompt, "system_prompts.models.alpaca", overwrite=True) # <<<< Catalog name has changed

It also means that all the system-level instructions were moved to the catalog under system_prompts instead of instructions.
This change is breaking old instruction but was necassry to enable the next very useful change.

  1. Templates can now (1) generate task specific instruction once at the head of the example, and (2) can add few words the model will say before the models' final prediction

This change was requested by many pepole.

For example here in this COLA dataset example:

User: Classify the grammatical acceptability of the following text to one of these options: unacceptable, acceptable. text: Fred watered the plants flat.
Agent: acceptable

User: Classify the grammatical acceptability of the following text to one of these options: unacceptable, acceptable. text: The pond froze solid.
Agent:

The instruction "Classify the ..." is reapted for every demonstration. Also with the current template there is no way to put few words that the agent will say before the prediciton for instance: "Agent: The class is ". With the new changes both of these important features are enabled.

If the old way for defining tempaltes for classification was:

add_to_catalog(
    InputOutputTemplate(
        input_format="Classify the {type_of_class} of the following {text_type} to one of these options: {classes}. {text_type}: {text}",
        output_format="{label}",
    ),
    "templates.classification.multi_class.default_no_instruction",
    overwrite=True,
)

It is now defined this way:

add_to_catalog(
    InputOutputTemplate(
        input_format="{text_type}: {text}", # <<<< Changed
        output_format="{label}",
        target_prefix="The {type_of_class} is ", # <<<< Added
        instruction="Classify the {type_of_class} of the following {text_type} to one of these options: {classes}.\n", # <<<< Added
    ),
    "templates.classification.multi_class.instruction",
    overwrite=True,
)

The new template fields instruction and target_prefix will produce this example:

Classify the grammatical acceptability of the following text to one of these options: unacceptable, acceptable.

User: text: Fred watered the plants flat.
Agent: The grammatical acceptability is acceptable

User: text: The pond froze solid.
Agent: The grammatical acceptability is

Notice how the instruction appears only once, and the target prefix is appearing after the 'Agent:'.

Read more in the tutorial on preparing templates.

  1. Loading from catalog with modifications

Now you can load an item from the catalog and change its fields. For example, if you want to use a task but with a different metric, you can use this syntax:

card = TaskCard(
    loader=LoadHF(path="glue", name="cola"),
    preprocess_steps=[...],
    task="tasks.classification.multi_class[metrics=[metrics.matthews_correlation]]", # <<<< Modified
    templates="templates.classification.multi_class.all",
)

add_to_catalog(card, "cards.cola", overwrite=True)

Read more in the tutorial on loading from the catalog.

  1. Renaming of additional_inputs to task_data

In an effort to more accurately represent the origin of certain fields within our system, we've renamed the additional_inputs parameter to task_data. This modification underscores the fact that these fields are derived directly from the task definition itself. This change is crucial for maintaining the integrity and reliability of metrics, as it ensures these fields are validated against the task schema. Consequently, developers crafting metrics for specific tasks can effortlessly ascertain which fields are accessible to them by simply referring to the task schema. This alignment between task definitions and metrics development fosters a more intuitive and efficient workflow for unitxt contributors.

Release Changes

BugFixes:

New Assets:

Enhancments

  • Tests can be done now also on PRs from forks. by @elronbandel in #537 #538
  • Show artifact class details in the documentation. by @dafnapension in #528
  • UI improvements by @Roni-Friedman in #541
  • Update README.md by @eltociear in #540
  • Add artifact_identifier to Artifact objects loaded from the catalog, linking them to their catalog name. by @matanor in #545 #547 #546
  • allow imports list for executequery and filterbyquery and rename to ExecuteExpression and FilterByExpression by @dafnapension in #542
  • Add tests for api is presented in the unitxt paper. by @elronbandel in #558
  • Extend the function that evaluate with unitxt metric on external data to new types of data by @assaftibm in #557
  • Add Kendall's tau metric by @lilacheden in #535
  • Add new table operators for serialization & truncation by @csrajmohan in #567
  • Unitxt should operate with no package requirements by default. This adds some tools to do so. by @elronbandel in #570
  • Seperate library tests and catalog preperation by @elronbandel in #572
  • Add class for constants handling by @elronbandel in #575
  • Add code needed for evaluating metrics as models by @lilacheden in #573
  • Improved error message when using TemplateDict ...
Read more

Unitxt 1.6.1

30 Jan 15:07
Compare
Choose a tag to compare

What's Changed

Breaking Changes:

  • StreamSource is depracted and replaced with SourceOperator in #523

Full Changelog: 1.6.0...1.6.1

1.6.0

30 Jan 14:14
Compare
Choose a tag to compare

What's Changed

BugFixes:

New Assets:

Enhancments

  • Enhanced UI by @Roni-Friedman in #511
  • Prepare load_dataset and evaluate api to fit the paper by @elronbandel in #510
  • Update catalog navigation Index on documentation side menu for easier catalog browsing by @matanor in #518
  • Add catalog summary printing functionality by @elronbandel in #519
  • add docstrings to some operators and templates, so that they show in the respective catalog cards by @dafnapension in #522
  • Added UNITXT_TEST_METRIC_DISABLE to disable test_metric by @yoavkatz in #526
  • Update docs introduction and component sections by @matanor in #525

Breaking Changes

  • processors are now operators and should be redefined accordingly
  • The functionality of unitxt dataset creation moved from dataset to dataset_utils

Full Changelog: 1.5.0...1.6.0

Unitxt 1.5.3

22 Jan 19:09
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.5.2...1.5.3

Unitxt 1.5.2

22 Jan 18:05
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.5.1...1.5.2

1.5.1

18 Jan 14:59
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.5.0...1.5.1

Unitxt 1.5.0

18 Jan 13:57
Compare
Choose a tag to compare

What's Changed

  • Add Perplexity by @assaftibm in #442
  • Balance demos in fair_tos datasets by @yoavkatz in #473
  • postprocessors become extensions of FieldOperator by @dafnapension in #468
  • Initial UI by @Roni-Friedman in #475
  • introducing text at the top of loaders.py by @dafnapension in #474
  • Improve Unitxt UI and add support for multiple catalogs by @Roni-Friedman in #476
  • Improve ExtractMostCommonFieldValues performance by avoiding the creation of the stream-length long list of values instead building values counter on the fly by @dafnapension in #471
  • Add a new Perturbate operator that is handy for faking prediction as a perturbated version of target or for any other perturbation use cases by @dafnapension in #456
  • add a card for HF xsum, a summary dataset by @dafnapension in #479
  • Add QA, NER, Targeted sentiment and Generation tasks, Llama and Alpaca formats and instructions and whitespace augmentor by @matanor in #483
  • Cfpb product by @ilyashnil in #485
  • Improve catalog UI on documentation website by separating catalog objects to files and adding information per catalog item by @matanor in #461
  • Update QA templates by @matanor in #486
  • Length balancer docstring by @matanor in #487
  • Add process_instance function to every mutli stream operator for easier testing and usage at instance level by @elronbandel in #488
  • Add LRU caching for catalog artifact loading to minimize IO overhead and enhance performance by @elronbandel in #489
  • Make postprocessors a general operator that operates on 'prediction' and on 'references' which enables the use of every possible operator as postprocessor by @dafnapension in #484
  • Improve UI code presentation and organization by @Roni-Friedman in #491
  • Simplify ui launching with the console command unitxt-explore by @elronbandel in #492
  • Xmmlu template multilingual by @gitMichal in #493

New Contributors

Full Changelog: 1.4.6...1.5.0

Unitxt 1.4.6

11 Jan 16:01
Compare
Choose a tag to compare

What's Changed

  • Fix automatic dataset and metric uploads to Hugginface hub by @elronbandel in #466

Full Changelog: 1.4.5...1.4.6

Unitxt 1.4.4

11 Jan 15:40
Compare
Choose a tag to compare

What's Changed

  • Fix HuggingFace integration by changing logging.py to logging_utils.py to comply with hf dataset conventions by @elronbandel in #457
  • Add FilterByQuery and ExecuteQuery as simple operators receiving textual python query by @dafnapension in #449
  • New multi label template by @yoavkatz in #462
  • Delete old formats and make SystemFormat the only format exist by @elronbandel in #458

Full Changelog: 1.4.3...1.4.4

Unitxt 1.4.3

09 Jan 18:36
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.4.2...1.4.3