Skip to content

Conversation

@richardsun0713
Copy link
Contributor

@richardsun0713 richardsun0713 commented Aug 25, 2023

  • Removes the auto_audit_percentage and auto_audit_number_of_labels parameters from labelbox.client.Client.create_project and replaces them with the quality_mode enum

@richardsun0713 richardsun0713 marked this pull request as ready for review August 29, 2023 00:10
@richardsun0713 richardsun0713 requested review from a team, kkim-labelbox and kopreschko August 29, 2023 00:10
queue_mode (Optional[QueueMode]): The queue mode to use
auto_audit_percentage (Optional[float]): The percentage of data rows that will require more than 1 label
auto_audit_number_of_labels (Optional[float]): Number of labels required for data rows selected for multiple labeling (auto_audit_percentage)
quality_mode (Optional[QualityMode]): The quality mode to use (e.g. Benchmark, Consensus). Defaults to
Copy link
Contributor

@vbrodsky vbrodsky Aug 29, 2023

Choose a reason for hiding this comment

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

what happens to existing projects where these attributes are set and, say, we do smth like client.get_project(). I suppose it would work but the attributes will be missing? From the client point of view, is there any migration needs to happen, i.e. if auto_audit_percentage and auto_audit_number_of_labels => set quality mode etcv

Copy link
Contributor

Choose a reason for hiding this comment

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

Also if the quality mode default to Benchmark, shouldn't we set it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

auto_audit_percentage and auto_audit_number_of_labels are still in the Project model but have no meaning anymore - it has been replaced with equivalents at the batch level (specified during batch creation). The migration has already been performed on the backend, this change simply removes the old obsolete data from the client model

"""
media_type = kwargs.get("media_type")

auto_audit_percentage = kwargs.get("auto_audit_percentage")
Copy link
Contributor

Choose a reason for hiding this comment

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

if these attributes are removed from the model, why are we dealing with them here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is here to help present a more readable message that can inform users how to migrate to the new usage model

queue_mode (Optional[QueueMode]): The queue mode to use
auto_audit_percentage (Optional[float]): The percentage of data rows that will require more than 1 label
auto_audit_number_of_labels (Optional[float]): Number of labels required for data rows selected for multiple labeling (auto_audit_percentage)
quality_mode (Optional[QualityMode]): The quality mode to use (e.g. Benchmark, Consensus). Defaults to
Copy link
Contributor

Choose a reason for hiding this comment

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

Also if the quality mode default to Benchmark, shouldn't we set it here?

logger.warning(
"QueueMode.Dataset will eventually be deprecated, and is no longer "
"recommended for new projects. Prefer QueueMode.Batch instead.")
quality_mode = kwargs.get("quality_mode")
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like dupe lines, since we do the same line 684-..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These aren't duplicate lines; one exists to inform the user that a default has been selected, and the other exists to translate the given quality_mode to something our backend can interpret

data = kwargs
data.pop("quality_mode", None)
if quality_mode is None or quality_mode is QualityMode.Benchmark:
data["auto_audit_number_of_labels"] = 1
Copy link
Contributor

Choose a reason for hiding this comment

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

suggest making these numbers constants

from enum import Enum


class QualityMode(str):
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you mean QualityMode(str, Enum) ?

@richardsun0713 richardsun0713 merged commit b91479f into develop Aug 29, 2023
@richardsun0713 richardsun0713 deleted the rsun/QQC-2474 branch August 29, 2023 23:37
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