shiralkarprashant / knowledgestream

Code to reproduce results in "Finding Streams in Knowledge Graphs to Support Fact Checking"
36 stars 18 forks source link

output the discriminative paths #11

Closed remember9069 closed 2 years ago

remember9069 commented 2 years ago

The power of paths in section of path selection is recorded in a matrix? How could I output the most discriminative predicate paths which extracted from the algorithms in this repository? Thanks in advance.

shiralkarprashant commented 2 years ago

Hi, let me comment in the context of KS and KL-REL algorithms, since they are the main contributions supporting the published paper.

For each (s, p, o) triple instance, the KS and KL-REL algorithms output a score for each path or stream, which is called the truth score of the triple. See Eqn. 5 and 6 for KS and Eqn. 8 for KL-REL in the paper. This score is computed on lines mincostflow/ssp.py:L83 for KS and relklinker/rel_closure.pyx:L81 for KL-REL.

If you are interested in identifying the set of discriminative predicate paths for a relation (i.e., the set of predicate sequences while ignoring node identities), you need to do more: For a given target relation, you may create a dataset of both positive and negative (s, p, o) triples, apply these algorithms to find their predicate paths and corresponding scores, and perform correlation analysis between their resulting paths as features (with scores as feature values) and their true labels to identify the most disciminative predicate paths for the relation.

Hope this helps. Let us know if you have further questions.

remember9069 commented 2 years ago

Thanks for your detailed advices 👍, it helps me a lot. I think I am figuring it out. :D