Skip to content

Commit b634ee9

Browse files
author
SentienceDEV
committed
new fields with ml_rerank metadata
1 parent 6dc4b5b commit b634ee9

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

sentience/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Element(BaseModel):
4949
z_index: int = 0
5050

5151
# ML reranking metadata (optional - can be absent or null)
52-
rerank_index: int | None = None # 0-based, The rank after ML reranking
52+
fused_rank_index: int | None = None # 0-based, The rank index after ML reranking
5353
heuristic_index: int | None = None # 0-based, Where it would have been without ML
5454
ml_probability: float | None = None # Confidence score from ONNX model (0.0 - 1.0)
5555
ml_score: float | None = None # Raw logit score (optional, for debugging)

sentience/schemas/trace_v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
"in_viewport": {"type": "boolean"},
150150
"is_occluded": {"type": "boolean"},
151151
"z_index": {"type": "integer"},
152-
"rerank_index": {"type": ["integer", "null"]},
152+
"fused_rank_index": {"type": ["integer", "null"]},
153153
"heuristic_index": {"type": ["integer", "null"]},
154154
"ml_probability": {"type": ["number", "null"]},
155155
"ml_score": {"type": ["number", "null"]},

tests/test_snapshot.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def test_element_ml_fields_optional():
152152
is_occluded=False,
153153
z_index=0,
154154
)
155-
assert element_without_ml.rerank_index is None
155+
assert element_without_ml.fused_rank_index is None
156156
assert element_without_ml.heuristic_index is None
157157
assert element_without_ml.ml_probability is None
158158
assert element_without_ml.ml_score is None
@@ -168,12 +168,12 @@ def test_element_ml_fields_optional():
168168
in_viewport=True,
169169
is_occluded=False,
170170
z_index=1,
171-
rerank_index=0,
171+
fused_rank_index=0,
172172
heuristic_index=5,
173173
ml_probability=0.95,
174174
ml_score=2.34,
175175
)
176-
assert element_with_ml.rerank_index == 0
176+
assert element_with_ml.fused_rank_index == 0
177177
assert element_with_ml.heuristic_index == 5
178178
assert element_with_ml.ml_probability == 0.95
179179
assert element_with_ml.ml_score == 2.34
@@ -189,10 +189,10 @@ def test_element_ml_fields_optional():
189189
in_viewport=True,
190190
is_occluded=False,
191191
z_index=0,
192-
rerank_index=1,
192+
fused_rank_index=1,
193193
ml_probability=0.87,
194194
)
195-
assert element_partial.rerank_index == 1
195+
assert element_partial.fused_rank_index == 1
196196
assert element_partial.heuristic_index is None
197197
assert element_partial.ml_probability == 0.87
198198
assert element_partial.ml_score is None

0 commit comments

Comments
 (0)