mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fitin for infinity. (#4722)
### What problem does this PR solve? ### Type of change - [x] Refactoring
This commit is contained in:
@ -65,9 +65,12 @@ class KGSearch(Dealer):
|
||||
|
||||
def _ent_info_from_(self, es_res, sim_thr=0.3):
|
||||
res = {}
|
||||
es_res = self.dataStore.getFields(es_res, ["content_with_weight", "_score", "entity_kwd", "rank_flt",
|
||||
"n_hop_with_weight"])
|
||||
flds = ["content_with_weight", "_score", "entity_kwd", "rank_flt", "n_hop_with_weight"]
|
||||
es_res = self.dataStore.getFields(es_res, flds)
|
||||
for _, ent in es_res.items():
|
||||
for f in flds:
|
||||
if f in ent and ent[f] is None:
|
||||
del ent[f]
|
||||
if float(ent.get("_score", 0)) < sim_thr:
|
||||
continue
|
||||
if isinstance(ent["entity_kwd"], list):
|
||||
|
||||
Reference in New Issue
Block a user