Skip to content

v2.3.0

Compare
Choose a tag to compare
@frascuchon frascuchon released this 03 Oct 15:11
· 182 commits to develop since this release
1e54a48

🌟 Release highlights

Custom Fields: the most powerful way to build custom annotation tasks

We heard you. This new type of field gives you full control over how data is presented to annotators.

With custom fields, you can use your own CSS, HTML, and even Javascript (welcome interactive fields!). Moreover, you can populate your fields with custom structures like custom_field={"image1": ..., "image_2": ..., etc.}.

Here's an example:

Imagine you want to show two images and a prompt to your users.

With a custom field

With the new custom field, you can configure something like this:

Screenshot 2024-10-04 at 13 04 28

And you can set this up with a few lines of code:

css_template = """
<style>
#container {
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
}
.prompt {
    margin-bottom: 10px;
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    background-color: #f8f8f8;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.image-container {
    display: flex;
    gap: 10px;
}
.column {
    flex: 1;
    position: relative;
}
img {
    max-width: 100%;
    height: auto;
    display: block;
}
.image-label {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    color: black;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
}
</style>
"""

html_template = """
<div id="container">
    <div class="prompt"><strong>Prompt:</strong> {{record.fields.images.prompt}}</div>
    <div class="image-container">
        <div class="column">
            <img src="{{record.fields.images.image_1}}" />
            <div class="image-label">Image 1</div>
        </div>
        <div class="column">
            <img src="{{record.fields.images.image_2}}" />
            <div class="image-label">Image 2</div>
        </div>
    </div>
</div>
"""

custom_field = rg.CustomField(
    name="images",
    template=css_template + html_template,
)

# and the log records like this
rg.Record(
    fields={
        "prompt": prompt,
         "image_1": schnell_uri,
         "image_2": dev_uri,
   }
)

Before the custom field

Before this release, you were forced to use two ImageField and a TextField, which would be displayed sequentially, limiting the ability to compare the images side-by-side, with clear labels, prompt text, etc. It would look like this:

Screenshot 2024-10-04 at 14 13 52

How to get started with custom fields

Here we've shown a basic presentation-oriented custom field but you can set up anything you can think of, leveraging JS, html, and css. Imagination is the limit!

To get started check the docs: https://docs.argilla.io/v2.3/how_to_guides/custom_fields/

Other features

An other changes and fixes

Changed

  • Changed the repr method for SettingsProperties to display the details of all the properties in Setting object. (#5380)
  • Changed error messages when creating datasets with insufficient permissions. (#5540)

Fixed

  • Fixed serialization of ChatField when collecting records from the hub and exporting to datasets. (#5554)
  • Fixed error when creating default user with existing default workspace. (#5558)
  • Fixed the deployment yaml used to create a new Argilla server in K8s. Added USERNAME and PASSWORD to the environment variables of pod template. (#5434)
  • Fix autofill form on sign-in page #5522
  • Support copy on clipboard for no secure context #5535

New Contributors

Thanks to

Full Changelog: v2.2.2...v2.3.0