Skip to content

Commit

Permalink
fix: increase default logo threshold to 0.2 (from 0.1)
Browse files Browse the repository at this point in the history
We now require a confidence score of 0.2
  • Loading branch information
raphael0202 committed Nov 7, 2023
1 parent 56d7fe2 commit 74b48f5
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion robotoff/logos.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,26 @@ def import_logo_insights(
logos: list[LogoAnnotation],
thresholds: dict[LogoLabelType, float],
server_type: ServerType,
default_threshold: float = 0.1,
default_threshold: float = 0.2,
notify: bool = True,
) -> InsightImportResult:
"""Generate and import insights from logos.
Unannotated logos are considered instances of label "UNKNOWN". The
majority class is used as prediction, and the "UNKNOWN" prediction is
ignored.
:param logos: a list of `LogoAnnotation` model instances, used to generate
insights
:param thresholds: a dict of confidence thresholds for each class. If the
class is not defined, default threshold is used
:param server_type: the server type (project) associated with the logos
:param default_threshold: the default confidence threshold to use,
defaults to 0.2
:param notify: whether to send a notification for each logo selected to
generate an insight, defaults to True
:return: the result from the insight import
"""
selected_logos = []
logo_probs = []
for logo in logos:
Expand Down

0 comments on commit 74b48f5

Please sign in to comment.