Skip to content

Commit

Permalink
exclude unknown tag
Browse files Browse the repository at this point in the history
  • Loading branch information
gferraro committed Oct 1, 2024
1 parent d7e3c10 commit c6c6abb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/modelevaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ def metadata_confusion(dir, confusion_file, after_date=None, model_metadata=None
"Remapping %s to %s", human_tag, remapped_labels[human_tag]
)
human_tag = remapped_labels[human_tag]
if human_tag not in labels:
logging.info("Excluding %s", human_tag)

ai_tags = []
for tag in tags:
if tag.get("automatic") is True:
Expand All @@ -321,8 +324,6 @@ def metadata_confusion(dir, confusion_file, after_date=None, model_metadata=None
ai_tags.append(tag["what"])

y_true.append(human_tag)
if human_tag not in labels:
labels.append(human_tag)
if len(ai_tags) == 0:
y_pred.append("None")
else:
Expand Down

0 comments on commit c6c6abb

Please sign in to comment.