Skip to main content
Version: v1.2.X

Import an annotated dataset

Overview​

After creating an annotation task, you can import to the annotation task already annotated samples (for example, annotated images) from the same dataset you used to create the annotation task.

Instructions​

To import an annotated dataset to an annotation task, consider the following instructions:

  1. On the H2O Label Genie navigation menu, click Annotation tasks.
  2. In the annotation tasks table, double-click the row where the annotation task you want to use is located.
  3. Click the Import tab.
  4. Upload your dataset with existing annotations.
  5. Click Import annotated samples.
Note
  • H2O Label Genie lets you review and approve the imported annotations later. To import them pre-approved, select the Approve imported annotations checkbox, so that you don't have to approve them on the Annotate tab.
  • In some classification tasks, Save and next on the Annotate tab can replace the imported label of an unapproved sample. To avoid this, select Approve imported annotations when you import labels.
  • H2O Label Genie doesn't overwrite already approved records by default. To overwrite them, select the Overwrite already approved records checkbox. If Approve imported annotations is cleared, the overwritten records lose their approval.
  • The Import tab clears both checkboxes each time you open it, so select the ones that you need before each import.
  • Before importing an annotated dataset to an existing annotation task, the annotated dataset needs to be formatted in a certain way depending on the problem type it aims to solve. To learn more, see Required annotated dataset format.

import an annotated dataset

Required annotated dataset format​

Before importing an annotated dataset to an existing annotation task, the annotated dataset needs to be formatted in a certain way depending on the problem type it aims to solve.

Text classification​

The annotated dataset to import to a text classification annotation task needs to be formatted as follows:

A CSV file containing a text column and either a label column or one label_CLASS_NAME column for each class, where CLASS_NAME is the class name. Columns:

  • text: The text column needs to contain the original text input.
    Note

    The text column is used to merge the labels. Please make sure to use the original text column without any duplications. The original text column refers to the text column present in the dataset you used to create the annotation task.

  • label: In a single-label task with no classes or with two or more classes, the label column needs to contain the labels attributed to the texts specified in the text column. In versions before 1.3.0, if every label in the file is the same class, first add two or more classes to the rubric, including that one.
  • label_CLASS_NAME: In a multi-label task, or a binary task (which has only one class), the file needs one label_CLASS_NAME column for every class in the rubric. Before you import such a file, add all of its classes to the rubric and, for a multi-label file, select Allow multilabel selection. Each column contains 1 if the text has that class and 0 if it doesn't.

Text regression​

The annotated dataset to import to a text regression annotation task needs to be formatted as follows:

A CSV file containing a text and label column. Columns:

  • text: The text column needs to contain the original text input.
    Note

    The text column is used to merge the labels. Please make sure to use the original text column without any duplications. The original text column refers to the text column present in the dataset you used to create the annotation task.

  • label: The label column needs to contain the labels attributed to the texts specified in the text column.

Text-entity recognition​

The annotated dataset to import to a text-entity recognition annotation task needs to be formatted as follows:

A Parquet file containing a raw_text, text, and label column. Columns:

  • raw_text: The raw_text column needs to contain the original text input.
    Note

    The raw_text column is used to merge the labels. Please make sure to use the original text column without any duplications. The original text column refers to the text column present in the dataset you used to create the annotation task.

  • text: The text column needs to contain the list of tokens (words) of the text.
  • label: The label column needs to contain the list of labels, one for each token in the text column, with O for a token outside any entity.

Text summarization​

The annotated dataset to import to a text summarization annotation task needs to be formatted as follows:

A CSV file containing a text and label column. Columns:

  • text: The text column needs to contain the original text input.
    Note

    The text column is used to merge the labels. Please make sure to use the original text column without any duplications. The original text column refers to the text column present in the dataset you used to create the annotation task.

  • label: The label column needs to contain the summaries attributed to the texts specified in the text column.

Text-generative AI​

The annotated dataset to import to a text-generative AI annotation task needs to be formatted as follows:

A CSV file containing the following columns:

  • text: The text column needs to contain the original text input.
    Note

    The text column is used to merge the labels. Please make sure to use the original text column without any duplications. The original text column refers to the text column present in the dataset you used to create the annotation task.

  • label: The label column needs to contain the answers attributed to the texts specified in the text column.

Image classification​

The annotated dataset to import to an image classification annotation task needs to be formatted as follows:

A CSV file containing an image_path column and either a label column or one label_CLASS_NAME column for each class, where CLASS_NAME is the class name. Columns:

  • image_path: The image_path column needs to specify the locations of the images.
    Note

    The image_path column is used to merge the labels. Please make sure to use the correct relative paths without any duplications.

  • label: In a single-label task with no classes or with two or more classes, the label column needs to contain the labels attributed to the images specified in the image_path column. In versions before 1.3.0, if every label in the file is the same class, first add two or more classes to the rubric, including that one.
  • label_CLASS_NAME: In a multi-label task, or a binary task (which has only one class), the file needs one label_CLASS_NAME column for every class in the rubric. Before you import such a file, add all of its classes to the rubric and, for a multi-label file, select Allow multilabel selection. Each column contains 1 if the image has that class and 0 if it doesn't.

Image regression​

The annotated dataset to import to an image regression annotation task needs to be formatted as follows:

A CSV file containing an image_path and label column. Columns:

  • image_path: The image_path column needs to specify the locations of the images.
    Note

    The image_path column is used to merge the labels. Please make sure to use the correct relative paths without any duplications.

  • label: The label column needs to contain the labels attributed to the images specified in the image_path column.

Object detection​

The annotated dataset to import to an object detection annotation task needs to be formatted as follows:

A Parquet file with one row for each image, containing an image_path, class_id, x_min, x_max, y_min, and y_max column. Columns:

  • image_path: The image_path column needs to specify the locations of the images.
    Note

    The image_path column is used to merge the labels. Please make sure to use the correct relative paths without any duplications.

  • class_id: The class_id column needs to contain the list of class names of the image's bounding boxes.
  • x_min, x_max, y_min, and y_max: These columns need to contain the lists of bounding box coordinates in pixels, in the order of the class_id column.

Image instance segmentation​

The annotated dataset to import to an image instance segmentation annotation task needs to be formatted as follows:

A JSON file in a COCO format containing the following keys:

  • images: The image ID and file_name (location).
    Note

    The file_name is used to merge the labels. Please make sure to use the correct relative paths without any duplications.

  • annotations: The annotations in a COCO polygon format.
  • categories: The categories ID and name.

Audio classification​

The annotated dataset to import to an audio classification annotation task needs to be formatted as follows:

A CSV file containing an audio_path column and either a label column or one label_CLASS_NAME column for each class, where CLASS_NAME is the class name. Columns:

  • audio_path: The audio_path column needs to specify the locations of the audios.
    Note

    The audio_path column is used to merge the labels. Please make sure to use the correct relative paths without any duplications.

  • label: In a single-label task with no classes or with two or more classes, the label column needs to contain the labels attributed to the audios specified in the audio_path column. In versions before 1.3.0, if every label in the file is the same class, first add two or more classes to the rubric, including that one.
  • label_CLASS_NAME: In a multi-label task, or a binary task (which has only one class), the file needs one label_CLASS_NAME column for every class in the rubric. Before you import such a file, add all of its classes to the rubric and, for a multi-label file, select Allow multilabel selection. Each column contains 1 if the audio has that class and 0 if it doesn't.

Audio regression​

The annotated dataset to import to an audio regression annotation task needs to be formatted as follows:

A CSV file containing an audio_path and label column. Columns:

  • audio_path: The audio_path column needs to specify the locations of the audios.
    Note

    The audio_path column is used to merge the labels. Please make sure to use the correct relative paths without any duplications.

  • label: The label column needs to contain the labels attributed to the audios specified in the audio_path column.

Feedback