BioBridge-PrimeKG Multimodal Data Dump
In this tutorial, we will prepare Milvus database for storing and searching nodes and edges of a graph.
In particular, we are using PrimeKG multimodal data from the BioBridge project.
# Load necessary libraries
import os
import glob
import hydra
import cudf
import cupy as cp
from pymilvus import (
db,
connections,
FieldSchema,
CollectionSchema,
DataType,
Collection,
utility,
MilvusClient
)
from tqdm import tqdm
import time
Loading BioBridge-PrimeKG Multimodal Data¶
First, we need to get the path to the directory containing the parquet files of nodes and edges.
For nodes and edges, we have a separate folder that contains its enrichment and embeddings.
# Load hydra configuration
with hydra.initialize(version_base=None, config_path="../../../aiagents4pharma/talk2knowledgegraphs/configs"):
cfg = hydra.compose(
config_name="config", overrides=["tools/multimodal_subgraph_extraction=default"]
)
cfg = cfg.tools.multimodal_subgraph_extraction
cfg
{'_target_': 'talk2knowledgegraphs.tools.multimodal_subgraph_extraction', 'ollama_embeddings': ['nomic-embed-text'], 'temperature': 0.1, 'streaming': False, 'topk': 5, 'topk_e': 5, 'cost_e': 0.5, 'c_const': 0.01, 'root': -1, 'num_clusters': 1, 'pruning': 'gw', 'verbosity_level': 0, 'node_id_column': 'node_id', 'node_attr_column': 'node_attr', 'edge_src_column': 'edge_src', 'edge_attr_column': 'edge_attr', 'edge_dst_column': 'edge_dst', 'node_colors_dict': {'gene/protein': '#6a79f7', 'molecular_function': '#82cafc', 'cellular_component': '#3f9b0b', 'biological_process': '#c5c9c7', 'drug': '#c4a661', 'disease': '#80013f'}, 'biobridge': {'source': '/mnt/blockstorage/biobridge_multimodal/', 'node_type': ['gene/protein', 'molecular_function', 'cellular_component', 'biological_process', 'drug', 'disease']}}
# You can set the source directory for biobridge data here
cfg.biobridge.source = "/mnt/blockstorage/biobridge_multimodal"
%%time
# Loop over nodes and edges
graph_dict = {}
for element in ["nodes", "edges"]:
# Make an empty dictionary for each folder
graph_dict[element] = {}
for stage in ["enrichment", "embedding"]:
print(element, stage)
# Create the file pattern for the current subfolder
file_list = glob.glob(os.path.join(cfg.biobridge.source,
element,
stage, '*.parquet.gzip'))
print(file_list)
# Read and concatenate all dataframes in the folder
# Except the edges embedding, which is too large to read in one go
# We are using a chunk size to read the edges embedding in smaller parts instead
if element == "edges" and stage == "embedding":
# For edges embedding, only read two columns: triplet_index and edge_emb
# graph_dict[element][stage] = cudf.concat([cudf.read_parquet(f, columns=["triplet_index", "edge_emb"]) for f in file_list[:2]], ignore_index=True)
# Loop by chunks
# file_list = file_list[:2]
chunk_size = 5
graph_dict[element][stage] = []
for i in range(0, len(file_list), chunk_size):
chunk_files = file_list[i:i+chunk_size]
chunk_df = cudf.concat([cudf.read_parquet(f, columns=["triplet_index", "edge_emb"]) for f in chunk_files], ignore_index=True)
graph_dict[element][stage].append(chunk_df)
else:
# For nodes and edges enrichment, read and concatenate all dataframes in the folder
# This includes the nodes embedding, which is small enough to read in one go
graph_dict[element][stage] = cudf.concat([cudf.read_parquet(f) for f in file_list], ignore_index=True)
nodes enrichment ['/mnt/blockstorage/biobridge_multimodal/nodes/enrichment/drug.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/nodes/enrichment/cellular_component.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/nodes/enrichment/gene_protein.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/nodes/enrichment/disease.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/nodes/enrichment/biological_process.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/nodes/enrichment/molecular_function.parquet.gzip'] nodes embedding ['/mnt/blockstorage/biobridge_multimodal/nodes/embedding/drug.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/nodes/embedding/cellular_component.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/nodes/embedding/gene_protein.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/nodes/embedding/disease.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/nodes/embedding/biological_process.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/nodes/embedding/molecular_function.parquet.gzip'] edges enrichment ['/mnt/blockstorage/biobridge_multimodal/edges/enrichment/edges.parquet.gzip'] edges embedding ['/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3050000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2250000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1150000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_600000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1550000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1750000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3100000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1600000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2750000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2950000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3700000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_500000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_800000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1050000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_300000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_250000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3600000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_900000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2400000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1100000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3450000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_400000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1500000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_0.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1250000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3900000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1400000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_50000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1450000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1800000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1000000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1950000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2100000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2350000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3500000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3750000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2800000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1350000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_150000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2500000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_450000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_850000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1850000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3000000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_550000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_200000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3300000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2650000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3350000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_100000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3400000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3550000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_350000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3800000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3200000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2850000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2200000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3850000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3250000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2900000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_750000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1300000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2300000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2700000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3150000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1900000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2150000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_950000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2450000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1700000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_650000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_3650000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2550000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_700000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2000000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2600000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_2050000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1200000.parquet.gzip', '/mnt/blockstorage/biobridge_multimodal/edges/embedding/edges_1650000.parquet.gzip'] CPU times: user 19.9 s, sys: 15.4 s, total: 35.3 s Wall time: 24.4 s
# Get nodes enrichment and embedding dataframes
nodes_enrichment_df = graph_dict['nodes']['enrichment']
nodes_embedding_df = graph_dict['nodes']['embedding']
# Get edges enrichment and embedding dataframes
edges_enrichment_df = graph_dict['edges']['enrichment']
edges_embedding_df = graph_dict['edges']['embedding'] # !!consisted of a list of dataframes!!
# Merge nodes enrichment and embedding dataframes
merged_nodes_df = nodes_enrichment_df.merge(
nodes_embedding_df[["node_id", "desc_emb", "feat_emb"]],
on="node_id",
how="left"
)
# del nodes_enrichment_df, nodes_embedding_df # Free memory
Normalization of the embeddings¶
Helper to normalize the vector/matrix.
def normalize_matrix(m, axis=1):
"""
Normalize each row of a 2D matrix using CuPy.
Parameters:
m (cupy.ndarray): 2D matrix to normalize.
Returns:
cupy.ndarray: Normalized matrix.
"""
norms = cp.linalg.norm(m, axis=axis, keepdims=True)
return m / norms
def normalize_vector(v):
"""
Normalize a vector using CuPy.
Parameters:
v (cupy.ndarray): Vector to normalize.
Returns:
cupy.ndarray: Normalized vector.
"""
v = cp.asarray(v)
norm = cp.linalg.norm(v)
return v / norm
Setup Milvus Database¶
# Configuration for Milvus
milvus_host = "localhost"
milvus_port = "19530"
milvus_uri = "http://localhost:19530"
milvus_token = "root:Milvus"
milvus_user = "root"
milvus_password = "Milvus"
milvus_database = "t2kg_primekg"
# Connect to Milvus
connections.connect(
alias="default",
host=milvus_host,
port=milvus_port,
user=milvus_user,
password=milvus_password
)
# Check if the database exists, create if it doesn't
if milvus_database not in db.list_database():
db.create_database(milvus_database)
# Switch to the desired database
db.using_database(milvus_database)
# List all collections
for coll in utility.list_collections():
print(f"Collection: {coll}")
# Load the collection to get stats
collection = Collection(name=coll)
print(collection.num_entities)
# A helper function to chunk the data into smaller parts
# Utility: chunk generator
def chunked(data_list, chunk_size):
for i in range(0, len(data_list), chunk_size):
yield data_list[i:i + chunk_size]
Building Node Collection (Description Embedding)¶
%%time
# Configuration for Milvus collection
node_coll_name = f"{milvus_database}_nodes"
# Define schema for the collection
# Leave out the feat and feat_emb fields for now
desc_emb_dim = len(merged_nodes_df.iloc[0]['desc_emb'].to_arrow().to_pylist()[0])
node_fields = [
FieldSchema(name="node_index", dtype=DataType.INT64, is_primary=True),
FieldSchema(name="node_id", dtype=DataType.VARCHAR, max_length=1024),
FieldSchema(name="node_name", dtype=DataType.VARCHAR, max_length=1024,
enable_analyzer=True, enable_match=True),
FieldSchema(name="node_type", dtype=DataType.VARCHAR, max_length=1024,
enable_analyzer=True, enable_match=True),
FieldSchema(name="desc", dtype=DataType.VARCHAR, max_length=40960,
enable_analyzer=True, enable_match=True),
FieldSchema(name="desc_emb", dtype=DataType.FLOAT_VECTOR, dim=desc_emb_dim),
]
schema = CollectionSchema(fields=node_fields, description=f"Schema for collection {node_coll_name}")
# Create collection if it doesn't exist
if not utility.has_collection(node_coll_name):
collection = Collection(name=node_coll_name, schema=schema)
else:
collection = Collection(name=node_coll_name)
# Create indexes
collection.create_index(
field_name="node_index",
index_params={"index_type": "STL_SORT"}, # STL_SORT
index_name="node_index_index"
)
# Create index for node_name, node_type, desc fields (inverted)
collection.create_index(
field_name="node_name",
index_params={"index_type": "INVERTED"},
index_name="node_name_index"
)
collection.create_index(
field_name="node_type",
index_params={"index_type": "INVERTED"},
index_name="node_type_index"
)
collection.create_index(
field_name="desc",
index_params={"index_type": "INVERTED"},
index_name="desc_index"
)
collection.create_index(
field_name="desc_emb",
index_params={"index_type": "GPU_CAGRA", "metric_type": "IP"}, # AUTOINDEX
index_name="desc_emb_index"
)
# Prepare data for insertion
# Normalize the embeddings
graph_desc_emb_cp = cp.asarray(merged_nodes_df["desc_emb"].list.leaves).astype(cp.float32).reshape(merged_nodes_df.shape[0], -1)
graph_desc_emb_norm = normalize_matrix(graph_desc_emb_cp, axis=1)
data = [
merged_nodes_df["node_index"].to_arrow().to_pylist(),
merged_nodes_df["node_id"].to_arrow().to_pylist(),
merged_nodes_df["node_name"].to_arrow().to_pylist(),
merged_nodes_df["node_type"].to_arrow().to_pylist(),
merged_nodes_df["desc"].to_arrow().to_pylist(),
graph_desc_emb_norm.tolist(), # Use normalized embeddings
]
# Insert data in batches
batch_size = 500
total = len(data[0])
for i in tqdm(range(0, total, batch_size)):
batch = [
col[i:i+batch_size] for col in data
]
collection.insert(batch)
# Flush to persist data
collection.flush()
# Get collection stats
print(collection.num_entities)
100%|██████████| 170/170 [01:52<00:00, 1.51it/s]
84981 CPU times: user 28.2 s, sys: 3.68 s, total: 31.9 s Wall time: 2min 3s
# List all collections
for coll in utility.list_collections():
print(f"Collection: {coll}")
# Load the collection to get stats
collection = Collection(name=coll)
print(collection.num_entities)
Collection: t2kg_primekg_nodes 84981
%%time
# Assume node_coll_name is defined and collection exists
collection = Collection('t2kg_primekg_nodes')
# Load the collection into memory before query
collection.load()
# Query by expr on node_index
expr = "node_index == 13814"
output_fields = ["node_index", "node_id", "node_name", "node_type", "desc", "desc_emb"]
results = collection.query(expr, output_fields=output_fields)
print(results)
data: ["{'node_name': 'Copper', 'node_type': 'drug', 'desc': 'Copper belongs to drug node. Copper is a transition metal and a trace element in the body. It is important to the function of many enzymes including cytochrome c oxidase, monoamine oxidase and superoxide dismutase. Copper is commonly used in contraceptive intrauterine devices (IUD). Copper is absorbed from the gut via high affinity copper uptake protein and likely through low affinity copper uptake protein and natural resistance-associated macrophage protein-2. It is believed that copper is reduced to the Cu1+ form prior to transport. Once inside the enterocyte, it is bound to copper transport protein ATOX1 which shuttles the ion to copper transporting ATPase-1 on the golgi membrane which take up copper into the golgi apparatus. Once copper has been secreted by enterocytes into the systemic circulation it remain largely bound by ceruloplasmin (65-90%), albumin (18%), and alpha 2-macroglobulin (12%). Copper is nearly entirely bound by ceruloplasmin (65-90%), plasma albumin (18%), and alpha 2-macroglobulin (12%). Copper is incorporated into many enzymes throughout the body as an essential part of their function. Copper ions are known to reduce fertility when released from copper-containing IUDs. For use in the supplementation of total parenteral nutrition and in contraception with intrauterine devices.', 'desc_emb': [-0.008437114, -0.006676033, 0.017289387, -0.031070005, -0.02470869, 0.026931802, -0.025539009, -0.016030516, -0.022900736, -0.017262602, 0.01635193, 0.02225791, -0.013927933, 0.0072853803, -0.010954855, 0.01364, 0.033105627, 0.025713107, -0.0011316446, 0.019137517, -0.042480197, 0.02196328, 0.0012337605, -0.011530722, 0.001766102, 0.0112494845, 0.030427177, -0.03964104, -0.0038636622, -0.02178918, -0.00078553875, 0.0020724498, -0.02006158, 0.01814649, 0.010546392, 0.011095474, 0.019512499, 0.006207305, -0.002527786, -0.0065588513, 0.018280413, 0.006548807, -0.0063512716, 0.024239961, -0.0007826092, 0.009568758, 0.0057821013, 0.0011140673, -0.025391694, 0.0064517134, 0.009200471, 0.012454786, -0.0059997253, -0.015856417, -0.0007487101, -0.021869535, 0.0077942857, 0.018454513, 0.011999451, -0.02035621, -0.0113432305, -0.010820933, -0.011624468, 0.024373883, 0.00061897276, 0.03139142, 0.0070309276, 0.008109003, -0.0015032793, 0.017235817, 0.0064718015, 0.031150358, 0.012809681, -0.012829769, 0.037096515, -0.025820246, -0.065086305, 0.00038105118, 0.003024973, 0.01802596, 0.019057162, 0.0065119783, -0.0011835395, 0.01903038, 0.01008436, 0.015923379, 0.008470594, 0.025418477, -0.004456269, -0.0039708004, -0.0071246736, 0.01754384, 0.019887483, 0.03682867, -0.006200609, 0.03460556, -0.016418891, 0.050461974, -0.013064133, -0.011738301, -0.00844381, 0.01552161, -0.009287521, -0.01676709, -0.019485714, 0.005273196, -0.0142895235, -0.011678036, 0.016981365, -0.022606106, -0.011236092, 0.071407445, 0.010526303, -0.0386768, -0.008309888, 0.0015719145, 0.027427314, -0.007051016, -0.00069723366, -0.0017995827, -0.016539421, 0.014959136, 0.01676709, -0.023329288, 0.009401355, 0.011992754, -0.022351654, -0.019244654, 0.007546529, -0.007821071, 0.0013810751, -0.0016715194, 0.003853618, 0.04004281, -0.013372155, 0.0042955624, -0.020275857, -0.0016430608, -0.005882543, -0.024119431, 0.03361453, 0.021280276, -0.011952577, -0.0022632892, 0.0011249485, 0.040551715, 0.038891077, 0.008972803, -0.009321001, 0.004888169, 0.009890172, -0.0013693569, 0.030534314, -0.028739754, 0.021574905, 0.0130507415, -0.0073791263, 0.016218007, 0.014061855, -0.029355798, -0.0016413869, -0.035221603, -0.009990614, -0.0026014433, 0.017342957, 0.01982052, 0.012829769, -0.0066392045, 0.025726499, -0.005929416, 0.01220703, 0.02304805, -0.029543288, 0.031284284, 0.00592272, 0.009622327, 0.007881336, 0.014222562, -0.013767227, -0.029329013, -0.0033681493, -0.0037900049, 0.018722357, -0.009321001, -0.009856692, 0.0010152995, 0.018333983, 0.012896731, 0.011557506, -0.015856417, -0.027454099, 0.008450506, -0.029302228, -0.027748728, -0.63554233, 0.0041382033, -0.003960756, -0.021936495, -0.01101512, 0.019606246, 0.017704546, -0.004278822, 0.008852273, 5.335972e-05, 0.000274541, 0.023623917, 0.020757977, -0.023155188, -0.012046323, -0.02494975, -0.015267157, -0.0025411781, 0.006274266, -0.053033285, -0.052872576, 0.0046169762, -0.020570487, 0.016981365, 0.014329701, -0.002574659, 0.018575042, -0.019726776, -0.009347786, 0.0075063524, 0.002807349, 0.023356073, 0.019258047, 0.042399842, 0.051988687, 0.0048781247, -0.014878782, 0.020275857, -0.0076871477, 0.03503411, -0.010037486, -0.024963142, 0.015789455, -0.040016025, -0.0047944235, 0.011537418, 0.019539284, 0.018842887, 0.019673206, -0.006160432, -0.012963692, -0.015280549, -0.011959273, 0.0075800098, -0.00516271, 0.011617771, 0.029114736, -0.026034521, 0.008102308, -0.004181728, 0.001487376, -0.0014020005, 0.00071020745, -0.01766437, -0.019766951, -0.010995032, -0.036266197, -0.008731743, 0.0051392736, 0.028793324, 0.011075386, 0.012474875, 0.009749553, -0.016325146, 0.030507531, 0.015481433, -0.008169269, 0.007760805, -0.0039473637, 0.04620324, 0.013459205, 0.012059716, -0.008216142, -0.017744724, 0.030695021, 0.007519745, -0.006481846, -0.00019094409, 0.020369602, -0.018200058, 0.009454924, 0.0076201865, -0.0066392045, -0.0193384, -0.025391694, 0.018936632, -0.019231262, -0.022177555, 0.019807128, 0.0041482477, -0.0082094455, -0.027333569, -0.035194818, 0.015401079, 0.016151046, 0.014128816, -0.026851447, -0.0047475505, 0.038408954, -0.024333706, -0.0041348552, -0.0017008149, 0.0075264405, -0.016807266, -0.0034551988, -0.0041214633, 0.003189028, 0.012836466, -0.0002423159, -0.027855866, 0.030427177, -0.011510633, 0.0033396906, 0.007539833, -0.010057575, 0.0055443887, 0.0026717526, -0.02524438, -0.0032911438, -0.014008286, 0.002204698, -0.0062943543, 0.0224454, -0.010747275, 0.03179319, 0.013619912, 0.03969461, -0.0013752161, -0.0063613155, -0.03964104, -0.016700128, -0.011611075, 0.006870221, -4.9462367e-05, -0.012394521, -0.015079666, -0.023623917, 0.02453459, 0.003016603, -0.012481571, -0.017168857, -0.006826696, -0.0050220913, 0.03755185, 0.0193384, -0.012173549, -0.009200471, -0.0056950515, -0.01262219, -0.0032057683, -0.008470594, 0.038408954, -0.020329425, 0.005705096, -0.009374571, 0.0071849385, 0.0056749634, 0.022485577, -0.013593127, -0.03806076, 0.006421581, 0.0027654984, -0.013994894, -0.008504075, -0.025391694, 0.0005382008, -0.0013676828, -0.005279892, -0.02006158, 0.0006177172, -0.0077273245, -0.011323142, -0.014945744, -0.009622327, 0.022498969, 0.014557368, 0.01921787, 0.0050890525, 0.004061198, 0.027079117, 0.0032308786, 0.014463623, -0.021601688, -0.008852273, -0.010499519, -0.0053535495, -0.0070778006, 0.0051928423, -0.002079146, 0.02213738, 0.014222562, -0.012253903, -0.006615768, -0.034391284, 0.00048756137, -0.009957133, -0.0130172605, 0.005427207, 0.03002541, -0.0023955377, -0.005718488, -0.021333843, 0.0013534536, -0.013077525, -0.0031655915, 0.042239137, 0.0065387627, -0.018950025, -0.00015662647, -0.025083672, -0.0006281799, -0.010887894, 0.036266197, -0.0013852601, -0.0011827025, 0.0016397128, 0.02035621, -0.0025880511, -0.0035589887, -0.0057620127, 0.01101512, -0.009354482, -0.009287521, -0.010111144, -0.0024323664, 0.0072050267, 0.007345645, -0.011336534, 0.032409232, -0.015320727, -0.0017995827, 0.010532999, 0.028257633, -0.00056498527, 0.008745135, -0.013820795, 0.020811547, 0.018333983, 0.0041382033, 0.010298636, 0.0005545226, 0.011303053, -0.03790005, -0.016137654, 0.0016070692, -0.01020489, 0.012595405, 0.030105762, 0.035382308, 0.028043358, 0.030802159, -0.013251625, 0.0038435739, -0.013070829, 0.0035589887, 0.021052606, 0.017342957, -0.016378714, -0.019164301, 0.00043692195, -0.036667965, -0.00024566398, 0.009394659, -0.019740168, 0.013613216, 0.03144499, -0.01790543, 0.01724921, 0.013646696, -0.011202612, -0.028686184, -0.027266607, 0.0076268828, 0.019646421, -0.01032542, -0.026195228, -0.029114736, 0.015976947, 0.004928346, 0.01856165, -0.009508493, 0.019258047, -0.010466038, 0.025324732, -0.017624194, -0.0038804025, 0.021119568, -0.0087987045, 0.010921375, -0.012267295, -0.016619775, -0.021976672, -0.041676663, 0.0151600195, 0.053568974, 0.007713932, 0.011912401, -0.0077474127, 0.009762946, 0.01110217, -0.016392106, 0.0046872855, 0.0025227638, -0.04087313, 0.00070727785, 0.01821345, -0.020048188, 0.014075248, 0.030962866, -0.022003457, -0.018347373, -0.0094817085, -0.0050220913, 0.001211998, 0.012736023, 0.020034797, -0.01343242, 0.0070577124, 0.019258047, 0.0061738244, 0.0067563867, -0.01581624, 0.019311616, 0.0057352283, 0.010452646, -0.021467766, -0.012140069, -0.0019602897, -0.0013844232, 0.0045500146, -0.00853086, -0.023141798, 0.0020172067, -0.0075733135, 0.021507943, -0.021601688, 0.011229396, 0.023650702, 0.013901149, -0.0015576853, 0.006702818, 0.02871297, 0.03701616, 0.00019502455, 0.024963142, -0.0034250661, 0.01802596, 0.010198194, -0.0448908, -0.0026667304, 0.009776338, 0.016057301, -0.0027956308, 0.022271302, 0.017101895, 0.026971979, 0.009454924, -0.009756249, -0.01032542, -0.020865116, 0.012675758, -0.01163786, 0.0040310654, -0.010211586, 0.018066136, -0.000767543, 0.011651251, -0.034525204, 0.028016573, -0.028793324, 0.011216004, 0.010419166, -0.018427728, -0.0053736377, -0.0022381789, -0.011557506, 0.02938258, -0.007901424, 0.019807128, -0.015119842, -0.012494964, -0.029007599, -0.0042587337, 0.0060231616, 0.011216004, -0.030828943, 0.00090062834, -0.010332116, 0.017048327, 0.02686484, -0.0006809119, -0.020624055, 0.0066860775, 0.03026647, -0.0037866568, -0.02208381, 0.0014647766, -0.03800719, 0.011242788, -0.008276407, 0.037444714, -5.63939e-05, -0.013727049, -0.0001843526, 0.008510771, -0.022539146, -0.009756249, -0.00853086, -0.0043123025, 0.008571036, 0.011416888, 0.010405773, 0.008423721, -0.012501659, -0.00015045349, -0.011115562, -0.0003496631, -0.03313241, -0.011055297, -0.005514256, -0.0120864995, 0.006100167, -0.015776064, -0.02620862, -0.00028395743, -0.0097294655, -0.009990614, -0.016914405, 0.00078302773, 0.009079942, -0.011115562, 0.03356096, -0.01196597, -0.010767364, -0.0055912617, 0.007821071, 0.025940776, 0.023128405, -0.009769642, 0.020878509, -0.009716073, -0.013820795, -0.0048781247, 0.0052397153, 0.020985646, 0.032007463, -0.020691017, -0.032650292, -0.0014061856, -0.0060399016, -0.0091402065, -0.015468041, -0.0065722433, -0.0004624509, -0.007258596, 0.009033068, -0.011751694, -0.012320864, 0.0021193225, -0.025230987, 0.006813304, 0.01474486, -0.0061302995, 0.00942814, 0.012722631, -0.027775513, -0.031177143, 0.01957946, -0.015655532, -0.018066136, -0.007091193, -0.022565931, 0.04012316, 0.025177417, 0.025806854, 0.0005172754, 0.0060131173, -0.005109141, -0.00176108, 0.016365321, -0.010820933, -0.00090397644, 0.0082697105, 0.015843024, 0.015173412, -0.010352205, 0.01420917, -0.0014145557, -0.008021954, 0.015548394, -0.017450094, -0.0012814703, -0.022820383, -0.0072518997, -0.04269447, -0.004000933, -0.02130706, -0.0032660333, -0.031284284, -0.01844112, 0.014811821, 0.008792008, 0.019766951, -0.019900873, 0.028311202, -0.02375784, 0.035489447, 0.007218419, 0.0032040942, -0.005293284, -0.026971979, -0.00540377, 0.014276131, 0.020637447, -0.002810697, 0.015293942, -0.0067965635, -0.03098965, 0.0056548747, 0.012977084, -0.014235955, -0.007432695, 0.020034797, -0.022887344, -0.0052664997, -0.0039841924, -0.01569571, -0.046953205, -0.00029965147, 0.023128405, -0.0059093274, 0.018293805, -0.008919234, -0.0006009769, 0.02208381, -0.006073382, 0.042426627, -0.021588298, 0.038730368, 0.0048111635, -0.0042955624, -0.0052865883, -0.015762672, 0.0068467846, -0.002420648, 0.021333843, 0.04004281, -0.0011885617, -0.003135459, -0.011082081, -0.0072452035, 0.0050086994, -0.014557368, 0.007941601, 0.0017393176, 0.005105793, -0.02817728, -0.000826971, 0.0025177419, 0.00901298, 0.00045073268, -0.012997172, -0.021815965, 0.009274129, -0.0037129994, 0.018106313, 0.0016405499, 0.02627558, 0.0027839127, -0.00083534117, -0.00031513625, -0.027909435, -0.011631164, -0.0077206283, 0.017557232, 0.024293529, 0.014423446, 0.013405636, -8.83051e-05, -0.0039339717, 0.011216004, -0.020074973, 0.002909465, 0.036159057, 0.0059528523, 0.013927933, 0.025030103, 0.009274129, 0.0033296465, -0.029007599, -0.0013224841, -0.0047944235, -0.024132824, -0.015240373, -0.0040879827, 0.00015348766, -0.029462935, -0.016981365, -0.0016397128, 0.0062374375, -0.049819145, 0.0063043986, 0.049229886, -0.040149946, -0.014302916, -0.0050455276, 0.001155918, 0.029570073, -0.0095419735, -0.009334394, -0.029409366, 0.016070694, -0.010245066, 0.030828943, 0.026730917, 0.024333706, -0.004007629, 0.004720766, -0.015668925, -0.018722357, 0.013131095, -0.0072050267, -0.030507531, 0.0042754738, -0.013124399, -0.0040277173, 0.035060894, -0.0087049585, 0.015494825, 0.0010822607, 0.013994894, 0.0012019539, -0.009796427, 0.007546529, -0.029543288, -0.0004406885, 0.018963417, -0.011959273, -0.026222013, -0.012588709, 0.0012873295, 0.0110017285, -0.018588435, -0.0029914924, -0.023998901, 0.0077273245, -0.021561513, -0.020691017, 0.014316308, -0.00514597, -0.018133098, 0.015146627, -0.005879195, 0.003413348, -0.023798017, -0.015856417, 0.01850808, -0.00082320446, -0.0021025822, 0.00571514, 0.0059762886, -0.02166865, -0.02823085, 0.019043772, 0.0062608737, 0.01873575, 0.000115717354, -0.026530035, -0.0047676386, 0.018226843, -0.020436564, -0.027092509, -0.0053669414, 0.024266746, -0.0014061856, 0.023195365, 0.0076737553, -0.01562875, -0.008865666, 0.025324732, -0.039078567, 0.0077407164, 0.03425736, 0.00061939127, 0.033694886, 0.013345371, -0.038998213, -0.024936358, 0.020945469, 0.00045575478, 0.004734158, 0.014142209, -0.0091402065, 3.59655e-05, -0.012133373, -0.018066136, 2.0389169e-05, -0.011912401, 0.03198068, -0.007559921, -0.018494688, 0.0070711044, 0.002855896, -0.0065555032, -0.0012019539, -0.007586706, 0.014222562, -0.013994894, 0.0025512225, -0.0067362986, 0.03664118, -0.009602238, -0.0117784785, 0.01599034, -0.0017142071, -0.001816323, 0.023382857, -0.017222425, -0.023423035, -0.011269573, -0.026489858, -0.00024524546, -0.008604516, 0.005926068, -0.008490683, 0.0024691948, -0.001923461, -0.02782908, 0.010178105, -0.018575042, -0.01469129, -0.028766539, 0.012977084, -0.008450506, 0.0042085126, -0.0014672877, -0.0024457586, -0.0030048846, -0.015601964, -0.004760943, 0.0046605007, -0.023007875, -0.025913991, -0.009187079, 0.0075733135, 0.01707511, -0.019499106, -0.006809956, 0.00847729, 0.017235817, 0.19231261, -0.0063881003, 0.028391555, 0.027320176, -0.009441532, 0.0026449682, 0.015401079, 0.0048145116, 0.020503525, 0.015950162, 0.013218144, 0.007432695, -0.014543977, 0.0008219489, -0.03382881, -0.015642142, -0.042426627, 0.0019619637, -0.012709239, 0.017958999, -0.013211448, -0.020449957, 0.023409642, -0.014651114, 0.008062131, -0.0011977688, 0.010720491, -0.0028960726, 0.019016987, 0.00032894698, 0.0017778203, 0.005390378, 0.0108477175, -0.00043273685, 0.014168994, -0.0067329505, 0.011450368, -0.028552262, 0.01224051, -0.019445539, -0.0039774966, 0.010633442, -0.028257633, -0.010834325, -0.01023837, 0.013265017, 0.00040888193, -0.023141798, -0.014677899, -0.0045801476, -0.035998352, 0.010961551, 0.0021544772, 0.0027219735, -0.0039339717, 0.012695847, -0.003026647, 0.0005666593, 0.008671478, 0.0038770544, -0.0035824252, -0.0019586156, -0.012508355, 0.040685635, -0.0028207414, 0.030373607, -0.023208758, -0.009488405, 0.02679788, -0.024976535, -0.0007658689, 0.008229534, -0.0071380655, 0.00011770526, -0.0041984683, 0.007425999, -0.01044595, 0.017932214, 0.0131110065, -0.00018236469, -0.010767364, -0.01110217, -0.029864702, 0.013680177, -0.006200609, -0.0011400147, 0.014651114, -0.0065320665, -0.025873814, -0.009441532, 0.012106588, -0.019847305, -0.00853086, -0.012715935, 0.013305194, 0.0055778692, 0.011416888, 0.0060131173, -0.002914487, 0.0052899364, -0.023838194, 0.072318114, 0.009086638, 0.014530584, 0.01023837, 0.01706172, -0.021119568, 0.01880271, 0.0057553165, -0.021923102, 0.017209033, -0.02662378, -0.0134525085, -0.011416888, 0.0065655475, 0.025646146, 0.018775925, -0.011905705, 0.010419166, -0.009146903, 0.0070108394, -0.024400668, 0.00925404, 0.004181728, -0.0052999803, 1.2934501e-05, -0.027373746, 0.015414472, -0.020543702, -0.035757292, -0.011631164, -0.008135788, 0.0059327637, 0.009930349, -0.012454786, 0.020798154, 0.01730278, -0.004847992, 0.004690633, 0.024065861, -0.01826702, -0.003512116, 0.028980814, 0.0059695924, 0.005343505, -0.020744586, -0.02154812, -0.00063445757, -0.02220434, -0.019793736, 0.001487376, -0.017731331, -0.0049417377, -0.0005821441, 0.013847579, -0.022632891, -0.009508493, -0.036185842, 0.01396811, -0.017570624, -0.016606383, 0.001157592, 0.028820107, 0.0021193225, -0.013847579, 0.009180383, -0.16874227, 0.015588571, 0.011082081, -0.027400529, 0.013425724, 0.0067496905, -0.02381141, 0.01844112, 0.0076871477, -0.011162435, 0.033587746, 0.008571036, -0.022177555, -0.022659676, -0.003512116, -0.008149181, -0.006542111, 0.005323417, 0.021333843, 0.01635193, 0.023061443, -0.027668376, 0.0059662443, -0.009829907, 0.03431093, 0.027146077, 0.017383132, -0.0064483653, 0.009006284, -0.009448228, -0.00042018163, 0.019191084, 0.0417838, 0.00017807499, 0.025043495, 0.004837948, 0.017275995, -0.026637172, 0.00018121379, 0.022780206, 0.0069103977, 0.0014488733, -0.014543977, 0.02698537, -0.020945469, 0.03187354, -0.012896731, 0.002855896, 0.029329013, 0.002906117, 0.026945194, -0.003800049, -0.0041448995, 0.024065861, 0.01999462, 0.0019000245, -0.0012990476, 0.036453687, -0.0031388071, -0.011122258, 0.0028358076, -0.017450094, 0.017195642, 0.0009968851, 0.023530172, -0.015079666, -0.0011492219, 0.019070555, -0.025391694, -0.002743736, -0.012756112, 0.008169269, 0.018789317, -0.010365597, 0.019793736, 0.019043772, -0.019766951, 0.0050823563, -0.003356431, 0.015950162, -0.0072719883, 0.009937045, -0.038757153, -0.012006146, -0.016365321, -0.01574928, 0.01683405, -0.0051359255, -0.004653805, 0.0034418066, 0.017329564, -0.02137402, -0.031311065, -0.03157891, 0.026596995, 0.01310431, 0.014343092, -0.009655808, -0.01844112, -0.022070417, 0.025592577, -0.021226706, -0.029811133, -0.0023938636, 0.044676524, 0.012494964, -0.01184544, -0.017048327, 0.02782908, -0.0025076976, 0.009849995, -0.0013316913, 0.0193384, 0.040149946, -0.020195503, 0.034926973, 0.020141935, -0.020824939, -0.010004006, -0.020262465, 0.045640767, 0.007499656, -0.00045240673, 0.010720491, -0.026288973, -0.0073992144, -0.11935167, -0.0065588513, 0.02513724, 0.013927933, -0.009361179, 0.0033095581, -0.01903038, 0.029275443, 0.013666784, 0.022485577, -0.024427451, -0.016726913, -0.009896868, -0.005882543, 0.008872362, 0.009207168, -0.009501797, -0.0030015365, -0.027775513, 0.032141387, -0.001972008, -0.023074836, 0.006398144, 0.01861522, -0.008109003, -0.010499519, -0.005038832, 0.0130172605, 0.0058658025, 0.0071447617, 0.02441406, 0.00042562225, 0.035194818, -0.0025076976, -0.016874228, 0.007004143, 0.018695572, 0.00035803326, 0.044542603, -0.02016872, -0.004563407, 0.010620049, 0.0044730096, -0.011510633, 0.026061306, -0.010432558, -0.037096515, -0.005440599, -0.014450231, -0.011765086, -0.025954168, -0.0095419735, -0.03736436, -0.0046337163, 0.011818655, 0.005946156, 0.021226706, 0.019191084, -0.029757565, -0.013171271, -0.0018447816, -0.0039071874, -0.012227118, 0.007452783, 0.031016435, -0.014356485, -0.008417025, -0.002807349, 0.00208919, -0.0405785, -0.025030103, -0.0056816596, -0.016606383, -0.0039205793, -0.019164301, 0.04028387, 0.019351792, 0.012890034, 0.01969999, -0.041703448, -0.011865527, -0.024373883, -0.0050723124, -0.033802025, -0.0056247422, 0.038542878, 0.0364269, 0.0030567795, 0.009742857, -0.019432146, -0.019351792, 0.036989376, 0.0048982133, -0.015334118, 0.0010881198, 0.043015886, 0.0024256702, -0.00086128863, 0.018226843, 0.007981777, -0.016485853, -0.024132824, -0.049712006, 0.0054707313, 0.025913991, -0.0067999116, 0.00084998895, 0.00028479443, 0.0081156995, 0.004071242, -0.0093879625, 0.012970388, -0.010365597, -0.004821208, 0.005705096, -0.011979362, -0.02494975, 0.0039272755, 0.033052057, -0.0040879827, 0.0024859353, 0.008182661, -0.014932351, 0.0040411097, -0.0035991655, 0.013445812, -0.042828396, -0.0010069293, 0.0075532254, -0.013767227, -0.0077808932, -0.006106863, 0.0077675013, -0.035596583, -0.0016296686, -0.0072719883, -0.005122533, -0.028445125, -0.01486539, -0.003245945, 0.014396662, 0.02161508, -0.00023792157, -0.023315895, -0.0058591063, -0.011651251, 0.004235297, -0.007024232, -0.026637172, 0.010064271, -0.006763083, 0.013044045, 0.026596995, 0.012126677, 0.014905566, -0.032462798, -0.0009801448, -0.0042520375, -0.003525508, -0.0138877565, -0.0343645, -0.02058388, 0.011564203, 0.011021816, -0.0034016299, 0.00616378, 0.029409366, -0.001814649, -0.027614806, -0.029275443, 0.030400392, -0.007218419, -0.011724909, -0.016445676, -0.004653805, 0.0107539715, 0.013660088, 0.0042520375, -0.021467766, 0.002519416, -0.004667197, 0.013144487, -0.017958999, -0.014597545, -0.013633303, 0.022726638, 0.004114767, 0.0128632495, 0.006870221, 0.021226706, 0.018695572, 0.0051325774, -0.0010362249, 0.0150662735, -0.008370153, -0.008845577, -0.007646971, 0.00176108, -0.002142759, -0.013117703, -0.018521473, 0.034766264, -0.0052999803, -0.001649757, -0.00096005644, -0.027561236, -0.019566068, 0.0021661955, -0.027119292, -0.04743533, -0.035435878, 0.032328878, -0.0009416421, 0.018936632, 0.028498694, -0.008129092, -0.019659813, 0.005879195, -0.014102032, -0.00030090698, 0.0034719391, 0.025632754, -0.008691566, 0.019150909, -0.013070829, -0.00196866, 0.044730093, -0.013010564, 0.016405499, -0.026114875, 0.04012316, 0.006501934, 0.019753559, -0.019900873, -0.046283595, -0.012736023, 0.023610525, -0.024762258, 0.016124262, 0.016874228, 0.0021829358, 0.07371091, 0.006542111, -0.042587336, 0.0032057683, 0.01391454, 0.018936632, -0.02184275, 0.0013425724, 0.018106313, -0.027963005, 0.0022448748, -0.006009769, 0.03144499, -0.019766951, -0.01861522, 0.018521473, -0.007841159, 0.02018211, -0.017342957, -0.02536491, 0.0050957487, -0.04250698, 0.008035347, 6.980576e-07, -0.047542464, 0.015200196, 0.047703173, -0.012059716, -0.0010688684, -0.057265233, 0.0033162544, -0.0016614752, -0.028498694, -0.0152537655, 0.009736161, 0.0026650564, -0.0068467846, -0.023864977, 0.0007918164, 0.029034384, -0.007707236, 0.041623093, -0.019887483, -0.0112494845, -0.014878782, -0.00737243, -0.027588021, -0.03353418, -0.030828943], 'node_index': 13814, 'node_id': 'Copper_(14012)'}"] CPU times: user 5 ms, sys: 1.73 ms, total: 6.73 ms Wall time: 12.5 ms
%%time
# Assume node_coll_name is defined and collection exists
collection = Collection('t2kg_primekg_nodes')
# Load the collection into memory before query
collection.load()
# Query by expr on node_index
expr = "node_index in [13814, 13815]"
output_fields = ["node_index", "node_id", "node_name", "node_type", "desc", "desc_emb"]
results = collection.query(expr, output_fields=output_fields)
print(results)
data: ["{'node_type': 'drug', 'desc': 'Copper belongs to drug node. Copper is a transition metal and a trace element in the body. It is important to the function of many enzymes including cytochrome c oxidase, monoamine oxidase and superoxide dismutase. Copper is commonly used in contraceptive intrauterine devices (IUD). Copper is absorbed from the gut via high affinity copper uptake protein and likely through low affinity copper uptake protein and natural resistance-associated macrophage protein-2. It is believed that copper is reduced to the Cu1+ form prior to transport. Once inside the enterocyte, it is bound to copper transport protein ATOX1 which shuttles the ion to copper transporting ATPase-1 on the golgi membrane which take up copper into the golgi apparatus. Once copper has been secreted by enterocytes into the systemic circulation it remain largely bound by ceruloplasmin (65-90%), albumin (18%), and alpha 2-macroglobulin (12%). Copper is nearly entirely bound by ceruloplasmin (65-90%), plasma albumin (18%), and alpha 2-macroglobulin (12%). Copper is incorporated into many enzymes throughout the body as an essential part of their function. Copper ions are known to reduce fertility when released from copper-containing IUDs. For use in the supplementation of total parenteral nutrition and in contraception with intrauterine devices.', 'desc_emb': [-0.008437114, -0.006676033, 0.017289387, -0.031070005, -0.02470869, 0.026931802, -0.025539009, -0.016030516, -0.022900736, -0.017262602, 0.01635193, 0.02225791, -0.013927933, 0.0072853803, -0.010954855, 0.01364, 0.033105627, 0.025713107, -0.0011316446, 0.019137517, -0.042480197, 0.02196328, 0.0012337605, -0.011530722, 0.001766102, 0.0112494845, 0.030427177, -0.03964104, -0.0038636622, -0.02178918, -0.00078553875, 0.0020724498, -0.02006158, 0.01814649, 0.010546392, 0.011095474, 0.019512499, 0.006207305, -0.002527786, -0.0065588513, 0.018280413, 0.006548807, -0.0063512716, 0.024239961, -0.0007826092, 0.009568758, 0.0057821013, 0.0011140673, -0.025391694, 0.0064517134, 0.009200471, 0.012454786, -0.0059997253, -0.015856417, -0.0007487101, -0.021869535, 0.0077942857, 0.018454513, 0.011999451, -0.02035621, -0.0113432305, -0.010820933, -0.011624468, 0.024373883, 0.00061897276, 0.03139142, 0.0070309276, 0.008109003, -0.0015032793, 0.017235817, 0.0064718015, 0.031150358, 0.012809681, -0.012829769, 0.037096515, -0.025820246, -0.065086305, 0.00038105118, 0.003024973, 0.01802596, 0.019057162, 0.0065119783, -0.0011835395, 0.01903038, 0.01008436, 0.015923379, 0.008470594, 0.025418477, -0.004456269, -0.0039708004, -0.0071246736, 0.01754384, 0.019887483, 0.03682867, -0.006200609, 0.03460556, -0.016418891, 0.050461974, -0.013064133, -0.011738301, -0.00844381, 0.01552161, -0.009287521, -0.01676709, -0.019485714, 0.005273196, -0.0142895235, -0.011678036, 0.016981365, -0.022606106, -0.011236092, 0.071407445, 0.010526303, -0.0386768, -0.008309888, 0.0015719145, 0.027427314, -0.007051016, -0.00069723366, -0.0017995827, -0.016539421, 0.014959136, 0.01676709, -0.023329288, 0.009401355, 0.011992754, -0.022351654, -0.019244654, 0.007546529, -0.007821071, 0.0013810751, -0.0016715194, 0.003853618, 0.04004281, -0.013372155, 0.0042955624, -0.020275857, -0.0016430608, -0.005882543, -0.024119431, 0.03361453, 0.021280276, -0.011952577, -0.0022632892, 0.0011249485, 0.040551715, 0.038891077, 0.008972803, -0.009321001, 0.004888169, 0.009890172, -0.0013693569, 0.030534314, -0.028739754, 0.021574905, 0.0130507415, -0.0073791263, 0.016218007, 0.014061855, -0.029355798, -0.0016413869, -0.035221603, -0.009990614, -0.0026014433, 0.017342957, 0.01982052, 0.012829769, -0.0066392045, 0.025726499, -0.005929416, 0.01220703, 0.02304805, -0.029543288, 0.031284284, 0.00592272, 0.009622327, 0.007881336, 0.014222562, -0.013767227, -0.029329013, -0.0033681493, -0.0037900049, 0.018722357, -0.009321001, -0.009856692, 0.0010152995, 0.018333983, 0.012896731, 0.011557506, -0.015856417, -0.027454099, 0.008450506, -0.029302228, -0.027748728, -0.63554233, 0.0041382033, -0.003960756, -0.021936495, -0.01101512, 0.019606246, 0.017704546, -0.004278822, 0.008852273, 5.335972e-05, 0.000274541, 0.023623917, 0.020757977, -0.023155188, -0.012046323, -0.02494975, -0.015267157, -0.0025411781, 0.006274266, -0.053033285, -0.052872576, 0.0046169762, -0.020570487, 0.016981365, 0.014329701, -0.002574659, 0.018575042, -0.019726776, -0.009347786, 0.0075063524, 0.002807349, 0.023356073, 0.019258047, 0.042399842, 0.051988687, 0.0048781247, -0.014878782, 0.020275857, -0.0076871477, 0.03503411, -0.010037486, -0.024963142, 0.015789455, -0.040016025, -0.0047944235, 0.011537418, 0.019539284, 0.018842887, 0.019673206, -0.006160432, -0.012963692, -0.015280549, -0.011959273, 0.0075800098, -0.00516271, 0.011617771, 0.029114736, -0.026034521, 0.008102308, -0.004181728, 0.001487376, -0.0014020005, 0.00071020745, -0.01766437, -0.019766951, -0.010995032, -0.036266197, -0.008731743, 0.0051392736, 0.028793324, 0.011075386, 0.012474875, 0.009749553, -0.016325146, 0.030507531, 0.015481433, -0.008169269, 0.007760805, -0.0039473637, 0.04620324, 0.013459205, 0.012059716, -0.008216142, -0.017744724, 0.030695021, 0.007519745, -0.006481846, -0.00019094409, 0.020369602, -0.018200058, 0.009454924, 0.0076201865, -0.0066392045, -0.0193384, -0.025391694, 0.018936632, -0.019231262, -0.022177555, 0.019807128, 0.0041482477, -0.0082094455, -0.027333569, -0.035194818, 0.015401079, 0.016151046, 0.014128816, -0.026851447, -0.0047475505, 0.038408954, -0.024333706, -0.0041348552, -0.0017008149, 0.0075264405, -0.016807266, -0.0034551988, -0.0041214633, 0.003189028, 0.012836466, -0.0002423159, -0.027855866, 0.030427177, -0.011510633, 0.0033396906, 0.007539833, -0.010057575, 0.0055443887, 0.0026717526, -0.02524438, -0.0032911438, -0.014008286, 0.002204698, -0.0062943543, 0.0224454, -0.010747275, 0.03179319, 0.013619912, 0.03969461, -0.0013752161, -0.0063613155, -0.03964104, -0.016700128, -0.011611075, 0.006870221, -4.9462367e-05, -0.012394521, -0.015079666, -0.023623917, 0.02453459, 0.003016603, -0.012481571, -0.017168857, -0.006826696, -0.0050220913, 0.03755185, 0.0193384, -0.012173549, -0.009200471, -0.0056950515, -0.01262219, -0.0032057683, -0.008470594, 0.038408954, -0.020329425, 0.005705096, -0.009374571, 0.0071849385, 0.0056749634, 0.022485577, -0.013593127, -0.03806076, 0.006421581, 0.0027654984, -0.013994894, -0.008504075, -0.025391694, 0.0005382008, -0.0013676828, -0.005279892, -0.02006158, 0.0006177172, -0.0077273245, -0.011323142, -0.014945744, -0.009622327, 0.022498969, 0.014557368, 0.01921787, 0.0050890525, 0.004061198, 0.027079117, 0.0032308786, 0.014463623, -0.021601688, -0.008852273, -0.010499519, -0.0053535495, -0.0070778006, 0.0051928423, -0.002079146, 0.02213738, 0.014222562, -0.012253903, -0.006615768, -0.034391284, 0.00048756137, -0.009957133, -0.0130172605, 0.005427207, 0.03002541, -0.0023955377, -0.005718488, -0.021333843, 0.0013534536, -0.013077525, -0.0031655915, 0.042239137, 0.0065387627, -0.018950025, -0.00015662647, -0.025083672, -0.0006281799, -0.010887894, 0.036266197, -0.0013852601, -0.0011827025, 0.0016397128, 0.02035621, -0.0025880511, -0.0035589887, -0.0057620127, 0.01101512, -0.009354482, -0.009287521, -0.010111144, -0.0024323664, 0.0072050267, 0.007345645, -0.011336534, 0.032409232, -0.015320727, -0.0017995827, 0.010532999, 0.028257633, -0.00056498527, 0.008745135, -0.013820795, 0.020811547, 0.018333983, 0.0041382033, 0.010298636, 0.0005545226, 0.011303053, -0.03790005, -0.016137654, 0.0016070692, -0.01020489, 0.012595405, 0.030105762, 0.035382308, 0.028043358, 0.030802159, -0.013251625, 0.0038435739, -0.013070829, 0.0035589887, 0.021052606, 0.017342957, -0.016378714, -0.019164301, 0.00043692195, -0.036667965, -0.00024566398, 0.009394659, -0.019740168, 0.013613216, 0.03144499, -0.01790543, 0.01724921, 0.013646696, -0.011202612, -0.028686184, -0.027266607, 0.0076268828, 0.019646421, -0.01032542, -0.026195228, -0.029114736, 0.015976947, 0.004928346, 0.01856165, -0.009508493, 0.019258047, -0.010466038, 0.025324732, -0.017624194, -0.0038804025, 0.021119568, -0.0087987045, 0.010921375, -0.012267295, -0.016619775, -0.021976672, -0.041676663, 0.0151600195, 0.053568974, 0.007713932, 0.011912401, -0.0077474127, 0.009762946, 0.01110217, -0.016392106, 0.0046872855, 0.0025227638, -0.04087313, 0.00070727785, 0.01821345, -0.020048188, 0.014075248, 0.030962866, -0.022003457, -0.018347373, -0.0094817085, -0.0050220913, 0.001211998, 0.012736023, 0.020034797, -0.01343242, 0.0070577124, 0.019258047, 0.0061738244, 0.0067563867, -0.01581624, 0.019311616, 0.0057352283, 0.010452646, -0.021467766, -0.012140069, -0.0019602897, -0.0013844232, 0.0045500146, -0.00853086, -0.023141798, 0.0020172067, -0.0075733135, 0.021507943, -0.021601688, 0.011229396, 0.023650702, 0.013901149, -0.0015576853, 0.006702818, 0.02871297, 0.03701616, 0.00019502455, 0.024963142, -0.0034250661, 0.01802596, 0.010198194, -0.0448908, -0.0026667304, 0.009776338, 0.016057301, -0.0027956308, 0.022271302, 0.017101895, 0.026971979, 0.009454924, -0.009756249, -0.01032542, -0.020865116, 0.012675758, -0.01163786, 0.0040310654, -0.010211586, 0.018066136, -0.000767543, 0.011651251, -0.034525204, 0.028016573, -0.028793324, 0.011216004, 0.010419166, -0.018427728, -0.0053736377, -0.0022381789, -0.011557506, 0.02938258, -0.007901424, 0.019807128, -0.015119842, -0.012494964, -0.029007599, -0.0042587337, 0.0060231616, 0.011216004, -0.030828943, 0.00090062834, -0.010332116, 0.017048327, 0.02686484, -0.0006809119, -0.020624055, 0.0066860775, 0.03026647, -0.0037866568, -0.02208381, 0.0014647766, -0.03800719, 0.011242788, -0.008276407, 0.037444714, -5.63939e-05, -0.013727049, -0.0001843526, 0.008510771, -0.022539146, -0.009756249, -0.00853086, -0.0043123025, 0.008571036, 0.011416888, 0.010405773, 0.008423721, -0.012501659, -0.00015045349, -0.011115562, -0.0003496631, -0.03313241, -0.011055297, -0.005514256, -0.0120864995, 0.006100167, -0.015776064, -0.02620862, -0.00028395743, -0.0097294655, -0.009990614, -0.016914405, 0.00078302773, 0.009079942, -0.011115562, 0.03356096, -0.01196597, -0.010767364, -0.0055912617, 0.007821071, 0.025940776, 0.023128405, -0.009769642, 0.020878509, -0.009716073, -0.013820795, -0.0048781247, 0.0052397153, 0.020985646, 0.032007463, -0.020691017, -0.032650292, -0.0014061856, -0.0060399016, -0.0091402065, -0.015468041, -0.0065722433, -0.0004624509, -0.007258596, 0.009033068, -0.011751694, -0.012320864, 0.0021193225, -0.025230987, 0.006813304, 0.01474486, -0.0061302995, 0.00942814, 0.012722631, -0.027775513, -0.031177143, 0.01957946, -0.015655532, -0.018066136, -0.007091193, -0.022565931, 0.04012316, 0.025177417, 0.025806854, 0.0005172754, 0.0060131173, -0.005109141, -0.00176108, 0.016365321, -0.010820933, -0.00090397644, 0.0082697105, 0.015843024, 0.015173412, -0.010352205, 0.01420917, -0.0014145557, -0.008021954, 0.015548394, -0.017450094, -0.0012814703, -0.022820383, -0.0072518997, -0.04269447, -0.004000933, -0.02130706, -0.0032660333, -0.031284284, -0.01844112, 0.014811821, 0.008792008, 0.019766951, -0.019900873, 0.028311202, -0.02375784, 0.035489447, 0.007218419, 0.0032040942, -0.005293284, -0.026971979, -0.00540377, 0.014276131, 0.020637447, -0.002810697, 0.015293942, -0.0067965635, -0.03098965, 0.0056548747, 0.012977084, -0.014235955, -0.007432695, 0.020034797, -0.022887344, -0.0052664997, -0.0039841924, -0.01569571, -0.046953205, -0.00029965147, 0.023128405, -0.0059093274, 0.018293805, -0.008919234, -0.0006009769, 0.02208381, -0.006073382, 0.042426627, -0.021588298, 0.038730368, 0.0048111635, -0.0042955624, -0.0052865883, -0.015762672, 0.0068467846, -0.002420648, 0.021333843, 0.04004281, -0.0011885617, -0.003135459, -0.011082081, -0.0072452035, 0.0050086994, -0.014557368, 0.007941601, 0.0017393176, 0.005105793, -0.02817728, -0.000826971, 0.0025177419, 0.00901298, 0.00045073268, -0.012997172, -0.021815965, 0.009274129, -0.0037129994, 0.018106313, 0.0016405499, 0.02627558, 0.0027839127, -0.00083534117, -0.00031513625, -0.027909435, -0.011631164, -0.0077206283, 0.017557232, 0.024293529, 0.014423446, 0.013405636, -8.83051e-05, -0.0039339717, 0.011216004, -0.020074973, 0.002909465, 0.036159057, 0.0059528523, 0.013927933, 0.025030103, 0.009274129, 0.0033296465, -0.029007599, -0.0013224841, -0.0047944235, -0.024132824, -0.015240373, -0.0040879827, 0.00015348766, -0.029462935, -0.016981365, -0.0016397128, 0.0062374375, -0.049819145, 0.0063043986, 0.049229886, -0.040149946, -0.014302916, -0.0050455276, 0.001155918, 0.029570073, -0.0095419735, -0.009334394, -0.029409366, 0.016070694, -0.010245066, 0.030828943, 0.026730917, 0.024333706, -0.004007629, 0.004720766, -0.015668925, -0.018722357, 0.013131095, -0.0072050267, -0.030507531, 0.0042754738, -0.013124399, -0.0040277173, 0.035060894, -0.0087049585, 0.015494825, 0.0010822607, 0.013994894, 0.0012019539, -0.009796427, 0.007546529, -0.029543288, -0.0004406885, 0.018963417, -0.011959273, -0.026222013, -0.012588709, 0.0012873295, 0.0110017285, -0.018588435, -0.0029914924, -0.023998901, 0.0077273245, -0.021561513, -0.020691017, 0.014316308, -0.00514597, -0.018133098, 0.015146627, -0.005879195, 0.003413348, -0.023798017, -0.015856417, 0.01850808, -0.00082320446, -0.0021025822, 0.00571514, 0.0059762886, -0.02166865, -0.02823085, 0.019043772, 0.0062608737, 0.01873575, 0.000115717354, -0.026530035, -0.0047676386, 0.018226843, -0.020436564, -0.027092509, -0.0053669414, 0.024266746, -0.0014061856, 0.023195365, 0.0076737553, -0.01562875, -0.008865666, 0.025324732, -0.039078567, 0.0077407164, 0.03425736, 0.00061939127, 0.033694886, 0.013345371, -0.038998213, -0.024936358, 0.020945469, 0.00045575478, 0.004734158, 0.014142209, -0.0091402065, 3.59655e-05, -0.012133373, -0.018066136, 2.0389169e-05, -0.011912401, 0.03198068, -0.007559921, -0.018494688, 0.0070711044, 0.002855896, -0.0065555032, -0.0012019539, -0.007586706, 0.014222562, -0.013994894, 0.0025512225, -0.0067362986, 0.03664118, -0.009602238, -0.0117784785, 0.01599034, -0.0017142071, -0.001816323, 0.023382857, -0.017222425, -0.023423035, -0.011269573, -0.026489858, -0.00024524546, -0.008604516, 0.005926068, -0.008490683, 0.0024691948, -0.001923461, -0.02782908, 0.010178105, -0.018575042, -0.01469129, -0.028766539, 0.012977084, -0.008450506, 0.0042085126, -0.0014672877, -0.0024457586, -0.0030048846, -0.015601964, -0.004760943, 0.0046605007, -0.023007875, -0.025913991, -0.009187079, 0.0075733135, 0.01707511, -0.019499106, -0.006809956, 0.00847729, 0.017235817, 0.19231261, -0.0063881003, 0.028391555, 0.027320176, -0.009441532, 0.0026449682, 0.015401079, 0.0048145116, 0.020503525, 0.015950162, 0.013218144, 0.007432695, -0.014543977, 0.0008219489, -0.03382881, -0.015642142, -0.042426627, 0.0019619637, -0.012709239, 0.017958999, -0.013211448, -0.020449957, 0.023409642, -0.014651114, 0.008062131, -0.0011977688, 0.010720491, -0.0028960726, 0.019016987, 0.00032894698, 0.0017778203, 0.005390378, 0.0108477175, -0.00043273685, 0.014168994, -0.0067329505, 0.011450368, -0.028552262, 0.01224051, -0.019445539, -0.0039774966, 0.010633442, -0.028257633, -0.010834325, -0.01023837, 0.013265017, 0.00040888193, -0.023141798, -0.014677899, -0.0045801476, -0.035998352, 0.010961551, 0.0021544772, 0.0027219735, -0.0039339717, 0.012695847, -0.003026647, 0.0005666593, 0.008671478, 0.0038770544, -0.0035824252, -0.0019586156, -0.012508355, 0.040685635, -0.0028207414, 0.030373607, -0.023208758, -0.009488405, 0.02679788, -0.024976535, -0.0007658689, 0.008229534, -0.0071380655, 0.00011770526, -0.0041984683, 0.007425999, -0.01044595, 0.017932214, 0.0131110065, -0.00018236469, -0.010767364, -0.01110217, -0.029864702, 0.013680177, -0.006200609, -0.0011400147, 0.014651114, -0.0065320665, -0.025873814, -0.009441532, 0.012106588, -0.019847305, -0.00853086, -0.012715935, 0.013305194, 0.0055778692, 0.011416888, 0.0060131173, -0.002914487, 0.0052899364, -0.023838194, 0.072318114, 0.009086638, 0.014530584, 0.01023837, 0.01706172, -0.021119568, 0.01880271, 0.0057553165, -0.021923102, 0.017209033, -0.02662378, -0.0134525085, -0.011416888, 0.0065655475, 0.025646146, 0.018775925, -0.011905705, 0.010419166, -0.009146903, 0.0070108394, -0.024400668, 0.00925404, 0.004181728, -0.0052999803, 1.2934501e-05, -0.027373746, 0.015414472, -0.020543702, -0.035757292, -0.011631164, -0.008135788, 0.0059327637, 0.009930349, -0.012454786, 0.020798154, 0.01730278, -0.004847992, 0.004690633, 0.024065861, -0.01826702, -0.003512116, 0.028980814, 0.0059695924, 0.005343505, -0.020744586, -0.02154812, -0.00063445757, -0.02220434, -0.019793736, 0.001487376, -0.017731331, -0.0049417377, -0.0005821441, 0.013847579, -0.022632891, -0.009508493, -0.036185842, 0.01396811, -0.017570624, -0.016606383, 0.001157592, 0.028820107, 0.0021193225, -0.013847579, 0.009180383, -0.16874227, 0.015588571, 0.011082081, -0.027400529, 0.013425724, 0.0067496905, -0.02381141, 0.01844112, 0.0076871477, -0.011162435, 0.033587746, 0.008571036, -0.022177555, -0.022659676, -0.003512116, -0.008149181, -0.006542111, 0.005323417, 0.021333843, 0.01635193, 0.023061443, -0.027668376, 0.0059662443, -0.009829907, 0.03431093, 0.027146077, 0.017383132, -0.0064483653, 0.009006284, -0.009448228, -0.00042018163, 0.019191084, 0.0417838, 0.00017807499, 0.025043495, 0.004837948, 0.017275995, -0.026637172, 0.00018121379, 0.022780206, 0.0069103977, 0.0014488733, -0.014543977, 0.02698537, -0.020945469, 0.03187354, -0.012896731, 0.002855896, 0.029329013, 0.002906117, 0.026945194, -0.003800049, -0.0041448995, 0.024065861, 0.01999462, 0.0019000245, -0.0012990476, 0.036453687, -0.0031388071, -0.011122258, 0.0028358076, -0.017450094, 0.017195642, 0.0009968851, 0.023530172, -0.015079666, -0.0011492219, 0.019070555, -0.025391694, -0.002743736, -0.012756112, 0.008169269, 0.018789317, -0.010365597, 0.019793736, 0.019043772, -0.019766951, 0.0050823563, -0.003356431, 0.015950162, -0.0072719883, 0.009937045, -0.038757153, -0.012006146, -0.016365321, -0.01574928, 0.01683405, -0.0051359255, -0.004653805, 0.0034418066, 0.017329564, -0.02137402, -0.031311065, -0.03157891, 0.026596995, 0.01310431, 0.014343092, -0.009655808, -0.01844112, -0.022070417, 0.025592577, -0.021226706, -0.029811133, -0.0023938636, 0.044676524, 0.012494964, -0.01184544, -0.017048327, 0.02782908, -0.0025076976, 0.009849995, -0.0013316913, 0.0193384, 0.040149946, -0.020195503, 0.034926973, 0.020141935, -0.020824939, -0.010004006, -0.020262465, 0.045640767, 0.007499656, -0.00045240673, 0.010720491, -0.026288973, -0.0073992144, -0.11935167, -0.0065588513, 0.02513724, 0.013927933, -0.009361179, 0.0033095581, -0.01903038, 0.029275443, 0.013666784, 0.022485577, -0.024427451, -0.016726913, -0.009896868, -0.005882543, 0.008872362, 0.009207168, -0.009501797, -0.0030015365, -0.027775513, 0.032141387, -0.001972008, -0.023074836, 0.006398144, 0.01861522, -0.008109003, -0.010499519, -0.005038832, 0.0130172605, 0.0058658025, 0.0071447617, 0.02441406, 0.00042562225, 0.035194818, -0.0025076976, -0.016874228, 0.007004143, 0.018695572, 0.00035803326, 0.044542603, -0.02016872, -0.004563407, 0.010620049, 0.0044730096, -0.011510633, 0.026061306, -0.010432558, -0.037096515, -0.005440599, -0.014450231, -0.011765086, -0.025954168, -0.0095419735, -0.03736436, -0.0046337163, 0.011818655, 0.005946156, 0.021226706, 0.019191084, -0.029757565, -0.013171271, -0.0018447816, -0.0039071874, -0.012227118, 0.007452783, 0.031016435, -0.014356485, -0.008417025, -0.002807349, 0.00208919, -0.0405785, -0.025030103, -0.0056816596, -0.016606383, -0.0039205793, -0.019164301, 0.04028387, 0.019351792, 0.012890034, 0.01969999, -0.041703448, -0.011865527, -0.024373883, -0.0050723124, -0.033802025, -0.0056247422, 0.038542878, 0.0364269, 0.0030567795, 0.009742857, -0.019432146, -0.019351792, 0.036989376, 0.0048982133, -0.015334118, 0.0010881198, 0.043015886, 0.0024256702, -0.00086128863, 0.018226843, 0.007981777, -0.016485853, -0.024132824, -0.049712006, 0.0054707313, 0.025913991, -0.0067999116, 0.00084998895, 0.00028479443, 0.0081156995, 0.004071242, -0.0093879625, 0.012970388, -0.010365597, -0.004821208, 0.005705096, -0.011979362, -0.02494975, 0.0039272755, 0.033052057, -0.0040879827, 0.0024859353, 0.008182661, -0.014932351, 0.0040411097, -0.0035991655, 0.013445812, -0.042828396, -0.0010069293, 0.0075532254, -0.013767227, -0.0077808932, -0.006106863, 0.0077675013, -0.035596583, -0.0016296686, -0.0072719883, -0.005122533, -0.028445125, -0.01486539, -0.003245945, 0.014396662, 0.02161508, -0.00023792157, -0.023315895, -0.0058591063, -0.011651251, 0.004235297, -0.007024232, -0.026637172, 0.010064271, -0.006763083, 0.013044045, 0.026596995, 0.012126677, 0.014905566, -0.032462798, -0.0009801448, -0.0042520375, -0.003525508, -0.0138877565, -0.0343645, -0.02058388, 0.011564203, 0.011021816, -0.0034016299, 0.00616378, 0.029409366, -0.001814649, -0.027614806, -0.029275443, 0.030400392, -0.007218419, -0.011724909, -0.016445676, -0.004653805, 0.0107539715, 0.013660088, 0.0042520375, -0.021467766, 0.002519416, -0.004667197, 0.013144487, -0.017958999, -0.014597545, -0.013633303, 0.022726638, 0.004114767, 0.0128632495, 0.006870221, 0.021226706, 0.018695572, 0.0051325774, -0.0010362249, 0.0150662735, -0.008370153, -0.008845577, -0.007646971, 0.00176108, -0.002142759, -0.013117703, -0.018521473, 0.034766264, -0.0052999803, -0.001649757, -0.00096005644, -0.027561236, -0.019566068, 0.0021661955, -0.027119292, -0.04743533, -0.035435878, 0.032328878, -0.0009416421, 0.018936632, 0.028498694, -0.008129092, -0.019659813, 0.005879195, -0.014102032, -0.00030090698, 0.0034719391, 0.025632754, -0.008691566, 0.019150909, -0.013070829, -0.00196866, 0.044730093, -0.013010564, 0.016405499, -0.026114875, 0.04012316, 0.006501934, 0.019753559, -0.019900873, -0.046283595, -0.012736023, 0.023610525, -0.024762258, 0.016124262, 0.016874228, 0.0021829358, 0.07371091, 0.006542111, -0.042587336, 0.0032057683, 0.01391454, 0.018936632, -0.02184275, 0.0013425724, 0.018106313, -0.027963005, 0.0022448748, -0.006009769, 0.03144499, -0.019766951, -0.01861522, 0.018521473, -0.007841159, 0.02018211, -0.017342957, -0.02536491, 0.0050957487, -0.04250698, 0.008035347, 6.980576e-07, -0.047542464, 0.015200196, 0.047703173, -0.012059716, -0.0010688684, -0.057265233, 0.0033162544, -0.0016614752, -0.028498694, -0.0152537655, 0.009736161, 0.0026650564, -0.0068467846, -0.023864977, 0.0007918164, 0.029034384, -0.007707236, 0.041623093, -0.019887483, -0.0112494845, -0.014878782, -0.00737243, -0.027588021, -0.03353418, -0.030828943], 'node_index': 13814, 'node_id': 'Copper_(14012)', 'node_name': 'Copper'}", '{\'node_type\': \'drug\', \'desc\': "Oxygen belongs to drug node. Oxygen is an element displayed by the symbol O, and atomic number 8. It is an essential element for human survival. Decreased oxygen levels may be treated with medical oxygen therapy. Treatment with oxygen serves to increase blood oxygen levels and also exerts a secondary effect of decreasing blood flow resistance in the diseased lung, leading to decreased cardiovascular workload in an attempt to oxygenate the lungs. Oxygen therapy is used to treat emphysema, pneumonia, some heart disorders (congestive heart failure), some disorders that cause increased pulmonary artery pressure, and any disease that impairs the body\'s ability to take up and use gaseous oxygen. Higher level of oxygen than ambient air (hyperoxia) can be introduced under normobaric or hyperbaric conditions. Oxygen therapy increases the arterial pressure of oxygen and is effective in improving gas exchange and oxygen delivery to tissues, provided that there are functional alveolar units. Oxygen plays a critical role as an electron acceptor during oxidative phosphorylation in the electron transport chain through activation of cytochrome c oxidase (terminal enzyme of the electron transport chain). This process achieves successful aerobic respiration in organisms to generate ATP molecules as an energy source in many tissues. Oxygen supplementation acts to restore normal cellular activity at the mitochondrial level and reduce metabolic acidosis. There is also evidence that oxygen may interact with O2-sensitive voltage-gated potassium channels in glomus cells and cause hyperpolarization of mitochondrial membrane. Oxygen binds to oxygen-carrying protein in red blood cells called hemoglobin with high affinity. The amount of oxygen molecules bound to the fixed amount of circulating hemoglobin in the blood determines the overall oxygen saturation level and this oxygen-delivering capacity is regulated by Bohr effect. Oxygen therapy improves effective cellular oxygenation, even at a low rate of tissue perfusion. Oxygen molecules adjust hypoxic ventilatory drive by acting on chemoreceptors on carotid bodies that sequentially relay sensory information to the higher processing centers in brainstem. It also attenuates hypoxia-induced mitochondrial depolarization that generates reactive oxygen species and/or apoptosis. Oxygen therapy in clinical settings is used across diverse specialties, including various types of anoxia, hypoxia or dyspnea and any other disease states and conditions that reduce the efficiency of gas exchange and oxygen consumption such as respiratory illnesses, trauma, poisonings and drug overdoses. Oxygen therapy tries to achieve hyperoxia to reduce the extent of hypoxia-induced tissue damage and malfunction. ", \'desc_emb\': [0.0011131193, 0.00035166115, -0.011181605, -0.04077155, -0.011246652, 0.02419754, -0.016274797, -0.01151985, -0.027632028, 0.0079422565, -0.019462107, 0.01414125, -0.00018365656, 0.023781238, -0.0011261287, -0.010680742, 0.035047404, 0.0017481421, 0.010882388, -0.014713665, -0.018174173, 0.017953012, -0.016600031, 0.009880662, -0.017913984, 0.01151985, 0.033954613, -0.0328358, 0.019579193, -0.024535784, 0.021543616, 0.001392822, -0.020190636, -0.010231917, -0.0010399413, 0.009100096, -0.0030637207, -0.003120637, 0.013894071, -0.004823246, 0.027762122, 0.017744862, -0.003639388, 0.0068234457, -0.0026230263, -0.01823922, -0.0025270816, -0.037831422, 0.0065014623, -0.004302869, 0.0029531405, 0.009568435, 0.004058942, -0.0051192106, 0.0036361355, -0.032263387, -0.016105674, 0.02557654, 0.010485601, -0.008527681, -0.003802006, -0.013568835, -0.030988462, 0.012612642, -0.0056265783, 0.022467285, 0.0030474588, 0.04420604, -0.01037502, 0.006468939, 0.028100368, 0.03715493, 0.012924869, 0.024210548, 0.008384577, -0.005893272, -0.024392681, 0.005278576, 0.017419627, 0.0045435433, 0.010335992, -0.021556625, -0.00673238, 0.026435161, 0.029895669, -0.0028344295, -0.0046281046, 0.012261388, 0.004631357, 0.010023765, 0.010745789, 0.004556553, 0.009236695, 0.0147917215, 0.006397387, 0.03699882, 0.002775887, 0.032185327, 0.0026799424, -0.018187182, 0.00010651471, -0.0014310373, -0.034813233, -0.010179879, -0.031612914, 0.014921816, -0.005350128, 0.0019855641, 0.003447499, -0.007090139, -0.011428784, 0.056721114, -0.008638261, -0.013321656, 0.0046281046, 0.02326086, 0.026851462, 0.007623526, -0.017575739, 0.0045012627, 0.0059843375, 0.017133418, 0.010257935, -0.005460708, -0.00026181477, -0.01346476, -0.032341443, -0.018889692, -0.005050911, -0.0074088704, 0.015090939, 0.015806457, 0.016769154, -0.011448299, -0.021881862, 0.042046476, -0.011832076, -0.018174173, -0.029505387, -0.024626851, 0.014388429, 0.0074153747, -0.0053826515, -0.0074218796, -0.011227137, 0.020476842, 0.03533361, 0.01528608, 0.013646891, -0.003623126, 0.0057176445, -0.009535912, 0.0016074777, -0.028230462, 0.00014625445, 0.009340771, -0.009568435, 0.017172446, -0.014037175, -0.020398786, 0.01639188, -0.016508967, -0.016105674, -0.0051192106, 0.020177625, 0.007838181, -0.0015351127, 0.0139461085, -0.008124389, 0.0012342697, -0.00445573, 0.03759725, -0.003967876, 0.008566709, -0.002275024, 0.035229534, -0.0039386046, 0.03174301, 0.002837682, -0.017432636, -0.007486927, 0.017979031, 0.0079227425, 0.009666006, -0.015871504, 0.005633083, 0.027085632, -0.009692025, 0.027189707, -0.04425808, -0.00073828513, 0.025615567, -0.013829024, -0.009581445, -0.64610034, -0.015689373, -0.038924213, -0.011233643, 0.014583571, 0.018161165, 0.014609589, -0.0010496983, -8.110566e-05, 0.022779511, 0.0058022058, 0.019696277, -0.0050931918, -0.0045142723, 0.016118683, -0.03585399, -0.018382324, -0.013568835, 0.032133292, -0.038429856, -0.023364935, -0.016261786, -0.042983156, 0.00016800458, 0.012801278, 0.026396133, 0.021582644, -0.005714392, 0.003805258, 0.028178426, 0.007207224, 0.010069299, 0.032185327, 0.018811636, 0.053286623, -0.0018424605, -0.020021513, 0.017237494, 0.008579719, 0.018538438, 0.021998946, -0.0034052182, 0.0255245, -0.025732651, -0.013438741, 0.019449098, 0.027996292, -0.015585297, 0.0085927285, 0.0087293275, 0.02054189, 0.005174501, -0.022402238, 0.012957392, 0.00079682755, -0.00049191905, 0.021517597, -0.020932171, 0.0094188275, -0.010550647, -0.00042361955, 0.010479095, -0.009945709, -0.02624002, -0.0026978306, 0.024991114, -0.028022312, 0.0030068045, 0.010270945, 0.015624325, 0.011350728, 0.03556778, -0.0048557697, 0.00478747, 0.008996021, 0.0072657666, -0.00083585584, 0.0035938548, -0.012989916, 0.03806559, 0.014180278, -0.0053989133, -0.005805458, -0.003057216, 0.04496059, 0.015208024, -0.02327387, 0.016053636, 0.02374221, -0.0009505015, 0.015572287, 0.012807784, -0.0036328833, -0.028620746, -0.012664679, -0.0011692225, 0.009080582, 0.0037076874, 0.027033595, 0.015910532, -0.010615694, -0.005167996, -0.010498609, 0.018811636, -0.012092265, 0.0040361756, -0.037363082, -0.023442993, 0.035932045, -0.02236321, -0.006267293, -0.019110853, 0.023143776, -0.0022864072, 0.041265912, -0.006758399, -0.0039548664, 0.0010732779, 0.004361411, -0.05151734, 0.015936552, -0.016600031, -0.0014838881, -0.012846812, 0.021075277, -0.008722822, -0.0075584785, -0.013529807, -0.015116957, -0.014778712, -0.0017595254, -0.011240147, 0.007434889, 0.0124890525, 0.006059142, 0.00071755133, 0.030650217, 0.009679016, 0.01800505, -0.024080455, 0.0047842176, -0.00135542, -0.011031996, -0.0028815886, -0.010075803, -0.0034442465, -0.015299089, 0.008781365, -0.018863672, 0.0055029886, -0.017874956, -0.0064299107, -0.0117800385, 0.04680793, 0.0033824518, -0.023013681, 0.005668859, -0.015728401, -0.024587821, -0.007499936, -0.0029905427, 0.024314623, 0.0055094934, 0.0026457927, -0.021959918, -0.006133946, -0.018187182, 0.02167371, -0.015884513, -0.042931117, -0.012807784, -0.009412322, -0.006986064, -0.013972128, -0.004468739, 0.016001599, -0.011695477, -0.0068039317, 0.0011090538, 0.0027872704, 0.0087098135, -0.017003324, 0.0012049985, -0.010401039, 0.0013456629, 0.009191162, 0.019488126, 0.0139851365, 0.013737958, 0.038455874, -0.0125475945, 0.031404763, -0.015663354, 0.014180278, -0.002946636, -0.027241746, -0.0027466158, -0.029349273, 0.004123989, 0.025459453, 0.017224485, -0.026539236, 0.031352725, -0.018343296, 0.030702254, 0.0066868467, -0.009048059, -0.0031889365, 0.010179879, 0.01505191, -0.007825172, -0.01128568, 0.00038154217, 0.0049078073, -0.018915711, 0.02283155, -0.011558878, -0.006381125, 0.0048460127, -0.016899249, 0.003029571, -0.0058379816, 0.0066868467, -0.0036003597, -0.015364137, 0.0051289676, 0.028985009, 0.0027970274, -0.0032328432, -0.007454403, -0.007727601, -0.017953012, 0.0053728945, -0.009490379, 0.003603612, 0.01937104, -0.00041508212, -0.009490379, 0.03078031, -0.007278776, -0.009054563, 0.0053566326, 0.032809783, -0.022675436, -0.006751894, 0.011968675, 0.03124865, 0.0054574558, -0.015858496, -0.016756145, -0.017679814, -0.0075454693, -0.0065632574, -0.0012749241, 0.0020684993, -0.005441194, 0.02215506, -0.0069015026, 0.04514272, 0.030390028, 0.04077155, -0.011669459, 0.034110725, -0.012287406, -0.0009822119, 0.0066380617, -0.0029970473, -0.009048059, -0.005652597, -0.0016066646, -0.02258437, 0.0064624343, 0.008404092, -0.016040627, 0.03879412, 0.02143954, -0.027996292, 0.008644766, 0.033460252, 0.026604284, -0.016977306, -0.0018847411, 0.01826524, 0.031222632, -0.012671185, -0.009054563, -0.02072402, 0.011214129, -0.004494758, 0.0094773695, -0.004605338, -0.006875484, 0.005675364, 0.008878936, -0.0008216268, -0.046859965, 0.000192194, 0.018902702, 0.033746462, -0.003694678, -0.018681541, 0.008202446, -0.016404891, 0.004485001, 0.040511362, 0.008267493, 0.009275723, 0.019930447, -0.0049273213, -0.010030271, 0.011448299, -0.011162091, 0.002756373, -0.04334742, 0.018317277, 0.023182804, -0.0037434634, 0.011402765, 0.009139124, -0.032081254, 0.0030702255, -0.011669459, 0.0058802622, -0.014895797, 0.029739557, 0.008859422, -0.002883215, 0.02371619, -0.0073373183, 0.015025891, -0.0016700856, -0.017497683, 0.015494231, 0.0071877097, 0.0004768769, 0.001756273, 0.020333739, -0.0016326834, 0.004829751, 0.033642385, 0.0029254956, -0.03171699, -0.018512418, -0.006270545, 0.0052297907, -0.029817613, 0.015455202, 0.034839254, 0.02054189, 0.014310373, 0.0053631375, 0.024756944, 0.021608662, -0.0020424805, -0.0024051184, 0.025511492, 0.009236695, 0.012573614, -0.019462107, -0.014323382, -0.0037694823, -0.0021904628, 0.03101448, 0.012794774, 0.007929248, 0.023768228, -0.0039711283, 0.0038638005, -0.0040003997, -0.02327387, -9.086273e-05, 0.0034540035, -0.0019481621, -0.004859022, 0.013191562, 0.008150408, -0.009900176, -0.035047404, 0.009718044, -0.0041337465, 0.0004931387, 0.0145965805, -0.027658047, 0.0145965805, -0.013503788, -0.03392859, 0.03309599, -0.019097842, -0.0006447799, 0.0017416374, 0.014232316, 0.011890619, -0.005171248, -0.017718844, 0.006413649, -0.0058022058, -0.0060461327, -0.0052200337, 0.038611986, 0.01345175, 0.020711012, -0.00888544, 0.0035288078, 0.0005793262, -0.0035157984, 0.0077731344, -0.0012033723, -0.03582797, 0.010030271, -0.004715918, 0.004592329, 0.002275024, -0.01665207, 0.004241074, 0.022558352, -0.023117756, -0.0102058975, -0.015377146, 0.0070836344, 0.04129193, 0.0132175805, 0.012976906, -0.0145965805, -0.017315552, -0.013399713, -0.004712666, -0.00798779, -0.016990315, 0.0030507112, -0.025641587, -0.012892345, 0.014336391, -0.0023124262, -0.013334665, 0.01938405, 0.0027905228, 0.0022050983, 0.006986064, -0.009542417, -0.004550048, -0.012723222, 0.035697874, -0.017536711, -0.0005329801, -0.025654595, -0.013711939, 0.025654595, 0.021790795, -0.0068364553, -0.013126515, -0.005184258, -0.011305194, -0.0023872303, 0.00627705, 0.013568835, 0.024782963, 0.0037922487, -0.0230397, -0.034318876, 0.006771408, -0.0102254115, -0.011923143, 0.0012196341, -0.013568835, 0.0018538437, 0.013080982, 0.007350328, -0.0102449255, 0.026591275, -0.029037047, -0.030364009, 0.007948762, -0.002920617, -0.0077406107, -0.015455202, -0.023638133, -0.043945853, 0.009184658, -0.020268692, -0.014011156, -0.011071024, -0.010888892, 0.017757872, 0.030025763, 0.012437015, -0.023078728, 0.027944256, 0.012983411, -0.010667732, 0.01139626, -0.011018987, 0.011123062, -0.009854643, 0.012599633, 0.0013188309, -0.015377146, 0.014245326, -0.0044101966, -0.0006561631, 0.0035613314, -0.008052837, -0.0032409742, -0.0069210166, -0.015129967, -0.021270417, 0.016756145, -0.03215931, 0.009022039, -0.040043026, -0.010823846, 0.038846157, 0.00911961, 0.0030165615, -0.015325109, -0.004706161, -0.023560077, -0.0045337863, 0.014401439, -0.00069356523, -0.005233043, -0.02259738, -0.018174173, -0.03124865, -0.0075129457, 0.0010521376, -0.016574014, -0.012690699, -0.021179352, -0.014349401, 0.007890219, -0.009275723, -0.010784817, -0.00211078, -0.03650446, -0.00019341362, -0.009770081, -0.012280902, -0.025420425, -0.014037175, 0.034995366, 0.0032458527, 0.03304395, -0.011155586, -0.0042833546, 0.02463986, -0.02211603, 0.0069535403, -0.012853317, 0.04150008, -0.006179479, -0.014050184, -0.005906281, -0.02350804, 0.009191162, -0.01197518, 0.010869378, -0.017926995, -0.0025531005, -0.014999872, 0.012593128, 0.006189236, 0.01392009, -0.008839907, 0.02672137, -0.014115231, -0.0034832747, -0.018122135, -0.01662605, -0.024080455, 0.011539364, -0.00045126458, -0.02804833, -0.00039353524, -0.0063323397, -0.020619946, 0.005506241, -0.0020310972, -0.0007882901, 0.00684296, 0.0015188509, -0.021764776, -0.005067173, -0.026500208, -0.00991969, 0.0021888365, 0.025238294, -0.0155592775, 0.025459453, 0.01691226, -0.008137398, -0.0056135687, -0.021556625, -0.007090139, 0.032055236, -0.008345549, 0.005080182, 0.02577168, -0.0032263387, 0.0056460924, -0.0009456229, -0.0070771296, -0.007851191, -0.014973854, 0.009861148, 0.0028539437, 0.034318876, -0.019188909, -0.007857695, -0.01278827, -0.026083907, -0.025459453, -0.0027384849, 0.008013809, -0.03424082, -0.0056265783, -0.000110783425, -0.0029515144, 0.025303341, -0.017601758, -0.01939706, -0.0079422565, 0.030364009, -0.00809837, 0.025641587, 0.0042963643, 0.01662605, -0.006169722, -0.008117884, -0.014310373, -0.027632028, 0.008300016, 0.013373693, -0.041734252, -0.028126387, -0.02395036, -0.020216653, 0.0025238295, -0.0027954013, 0.020789068, 0.0022538838, 0.002884841, -0.014544542, -0.029271217, 0.025615567, -0.017068371, 0.0077796387, 0.023156784, -0.04402391, -0.021205371, -0.005460708, 0.0028246725, 0.0049891165, -0.014726674, -0.013659901, -0.040927667, 0.017458655, -0.012157312, -0.0020717517, -0.017835928, 0.017432636, -0.030650217, 0.021946907, 0.0026246523, 0.017406616, -0.013133019, -0.008260988, -0.0006988503, -0.00083748205, -0.030832348, -0.0019676762, 0.005704635, -0.007623526, -0.023573088, -0.008599233, 0.008423606, 0.012931373, 0.015702382, -0.023898322, -0.013672911, 0.0030897395, -0.047042098, -0.00087407103, -0.0038605484, 0.024444718, -0.0039808853, 0.031769026, 0.0011602786, 0.0037597253, 0.013269618, 0.009262714, -0.011767029, -0.017263513, 0.013776986, 0.0020993967, 0.00069315865, -0.014167269, -0.041604158, -0.0058542434, 0.0147917215, -0.013002925, 0.0132566085, 0.017172446, 0.010589676, 0.012300416, 0.0017156185, 0.020060541, -0.0035775932, 0.00014391681, -0.010134346, -0.023143776, -0.005294838, 0.01894173, 0.036556497, 0.0052720713, 0.010927921, -0.0006175414, 0.004839508, 0.0063225827, -0.00061103667, 9.599536e-05, 0.0029222432, -0.0057924488, -0.017237494, 0.007838181, -0.025199266, 0.0092432, 0.00644292, 0.0155202495, 0.0018343296, 0.0031190107, 0.0070771296, -0.0014481122, 0.025797699, 0.0052265385, -0.022376219, 0.014232316, 0.013829024, -0.02557654, 0.02600585, 0.0023156784, -0.007389356, -0.014440467, 0.027085632, 0.0016944782, -0.0018668532, -0.0074088704, -0.019475115, -0.016105674, -0.020919163, -0.017055362, 0.0065860236, -0.008260988, -0.0062380214, -0.0062347692, 0.0009456229, -0.013087486, -0.0016448798, 0.0029450096, 0.0013107001, 0.013763976, 0.19868001, -0.0058444864, -0.008254483, 0.017068371, -0.003185684, 0.012619147, -0.0106222, -0.02807435, -0.01128568, 0.013933099, 0.02371619, -0.008547195, -0.018850664, -0.0053111, -0.011058015, 0.0009813989, -0.0230397, -0.007324309, -0.01505191, 0.0030864873, -0.030416047, 0.00097408105, 0.011552374, 0.00205549, 0.012619147, -0.0044817487, 0.0117605245, -0.00014096937, 0.045715135, 0.008182932, -0.0055192504, 0.010017261, -0.0037011828, -0.00025002498, 0.012645165, -0.0032230862, 0.0118190665, -0.030598179, -0.0021498082, -0.009262714, 0.00216607, 0.022987662, -0.030598179, -0.0044004396, 0.029791594, 0.047796644, -0.014128241, -0.019683268, -0.02009957, -0.0115848975, -0.034006648, 0.0076950775, 0.0016879735, 0.028724821, -0.0016188609, 0.019266965, 0.009835129, 0.013107001, -0.0014798227, 3.1411928e-06, -0.0071812053, -0.01060919, -0.0070641204, 0.03231542, -0.0087683555, 0.0264872, -0.040173117, -0.0007886967, -0.016495956, 0.010693751, 0.0022977905, 0.00035897896, -0.0024262588, -0.009555426, -0.016482947, -0.010212402, 0.01619674, 0.0108563695, -0.009334266, 0.022480294, -0.008378073, -0.022063993, -0.025667604, 0.017380599, -0.006771408, -0.023364935, -0.003558079, 0.02259738, -0.009262714, 0.0063128257, -0.0032247123, -0.020112578, -0.017731853, 0.020463834, 0.021023238, -0.020789068, 0.008872431, 0.014583571, -0.020021513, 0.01937104, -0.01084336, 0.07873307, -0.014648618, -0.002457156, 0.020476842, 0.010745789, -0.029505387, 0.02737184, -0.0023807257, 0.010108327, 0.015767429, -0.043451495, -0.0044069444, -0.008085361, 0.010368516, 0.035723895, 0.008117884, -0.020177625, 0.016066646, -0.015025891, -0.0016302442, -0.018135145, -0.008781365, 0.022727475, -0.013295637, 0.0010846612, -0.02942733, 0.035099443, -0.014505514, -0.02713767, 0.021855842, -0.009054563, -0.0010066046, 0.0039093336, -0.012365463, 0.01849941, -0.0040556896, -0.022480294, 0.0073112994, 0.009913186, -0.013933099, -0.009535912, 0.010101822, 0.017926995, 0.016704109, -0.051673453, 0.0046508713, -0.02121838, 0.002483175, -0.012872831, -0.014882787, -0.02713767, 0.008917964, -0.019358031, -0.00058827014, -0.020203644, 0.016222758, -0.02305271, 0.016313825, -0.005916038, -0.007981285, 0.00398739, 0.02349503, -0.032445516, -0.0070185876, -0.0029889166, -0.16214953, 0.004452477, 0.020867126, -0.01782292, 0.0198654, -0.017003324, 0.016274797, -0.0031011228, -0.0027888964, 0.017848937, 0.018330287, 0.009802605, -0.0034767701, -0.0013066346, 0.011097044, -0.01983938, 0.018889692, 0.0282825, 0.027449897, -0.002475044, 0.016118683, 0.0045110197, 0.028932972, 0.0028132892, 0.012684194, -0.012137798, -0.005434689, 0.00991969, 0.014323382, 0.010088813, -0.023768228, 0.012749241, 0.031795047, 0.0021514345, -0.0076755635, 0.008527681, 0.032341443, -0.011116558, -0.025615567, 0.015129967, -0.0048362557, 0.014895797, -0.0040296707, 0.0024278848, -0.027970273, 0.016977306, 0.02443171, -0.008976506, 0.011968675, 0.02669535, 0.022675436, 0.011142576, -0.017900975, 0.024782963, 0.0044264584, -0.0020587423, 0.00043337664, 0.010628704, -0.021764776, -0.010739285, 0.012833802, -0.04496059, -0.007025092, 0.0017074876, 0.019943455, -7.404195e-05, -0.020060541, 0.0069405306, -0.008833403, 0.0062185074, -0.034266837, -0.025017133, 0.029271217, 0.013659901, 0.008761851, 0.011350728, -0.015012882, 0.0052558095, 0.0025075676, 0.033954613, 0.010368516, 0.004302869, -0.020658974, -0.008332539, -0.0034117228, 0.012859821, 0.01197518, -0.007525955, -0.015416174, -0.004413449, 0.01963123, -0.02487403, -0.015637334, -0.014570561, 0.016574014, 0.018967748, 0.019071825, -0.010862874, 0.0025108198, -0.0058900192, 0.019722296, -0.0006394948, -0.0023530805, -0.009692025, 0.050918907, 0.016313825, -0.0033889564, -0.009178152, 0.04220259, -0.0004467926, -0.010524629, -0.001056203, 0.017172446, 0.044180024, -0.007343823, 0.012716717, 0.023482021, -0.021907879, -0.011506841, -0.0058835144, 0.06551549, 0.013568835, -0.018681541, 0.03192514, -0.015103948, -0.04287908, -0.1313432, -0.030494103, 0.029947707, 0.012144303, 0.0064396677, 0.024496756, -0.010218907, 0.0046443664, -0.002757999, 0.025615567, -0.01153286, -0.029011028, -0.012391482, 0.006569762, 0.025953813, -0.007831677, -0.004946836, -0.0040166616, -0.00072486914, 0.028880933, -0.013503788, -0.00089602446, -0.0040394277, 0.0037239492, -0.004810237, -0.028568707, -0.0077861436, 0.017640786, 0.0046541234, -0.009548921, 0.01937104, -0.0030994967, 0.009548921, -0.0076625543, 0.009594454, 0.0065632574, 0.03746716, -0.02396337, 0.043139268, -0.015025891, 0.0023498281, 0.023377946, 0.027892217, 0.002457156, 0.027449897, -0.0269035, -0.03496935, -0.008267493, -0.017237494, 0.0011423905, -0.03489129, 0.012287406, -0.036374364, -0.0015180379, 0.002829551, -0.014765703, 0.02692952, 0.009210676, -0.032965895, -0.0040719514, 0.012183331, -0.0046638804, -0.0064559295, 0.011448299, 0.005633083, -0.042280648, -0.012443519, -0.022714464, 0.011428784, -0.024249578, -0.017692825, 0.013308646, -0.00025591988, -0.0021367988, -0.01644392, 0.0075844973, -0.00051915756, -0.018837655, 0.008449624, -0.0064266585, -0.021179352, 0.0013025692, 0.0079227425, -0.031612914, 0.0022181077, 0.044804476, 0.0191759, 0.0005305408, 0.017601758, -0.029089084, -0.019670257, 0.02371619, -0.004715918, 0.0056298305, 0.010576666, -0.0068234457, -0.010784817, -0.0072007193, 0.024509765, 0.018070098, -0.017497683, -0.027449897, -0.027892217, 0.0067909225, 0.014960844, 0.0074413936, -0.0013139524, -0.004702909, 0.016743137, 0.011903628, 0.014531533, -0.025589548, -0.012417501, 0.0063225827, -0.0054704654, -0.00078300503, -0.0125280805, -0.020060541, 0.019188909, 0.0048720315, -0.0036784161, -0.0030068045, -0.015377146, -0.004247579, -0.006124189, 0.018395334, -0.015129967, -0.016404891, -0.0043939347, 0.0046378616, -0.02305271, 0.008319531, 0.00023193374, -0.03169097, -0.00444272, -0.0016798426, -0.022272144, -0.002649045, -0.030129839, 0.00387681, -0.023221832, 0.012215855, -0.032133292, -0.030988462, 0.014180278, -0.0063258354, 0.0077796387, 0.009854643, -0.024366662, 0.022024965, 0.00027868638, -0.013646891, 0.046885986, 0.020229664, -0.024808982, -0.032029215, -0.020789068, -0.003431237, 0.0063258354, -0.0051257154, -0.0029547666, -0.015090939, 0.03627029, -0.0016733379, -0.001819694, -0.0006797427, 0.015897524, -0.024496756, 0.019423079, -0.014661627, 0.021569634, -0.014583571, -0.029401312, -0.016222758, 0.014947834, 0.008267493, 0.015988588, 0.0011862974, -0.0052623143, 0.019553173, 0.014804731, 0.011142576, 0.017315552, -0.026955537, -0.03554176, 0.019084834, 0.013672911, -0.019058814, -0.03424082, 0.028256482, 0.0071486817, -0.008482148, -0.0073112994, 0.012671185, 0.006595781, 0.007486927, 0.028906953, 0.0052265385, 0.0016456929, -0.009028545, -0.016756145, 0.018980758, 0.013386703, 0.013803005, -0.0036523973, -0.0050931918, -0.016587023, -0.011526355, -0.014674637, -0.01574141, -0.031118555, 0.009074077, 0.01346476, -0.0015619446, 0.017575739, -0.0020587423, -0.01732856, 0.02279252, 0.0013887567, -0.018993767, -0.0045630573, 0.020125588, 0.013555826, -0.0024945582, 0.017016334, 0.013334665, 0.023911333, 0.012059742, 0.027007576, -0.0148307495, 0.007213729, 0.008163417, 0.012410996, -0.013607863, -0.046469685, -0.011012482, 0.027866198, -0.0355938, 0.039990988, -0.008599233, 0.017705834, 0.052584115, 0.0029368787, -0.04496059, -0.008163417, 0.018291257, 0.02692952, -0.021491578, 0.0076365354, -0.00990668, -0.019891419, 0.020112578, -0.019566182, 0.022454275, -0.014453476, -0.028256482, 0.01800505, 0.0017432636, 0.011591402, 0.013894071, 0.012827298, 0.012580118, -0.012131293, 0.00018111565, -0.014869778, -0.04813489, -0.010043279, 0.04654774, -0.01894173, -0.018356305, -0.046209496, -0.0059908424, -0.00043093736, -0.046599776, -0.023989389, -0.003447499, -0.029557424, -0.0024685394, -0.03080633, -0.01345175, 0.008078855, -0.0059908424, 0.037571233, -0.024821991, -0.044414192, -0.034292858, -0.018993767, -0.019071825, -0.0016782164, -0.023351926], \'node_index\': 13815, \'node_id\': \'Oxygen_(14013)\', \'node_name\': \'Oxygen\'}'] CPU times: user 6.55 ms, sys: 692 μs, total: 7.24 ms Wall time: 13.6 ms
%%time
vector_to_search = merged_nodes_df["desc_emb"].loc[2]
# Assume node_coll_name is defined and collection exists
collection = Collection('t2kg_primekg_nodes')
# Load the collection into memory before query
collection.load()
# Vector similarity search in Milvus
vector_to_search = normalize_vector(merged_nodes_df["desc_emb"].iloc[2]).tolist()
search_params = {"metric_type": "IP"}
results = collection.search(
data=[vector_to_search],
anns_field="desc_emb",
param=search_params,
limit=10,
output_fields=["node_id", "node_name"]
)
results
CPU times: user 140 ms, sys: 39.1 ms, total: 179 ms Wall time: 521 ms
data: [[{'node_index': 11504, 'distance': 1.0000001192092896, 'entity': {'node_name': 'SSTR2', 'node_id': 'SSTR2_(11630)'}}, {'node_index': 28075, 'distance': 0.9640881419181824, 'entity': {'node_name': 'SSTR4', 'node_id': 'SSTR4_(34965)'}}, {'node_index': 13207, 'distance': 0.9590871334075928, 'entity': {'node_name': 'SSTR1', 'node_id': 'SSTR1_(13376)'}}, {'node_index': 10873, 'distance': 0.9556770920753479, 'entity': {'node_name': 'SSTR3', 'node_id': 'SSTR3_(10983)'}}, {'node_index': 11786, 'distance': 0.9445285797119141, 'entity': {'node_name': 'SSTR5', 'node_id': 'SSTR5_(11920)'}}, {'node_index': 12024, 'distance': 0.9246837496757507, 'entity': {'node_name': 'SST', 'node_id': 'SST_(12165)'}}, {'node_index': 15309, 'distance': 0.9021860361099243, 'entity': {'node_name': 'Somatostatin', 'node_id': 'Somatostatin_(15618)'}}, {'node_index': 10048, 'distance': 0.8932695388793945, 'entity': {'node_name': 'SCTR', 'node_id': 'SCTR_(10137)'}}, {'node_index': 78455, 'distance': 0.891120433807373, 'entity': {'node_name': 'type 2 somatostatin receptor binding', 'node_id': 'type 2 somatostatin receptor binding_(120756)'}}, {'node_index': 11639, 'distance': 0.8880254030227661, 'entity': {'node_name': 'SSR2', 'node_id': 'SSR2_(11769)'}}]]
merged_nodes_df.loc[2]
node_index | primekg_node_index | node_id | node_name | node_type | desc | feat | desc_emb | feat_emb | |
---|---|---|---|---|---|---|---|---|---|
2 | 11504 | 11630 | SSTR2_(11630) | SSTR2 | gene/protein | SSTR2 belongs to gene/protein node. SSTR2 is s... | MDMADEPLNGSHTWLSIPFDLNGSVVSTNTSNQTEPYYDLTSNAVL... | [-0.036013797, 0.002569047, -0.0049933116, -0.... | [0.10192450135946274, -0.04799338057637215, 0.... |
Building Node Collection (Node Type-specific Embedding)¶
Note that nodes information of the PrimeKG data is different for each node type, we are going to build a separate collection for each node type.
We will use the node type as the collection name.
%%time
# Loop over group enrichment nodes by node_type
for node_type, nodes_df in tqdm(merged_nodes_df.groupby('node_type')):
print(f"Processing node type: {node_type}")
# Milvus collection name for this node_type
node_coll_name = f"{milvus_database}_nodes_{node_type.replace('/', '_')}"
# Define collection schema
desc_emb_dim = len(nodes_df.iloc[0]['desc_emb'].to_arrow().to_pylist()[0])
feat_emb_dim = len(nodes_df.iloc[0]['feat_emb'].to_arrow().to_pylist()[0])
node_fields = [
FieldSchema(name="node_index", dtype=DataType.INT64, is_primary=True, auto_id=False),
FieldSchema(name="node_id", dtype=DataType.VARCHAR, max_length=1024),
FieldSchema(name="node_name", dtype=DataType.VARCHAR, max_length=1024,
enable_analyzer=True, enable_match=True),
FieldSchema(name="node_type", dtype=DataType.VARCHAR, max_length=1024,
enable_analyzer=True, enable_match=True),
FieldSchema(name="desc", dtype=DataType.VARCHAR, max_length=40960,
enable_analyzer=True, enable_match=True),
FieldSchema(name="desc_emb", dtype=DataType.FLOAT_VECTOR, dim=desc_emb_dim),
FieldSchema(name="feat", dtype=DataType.VARCHAR, max_length=40960,
enable_analyzer=True, enable_match=True),
FieldSchema(name="feat_emb", dtype=DataType.FLOAT_VECTOR, dim=feat_emb_dim),
]
schema = CollectionSchema(fields=node_fields, description=f"schema for collection {node_coll_name}")
# Create collection if not exists
if not utility.has_collection(node_coll_name):
collection = Collection(name=node_coll_name, schema=schema)
else:
collection = Collection(name=node_coll_name)
# Create index for node_index field (scalar)
collection.create_index(
field_name="node_index",
index_params={"index_type": "STL_SORT"},
index_name="node_index_index"
)
# Create index for node_name, node_type, desc fields (inverted)
collection.create_index(
field_name="node_name",
index_params={"index_type": "INVERTED"},
index_name="node_name_index"
)
collection.create_index(
field_name="node_type",
index_params={"index_type": "INVERTED"},
index_name="node_type_index"
)
collection.create_index(
field_name="desc",
index_params={"index_type": "INVERTED"},
index_name="desc_index"
)
collection.create_index(
field_name="desc_emb",
index_params={"index_type": "GPU_CAGRA", "metric_type": "IP"}, # AUTOINDEX
index_name="desc_emb_index"
)
# Create index for feat_emb (vector)
collection.create_index(
field_name="feat_emb",
index_params={"index_type": "GPU_CAGRA", "metric_type": "IP"}, # AUTOINDEX
index_name="feat_emb_index"
)
# Prepare data for insertion
# Normalize the embeddings
graph_desc_emb_cp = cp.asarray(nodes_df["desc_emb"].list.leaves).astype(cp.float32).reshape(nodes_df.shape[0], -1)
graph_desc_emb_norm = normalize_matrix(graph_desc_emb_cp, axis=1)
graph_feat_emb_cp = cp.asarray(nodes_df["feat_emb"].list.leaves).astype(cp.float32).reshape(nodes_df.shape[0], -1)
graph_feat_emb_norm = normalize_matrix(graph_feat_emb_cp, axis=1)
# Columns must be lists of values in order matching schema fields
data = [
nodes_df["node_index"].to_arrow().to_pylist(),
nodes_df["node_id"].to_arrow().to_pylist(),
nodes_df["node_name"].to_arrow().to_pylist(),
nodes_df["node_type"].to_arrow().to_pylist(),
nodes_df["desc"].to_arrow().to_pylist(),
graph_desc_emb_norm.tolist(), # Use normalized embeddings
nodes_df["feat"].to_arrow().to_pylist(),
graph_feat_emb_norm.tolist(), # Use normalized embeddings
]
# Batch insert data in chunks
batch_size = 500
total_rows = len(data[0])
for i in tqdm(range(0, total_rows, batch_size)):
batch = [col[i:i + batch_size] for col in data]
collection.insert(batch)
# Flush the collection to ensure data is persisted
collection.flush()
# Print collection stats (number of entities and segment info)
stats = collection.num_entities
print(f"Collection {node_coll_name} stats:")
print(stats)
0%| | 0/6 [00:00<?, ?it/s]
Processing node type: biological_process
100%|██████████| 55/55 [00:48<00:00, 1.12it/s] 17%|█▋ | 1/6 [00:59<04:57, 59.56s/it]
Collection t2kg_primekg_nodes_biological_process stats: 27409 Processing node type: cellular_component
100%|██████████| 9/9 [00:07<00:00, 1.24it/s] 33%|███▎ | 2/6 [01:14<02:12, 33.03s/it]
Collection t2kg_primekg_nodes_cellular_component stats: 4011 Processing node type: disease
100%|██████████| 35/35 [00:30<00:00, 1.15it/s] 50%|█████ | 3/6 [01:51<01:45, 35.14s/it]
Collection t2kg_primekg_nodes_disease stats: 17054 Processing node type: drug
100%|██████████| 14/14 [00:11<00:00, 1.18it/s] 67%|██████▋ | 4/6 [02:08<00:56, 28.09s/it]
Collection t2kg_primekg_nodes_drug stats: 6759 Processing node type: gene/protein
100%|██████████| 38/38 [00:41<00:00, 1.09s/it] 83%|████████▎ | 5/6 [02:58<00:35, 35.68s/it]
Collection t2kg_primekg_nodes_gene_protein stats: 18797 Processing node type: molecular_function
100%|██████████| 22/22 [00:19<00:00, 1.14it/s] 100%|██████████| 6/6 [03:24<00:00, 34.10s/it]
Collection t2kg_primekg_nodes_molecular_function stats: 10951 CPU times: user 1min 5s, sys: 8.56 s, total: 1min 14s Wall time: 3min 24s
# List all collections
for coll in utility.list_collections():
print(f"Collection: {coll}")
# Load the collection to get stats
collection = Collection(name=coll)
print(collection.num_entities)
Collection: t2kg_primekg_nodes_disease 17054 Collection: t2kg_primekg_nodes_drug 6759 Collection: t2kg_primekg_nodes_gene_protein 18797 Collection: t2kg_primekg_nodes_molecular_function 10951 Collection: t2kg_primekg_nodes 84981 Collection: t2kg_primekg_nodes_biological_process 27409 Collection: t2kg_primekg_nodes_cellular_component 4011
%%time
# Assume node_coll_name is defined and collection exists
collection = Collection('t2kg_primekg_nodes_gene_protein')
# Load the collection into memory before query
collection.load()
# Vector similarity search in Milvus
vector_to_search = normalize_vector(merged_nodes_df["feat_emb"].iloc[2]).tolist()
search_params = {"metric_type": "IP"}
results = collection.search(
data=[vector_to_search],
anns_field="feat_emb",
param=search_params,
limit=10,
output_fields=["node_id", "node_name"]
)
results
CPU times: user 13.9 ms, sys: 366 μs, total: 14.2 ms Wall time: 22.9 ms
data: [[{'node_index': 7072, 'distance': 0.9999998807907104, 'entity': {'node_id': 'SOX14_(7119)', 'node_name': 'SOX14'}}, {'node_index': 460, 'distance': 0.9957526922225952, 'entity': {'node_id': 'SOX2_(460)', 'node_name': 'SOX2'}}, {'node_index': 13546, 'distance': 0.9949035048484802, 'entity': {'node_id': 'SOX7_(13730)', 'node_name': 'SOX7'}}, {'node_index': 49952, 'distance': 0.9946167469024658, 'entity': {'node_id': 'SOX21_(57709)', 'node_name': 'SOX21'}}, {'node_index': 6972, 'distance': 0.9945659041404724, 'entity': {'node_id': 'SOX9_(7019)', 'node_name': 'SOX9'}}, {'node_index': 9392, 'distance': 0.9940434694290161, 'entity': {'node_id': 'LEF1_(9476)', 'node_name': 'LEF1'}}, {'node_index': 1678, 'distance': 0.9940416216850281, 'entity': {'node_id': 'SOX10_(1682)', 'node_name': 'SOX10'}}, {'node_index': 11064, 'distance': 0.9938754439353943, 'entity': {'node_id': 'TOX2_(11177)', 'node_name': 'TOX2'}}, {'node_index': 6659, 'distance': 0.993757426738739, 'entity': {'node_id': 'TOX_(6704)', 'node_name': 'TOX'}}, {'node_index': 5090, 'distance': 0.9937493205070496, 'entity': {'node_id': 'SOX30_(5120)', 'node_name': 'SOX30'}}]]
# Check the ground truth for the search
merged_nodes_df.loc[2]
node_index | primekg_node_index | node_id | node_name | node_type | desc | feat | desc_emb | feat_emb | |
---|---|---|---|---|---|---|---|---|---|
2 | 7072 | 7119 | SOX14_(7119) | SOX14 | gene/protein | SOX14 belongs to gene/protein node. SOX14 is S... | MSKPSDHIKRPMNAFMVWSRGQRRKMAQENPKMHNSEISKRLGAEW... | [-0.02060385, -0.020443613, -0.017091982, -0.0... | [0.049131330102682114, 0.014837502501904964, 0... |
# Get node indices from the results
[n['node_index'] for n in results[0]]
[7072, 460, 13546, 49952, 6972, 9392, 1678, 11064, 6659, 5090]
# Get the cosine similarity scores
[n['distance'] for n in results[0]]
[0.9999998807907104, 0.9957526922225952, 0.9949035048484802, 0.9946167469024658, 0.9945659041404724, 0.9940434694290161, 0.9940416216850281, 0.9938754439353943, 0.993757426738739, 0.9937493205070496]
Building Edge Collection¶
Subsquently, we are also building the edges collection in Milvus.
Note that the edges information of PrimeKG has massive records, so once again we are chunking the data to avoid memory issues.
%%time
# Define collection name
edge_coll_name = f"{milvus_database}_edges"
# Define schema
edge_fields = [
FieldSchema(name="triplet_index", dtype=DataType.INT64, is_primary=True, auto_id=False),
FieldSchema(name="head_id", dtype=DataType.VARCHAR, max_length=1024),
FieldSchema(name="head_index", dtype=DataType.INT64),
FieldSchema(name="tail_id", dtype=DataType.VARCHAR, max_length=1024),
FieldSchema(name="tail_index", dtype=DataType.INT64),
FieldSchema(name="edge_type", dtype=DataType.VARCHAR, max_length=1024),
FieldSchema(name="display_relation", dtype=DataType.VARCHAR, max_length=1024),
FieldSchema(name="feat", dtype=DataType.VARCHAR, max_length=40960),
FieldSchema(name="feat_emb", dtype=DataType.FLOAT_VECTOR, dim=1536),
]
edge_schema = CollectionSchema(fields=edge_fields, description="Schema for edges collection")
# Create collection if not exists
if not utility.has_collection(edge_coll_name):
collection = Collection(name=edge_coll_name, schema=edge_schema)
else:
collection = Collection(name=edge_coll_name)
# Create indexes
collection.create_index(field_name="triplet_index", index_params={"index_type": "STL_SORT"}, index_name="triplet_index_index")
collection.create_index(field_name="head_index", index_params={"index_type": "STL_SORT"}, index_name="head_index_index")
collection.create_index(field_name="tail_index", index_params={"index_type": "STL_SORT"}, index_name="tail_index_index")
collection.create_index(field_name="feat_emb", index_params={"index_type": "GPU_CAGRA", "metric_type": "IP"}, index_name="feat_emb_index") # AUTOINDEX
# Iterate over chunked edges embedding df
for edges_df in tqdm(edges_embedding_df):
# Merge enrichment with embedding
merged_edges_df = edges_enrichment_df.merge(
edges_df[["triplet_index", "edge_emb"]],
on="triplet_index",
how="inner"
)
# Prepare data fields in column-wise format
# Normalize the embeddings
edges_edge_emb_cp = cp.asarray(merged_edges_df["edge_emb"].list.leaves).astype(cp.float32).reshape(merged_edges_df.shape[0], -1)
edges_edge_emb_norm = normalize_matrix(edges_edge_emb_cp, axis=1)
data = [
merged_edges_df["triplet_index"].to_arrow().to_pylist(),
merged_edges_df["head_id"].to_arrow().to_pylist(),
merged_edges_df["head_index"].to_arrow().to_pylist(),
merged_edges_df["tail_id"].to_arrow().to_pylist(),
merged_edges_df["tail_index"].to_arrow().to_pylist(),
merged_edges_df["edge_type_str"].to_arrow().to_pylist(),
merged_edges_df["display_relation"].to_arrow().to_pylist(),
merged_edges_df["feat"].to_arrow().to_pylist(),
edges_edge_emb_norm.tolist(), # Use normalized embeddings
]
# Insert in chunks
batch_size = 500
for i in tqdm(range(0, len(data[0]), batch_size)):
batch_data = [d[i:i+batch_size] for d in data]
collection.insert(batch_data)
# Flush to ensure persistence
collection.flush()
# Print collection stats
print(collection.num_entities)
time.sleep(5) # Sleep to avoid overwhelming the server
100%|██████████| 500/500 [05:31<00:00, 1.51it/s]
250000
100%|██████████| 500/500 [05:34<00:00, 1.49it/s]
500000
100%|██████████| 500/500 [05:36<00:00, 1.49it/s]
750000
100%|██████████| 500/500 [05:34<00:00, 1.49it/s]
1000000
100%|██████████| 500/500 [05:33<00:00, 1.50it/s]
1250000
100%|██████████| 410/410 [04:34<00:00, 1.49it/s]
1454610
100%|██████████| 500/500 [05:36<00:00, 1.49it/s]
1704610
100%|██████████| 500/500 [05:34<00:00, 1.50it/s]
1954610
100%|██████████| 500/500 [05:33<00:00, 1.50it/s]
2204610
100%|██████████| 500/500 [05:34<00:00, 1.50it/s]
2454610
100%|██████████| 500/500 [05:36<00:00, 1.49it/s]]
2704610
100%|██████████| 500/500 [05:31<00:00, 1.51it/s]]
2954610
100%|██████████| 500/500 [05:36<00:00, 1.49it/s]]
3204610
100%|██████████| 500/500 [05:33<00:00, 1.50it/s]]
3454610
100%|██████████| 500/500 [05:34<00:00, 1.49it/s]]
3704610
100%|██████████| 400/400 [04:27<00:00, 1.50it/s]]
3904610
100%|██████████| 16/16 [1:35:30<00:00, 358.18s/it]
CPU times: user 23min 24s, sys: 2min 56s, total: 26min 20s Wall time: 1h 35min 33s
# List all collections
for coll in utility.list_collections():
print(f"Collection: {coll}")
# Load the collection to get stats
collection = Collection(name=coll)
print(collection.num_entities)
Collection: t2kg_primekg_nodes_molecular_function 10951 Collection: t2kg_primekg_edges 3904610 Collection: t2kg_primekg_nodes 84981 Collection: t2kg_primekg_nodes_biological_process 27409 Collection: t2kg_primekg_nodes_cellular_component 4011 Collection: t2kg_primekg_nodes_disease 17054 Collection: t2kg_primekg_nodes_drug 6759 Collection: t2kg_primekg_nodes_gene_protein 18797
# Assume node_coll_name is defined and collection exists
collection = Collection('t2kg_primekg_edges')
# Load the collection into memory before query
collection.load()
%%time
# Assume node_coll_name is defined and collection exists
collection = Collection('t2kg_primekg_edges')
# Load the collection into memory before query
collection.load()
# Query by expr on triplet_index
expr = "triplet_index == 0"
output_fields = ["triplet_index", "head_id", "tail_id", "edge_type", "feat", "feat_emb"]
results = collection.query(expr, output_fields=output_fields)
results
CPU times: user 5 ms, sys: 0 ns, total: 5 ms Wall time: 564 ms
data: ["{'feat': 'PHYHIP (gene/protein) has a direct relationship of protein_protein:ppi with KIF15 (gene/protein).', 'feat_emb': [-0.01934238, 0.0011752498, 0.004431808, -0.033904973, -0.01556057, 0.011148459, 0.0011645806, 0.028704984, 0.012691384, -0.005199988, 0.020970657, 0.01423431, 0.009421695, 0.0033714569, -0.0027230997, -0.0106954295, 0.015586833, -0.015100975, 0.01833127, 0.014812087, -0.008581293, 0.019014098, 0.005584078, -0.036977693, 0.010511592, 0.034535274, 0.010833308, -0.026236303, -0.025107013, -0.037502944, 0.027575694, -0.019513085, -0.001110414, 0.015416126, 0.0045368583, -0.0110171465, 0.009841897, -0.021863585, 0.016400972, -0.0021190608, -0.0024818124, -0.0077540223, -0.006516399, 0.0013426737, -0.0038474659, -0.0059189256, 0.0074257404, -0.022231262, -0.017438343, 0.008292405, -0.014102997, 0.002123985, -0.012579769, -0.020051468, 0.0068545295, -0.0032368612, 0.0050850892, 0.00063440506, -0.028127206, -0.004412111, 0.0011465251, 0.0029463316, -0.008568162, -0.0091984635, 0.016532285, 0.006933317, 0.0019582026, 0.023124188, 0.015219157, -0.0047896355, 0.04125849, 0.033012044, -0.0026837059, -0.004812615, 0.013761584, -0.0022700704, -0.007970689, 0.0009544801, -0.02783832, 0.024411054, 0.019197935, -0.0050653922, 0.018580765, 0.0091984635, 0.015258551, -0.03091104, -0.017293898, 0.029729223, 0.020668639, -0.009828765, 0.02917771, 0.020629246, 0.003824486, 0.004855292, -0.008141396, -0.0114636095, -0.0006499985, 0.01269795, 0.011082803, -0.021797929, -0.026919128, 0.029414073, -0.014680774, -0.0013032798, -0.018055514, -0.0077737193, -0.010012603, -0.0108595705, 0.0109383585, -0.013879766, -0.012967141, 0.03758173, 0.012803, -0.02343934, 0.008587859, -0.00035433946, 0.031357504, 0.013800978, -0.012356536, -0.0041133743, 0.031173665, 0.0021912828, 0.009579271, -0.013288858, 0.026354484, 0.03726658, -0.021023184, -0.024319135, -0.009585836, -0.0054855933, 0.018042382, 0.0070514986, 0.011227246, -0.0059583196, -0.017792888, -0.0072944276, -0.018777734, -0.016466629, -0.004740393, -0.024437318, 0.005597209, 0.022966614, -0.028915085, 0.0084302835, -0.013866634, 0.012691384, 0.010065128, -0.003604537, -0.020392882, 0.0019417884, 0.004671454, -0.0021666617, -0.0116671445, 0.013439868, 0.013498958, 0.004192162, -0.0026295392, 0.00427095, -0.002288126, -0.00012382389, -0.013590878, -2.7416681e-05, 0.0012901485, 0.012468153, 0.03041205, 0.030674675, -0.0035782745, -0.011128762, 0.005787613, -0.02447671, 0.0031465837, 0.015337338, -0.059300873, 0.01402421, 0.022717118, 0.00039968343, 0.021351466, 0.011187852, -0.027365593, -0.018278746, -0.011798457, 0.00046410877, 0.016913092, -0.0022470907, 0.005180291, -0.0042020106, 0.027759532, -0.023019139, -0.004392414, -0.015993902, 0.014549461, 0.014601986, 0.012126739, -0.0051277657, -0.645849, -0.040785763, 0.007557053, -0.0134464335, 0.027391855, 0.033038307, 0.005213119, 0.014851481, 0.015100975, 0.0068348325, -0.0017005011, 0.03288073, -0.014995925, -0.017228242, -0.015796933, -0.03277568, -0.011115631, -0.047955442, 0.00282815, -0.014772693, -0.013906028, -0.012954011, 0.01402421, 0.033012044, 0.016781779, -0.0012606031, 0.05005645, -0.0058467034, -0.00011448837, 0.016729254, -0.019224199, 0.033773657, 0.0032614823, 0.011647448, 0.039288796, -0.0060469555, 0.013564615, 0.01914541, 0.010879268, 0.03471911, -0.032197904, -6.422018e-05, 0.0131247165, 0.013551484, -0.021049445, 0.016939355, 0.008994929, 0.00028252776, 0.022612069, -0.0046222117, -0.024621155, 0.011864114, -0.011686841, 0.009231292, -0.0049209483, 0.0058926633, 0.026236303, -0.03490295, -0.0040345867, 0.002691913, 0.008876747, -0.0076227095, -0.002636105, -0.01161462, 0.014247442, 0.010183309, -0.004300495, -0.0039689303, 6.873406e-05, -0.0074191745, 0.029151447, 0.011864114, -0.004796201, 0.006736348, 0.004684585, 0.03724032, 0.027391855, 0.02712923, -0.0091196755, 0.018055514, -0.024949437, 0.013170676, -0.021154497, 0.012074214, 0.0144969355, 0.00885705, -0.02642014, 0.0131247165, -0.008627253, -0.025356507, 0.015429257, -0.029702961, -0.012356536, -0.018685816, -0.030333262, -0.006332561, -0.03666254, -0.005961602, 0.036504965, -0.028074682, 0.0049570594, 0.0034141336, -0.019184804, 0.0030530232, 0.020747427, -0.007911597, -0.0249757, -0.007872204, 0.01956561, 0.001959844, -0.0037818095, -0.01233684, -0.0030530232, -0.017727232, -0.018501977, -0.032197904, 0.05783017, -0.001848228, -0.0007767974, -0.010682299, 0.0006011665, 0.007845941, 0.00056546583, 0.002544186, 0.02682721, 0.028100945, 0.00463206, -0.023767622, -0.007845941, -0.013997947, 0.017018143, -0.004251253, 0.02580297, -0.0023701964, 0.012304012, 0.014076735, 0.018055514, 0.010577248, 0.022743382, -0.034430224, 4.362561e-05, -0.0023981004, 0.013374211, -0.014720168, -0.0008256294, -0.025658526, -0.029545385, -0.01361714, 0.033773657, -0.0016873698, 0.01802925, -0.011936336, 0.0009052378, 0.022047423, 0.0155080445, -0.006388369, -0.003156432, 0.01607269, -0.009559574, -0.030884776, 0.012566637, 0.0014148956, -0.02519893, -0.019014098, -0.019158542, -0.023478733, 0.022966614, 0.005945188, -0.007537356, -0.004612363, 0.0048421603, -0.026144383, -0.022874694, 0.012284315, -0.0033386287, 0.010097956, 0.034141336, -0.0070449333, -0.0014017645, -0.00988129, -0.0025326961, -0.017700968, -0.027286805, 0.010459066, 0.03337972, 0.0015183046, 0.013590878, -0.0014797314, 0.0025770143, 0.033327196, -0.026577717, 0.013656534, -0.0043825656, 0.009717149, -0.0029217103, -0.015836326, 0.01956561, 0.0030595888, -0.010688864, 0.014286836, 0.028311046, -0.026971655, 0.004996453, -0.046852417, 0.009592402, -0.0076555377, -0.021233283, -0.022257524, -0.0052590785, -0.007839376, 0.009907553, 0.006368672, -0.0028379986, -0.010229269, 0.0033369872, -0.014890875, -0.014680774, 0.0072222054, -0.008443414, -0.0033205731, 0.017740363, 0.01054442, 0.02263833, 0.008981797, -0.011299469, -0.00988129, 0.02345247, 0.010051996, 0.012448456, -0.010951489, -0.00691362, -0.0049734735, 0.021561567, 0.016361577, -0.00030407126, -0.009283816, 0.002435853, -0.011345428, 0.0253959, 0.013787847, 0.00011571943, 0.009283816, 0.012546941, -0.023334289, 0.005561098, -0.011141893, 0.022507017, 0.0024736053, -0.025330244, -0.0012064365, 0.005163877, 0.025422163, -0.007891901, 0.010025734, 0.00655251, -0.011299469, 0.0035290322, 0.030438313, 0.042440306, 0.011325731, -0.0068676607, -0.011292903, 0.0134858275, 0.005193422, 0.00040809563, 0.011647448, -0.0144969355, -0.0057121078, -0.03183023, -0.011200984, -0.0053509977, 0.021207022, 0.0018039099, -0.02416156, 0.014785824, 0.007176246, 0.022270655, 0.0109383585, -0.00813483, 0.0015297944, -0.027155492, -0.033248406, 0.015100975, 0.033222146, -0.015074712, -0.0057547847, -0.033117093, 0.0155474385, -0.0063391267, 0.0144969355, -0.00668054, 0.016873699, 0.03532315, 0.0018350967, -0.011325731, -0.025461556, 0.0042348388, -0.00998634, 0.021180758, -0.0039098393, -0.019526217, 0.005393674, -0.034062546, -3.1391974e-05, 0.06812509, 0.015429257, -0.008594424, 0.003181053, -0.0033140075, -0.0027214582, 0.029466597, -0.00077023177, 0.008410586, 0.0011867397, 0.001102207, -0.0058696833, -0.016847435, 0.0029381246, 0.0020862324, -0.0006602573, -0.016046427, -0.036268603, -0.012146437, 0.00030571266, 0.013334817, 0.031672653, 0.008463112, 0.005413371, 0.00060444936, 0.0074060434, -0.009756543, -0.019211067, 0.011634316, -0.010314623, 0.0026837059, -0.019486824, 0.0057744817, 0.0049439277, 0.0056595826, 0.006880792, 0.0018958289, -0.04737767, -0.011988861, 0.007327256, -0.013295423, 0.0014009437, 0.01864642, 0.023255501, -0.007287862, -0.003936102, 0.040733237, 0.032302953, 0.030753464, -0.012809566, 0.0071302867, -0.0013574463, 0.007281296, -0.014707036, -0.02519893, -0.024529235, 0.0032319368, 0.00307272, 0.023084795, 0.0055315527, 0.0021994899, 0.012139871, 0.012107043, -0.012264618, 0.019132279, 0.0020369901, 0.005025998, -0.0033369872, -0.005987865, -0.013945422, 0.010682299, 0.009093413, -0.014877743, -0.022546412, 0.0108989645, -0.01842319, 0.008929272, -0.016702991, 0.009513614, -0.022086818, -0.0012450097, -0.019893894, -0.0075898813, -0.001776006, 0.014037341, -0.0063391267, 0.0099666435, -0.03471911, -0.012481284, -0.018922178, -0.00014516222, -0.020484801, -0.0069070547, -0.0065065506, -0.017779756, 0.0061946823, 0.005196705, -0.0032155227, 0.021666616, 0.0013993023, -0.018790865, 0.0015962715, 0.02366257, -0.009139373, 0.0012663481, 0.033721134, -0.0027821905, 0.001995955, 0.019316116, -0.0077343252, -0.013223202, 0.027286805, 0.006240642, -0.018685816, -0.015311075, 0.00088554085, 0.02087874, 0.012061083, -0.019027228, 0.0029315588, 0.019276723, -0.033117093, -0.0037653954, -0.022703988, 0.008167658, -0.000718117, -0.011240378, 0.0038999908, -0.036610015, -0.012901485, 0.0051212003, 2.8852915e-05, 0.005025998, -0.0025294132, 0.01013735, 0.03112114, -0.0077999816, 0.007228771, 7.309405e-05, -0.02078682, -0.023097927, 0.0075701843, 0.018856522, -0.00282815, -0.03041205, 0.014523199, -0.01351209, -0.028731246, -0.021338334, 0.014405017, -0.038422134, 0.030175688, 0.012737344, -0.019736318, -0.0202747, -0.005025998, -0.04104839, -0.013052495, -0.025041357, -0.0053411494, 0.0033304216, -0.023465602, 0.018685816, -0.005790896, 0.018593896, -0.024686811, -0.03264437, 0.01432623, 0.023583783, 0.0043530203, -0.0035552948, 0.0074454374, -0.020314094, -0.0074979626, 0.0014157164, -0.037109006, -0.0075110937, -0.0050752405, 0.023938328, 0.020235306, 0.0300969, 0.008686343, 0.013387343, 0.028284783, 0.011227246, -0.011529266, 0.018147433, 0.002424363, -0.044173636, 0.024292873, 0.021036314, -0.022979744, 0.026945392, 0.0043234746, 0.0029184276, 0.026603978, -0.007524225, -0.018515108, -0.0040148897, -0.012356536, 0.006585338, -0.02406964, -0.0025770143, 0.01116159, -0.021062577, -0.019224199, -0.011752498, -0.030517101, 0.0070514986, -0.0050785234, 0.021574697, -0.016506022, 0.04687868, 0.009191898, 0.038527183, -0.002120702, -0.0018465866, 0.007931295, 0.00045590173, 0.04123223, -0.030359525, 0.03225043, -0.026971655, 0.0018597179, -0.0019073188, -0.0064376113, -0.02601307, -0.0062734704, -0.014601986, -0.00077310426, -0.021784797, -0.033405982, -0.0360585, -0.01821309, -0.002499868, 0.020826215, -0.04553929, 0.020484801, 0.00078090094, -0.031042352, 0.021745404, 0.012277749, 0.022152474, -0.013840372, 0.046826154, 0.04966251, 0.006020693, -0.025816102, 0.0074191745, 0.009500483, 0.0014034058, 0.019329248, 0.017779756, -0.0022142625, -0.013551484, -0.005419937, 0.004740393, -0.020051468, -0.042335253, 0.0027378723, -0.008167658, 0.0135252215, 0.007859073, 0.0149433995, -0.014772693, 0.0024785297, -0.003156432, 0.020773688, -0.0074454374, -0.005035847, 0.00091180345, 0.018239351, -0.0011186211, 0.0074388715, 0.0022536563, -0.016558547, -0.005268927, -0.008660081, 0.0034338303, 0.0017037839, 0.0017070668, 0.019079754, 0.0043267575, 0.023898935, -0.0046747364, -0.015705014, 0.0058270064, -0.0114636095, -0.013787847, 0.03471911, 0.0068348325, -0.026485797, 0.00027637248, 0.0030448162, 0.025422163, -0.03419386, -0.004087112, -0.016637335, -0.014470673, -0.0037095873, 0.027943369, 0.010642905, 0.015271681, 0.0047206962, -0.009507049, -0.0022864845, -0.021666616, -0.0055052903, 0.038133245, -0.046038277, 0.0009914119, 0.0009955154, 0.020865608, -0.0021732273, 0.027601955, 0.016939355, 0.009815633, 0.027995894, -0.036741327, 0.0026623677, -0.008758565, -0.008180789, -0.018370664, -0.0025491102, -0.012310578, -0.014956531, 0.0230454, -0.01208078, -0.02211308, 0.023465602, 0.0076161437, 0.016939355, 0.018501977, -0.010728258, 0.008069173, -0.004044435, 0.00409696, -0.01822622, 0.011200984, 0.0059583196, -0.014102997, -0.00019409676, 0.011279772, -0.019907024, -0.009382301, -0.012579769, -0.009664624, -0.019014098, -0.01203482, -0.018554503, -0.010143916, -0.00855503, -0.02467368, -0.001016033, -0.0017710817, -0.013630271, -0.025264587, 0.008804525, 0.0020763841, -0.010157047, -0.021207022, 0.017451474, 0.006000996, 0.0018679249, -0.008285839, -0.0125535065, -0.0046747364, -0.018593896, -0.027733268, 0.0052656443, 0.007281296, 0.047246356, 0.001352522, -0.048743322, -0.019696923, -0.023925196, -0.02928276, -0.014378754, -0.012015124, -0.013866634, -0.02723428, -0.014667642, -0.011004015, 0.004500747, 0.007300993, 0.024739336, 0.0059944303, -0.016506022, 0.019526217, -0.005239382, 0.020497931, -0.00012669637, -0.005672714, -0.012881788, 0.019841367, -0.007268165, -0.0041790307, 0.037030216, -0.01361714, 0.02057672, -0.0139322905, 0.012461587, 0.011601488, 0.017543394, 0.013906028, -0.0347979, -0.016821172, 0.022690857, 0.010104522, -0.025658526, 0.0050653922, -0.014457542, 0.020248437, -0.013709059, -0.0090802815, -0.01566562, 3.4315734e-05, -0.015901983, 0.0026738574, -0.007819679, 0.0043628686, 0.016781779, 0.031751443, 0.0029578214, -0.0035257493, 0.003972213, 0.017188849, -0.00010658908, 0.026078727, 0.008784828, -0.008817656, -0.02282217, -0.011437347, -0.017832281, -0.022914087, -0.020852476, -0.0041691824, 0.008666647, 0.017753495, -0.00012064366, -0.020222176, -0.008207052, 0.010124219, 0.009356039, -0.010590379, -0.006060087, -0.00890301, -0.014142391, -0.012074214, 0.0045598377, -0.014733299, -0.02765448, 0.011141893, 0.0017612333, -0.018541371, 0.04167869, 0.21020557, -0.0056661484, 0.03571709, -0.0018580764, 0.0009987982, 0.0135252215, -0.004976756, 0.002215904, 0.010839874, -0.008174224, 0.013853503, 0.010262097, -0.004999736, 0.0006577952, 0.005193422, -0.027391855, -0.034535274, 0.0034010021, -0.03550699, -0.015849458, 0.0027395138, -0.0011284696, -0.0032105986, -0.013380777, 0.00977624, -0.019605005, -0.030727202, 0.0006118357, 0.008154526, -0.004241404, -0.01566562, 0.00076571794, 0.0039492333, -0.014864611, -0.0021896414, 0.0048224637, -0.013420171, -0.016151477, 0.022060554, -0.009612099, 0.013315121, 0.0123828, 0.011187852, -0.01864642, 0.006605035, -0.008660081, 0.011036843, 0.0070908926, -0.010518157, 0.019014098, -0.031410027, -0.00537726, 0.020103993, 0.021994898, -0.027680743, -0.01780602, 0.008686343, 0.023426209, -0.001216285, 0.026393877, 0.01586259, 0.015363601, -0.034955475, 0.017976725, -0.02212621, 0.018318139, -0.028810034, 0.007149983, 0.017635312, -0.022296919, -0.003552012, -0.02529085, 0.006628015, 0.021469647, -0.02435853, -0.018607028, 0.048848372, 0.0014813729, 0.004408828, 0.03335346, -0.004192162, -0.011516135, -0.042230204, -0.017412081, -0.00411994, -0.017359555, 0.015219157, 0.012028255, -0.039761525, -0.01566562, 0.028232258, -0.007412609, -0.008870182, -0.0052459473, -0.0037588296, -0.00054453785, -0.017674707, 0.015245419, -0.00772776, 0.0047075646, -0.01080048, 0.07810487, -0.017976725, -0.0019007531, -0.0046025147, -0.0002033297, -0.0011957674, 0.010373713, -0.020865608, -0.015258551, 0.0017218394, -0.03658375, 0.008883312, -0.012330274, -0.0023143885, 0.027995894, 0.017018143, -0.03295952, -0.00921816, 0.0074257404, -0.020287832, -0.0061027636, 0.020051468, 0.025947414, -0.016112084, 0.004116657, -0.004241404, -0.009277252, -0.01647976, -0.031882755, 0.034824163, 0.00885705, 0.010872702, 0.02652519, -0.012908051, 0.007596447, 0.014208048, -0.006381803, -0.016322184, 0.02354439, -0.019815106, -0.026341353, -0.034745373, 0.0057744817, 0.003696456, 0.009040888, 0.0123828, 0.011292903, -0.0079050325, 0.004871706, -0.039577685, -0.01577067, 0.0039098393, 0.004280798, 0.018961571, -0.02865246, -0.009690886, -0.025842365, 0.0074388715, 0.012185831, -0.021141365, -0.014155523, -0.013229767, -0.012691384, -0.0018531523, -0.01315098, -0.1661895, -0.010071694, -0.0018121169, -0.023176713, 0.009992906, 0.02313732, 0.0007296069, -0.01934238, 0.015691882, -0.0013418529, 0.019880762, -0.0021075709, -0.014431279, -0.038474657, 0.017700968, 0.012494415, -0.022690857, 0.027496906, 0.018961571, -0.0069661452, 0.0071105896, -0.009533311, 0.014470673, 0.0038343344, -0.00037034322, 0.022152474, -0.011765629, -0.014299966, -0.002808453, 0.010176744, -0.02959791, 0.017136324, 0.029729223, 0.017569656, 0.013269161, -0.014693906, -0.008128264, 0.016506022, -0.015429257, 0.043674644, 0.035480727, 0.012455022, -0.0042381217, -0.011365125, -0.014483805, 0.016519153, 0.017740363, 0.01504845, 0.027523167, 0.004415394, 0.013682797, 1.596528e-05, 0.019289855, 0.019355511, 0.016243396, -0.005781047, -0.012107043, 0.023741359, -0.00657549, 0.014352492, 0.0033583255, -0.017871676, 0.016151477, -0.025658526, 0.015179763, -0.021902978, -0.003368174, 0.013308555, -0.02804842, 0.0048946855, -0.015376732, -0.027917108, 0.0026705747, -0.008285839, -0.000280476, 0.004405545, -0.021732273, 0.026919128, 0.012461587, 0.0107348235, -0.005639886, 0.014510067, -0.0036373653, -0.0026558018, -0.01638784, -0.010255531, -0.008029779, -0.0029742355, -0.011128762, -0.015823195, 0.018895915, -0.022204999, 0.01084644, 0.0029299175, 0.041100916, 0.01229088, -0.019880762, -0.015705014, 0.0016808042, 0.016729254, 0.026131252, -0.0062143793, 0.008935838, 0.023596914, 0.015810065, 0.0056464514, 0.007117155, -0.0045532724, 0.043359496, -0.021430254, 0.00033115453, -0.006769176, 0.023518126, 0.029098922, -0.0065262476, 0.03513931, -0.00036747073, -0.006992408, 0.004376, -0.020261569, 0.06324026, 0.027418118, 0.0027789078, 0.025776708, -0.031803966, -0.011594922, -0.0911311, -0.02928276, 0.0023833278, 0.015284813, -0.007333821, 0.0014789107, -0.006345692, 0.0076818005, 0.003604537, 0.0064573083, 0.005219685, -0.022388836, -0.032696895, -0.016663598, 0.010583813, 0.010189875, -0.010912096, -0.013866634, -0.007327256, 0.025146406, 0.0049209483, 0.01171967, -0.01709693, -0.0170838, 0.022401968, 0.014418148, -0.034535274, -0.0049734735, 0.02160096, 0.00591236, 0.0011210833, -0.022756513, 0.023150451, 0.004799484, -0.008837353, -0.0051113516, 0.014444411, -0.01626966, 0.029335285, -0.00804291, 0.007117155, -0.002288126, 0.009336342, -0.0035585775, 0.0066706915, 0.0008005979, 0.006545944, 0.0013475979, 0.016519153, -0.0057186736, -0.036163554, -0.019775711, -0.02682721, -0.0041133743, 0.02273025, -0.04036556, -0.007012105, 0.006421197, -0.01336108, -0.027050443, -0.038553447, 0.001876132, -0.009073717, 0.03143629, 0.022467624, -0.01667673, -0.031173665, -0.038448397, 0.027969632, -0.014405017, -0.0150615815, 0.032302953, -0.0025540343, 0.016873699, -0.041442327, -0.008706041, -0.03288073, -0.027575694, 0.027995894, -0.032801945, -0.004083829, -0.03603224, 0.024240348, -0.021075709, 0.018344402, 0.0026672918, 0.0131641105, -0.004812615, 0.0030333262, -0.0018826977, -0.008233314, -0.0041133743, 0.01182472, -0.01028836, 0.0037456984, 0.01233684, 0.00160612, 0.0016414103, -3.444397e-05, 0.022296919, -0.03603224, -0.006992408, -0.04393727, 0.023623178, -0.00911311, -0.001252396, 0.011516135, -0.012638859, 0.03274942, 0.007360084, 0.021771666, 0.0155474385, -0.00499317, 0.01914541, -0.017228242, -0.0064179143, 0.009992906, 0.012218659, 0.033721134, 0.020025207, 0.039787788, 0.023465602, -0.005177008, 0.019092884, 0.012967141, 0.015796933, -0.016190872, -0.0022224695, -0.016729254, 0.004467919, -0.0015946301, 0.015402994, 0.018541371, -0.03298578, -0.0074913967, 0.004799484, -0.0064179143, -0.012310578, -0.025776708, 0.020090863, 0.024003984, 0.006421197, -0.019289855, -0.02200803, 0.0023143885, -0.00732069, 0.021312071, 0.020353489, -0.023833279, -0.005410088, -0.002964387, -0.012126739, 0.015534307, 0.018002989, 0.0024374942, -0.010912096, -0.014720168, -0.011982296, 0.013367645, -0.020642376, 0.029650437, -0.012277749, -0.00147809, 5.1191484e-05, 0.0011284696, -0.0079050325, -0.010629773, 0.0033944366, -0.015705014, -0.00015624175, 0.0012679895, -0.0401292, -0.027575694, 0.009546442, -0.021259546, 0.021233283, 0.018922178, -0.00012608083, -0.027733268, 0.007543922, -0.0034206992, -0.005177008, 0.023268633, -0.00028355364, -0.022283787, 0.0116277505, 0.0150221875, 0.007353518, 0.004228273, 0.0054265023, 0.015626226, 0.0052426644, -0.0035257493, 0.019644398, 0.004241404, 0.00062004273, 0.024148429, 0.0013369287, -0.019605005, -0.014352492, 0.004067415, 0.024594892, -0.026052464, -0.012546941, -0.017044405, -0.015705014, -0.011457044, 0.02477873, -0.01382724, -0.031278715, -0.013032798, -0.018830258, -0.003988627, -0.01956561, -0.010413107, 0.00027062753, 0.006559076, 0.007012105, 0.010971187, 0.0149433995, -0.008463112, 0.04209889, 0.00881109, 0.023912065, 0.0015872438, -0.0025835799, 0.035585776, 0.029125184, 0.012507547, -0.014155523, 0.047587767, -0.029151447, 0.011496438, 0.008174224, -0.02804842, 0.00028622092, -0.0038999908, 0.0154686505, -0.003643931, 0.021666616, -0.010419672, 0.07463821, -0.011798457, -0.025461556, -0.014194916, -0.009631796, 0.004812615, -0.011765629, 0.0149433995, -0.035664562, -0.015888851, -0.0006212738, -0.028888822, 0.027785795, -0.039971624, 0.010701995, -0.0085419, -0.017884808, 0.011516135, 0.006591904, -0.010012603, 0.018987834, -0.0023734793, 0.0048815543, -0.0011416009, -0.042834245, -0.005547967, 0.036216076, 0.0023587067, 0.020117125, -0.038763545, 0.008174224, 0.030779727, -0.02670903, -0.001876132, 0.025789838, 0.0038704455, -0.007281296, -0.0078656385, 0.044882722, 0.0132428985, -0.0021551717, -0.007209074, -0.018108038, -0.019775711, 0.0065262476, 0.0037653954, -0.0059254915, -0.021338334, -0.015586833], 'triplet_index': 0, 'head_id': 'PHYHIP_(0)', 'tail_id': 'KIF15_(8889)', 'edge_type': 'gene/protein|ppi|gene/protein'}"]
# Check the ground truth for the search
results[0]['triplet_index'], results[0]['head_id'], results[0]['tail_id'], results[0]['edge_type'], results[0]['feat']
(0, 'PHYHIP_(0)', 'KIF15_(8889)', 'gene/protein|ppi|gene/protein', 'PHYHIP (gene/protein) has a direct relationship of protein_protein:ppi with KIF15 (gene/protein).')
import numpy as np
%%time
# Assume node_coll_name is defined and collection exists
collection = Collection('t2kg_primekg_edges')
# Load the collection into memory before query
collection.load()
# Vector similarity search in Milvus
vector_to_search = normalize_vector(np.array(results[0]['feat_emb'])).tolist() # merged_edges_df["edge_emb"].iloc[0]
search_params = {"metric_type": "IP"}
results = collection.search(
data=[vector_to_search],
anns_field="feat_emb",
param=search_params,
limit=10,
output_fields=["head_id", "tail_id", "edge_type", "feat"]
)
results
CPU times: user 509 ms, sys: 154 ms, total: 664 ms Wall time: 1.05 s
data: [[{'triplet_index': 0, 'distance': 1.000000238418579, 'entity': {'edge_type': 'gene/protein|ppi|gene/protein', 'feat': 'PHYHIP (gene/protein) has a direct relationship of protein_protein:ppi with KIF15 (gene/protein).', 'head_id': 'PHYHIP_(0)', 'tail_id': 'KIF15_(8889)'}}, {'triplet_index': 3069556, 'distance': 0.9815623760223389, 'entity': {'edge_type': 'gene/protein|ppi|gene/protein', 'feat': 'KIF15 (gene/protein) has a direct relationship of protein_protein:ppi with PHYHIP (gene/protein).', 'head_id': 'KIF15_(8889)', 'tail_id': 'PHYHIP_(0)'}}, {'triplet_index': 93582, 'distance': 0.9684444665908813, 'entity': {'edge_type': 'gene/protein|ppi|gene/protein', 'feat': 'PHYHIP (gene/protein) has a direct relationship of protein_protein:ppi with PRKD2 (gene/protein).', 'head_id': 'PHYHIP_(0)', 'tail_id': 'PRKD2_(9221)'}}, {'triplet_index': 305788, 'distance': 0.9657970666885376, 'entity': {'edge_type': 'gene/protein|ppi|gene/protein', 'feat': 'PHYHIP (gene/protein) has a direct relationship of protein_protein:ppi with PPIE (gene/protein).', 'head_id': 'PHYHIP_(0)', 'tail_id': 'PPIE_(5629)'}}, {'triplet_index': 39303, 'distance': 0.9635176658630371, 'entity': {'edge_type': 'gene/protein|ppi|gene/protein', 'feat': 'PHYHIP (gene/protein) has a direct relationship of protein_protein:ppi with PAQR5 (gene/protein).', 'head_id': 'PHYHIP_(0)', 'tail_id': 'PAQR5_(8043)'}}, {'triplet_index': 300682, 'distance': 0.9599261283874512, 'entity': {'edge_type': 'gene/protein|ppi|gene/protein', 'feat': 'PHYHIP (gene/protein) has a direct relationship of protein_protein:ppi with PRMT5 (gene/protein).', 'head_id': 'PHYHIP_(0)', 'tail_id': 'PRMT5_(7026)'}}, {'triplet_index': 3154085, 'distance': 0.9597105979919434, 'entity': {'edge_type': 'gene/protein|ppi|gene/protein', 'feat': 'PHYHIP (gene/protein) has a direct relationship of protein_protein:ppi with SUPT5H (gene/protein).', 'head_id': 'PHYHIP_(0)', 'tail_id': 'SUPT5H_(1736)'}}, {'triplet_index': 3201926, 'distance': 0.9593513607978821, 'entity': {'edge_type': 'gene/protein|ppi|gene/protein', 'feat': 'PHYHIP (gene/protein) has a direct relationship of protein_protein:ppi with S100A13 (gene/protein).', 'head_id': 'PHYHIP_(0)', 'tail_id': 'S100A13_(5140)'}}, {'triplet_index': 3334423, 'distance': 0.9588445425033569, 'entity': {'edge_type': 'gene/protein|ppi|gene/protein', 'feat': 'PHYHIP (gene/protein) has a direct relationship of protein_protein:ppi with HNRNPA1 (gene/protein).', 'head_id': 'PHYHIP_(0)', 'tail_id': 'HNRNPA1_(352)'}}, {'triplet_index': 110476, 'distance': 0.9586011171340942, 'entity': {'edge_type': 'gene/protein|ppi|gene/protein', 'feat': 'PHYHIP (gene/protein) has a direct relationship of protein_protein:ppi with ANKRD12 (gene/protein).', 'head_id': 'PHYHIP_(0)', 'tail_id': 'ANKRD12_(6038)'}}]]
# Get node indices from the results
[n['triplet_index'] for n in results[0]]
[0, 3069556, 93582, 305788, 39303, 300682, 3154085, 3201926, 3334423, 110476]
# Get the cosine similarity scores
[n['distance'] for n in results[0]]
[1.000000238418579, 0.9815623760223389, 0.9684444665908813, 0.9657970666885376, 0.9635176658630371, 0.9599261283874512, 0.9597105979919434, 0.9593513607978821, 0.9588445425033569, 0.9586011171340942]