wyl-willing / MindMap

MindMap: Knowledge Graph Prompting Sparks Graph of Thoughts in Large Language Models
259 stars 25 forks source link

头实体和候选实体集path问题 #21

Open daxian-lh opened 2 months ago

daxian-lh commented 2 months ago

大佬,您在MindMap.py中,main方法里match_kg.append(match_kgi.replace(" ",""))。而在find_shortestpath方法中,使用了entities[i].replace(""," "),这不是会导致路径中的实体无法在候选集中匹配嘛(一个实体中有下划线,一个实体中无下划线),是不是在find_shortestpath中,不需要进行entities[i].replace(""," ")这一步的操作呀

wyl-willing commented 2 months ago

因为我在图谱中存储的时候用_链接起来作为实体了,你可以输出看一下,我应该是匹配的时候没用下划线,检索和存储的时候是用的下划线。匹配的时候实体的下划线应该也被我转过来了。

daxian-lh @.***>于2024年8月26日 周一16:06写道:

大佬,您在MindMap.py中,main方法里match_kg.append(match_kg_i.replace(" "," "))。而在find_shortest_path方法中,使用了entities[i].replace(""," "),这不是会导致路径中的实体无法在候选集中匹配嘛(一个实体中有下划线,一个实体中无下划线),是不是在find_shortestpath中,不需要进行entities[i].replace(""," ")这一步的操作呀

— Reply to this email directly, view it on GitHub https://github.com/wyl-willing/MindMap/issues/21, or unsubscribe https://github.com/notifications/unsubscribe-auth/APCDU657XZ4XV5ONHI76FLLZTLOZHAVCNFSM6AAAAABNDPVWK6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4DMMRSGQYDQNA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

daxian-lh commented 2 months ago

match_kg: ['Sharp_abdominal_pain', 'Nausea', 'Vomiting', 'Difficulty_eating']

entities: ['Sharp_abdominal_pain', 'Poisoning_due_to_ethylene_glycol', 'Nausea'] entities: ['Sharp_abdominal_pain', 'Pyelonephritis', 'Nausea'] entities: ['Sharp_abdominal_pain', 'Choledocholithiasis', 'Nausea'] entities: ['Sharp_abdominal_pain', 'Problem_during_pregnancy', 'Nausea'] entities: ['Sharp_abdominal_pain', 'Acute_pancreatitis', 'Nausea'] entities: ['Sharp_abdominal_pain', 'Volvulus', 'Nausea'] entities: ['Sharp_abdominal_pain', 'Infectious_gastroenteritis', 'Nausea']

这是我打印出来的,matchkg是您匹配到的实体,entities是图谱中的实体,您在寻找最短路径的代码中将”“转成了空格,这样是不是会导致entities中的实体匹配不上候选集中的实体呀。

我个人实在是想不通,可能上面提的问题过于简单了,希望大佬能为我解答一下,非常感谢

wyl-willing commented 2 months ago

你把搜索过程中的打印下呢,肯定是一一对应才匹配的到的。

daxian-lh @.***>于2024年8月26日 周一16:40写道:

image.png (view on web) https://github.com/user-attachments/assets/cd56bb7b-c287-490e-a3cd-0ad96f2653f6

— Reply to this email directly, view it on GitHub https://github.com/wyl-willing/MindMap/issues/21#issuecomment-2309668925, or unsubscribe https://github.com/notifications/unsubscribe-auth/APCDU67KO6BWUDSRXHGYLODZTLSY5AVCNFSM6AAAAABNDPVWK6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBZGY3DQOJSGU . You are receiving this because you commented.Message ID: @.***>