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

Finishing 1.4 #106

Closed cbizon closed 1 year ago

cbizon commented 1 year ago

After going through /score there are extra edges being added to the analysis.edge_bindings:

{
    "node_bindings": {
        "disease": [
            {
                "id": "MONDO:0001982",
                "qnode_id": "MONDO:0001982"
            }
        ],
        "chemical": [
            {
                "id": "PUBCHEM.COMPOUND:29435"
            }
        ]
    },
    "analyses": [
        {
            "resource_id": "infores:aragorn",
            "edge_bindings": {
                "t_edge": [
                    {
                        "id": "a08aeadf-d891-4328-83da-e949154c3179"
                    }
                ],
                "dummy_edge_0": [
                    {
                        "id": "b6bb4f99-b0a4-44b1-ade5-5cb5bd23d6a3"
                    }
                ]
            },
            "score": 0.3761019385523039,
            "support_graphs": [
                "OMNICORP_support_graph_343"
            ]
        }
    ]
}

That dummy_edge_0 was not part of the input.

What appears to be happening is that dummy edges are being collected from the support_graph portion of the analysis, so that all of the relevant edges are in the edge bindings for scoring. There are 2 problems:

  1. This is not all of the relevant edges. We also need to include all of the edges in support graphs for the t_edge.
  2. If we want to make bindings for simplicity, we need to not pass them back in the results. Either make a copy of the analysis to accumulate the edges, or remove them again before returning.