Spaces:
Sleeping
Sleeping
interpolar
Browse files
app.py
CHANGED
|
@@ -197,8 +197,12 @@ def hybrid_search_no_gemini(query: str, match_count: int = 50):
|
|
| 197 |
|
| 198 |
for c, s in zip(candidates, scores):
|
| 199 |
c["rerank_score"] = float(s)
|
| 200 |
-
|
| 201 |
-
c["rerank_prob"] =
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
|
| 203 |
candidates = sorted(candidates, key=lambda x: x["rerank_prob"], reverse=True)
|
| 204 |
return {"results": candidates[:10]}
|
|
|
|
| 197 |
|
| 198 |
for c, s in zip(candidates, scores):
|
| 199 |
c["rerank_score"] = float(s)
|
| 200 |
+
rerank_prob = apply_sigmoid(float(s))
|
| 201 |
+
c["rerank_prob"] = rerank_prob
|
| 202 |
+
|
| 203 |
+
db_sim = c.get("similarity", 0.0)
|
| 204 |
+
|
| 205 |
+
c["final_score"] = (0.6 * rerank_prob) + (0.4 * db_sim)
|
| 206 |
|
| 207 |
candidates = sorted(candidates, key=lambda x: x["rerank_prob"], reverse=True)
|
| 208 |
return {"results": candidates[:10]}
|