kolzchut-ragbot 1.1.3__py3-none-any.whl → 1.3.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 +2 -2
- kolzchut_ragbot/model.py +8 -13
- {kolzchut_ragbot-1.1.3.dist-info → kolzchut_ragbot-1.3.0.dist-info}/METADATA +1 -1
- {kolzchut_ragbot-1.1.3.dist-info → kolzchut_ragbot-1.3.0.dist-info}/RECORD +6 -6
- {kolzchut_ragbot-1.1.3.dist-info → kolzchut_ragbot-1.3.0.dist-info}/WHEEL +0 -0
- {kolzchut_ragbot-1.1.3.dist-info → kolzchut_ragbot-1.3.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 = []
|
kolzchut_ragbot/model.py
CHANGED
|
@@ -93,23 +93,18 @@ class Model:
|
|
|
93
93
|
index = index_from_page_id(int(doc_id))
|
|
94
94
|
|
|
95
95
|
if update:
|
|
96
|
-
hits = []
|
|
97
96
|
try:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
97
|
+
query = {
|
|
98
|
+
"query": {
|
|
99
|
+
"match": {
|
|
100
|
+
f"{identifier}": doc_id
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
self.es_client.delete_by_query(index=f"{EMBEDDING_INDEX}*", body=query)
|
|
105
105
|
|
|
106
106
|
except Exception as e:
|
|
107
107
|
logging.error(f"Error while searching for existing document: {e}")
|
|
108
|
-
if len(hits) > 0:
|
|
109
|
-
print("delete existing documents")
|
|
110
|
-
for hit in hits:
|
|
111
|
-
print("delete existing document", hit["_id"])
|
|
112
|
-
self.es_client.delete(index=index, id=hit["_id"])
|
|
113
108
|
|
|
114
109
|
for i, doc_dict in enumerate(paragraphs_dicts):
|
|
115
110
|
print(f"saving paragraph {i}")
|
|
@@ -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
|
-
kolzchut_ragbot/model.py,sha256=
|
|
8
|
-
kolzchut_ragbot-1.
|
|
9
|
-
kolzchut_ragbot-1.
|
|
10
|
-
kolzchut_ragbot-1.
|
|
11
|
-
kolzchut_ragbot-1.
|
|
7
|
+
kolzchut_ragbot/model.py,sha256=OfFFNj429IUUObOpjDB08ubZo6io45sOaoxkyEU68d4,6228
|
|
8
|
+
kolzchut_ragbot-1.3.0.dist-info/METADATA,sha256=irR9JjoI8OWFxEbh-0UjEogRHooZJtZ9pxtS9JBXy7M,2023
|
|
9
|
+
kolzchut_ragbot-1.3.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
10
|
+
kolzchut_ragbot-1.3.0.dist-info/top_level.txt,sha256=NTZoY4GGw3v_7jm0MgcdHw8simoZ78PsR7Meqmkgd_Q,16
|
|
11
|
+
kolzchut_ragbot-1.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|