ranking-agent / aragorn-ranker

Exposes TRAPI functions to add literature co-occurrence edges, convert publications to edge weights, and provide scores for answers.
MIT License
0 stars 1 forks source link

Handle set nodes. #17

Closed cbizon closed 3 years ago

cbizon commented 3 years ago

Currently in /score we calculate the kirchoff index for the graph consisting of non-set nodes. This is bad for 2 reasons

  1. That's loosing a lot of information
  2. Sometimes we don't have enough non-set nodes (need at least 2). This can happen e.g. when you do a 1-hop and then AC does a property coalesce, ending up with (node)-(set of nodes) in the answers.

Currently, when we hit a situation in which there are insufficient numbers of non-set nodes, we return a score of 0, which is bogus.

What's the right approach for set nodes?

One option would be to create a node that acts like a single node, i.e. somehow accumulate the scores along edges coming into a set node so that it looks like a single thing.

Discovered while working on https://github.com/ranking-agent/aragorn/issues/11

cbizon commented 3 years ago

It seems as though the ranker in messenger did handle these nodes, so we need to revisit that code and see what happened.

From Patrick: The resistance distance between non-set nodes takes into account the set nodes between them... e.g. in similarity-type questions, we don't need or want to actually compute distances from set nodes to elsewhere, but useful information comes from computing distances across them There's a special provision for leaf-set-nodes, where we pretend there is another node on the other side.

All of the above should happen in /score.

mmersmann commented 3 years ago

Cleaned up how weight attributes are passed around. Need a good test to demonstrate fix.

mmersmann commented 3 years ago

Reminder: @cbizon to test.

richakanwar13 commented 3 years ago

Per meeting on 9/24, can be closed.