kolzchut-ragbot 1.1.2__py3-none-any.whl → 1.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kolzchut_ragbot/engine.py +3 -3
- {kolzchut_ragbot-1.1.2.dist-info → kolzchut_ragbot-1.2.0.dist-info}/METADATA +1 -1
- {kolzchut_ragbot-1.1.2.dist-info → kolzchut_ragbot-1.2.0.dist-info}/RECORD +5 -5
- {kolzchut_ragbot-1.1.2.dist-info → kolzchut_ragbot-1.2.0.dist-info}/WHEEL +0 -0
- {kolzchut_ragbot-1.1.2.dist-info → kolzchut_ragbot-1.2.0.dist-info}/top_level.txt +0 -0
kolzchut_ragbot/engine.py
CHANGED
|
@@ -178,7 +178,7 @@ class Engine:
|
|
|
178
178
|
all_docs_by_model = self.elastic_model.search(query_embeddings)
|
|
179
179
|
all_docs = []
|
|
180
180
|
ids_for_fusion = []
|
|
181
|
-
all_docs_and_scores =
|
|
181
|
+
all_docs_and_scores = {}
|
|
182
182
|
|
|
183
183
|
for key, values in all_docs_by_model.items():
|
|
184
184
|
print(f"\nFound {len(values)} documents for model\n")
|
|
@@ -190,7 +190,7 @@ class Engine:
|
|
|
190
190
|
all_docs.append(doc)
|
|
191
191
|
scores_for_model.append({"doc": doc["_source"]["title"], "score": doc["_score"]})
|
|
192
192
|
ids_for_fusion.append(model_ids)
|
|
193
|
-
all_docs_and_scores
|
|
193
|
+
all_docs_and_scores[f'{key}'] = scores_for_model
|
|
194
194
|
print(f"\nFusing {len(ids_for_fusion)} results\n")
|
|
195
195
|
fused_ids = self.reciprocal_rank_fusion(ids_for_fusion, k=top_k)
|
|
196
196
|
top_k_documents = []
|
|
@@ -199,7 +199,7 @@ class Engine:
|
|
|
199
199
|
for fused_id in fused_ids:
|
|
200
200
|
for doc in all_docs:
|
|
201
201
|
if doc["_source"]["page_id"] == fused_id and doc["_source"]["title"] not in top_titles:
|
|
202
|
-
top_k_documents.append(
|
|
202
|
+
top_k_documents.append(doc["_source"])
|
|
203
203
|
top_titles.append(doc["_source"]["title"])
|
|
204
204
|
break
|
|
205
205
|
if len(top_titles) >= top_k:
|
|
@@ -2,10 +2,10 @@ kolzchut_ragbot/Document.py,sha256=ySawnD06HA0zHjHp4Y_CPjMMZqLp8onaEgd1dGP5sbs,3
|
|
|
2
2
|
kolzchut_ragbot/IntegrateService.py,sha256=CqB9vW6W5oj6Ig3crEa6hXqwro21z97UaG9ngxFTzYs,100
|
|
3
3
|
kolzchut_ragbot/__init__.py,sha256=KKAc2xjCl5Aui2Cj0FWyvJ51nmnFv7MspLMqOYb-QHA,26
|
|
4
4
|
kolzchut_ragbot/config.py,sha256=pcKVJVJ8P2YximjTrmVlrocHXSmzmNu_DFzNoPLa22E,138
|
|
5
|
-
kolzchut_ragbot/engine.py,sha256=
|
|
5
|
+
kolzchut_ragbot/engine.py,sha256=V8WUWyqvBWbGt-rRRf8G6BEyD-4GjsmtJrxBb6aPon8,10154
|
|
6
6
|
kolzchut_ragbot/llm_client.py,sha256=q_cUZq645P7i1PliYzpJRTWlsoSECVIhE-y9wU5eRtQ,352
|
|
7
7
|
kolzchut_ragbot/model.py,sha256=H-p5KQRlauBWXqFqcikjDwK8pbRmnqpqwy35ZAc8hQI,6505
|
|
8
|
-
kolzchut_ragbot-1.
|
|
9
|
-
kolzchut_ragbot-1.
|
|
10
|
-
kolzchut_ragbot-1.
|
|
11
|
-
kolzchut_ragbot-1.
|
|
8
|
+
kolzchut_ragbot-1.2.0.dist-info/METADATA,sha256=UhrqAa1ueYN5OgprKaFJpX32sMlyIZ35J-t1SaPm38w,2023
|
|
9
|
+
kolzchut_ragbot-1.2.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
10
|
+
kolzchut_ragbot-1.2.0.dist-info/top_level.txt,sha256=NTZoY4GGw3v_7jm0MgcdHw8simoZ78PsR7Meqmkgd_Q,16
|
|
11
|
+
kolzchut_ragbot-1.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|