udpated get prompts and system prompts

This commit is contained in:
root
2024-03-22 15:15:12 -07:00
parent af79e2400e
commit 56fd921d27
2 changed files with 423 additions and 19 deletions

View File

@@ -80,7 +80,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"id": "bbbdb428-6d01-43f2-9e58-b919e7a68736",
"metadata": {},
"outputs": [],
@@ -98,7 +98,7 @@
},
{
"cell_type": "code",
"execution_count": 81,
"execution_count": 6,
"id": "02374d3c-5711-4704-8b37-7eda0965c9b0",
"metadata": {},
"outputs": [
@@ -106,7 +106,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Yes, the compound Setmelanotide is used to treat Bardet-Biedl syndrome. This information is sourced from ChEMBL and DrugCentral.\n",
"Yes, the compound Setmelanotide is used to treat Bardet-Biedl syndrome. It is currently in phase 3 of clinical trials according to the sources ChEMBL and DrugCentral. However, it is advised to seek guidance from a healthcare professional for the most current and personalized treatment options. [Provenance: ChEMBL, DrugCentral]\n",
"\n"
]
}
@@ -128,7 +128,7 @@
},
{
"cell_type": "code",
"execution_count": 82,
"execution_count": 7,
"id": "06bf55f2-eccf-4c26-b65a-0ed2ed30e689",
"metadata": {},
"outputs": [
@@ -157,7 +157,7 @@
},
{
"cell_type": "code",
"execution_count": 98,
"execution_count": 8,
"id": "eca290bb-fe30-4bb2-ab36-405c2151bccb",
"metadata": {},
"outputs": [],
@@ -175,15 +175,15 @@
},
{
"cell_type": "code",
"execution_count": 100,
"id": "3dc1d019-8676-49d9-82c3-18ebe5497dbd",
"execution_count": 9,
"id": "03863049-4ea5-4733-aeb4-0be3f09d6b5f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"PNPLA3 has a more significant association with the disease liver benign neoplasm, as indicated by its lower GWAS p-value of 4e-14 compared to HLA-B's p-value of 2e-08. The provenance of this association is GWAS.\n",
"The gene PNPLA3 has a more significant association with the disease liver benign neoplasm, as indicated by the lower p-value of 4e-14 compared to HLA-B's p-value of 2e-08. The provenance of this information is the GWAS Catalog.\n",
"\n"
]
}
@@ -205,7 +205,7 @@
},
{
"cell_type": "code",
"execution_count": 99,
"execution_count": 10,
"id": "8614706d-90d9-49e8-9481-30628505ba2e",
"metadata": {},
"outputs": [
@@ -226,34 +226,33 @@
},
{
"cell_type": "markdown",
"id": "1fd3811b-546f-4ec3-8207-f9323e372744",
"id": "8087eb26-e144-48ee-8630-09c73eb35a37",
"metadata": {},
"source": [
"## Other questions:"
"## Question 3"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "2a1c9337-fd39-45b0-b12a-6de9b5971b9e",
"execution_count": 11,
"id": "4ed3bb71-12c8-40bf-b361-f9cd227c142d",
"metadata": {},
"outputs": [],
"source": [
"\n",
"question = 'Does drug dependence have any genetic factors? Do you have any statistical evidence from trustworthy sources for this?'\n"
"question = \"Is Parkinson's disease associated with PINK1 gene?\"\n"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "e6852cb3-8bf9-408b-ab65-492b75c690ed",
"execution_count": 12,
"id": "0d06bb9e-ed6e-4f1b-ac2e-65cf219eeb12",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Yes, drug dependence does have genetic factors. This is evidenced by the association of drug dependence with genes KAT2B and SLC25A16. The statistical evidence comes from Genome-Wide Association Studies (GWAS), with p-values of 4e-10 and 1e-09 respectively, indicating a statistically significant association.\n",
"Yes, Parkinson's disease is associated with the PINK1 gene. This association is reported in the DISEASES database - https://diseases.jensenlab.org.\n",
"\n"
]
}
@@ -265,9 +264,414 @@
"generate_response(question, LLM_TO_USE, KG_RAG_FLAG, evidence_flag=EDGE_EVIDENCE_FLAG, temperature=TEMPERATURE)\n"
]
},
{
"cell_type": "markdown",
"id": "b17ed61e-9de1-4e2b-ad04-5c41b1167e5b",
"metadata": {},
"source": [
"## Question 3- perturbed (entities in smaller case)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "ae0cccdb-8689-46b0-a1cb-808ec8f997e0",
"metadata": {},
"outputs": [],
"source": [
"question = \"Is parkinson's disease associated with pink1 gene?\"\n"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "1961ca49-f48a-46e3-bfc3-ced02fb1a2c2",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Yes, Parkinson's disease is associated with the PINK1 gene. This association is reported in the DISEASES database - https://diseases.jensenlab.org.\n",
"\n"
]
}
],
"source": [
"KG_RAG_FLAG = True\n",
"EDGE_EVIDENCE_FLAG = True \n",
"\n",
"generate_response(question, LLM_TO_USE, KG_RAG_FLAG, evidence_flag=EDGE_EVIDENCE_FLAG, temperature=TEMPERATURE)\n"
]
},
{
"cell_type": "markdown",
"id": "b7f6ee15-2e3a-4dea-bfa6-35401b6b67da",
"metadata": {},
"source": [
"## Question 4:"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "f5068a03-143d-4c29-87bf-bba1082408bd",
"metadata": {},
"outputs": [],
"source": [
"question = \"What are some protein markers associated with thoracic aortic aneurysm?\"\n"
]
},
{
"cell_type": "markdown",
"id": "056a4de0-c0fb-48ee-93e3-7742584362c9",
"metadata": {},
"source": [
"### With KG-RAG"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "6edd6bc4-e03b-473e-996e-6705f83ee2fa",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The protein markers associated with thoracic aortic aneurysm include Chondroitin sulfate proteoglycan 4 (CSPG4), Matrix Gla protein (MGP), Interleukin-2 receptor subunit alpha (IL2RA), Interleukin-1 beta (IL1B), Myosin-10 (MYH10), Tropomyosin alpha-4 chain (TPM4), Tyrosine-protein kinase Mer (MERTK), and Stabilin-1 (STAB1). The provenance of these associations is the Cell Taxonomy database.\n",
"\n"
]
}
],
"source": [
"KG_RAG_FLAG = True\n",
"EDGE_EVIDENCE_FLAG = True \n",
"\n",
"generate_response(question, LLM_TO_USE, KG_RAG_FLAG, evidence_flag=EDGE_EVIDENCE_FLAG, temperature=TEMPERATURE)\n"
]
},
{
"cell_type": "markdown",
"id": "e95cd283-ebf1-4394-bf40-e62fc96505eb",
"metadata": {},
"source": [
"### Without KG-RAG"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "f4c9d96b-c78f-44d4-9a46-1254f4856324",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Some protein markers associated with thoracic aortic aneurysm include Matrix metalloproteinases (MMPs), C-reactive protein (CRP), and fibrillin-1.\n",
"\n"
]
}
],
"source": [
"KG_RAG_FLAG = False\n",
"\n",
"generate_response(question, LLM_TO_USE, KG_RAG_FLAG, temperature=TEMPERATURE)\n"
]
},
{
"cell_type": "markdown",
"id": "84ecf6b4-5732-453a-94c3-a524c4572b81",
"metadata": {},
"source": [
"## Question 5:"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "0a049b56-cc9c-4777-8351-265839145690",
"metadata": {},
"outputs": [],
"source": [
"question = \"Are there any protein markers that show increased activity in adenocarcinoma?\"\n"
]
},
{
"cell_type": "markdown",
"id": "a9a82988-b1e6-441b-bafa-4b148e4054ba",
"metadata": {},
"source": [
"### With KG-RAG"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "6cd1217e-b504-4006-a099-87bc5361d85f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Yes, there are several protein markers that show increased activity in adenocarcinoma. These include Keratin, type II cytoskeletal 7 (Cytokeratin-7) (CK-7) (Keratin-7) (K7) (Sarcolectin) (Type-II keratin Kb7), Anterior gradient protein 2 homolog (AG-2) (hAG-2) (HPC8) (Secreted cement gland protein XAG-2 homolog), Guanine deaminase (Guanase) (Guanine aminase) (3.5.4.3) (Guanine aminohydrolase) (GAH) (p51-nedasin), and Graves disease carrier protein (GDC) (Graves disease autoantigen) (GDA) (Mitochondrial solute carrier protein homolog) (Solute carrier family 25 member 16). The provenance of these associations is the Cell Taxonomy.\n",
"\n"
]
}
],
"source": [
"KG_RAG_FLAG = True\n",
"EDGE_EVIDENCE_FLAG = True \n",
"\n",
"generate_response(question, LLM_TO_USE, KG_RAG_FLAG, evidence_flag=EDGE_EVIDENCE_FLAG, temperature=TEMPERATURE)\n"
]
},
{
"cell_type": "markdown",
"id": "7bcae3c8-130c-4121-a119-9b9bb79a21ee",
"metadata": {},
"source": [
"### Without KG-RAG"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "96d8e70c-4258-4679-a5fa-1bc798eabd59",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Yes, certain protein markers like carcinoembryonic antigen (CEA), CA 19-9, and cytokeratins can show increased activity in adenocarcinoma.\n",
"\n"
]
}
],
"source": [
"KG_RAG_FLAG = False\n",
"\n",
"generate_response(question, LLM_TO_USE, KG_RAG_FLAG, temperature=TEMPERATURE)\n"
]
},
{
"cell_type": "markdown",
"id": "03697e1c-6868-4c56-8876-1333bc493f44",
"metadata": {},
"source": [
"## Question 6:"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "189ef273-bf3a-415f-8198-0e7fc4a1cac0",
"metadata": {},
"outputs": [],
"source": [
"question = \"Do you know if ruxolitinib is approved as a pharmacologic treatment for vitiligo?\"\n"
]
},
{
"cell_type": "markdown",
"id": "fffd4c16-08fa-436f-b692-d3fe9eda305e",
"metadata": {},
"source": [
"### With KG-RAG"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "8e520c41-c5d3-4b38-a744-f954c106847a",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Yes, Ruxolitinib is associated with the treatment of vitiligo. This association is supported by data from ChEMBL and DrugCentral databases. However, it is always recommended to seek guidance from a healthcare professional for treatment options. (Provenance: ChEMBL, DrugCentral)\n",
"\n"
]
}
],
"source": [
"KG_RAG_FLAG = True\n",
"EDGE_EVIDENCE_FLAG = True \n",
"\n",
"generate_response(question, LLM_TO_USE, KG_RAG_FLAG, evidence_flag=EDGE_EVIDENCE_FLAG, temperature=TEMPERATURE)\n"
]
},
{
"cell_type": "markdown",
"id": "6b1c1e0c-2a6a-48a0-99f1-4daabb2f1f61",
"metadata": {},
"source": [
"### Without KG-RAG"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "91e4eabc-2027-4bb6-b75f-0064d2a52369",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"As of my knowledge up to date, ruxolitinib is not officially approved for the treatment of vitiligo. However, some clinical trials have shown promising results. Always consult with a healthcare provider for treatment options.\n",
"\n"
]
}
],
"source": [
"KG_RAG_FLAG = False\n",
"\n",
"generate_response(question, LLM_TO_USE, KG_RAG_FLAG, temperature=TEMPERATURE)\n"
]
},
{
"cell_type": "markdown",
"id": "be6ca1c2-f118-41cc-93a7-5e8db134193f",
"metadata": {},
"source": [
"## Question 7:"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "36a704be-f9d6-4968-82ec-09c4d0efe3a2",
"metadata": {},
"outputs": [],
"source": [
"question = \"Are there any biomarkers that show increased profile in hydrocephalus?\"\n"
]
},
{
"cell_type": "markdown",
"id": "cf579442-9b23-4160-be25-e4a9dd88999f",
"metadata": {},
"source": [
"### With KG-RAG"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "a9f242a8-4f31-4f58-926c-d48f3f95f584",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Yes, the Transmembrane protein 119 (TMEM119) and P2Y purinoceptor 12 (P2RY12) show an increased profile in hydrocephalus. The provenance of this information is the Cell Taxonomy database.\n",
"\n"
]
}
],
"source": [
"KG_RAG_FLAG = True\n",
"EDGE_EVIDENCE_FLAG = True \n",
"\n",
"generate_response(question, LLM_TO_USE, KG_RAG_FLAG, evidence_flag=EDGE_EVIDENCE_FLAG, temperature=TEMPERATURE)\n"
]
},
{
"cell_type": "markdown",
"id": "e0904315-0f47-4422-aa5c-063a3ccbc919",
"metadata": {},
"source": [
"### Without KG-RAG"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "1f1ab642-9385-4b04-83cf-6ace3eee6653",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Yes, certain biomarkers such as L1CAM, S100B, GFAP, and NSE have shown increased profiles in hydrocephalus.\n",
"\n"
]
}
],
"source": [
"KG_RAG_FLAG = False\n",
"\n",
"generate_response(question, LLM_TO_USE, KG_RAG_FLAG, temperature=TEMPERATURE)\n"
]
},
{
"cell_type": "markdown",
"id": "1fd3811b-546f-4ec3-8207-f9323e372744",
"metadata": {},
"source": [
"## Question 8:"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "2a1c9337-fd39-45b0-b12a-6de9b5971b9e",
"metadata": {},
"outputs": [],
"source": [
"\n",
"question = 'Does drug dependence have any genetic factors? Do you have any statistical evidence from trustworthy sources for this?'\n"
]
},
{
"cell_type": "markdown",
"id": "93f43325-fd99-4b43-a2b3-1314c26c7d8e",
"metadata": {},
"source": [
"### With KG-RAG"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "e6852cb3-8bf9-408b-ab65-492b75c690ed",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Yes, drug dependence does have genetic factors. The genes KAT2B and SLC25A16 have been associated with drug dependence. This information is backed by statistical evidence from the GWAS Catalog, with p-values of 4e-10 and 1e-09 respectively.\n",
"\n"
]
}
],
"source": [
"KG_RAG_FLAG = True\n",
"EDGE_EVIDENCE_FLAG = True \n",
"\n",
"generate_response(question, LLM_TO_USE, KG_RAG_FLAG, evidence_flag=EDGE_EVIDENCE_FLAG, temperature=TEMPERATURE)\n"
]
},
{
"cell_type": "markdown",
"id": "796144e2-338d-479c-ba3b-34b0c23a209b",
"metadata": {},
"source": [
"### Without KG-RAG"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "b8079bc6-d309-4c88-9440-376aa43d972e",
"metadata": {},
"outputs": [

View File

@@ -24,7 +24,7 @@ PROMPT_BASED_TEXT_GENERATION: |
# KG-RAG Based Text Generation
KG_RAG_BASED_TEXT_GENERATION: |
You are an expert biomedical researcher. For answering the Question at the end with brevity, you need to first read the Context provided. Then give your final answer briefly, by citing the Provenance information from the context. You can find Provenance from the Context statement 'Provenance of this association is <Provenance>'. Do not forget to cite the Provenance information.
You are an expert biomedical researcher. For answering the Question at the end with brevity, you need to first read the Context provided. Then give your final answer briefly, by citing the Provenance information from the context. You can find Provenance from the Context statement 'Provenance of this association is <Provenance>'. Do not forget to cite the Provenance information. Note that, if Provenance is 'GWAS' report it as 'GWAS Catalog'. If Provenance is 'DISEASES' report it as 'DISEASES database - https://diseases.jensenlab.org'. Additionally, when providing drug or medication suggestions, give maximum information available and then advise the user to seek guidance from a healthcare professional as a precautionary measure.
# True/False Question
TRUE_FALSE_QUESTION: |