-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find most related text unit from entities #304
Comments
It's creating an efficient index of text units while tracking how interconnected each unit is with other nodes in the graph. The code section:
#asked/claude-3-5-sonnet-2410
For example:
The relation_counts calculation is still accurate because:
So while we want to count all relationships, we only need to process each unique text unit once and store its metadata (data, order, relation_counts) in the lookup dictionary. |
Thank you very much for your answer, I understand this piece of code.
results = await entities_vdb.query(query, top_k=query_param.top_k)
if not len(results):
return None
node_datas = await asyncio.gather(
*[knowledge_graph_inst.get_node(r["entity_name"]) for r in results]
)
all_text_units = sorted(
all_text_units, key=lambda x: (x["order"], -x["relation_counts"])
) |
This is the code that find most related text unit from entities,Method name is
_find_most_related_text_unit_from_entities
.If it is the total number of times a text unit is referenced by neighboring nodes, why use
continue
, see lines 580,581.Can someone explain this part of the code?
Thank you for your help.
The text was updated successfully, but these errors were encountered: