Skip to content
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

fix: 修改了local search中的relation_counts计数规则 #318

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

zzzcccxx
Copy link
Contributor

您好,看到您的项目对我很有启发。但我在使用 local search 时,发现源码中/LightRAG/lightrag/operate.py 在召回实体最相关文本单元_find_most_related_text_unit_from_entities函数的时候,为了对文本单元重要性进行排序所使用到了relation_counts。
但在现有的逻辑中,如果一个文本单元c_id与多个实体节点相关联,且这些实体节点的一跳相邻节点数量不同,那么先遍历到一跳相邻节点少的实体节点时,relation_counts可能会被低估。
所以我修改为:在每次遍历时更新relation_counts,而不是跳过已经存在的文本单元。

@LarFii
Copy link
Collaborator

LarFii commented Nov 22, 2024

非常感谢!

@LarFii LarFii merged commit 8b4da85 into HKUDS:main Nov 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants