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

#2422 #2244

Merged
merged 1 commit into from
Mar 7, 2024
Merged

#2422 #2244

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions code/ARAX/ARAXQuery/ARAX_ranker.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from openapi_server.models.edge import Edge
from openapi_server.models.attribute import Attribute

edge_confidence_manual_agent = 0.999

def _get_nx_edges_by_attr(G: Union[nx.MultiDiGraph, nx.MultiGraph], key: str, val: str) -> Set[tuple]:
res_set = set()
Expand Down Expand Up @@ -550,7 +551,7 @@ def aggregate_scores_dmk(self, response):
kg_edge_id_to_edge = self.kg_edge_id_to_edge
score_stats = self.score_stats
no_non_inf_float_flag = True
for edge_key,edge in message.knowledge_graph.edges.items():
for edge_key, edge in message.knowledge_graph.edges.items():
kg_edge_id_to_edge[edge_key] = edge
if edge.attributes is not None:
for edge_attribute in edge.attributes:
Expand Down Expand Up @@ -586,9 +587,13 @@ def aggregate_scores_dmk(self, response):
response.info(f"Summary of available edge metrics: {score_stats}")

# Loop over the entire KG and normalize and combine the score of each edge, place that information in the confidence attribute of the edge
for edge_key,edge in message.knowledge_graph.edges.items():
for edge_key, edge in message.knowledge_graph.edges.items():
if edge.attributes is not None:
edge_attributes = {x.original_attribute_name:x.value for x in edge.attributes}
for edge_attribute in edge.attributes:
if edge_attribute.attribute_type_id == "biolink:agent_type" and edge_attribute.value == "manual_agent":
edge.confidence = edge_confidence_manual_agent
break
else:
edge_attributes = {}
if edge_attributes.get("confidence", None) is not None:
Expand Down
Loading