Spaces:
Running
Running
Joshua Lochner
commited on
Commit
·
13df84e
1
Parent(s):
3879103
Move `jaccard` to utils
Browse files- src/evaluate.py +1 -6
src/evaluate.py
CHANGED
|
@@ -41,12 +41,7 @@ class EvaluationArguments(TrainingOutputArguments):
|
|
| 41 |
}
|
| 42 |
)
|
| 43 |
|
| 44 |
-
|
| 45 |
-
def jaccard(x1, x2, y1, y2):
|
| 46 |
-
# Calculate jaccard index
|
| 47 |
-
intersection = max(0, min(x2, y2)-max(x1, y1))
|
| 48 |
-
filled_union = max(x2, y2) - min(x1, y1)
|
| 49 |
-
return intersection/filled_union
|
| 50 |
|
| 51 |
|
| 52 |
def attach_predictions_to_sponsor_segments(predictions, sponsor_segments):
|
|
|
|
| 41 |
}
|
| 42 |
)
|
| 43 |
|
| 44 |
+
from utils import jaccard
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
|
| 47 |
def attach_predictions_to_sponsor_segments(predictions, sponsor_segments):
|