Skip to content

Commit

Permalink
Remove the "Count" for Difference as it's rather confusing
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaarsen committed Sep 11, 2024
1 parent 762c0fe commit 0d4d73e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sentence_transformers/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,8 +916,15 @@ def mine_hard_negatives(
row_format = "{:<6} {:>14} {:>14} {:>14}"
formatter = lambda value: (f"{value.item():.4f}" if isinstance(value, torch.Tensor) else f"{value:,}")
print(row_format.format("Metric", "Positive", "Negative", "Difference"))
print(
row_format.format(
"Count",
formatter(len(positive_scores)),
formatter(len(negative_scores)),
"",
)
)
for metric, function in [
("count", len),
("mean", torch.mean),
("median", torch.median),
("std", torch.std),
Expand Down

0 comments on commit 0d4d73e

Please sign in to comment.