diff options
Diffstat (limited to 'gnqa/paper2_eval/src')
-rw-r--r-- | gnqa/paper2_eval/src/document_operations.py | 36 | ||||
-rw-r--r-- | gnqa/paper2_eval/src/parse_r2r_result.ipynb | 22 | ||||
-rw-r--r-- | gnqa/paper2_eval/src/parse_r2r_result.py | 51 |
3 files changed, 78 insertions, 31 deletions
diff --git a/gnqa/paper2_eval/src/document_operations.py b/gnqa/paper2_eval/src/document_operations.py index 10ed0bc..2682e57 100644 --- a/gnqa/paper2_eval/src/document_operations.py +++ b/gnqa/paper2_eval/src/document_operations.py @@ -8,6 +8,15 @@ from r2r import R2R, Document, GenerationConfig, R2RClient class DocOps: _type = '' + values_key = { + "text" : {"name": "contexts", "append": 1}, + "associatedQuery": {"name": "question", "append": 0}, + "id": {"name": "id", "append": 1}, + "title": {"name": "titles", "append": 1}, + "document_id": {"name": "document_id", "append": 1}, + "extraction_id": {"name": "extraction_id", "append": 1}, + "content": {"name": "answer", "append": 0} + } def __init__(self): self._type = 'QuestionList' @@ -22,6 +31,33 @@ class DocOps: with open(outp_file, "a") as the_data: the_data.write(output) + def get_ragas_out_dict(): + return { "titles": [], + "extraction_id": [], + "document_id": [], + "id": [], + "contexts": [], + "answer": "", + "question": ""} + + + def extract_response(obj, values_key, thedict): + if isinstance(obj, dict): + for key, val in obj.items(): + if (key in values_key.keys()): + if (values_key[key]["append"]): + thedict[values_key[key]["name"]].append(val.replace("\n", " ").strip()) + else: + thedict[values_key[key]["name"]] = val.replace("\n", " ").strip() + print(("", "Key -> {0}\tValue -> {1}".format(key,val)) [verbose]) + else: + if (len(obj.items()) == 1 ): + print(key, " --> ", val) + extract_response(val, values_key, thedict) + elif isinstance(obj, list): + for item in obj: + extract_response(item, values_key, thedict) + class QuestionList: _verbose = 0 _doc = '' diff --git a/gnqa/paper2_eval/src/parse_r2r_result.ipynb b/gnqa/paper2_eval/src/parse_r2r_result.ipynb index 93b05c5..21de4cf 100644 --- a/gnqa/paper2_eval/src/parse_r2r_result.ipynb +++ b/gnqa/paper2_eval/src/parse_r2r_result.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 32, + "execution_count": 41, "metadata": {}, "outputs": [], "source": [ @@ -11,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 42, "metadata": {}, "outputs": [], "source": [ @@ -25,7 +25,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 43, "metadata": {}, "outputs": [], "source": [ @@ -73,7 +73,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 44, "metadata": {}, "outputs": [ { @@ -144,7 +144,7 @@ "\n", "\n", "\n", - "domain_expoert_aging_1\n", + "../data/dataset/domain_expert_aging_1\n", "results --> {'completion': {'id': 'chatcmpl-ABLwRFLcOLGvXJuXhHs6NCge9tY7Z', 'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'content': 'The mouse genes associated with longevity include:\\n\\n1. **Mouse loci associated with life span**: These loci exhibit sex-specific and epistatic effects [1].\\n2. **Mouse growth hormone receptor**: Alterations in this gene result in increased lifespan [3], [4].\\n3. **Lmna heterozygosity**: This genetic modification ameliorates progeroid phenotypes and extends lifespan [6].\\n\\nThese references provide evidence of specific genes and loci in mice that have been linked to increased longevity.', 'role': 'assistant'}}], 'created': 1727269315, 'model': 'gpt-4o-2024-05-13', 'object': 'chat.completion', 'system_fingerprint': 'fp_e375328146', 'usage': {'completion_tokens': 103, 'prompt_tokens': 1413, 'total_tokens': 1516}}, 'search_results': {'vector_search_results': [{'id': '09da6f9e-b996-5438-91be-41d9438cb930', 'score': 0.7879571445013809, 'metadata': {'text': '11. Gelman R, Watson A, Bronson R et al (1988) Murine chromo-\\nsomal regions correlated with longevity. Genetics\\n118(4):693704\\n12. Jackson AU, Galecki AT, Burke DT et al (2002) Mouse loci\\nassociated with life span exhibit sex-specic and epistatic effects.\\nJ Gerontol A Biol Sci Med Sci 57(1):B9B15\\n13. Foreman JE, Lionikas A, Lang DH et al (2009) Genetic archi-\\ntecture for hole-board behaviors across substantial time intervalsin young, middle-aged and old mice. Genes Brain Behav', 'title': '2015 - A Chromosome 13 locus is associated with male-specific mortality in mice.pdf', 'version': 'v0', 'chunk_order': 67, 'document_id': 'ad8f2626-87fb-520e-8cef-ee9a9cc3ab0b', 'extraction_id': '5cc56e3b-53ab-5299-814d-014e2ed31d2f', 'associatedQuery': 'Which mouse genes have been associated with longevity?'}}, {'id': '14bf5e8a-4095-536f-b98b-00c8cdae3a31', 'score': 0.7488234639167786, 'metadata': {'text': 'Long-lived rodents reveal signatures of positive selection in genes associated\\nwith lifespan. PLoS Genet. 14:e1007272. doi: 10.1371/journal.pgen.100\\n7272\\nSchchter, F., Faure-Delanef, L., Gunot, F., Rouger, H., Froguel, P., Lesueur-Ginot,\\nL., et al. (1994). Genetic associations with human longevity at the APOE and\\nACE loci. Nat. Genet. 6, 2932. doi: 10.1038/ng0194-29\\nSchinaman, J. M., Rana, A., Ja, W. W., Clark, R. I., and Walker, D. W. (2019).', 'title': '2021 - Footprints in the Sand Deep Taxonomic Comparisons in Vertebrate Genomics to Unveil the Genetic Programs of Human Longevity.pdf', 'version': 'v0', 'chunk_order': 137, 'document_id': '0dc45abe-ab02-5b07-9916-7093b53323c0', 'extraction_id': '11ca91fa-a13f-5cc5-90c8-53d1ebe76836', 'associatedQuery': 'Which mouse genes have been associated with longevity?'}}, {'id': 'f8fdd2ee-710c-5d2c-8a70-bf48f4927653', 'score': 0.7425085306167603, 'metadata': {'text': 'of the mouse growth hormone receptor results in severely decreased body weights, insulin, and insulin- like \\ngrowth factor I levels and increased life span. Endocrinology 144:37993810. DOI: https://doi.org/10.1210/en. \\n2003-0374, PMID: 12933651\\nde Haan G, Williams RW. 2005. A genetic and genomic approach to identify longevity genes in mice. \\nMechanisms of Ageing and Development 126:133138. DOI: https://doi.org/10.1016/j.mad.2004.09.012, \\nPMID: 15610771', 'title': '2021 - Genetic loci and metabolic states associated with murine epigenetic aging.pdf', 'version': 'v0', 'chunk_order': 224, 'document_id': 'b82bd9e1-2373-577b-a942-164565eaca6b', 'extraction_id': 'a9ebf1d8-5ef8-5c52-962e-110873476823', 'associatedQuery': 'Which mouse genes have been associated with longevity?'}}, {'id': 'e613d3df-adb0-56b0-abfd-8828020c23c3', 'score': 0.7425085306167603, 'metadata': {'text': 'of the mouse growth hormone receptor results in severely decreased body weights, insulin, and insulin- like \\ngrowth factor I levels and increased life span. Endocrinology 144:37993810. DOI: https://doi.org/10.1210/en. \\n2003-0374, PMID: 12933651\\nde Haan G, Williams RW. 2005. A genetic and genomic approach to identify longevity genes in mice. \\nMechanisms of Ageing and Development 126:133138. DOI: https://doi.org/10.1016/j.mad.2004.09.012, \\nPMID: 15610771', 'title': '2021 -Mozhui- Epigenetic aging.pdf', 'version': 'v0', 'chunk_order': 224, 'document_id': 'd23daa43-4176-54e6-b3c3-b889843e92f1', 'extraction_id': 'e662d80d-b529-5749-856c-ed734c6e3eaa', 'associatedQuery': 'Which mouse genes have been associated with longevity?'}}, {'id': '02296a91-f1a4-5b35-a5d1-e1851797404b', 'score': 0.7411562954690294, 'metadata': {'text': 'Mulvey L, Sinclair A, Selman C (2014) Lifespan modulation in mice\\nand the confounding effects of genetic background. J Genet\\nGenomics 41:497503. doi: 10.1016/j.jgg.2014.06.002\\nOConnor TP, Lee A, Jarvis JUM, Buffenstein R (2002) Prolonged\\nlongevity in naked mole-rats: age-related changes in metabolism,\\nbody composition and gastrointestinal function. Comp Biochem\\nPhysiol A 133:835842. doi: 10.1016/S1095-6433(02)00198-8\\nOpazo JC, Palma RE, Melo F, Lessa EP (2005) Adaptive evolution of', 'title': '2016 - Unraveling the message insights into comparative genomics.pdf', 'version': 'v0', 'chunk_order': 188, 'document_id': '0deba7bb-c27a-5d9e-b1b2-e48a5574882c', 'extraction_id': 'c6f50e80-1bc5-5b0a-b57b-4c2bfe524d96', 'associatedQuery': 'Which mouse genes have been associated with longevity?'}}, {'id': '90214d4d-4068-5490-9049-5604b5dcf3e2', 'score': 0.7377414547050879, 'metadata': {'text': '/ mice by Lmna heterozy-\\ngosity ameliorates progeroid phenotypes and extends \\nlifespan [143, 174, 175].', 'title': '2012 - Chromatin Remodeling, DNA Damage Repair and Aging.pdf', 'version': 'v0', 'chunk_order': 112, 'document_id': '594e5dbe-b92a-5b0c-9f65-2a10670f9517', 'extraction_id': 'd9a12bd9-c65e-547a-89aa-4e0231558ddc', 'associatedQuery': 'Which mouse genes have been associated with longevity?'}}, {'id': '56e03e38-0ae5-5b29-b929-662fa091e0ac', 'score': 0.7320996842265558, 'metadata': {'text': 'References\\n1. Hook Met al.Genetic cartography of longevity in humans and mice: Current landscape and horizons. \\nBiochim. Biophys. Acta1864, 27182732 (2018).\\n2. Kuningas Met al.Genes encoding longevity: from model organisms to humans. Aging Cell7, 270\\n280 (2008). [PubMed: 18208581] \\n3. de Magalhes JP, Wuttke D, Wood SH, Plank M & V ora C Genome-environment interactions that \\nmodulate aging: Powerful targets for drug discovery. Pharmacol. Rev. 64, 88101 (2012). [PubMed: \\n22090473]', 'title': '2021 - Gene-by-environment modulation of lifespan and weight gain in the murine BXD family.pdf', 'version': 'v0', 'chunk_order': 130, 'document_id': '4d082da4-fa48-5170-8147-c4fea47a5d4b', 'extraction_id': '30ba3324-6e19-58c2-9e32-508f827af3e5', 'associatedQuery': 'Which mouse genes have been associated with longevity?'}}, {'id': 'ebc5b444-a63f-5819-9d3a-ffbf96b3d367', 'score': 0.7316716909408569, 'metadata': {'text': '\"Murine chromosomal regions correlated with longevity.\" Genetics 118: 693-704.', 'title': '2006 - THE GENETIC REGULATION OF THE RESPONSE OF HEMATOPOIETIC STEM_PROG.pdf', 'version': 'v0', 'chunk_order': 381, 'document_id': 'b84914bc-195d-5c48-8e89-0db719675c1f', 'extraction_id': 'c04cac81-a0b0-5d0a-b21e-2f94494bb302', 'associatedQuery': 'Which mouse genes have been associated with longevity?'}}, {'id': '80d01818-7573-5321-b33d-c7e291f3fe74', 'score': 0.7243530750274658, 'metadata': {'text': 'expression of alpha-1,2-mannosidase I extends lifespan in \\nDrosophila melanogaster and Caenorhabditis elegans . Aging Cell, \\n2009 , 8(4), 370-9. \\n[73] Wang, H.D.; Kazemi-Esfarjani, P.; Benzer, S. Multiple-stress \\nanalysis for isolation of Drosophila longevity genes . Proc Natl \\nAcad Sci U S A , 2004 , 101(34), 12610-5. \\n[74] Lin, Y.J.; Seroude, L.; Benzer, S. Extended life-span and stress \\nresistance in the Drosophila mutant methuselah . Science , 1998 , \\n282(5390), 943-6.', 'title': '2012 - Genome-Scale Studies of Aging Challenges and Opportunities.pdf', 'version': 'v0', 'chunk_order': 91, 'document_id': 'b77aace0-fa36-5fd4-8e2a-c8932198acd1', 'extraction_id': '9669b6fe-e9d7-55e8-a91a-c015df633daa', 'associatedQuery': 'Which mouse genes have been associated with longevity?'}}, {'id': '11af155f-85c6-5f8b-8943-5391ad678f7e', 'score': 0.7239880130298143, 'metadata': {'text': 'sion analysis of mouse liver genes: effect of age and of thelongevity mutant Prop1df. J Gerontol A Biol Sci Med Sci 56:\\nB72B80, 2001.\\n12.Fabrizio P, Pozza F, Pletcher SD, Gendron CM, and Longo\\nVD. Regulation of longevity and stress resistance by Sch9 in\\nYeast. Science 292: 288 290, 2001.\\n13.Haase D, Lehmann MH, Korner MM, Korfer R, Sigusch\\nHH, and Figulla HR. Identi cation and validation of selective', 'title': '2003 - Lifelong voluntary exercise in the mouse prevents.pdf', 'version': 'v0', 'chunk_order': 141, 'document_id': '24d4f270-f45b-5830-84f9-b1e5bcd3c070', 'extraction_id': '6a2cdf66-f3c9-5be9-b6b0-f203be169103', 'associatedQuery': 'Which mouse genes have been associated with longevity?'}}], 'kg_search_results': None}}\n", "\n", "\n", @@ -208,7 +208,7 @@ "\n", "\n", "\n", - "domain_expoert_aging_2\n", + "../data/dataset/domain_expert_aging_2\n", "results --> {'completion': {'id': 'chatcmpl-ABLwW9HA9VG184zgOmenEBU2eMIMc', 'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'content': 'Genetic factors associated with aging include:\\n\\n1. **Genome-wide association studies (GWAS)**: These studies offer an unbiased approach to identify new candidate genes for human diseases, including those related to aging. Convergent results from multiple aging-related traits can point out the genes responsible for the general aging of the organism [2].\\n\\n2. **Longevity-associated genes**: Dozens of genes have been associated with human longevity, although only a handful have shown consistent effects across populations. These genes are often related to specific biological pathways and processes [4].\\n\\n3. **Genes involved in mitochondrial and proteasomal functions**: Aging is associated with alterations in the transcript levels of many genes, including those involved in evolutionarily conserved mitochondrial and proteasomal functions. Some of these genes have been shown to be directly involved in regulating lifespan [7].\\n\\n4. **Genes with protective functions**: Certain genes that are overexpressed with age seem to have protective functions, helping organisms manage aging. These genes could be targets for manipulation to potentially influence the aging process [8].\\n\\nThese genetic factors highlight the complex interplay of various genes and pathways in the aging process.', 'role': 'assistant'}}], 'created': 1727269320, 'model': 'gpt-4o-2024-05-13', 'object': 'chat.completion', 'system_fingerprint': 'fp_e375328146', 'usage': {'completion_tokens': 231, 'prompt_tokens': 1014, 'total_tokens': 1245}}, 'search_results': {'vector_search_results': [{'id': '3117c019-7311-53ae-8ab1-927ca822c709', 'score': 0.7238354898642153, 'metadata': {'text': 'It is undisputed that genetic factors influence aging. In a remarkable', 'title': '2009 - The Human Ageing Genomic Resources online.pdf', 'version': 'v0', 'chunk_order': 9, 'document_id': 'e43cd3b6-ad8e-5422-ba7c-ceb6e66cc529', 'extraction_id': '7ada6b55-99c2-5e20-bf96-d153f927256c', 'associatedQuery': 'what genetic factor are associated with aging'}}, {'id': '0ad664d2-6756-5123-b192-8a56cf6887a5', 'score': 0.7047669643441531, 'metadata': {'text': 'perform a study of the genetic sources of biological\\naging. However, to be successful, the genetic study of acomplex condition requires a heritable phenotype to be\\ndeveloped and validated. Genome-wide association\\nstudies offer an unbiased approach to identify newcandidate genes for human diseases. It is hypothesized\\nthat convergent results from multiple aging-related traits\\nwill point out the genes responsible for the general agingof the organism. This perspective focuses on the', 'title': '2011 - How pleiotropic genetics of the musculoskeletal system.pdf', 'version': 'v0', 'chunk_order': 1, 'document_id': 'ed31486c-a651-5894-bd96-21fbd78f2646', 'extraction_id': 'b5b3c74a-90de-5b1e-9580-8031b10be7ec', 'associatedQuery': 'what genetic factor are associated with aging'}}, {'id': '9fa00091-9661-57bd-91c7-f0bf436805a7', 'score': 0.7019733190536499, 'metadata': {'text': 'population dynamics on the genetic architecture of human longevity. Aging (Albany NY). 2018;10(8):1947 63.\\n68. Bellenguez C, Kucukali F, Jansen I, Andrade V, Morenau-Grau S, Amin N, et al. Large meta-analysis of genome-wide\\nassociation studies expands knowledge of the genetic etiology of Alzheimer disease and highlights potential\\ntranslational opportunities. medRxiv. 2020.\\n69. Kojima T, Shimazui T, Hinotsu S, Joraku A, Oikawa T, Kawai K, et al. Decreased expression of CXXC4 promotes a', 'title': '2021 - Genome-wide association studies identify.pdf', 'version': 'v0', 'chunk_order': 192, 'document_id': '60c2e869-1fee-53ea-b332-26d9c2abc747', 'extraction_id': 'cd7730b6-22dc-5256-9310-79fc348b3226', 'associatedQuery': 'what genetic factor are associated with aging'}}, {'id': '786d2756-4c4d-5ac0-8d3d-63f914d51664', 'score': 0.6959169273475545, 'metadata': {'text': 'In addition to aging- and CR-related genes, another\\nsource of candidate genes and pathways for drug designare human longevity-associated genes (Barzilai andShuldiner, 2001; Browner et al., 2004; Kenyon, 2010).Dozens of genes have now been associated with humanlongevity (de Magalha es et al., 2009a), although only ahandful of genes have been shown to have consistenteffects across populations.\\nMany longevity-associated genes are related to spe-', 'title': '2012 - Genome-Environment Interactions That Modulate.pdf', 'version': 'v0', 'chunk_order': 119, 'document_id': 'b1a1997c-e9df-5dc0-9d12-a3977d0c64ec', 'extraction_id': 'd59d7882-333d-5576-86ab-3cfa6354b946', 'associatedQuery': 'what genetic factor are associated with aging'}}, {'id': 'a0672677-71ad-5603-8427-a0648eec407f', 'score': 0.6954198479652405, 'metadata': {'text': 'Clinical Genetics and Genomics of Aging', 'title': '2020 - Clinical Genetics and Genomics of Aging.pdf', 'version': 'v0', 'chunk_order': 1, 'document_id': '62b635c3-040e-512a-b016-6ef295308a1e', 'extraction_id': '4ea8424f-1cd8-569c-a1df-3f0f54206e70', 'associatedQuery': 'what genetic factor are associated with aging'}}, {'id': 'e0cce1c5-8709-5218-99b6-48a6ba242931', 'score': 0.694896936416626, 'metadata': {'text': 'effect fundamental mechanisms of aging (14, 16). The drawbacksof such studies include the improbability of picking the right geneto study the myriad of known and unknown genes affecting theprocess of interest (17). The linkage study described heremarkedly improves the efficiency of such association studies bydefining a region likely to contain polymorphism(s) with signif-icant influence on life span.\\nAdditional association studies with these families and repli-', 'title': '2001 - A genome-wide scan for linkage to human.pdf', 'version': 'v0', 'chunk_order': 40, 'document_id': '1431984a-82d9-51d4-a23c-5f76a02ab554', 'extraction_id': '17246c43-2e44-579b-867d-3dc7150ceedd', 'associatedQuery': 'what genetic factor are associated with aging'}}, {'id': 'bf2cd208-273f-5848-b243-df8b95ea7833', 'score': 0.6911037152347747, 'metadata': {'text': 'The multifactorial and temporal features of aging can beanalyzed efficiently by genome-wide transcriptional profiling,which has been conducted in various model organisms and hu-mans (Melov and Hubbard 2004). Aging is associated with alter-ations in transcript levels of many genes, including those in-volved in evolutionarily conserved mitochondrial and protea-somal functions (McCarroll et al. 2004), some of which havebeen shown to be directly involved in regulating lifespan in C.', 'title': '2007 - Temporal and spatial transcriptional profiles.pdf', 'version': 'v0', 'chunk_order': 11, 'document_id': '38f27ec7-08bf-5397-b2b8-bde95e0dc3f8', 'extraction_id': '2e42619b-d0b2-5d33-aab8-6f04002ee807', 'associatedQuery': 'what genetic factor are associated with aging'}}, {'id': '413f8f54-b5cc-5089-9f5c-d9e3b8bcf594', 'score': 0.6904207652556452, 'metadata': {'text': 'overexpressed with age seem to be a response to aging,in that they have been previously found to have protec-tive functions (de Magalha es et al., 2009b). As such,these genes may help organisms manage aging andcould be targets for manipulation. Likewise, gene ex-pression analysis of CR has been conducted to identifyassociated genes (Lee et al., 1999, 2000). A number ofmolecular signatures have emerged from such studiesthat could be useful to identify candidate processes andpathways that affect aging,', 'title': '2012 - Genome-Environment Interactions That Modulate.pdf', 'version': 'v0', 'chunk_order': 114, 'document_id': 'b1a1997c-e9df-5dc0-9d12-a3977d0c64ec', 'extraction_id': 'd59d7882-333d-5576-86ab-3cfa6354b946', 'associatedQuery': 'what genetic factor are associated with aging'}}, {'id': '50581d4f-396c-5d12-aec6-5f42e2ab88ef', 'score': 0.6901622229911234, 'metadata': {'text': 'Mol Genet Genomic Med. 2020;00:e1157. | 1 of 11\\nhttps://doi.org/10.1002/mgg3.1157\\nwileyonlinelibrary.com/journal/mgg3\\n1 | INTRODUCTION\\nAging is one of the inevitably dominant risk associated with \\nmany diseases.\\nSeveral biological factors contribute to this etiology which', 'title': '2020 - Role of Helicobacter pylori infection in the manifestation of old age-related diseases.pdf', 'version': 'v0', 'chunk_order': 0, 'document_id': 'e99c68d2-4f35-5591-8072-cfdb31966e68', 'extraction_id': 'e6916baa-9f9d-57aa-b44d-95fb614610a8', 'associatedQuery': 'what genetic factor are associated with aging'}}, {'id': '3c369292-4b9c-5156-a80f-4b3301026f30', 'score': 0.6883950233459473, 'metadata': {'text': 'al., 2009; Stanfel et al., 2009). Many of these genesmodulate the response to environmental signals, such asfood availability, and act in signaling pathways that ifunderstood can be targeted (Fig. 1). The genetic regula-tion of aging is therefore an emerging field with multipleapplications in the human nutrition, cosmetic, and phar-maceutical industries.\\nAGING GENES AS TARGETS FOR DRUG DISCOVERY 91', 'title': '2012 - Genome-Environment Interactions That Modulate.pdf', 'version': 'v0', 'chunk_order': 67, 'document_id': 'b1a1997c-e9df-5dc0-9d12-a3977d0c64ec', 'extraction_id': 'a01ca925-4ccf-5863-a162-7bd4c754fe89', 'associatedQuery': 'what genetic factor are associated with aging'}}], 'kg_search_results': None}}\n", "\n", "\n", @@ -272,7 +272,7 @@ "\n", "\n", "\n", - "domain_expoert_aging_3\n", + "../data/dataset/domain_expert_aging_3\n", "results --> {'completion': {'id': 'chatcmpl-ABLwhCwS1z9hZBn1zWSbHm5JcD7CF', 'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'content': 'Genes typically associated with early aging include those involved in segmental progeroid syndromes, such as the Werner syndrome gene [2]. Additionally, genes critical in pathways previously related to aging, such as the insulin/insulin-like signaling pathway, are also associated with early aging [2].', 'role': 'assistant'}}], 'created': 1727269331, 'model': 'gpt-4o-2024-05-13', 'object': 'chat.completion', 'system_fingerprint': 'fp_e375328146', 'usage': {'completion_tokens': 58, 'prompt_tokens': 1277, 'total_tokens': 1335}}, 'search_results': {'vector_search_results': [{'id': 'b719fbc0-94e4-5df0-abb7-0d13fc36214c', 'score': 0.7486875952854639, 'metadata': {'text': 'lar signatures of mammalian aging. Some of the genes', 'title': '2012 - Genome-Environment Interactions That Modulate.pdf', 'version': 'v0', 'chunk_order': 113, 'document_id': 'b1a1997c-e9df-5dc0-9d12-a3977d0c64ec', 'extraction_id': 'd59d7882-333d-5576-86ab-3cfa6354b946', 'associatedQuery': 'which genes are typically associated with early aging?'}}, {'id': '8fd5ab85-67ed-55e6-bbfa-09436c4fdbfb', 'score': 0.7380977429093288, 'metadata': {'text': 'www.ncbi.nlm.nih.gov/homologene) of genes strongly asso-ciated with aging in model organisms. Also included are genesin which mutations result in segmental progeroid syndromes,such as the Werners syndrome gene, as well as genes criticalin pathways previously related to aging, such as the insulin/insulin-like signalling pathway (de Magalhes \\net \\n \\nal \\n., 2005a). The', 'title': '2009 - The Human Ageing Genomic Resources online.pdf', 'version': 'v0', 'chunk_order': 18, 'document_id': 'e43cd3b6-ad8e-5422-ba7c-ceb6e66cc529', 'extraction_id': '52c67b46-63f2-54ae-a78e-e9d54a55f6e4', 'associatedQuery': 'which genes are typically associated with early aging?'}}, {'id': '413f8f54-b5cc-5089-9f5c-d9e3b8bcf594', 'score': 0.7369449452227419, 'metadata': {'text': 'overexpressed with age seem to be a response to aging,in that they have been previously found to have protec-tive functions (de Magalha es et al., 2009b). As such,these genes may help organisms manage aging andcould be targets for manipulation. Likewise, gene ex-pression analysis of CR has been conducted to identifyassociated genes (Lee et al., 1999, 2000). A number ofmolecular signatures have emerged from such studiesthat could be useful to identify candidate processes andpathways that affect aging,', 'title': '2012 - Genome-Environment Interactions That Modulate.pdf', 'version': 'v0', 'chunk_order': 114, 'document_id': 'b1a1997c-e9df-5dc0-9d12-a3977d0c64ec', 'extraction_id': 'd59d7882-333d-5576-86ab-3cfa6354b946', 'associatedQuery': 'which genes are typically associated with early aging?'}}, {'id': '896169ed-4b9b-5ebc-9c9d-1cd2e6f3437c', 'score': 0.7291975344184, 'metadata': {'text': 'expression profile of aging in human muscle. Physiol Genomics\\n2003;14:149-59.\\n142.\\nRodwell GE, Sonu R, Zahn JM. A transcriptional profile of aging inthe human kidney. PLoS Biol 2004;e427:2.\\n143. Hasty P, Campisi J, Hoeijmakers J, van Steeg H, Vijg J. Aging and\\ngenome maintenance: lessons from the mouse? Science 2003;299:1355-9.\\n144. Kyng KJ, May A, Klvraa S, Bohr VA. Gene expression profiling in\\nWerner syndrome closely resembles that of normal aging. Proc Natl\\nAcad Sci U S A 2003;100:12259-64.', 'title': '2011 - Clinical aspects and molecular diagnostics of skin aging.pdf', 'version': 'v0', 'chunk_order': 149, 'document_id': 'e32f8f2c-d3ad-5dae-a393-9bd87c370ebe', 'extraction_id': '674e1da7-73d5-5101-b5a5-4981e483123c', 'associatedQuery': 'which genes are typically associated with early aging?'}}, {'id': '6b4fb407-fd3f-52a3-9cfd-07dc5c891dd5', 'score': 0.7250815197776855, 'metadata': {'text': 'neurodegenerative diseases. Nature. 2006;443:787 95.\\n50. de Magalhes JP, Curado J, Church GM. Meta-analysis of age-related gene\\nexpression profiles identifies common signatures of aging. Bioinformatics.\\n2009;25:875 81.\\n51. Zahn JM, Poosala S, Owen AB, Ingram DK, Lustig A, Carter A, et al. AGEMAP:\\na gene expression database for aging in mice. PLoS Genet. 2007;3:e201.\\n52. Liu LF, Shen WJ, Ueno M, Patel S, Kraemer FB. Characterization of age-\\nrelated gene expression profiling in bone marrow and epididymal', 'title': '2015 - Transcriptomic profiles of aging in purified.pdf', 'version': 'v0', 'chunk_order': 172, 'document_id': '50f357a3-e0f2-5e32-a6b2-771fb4b1e1c6', 'extraction_id': 'e5fd1ff0-8df5-577f-9f2d-31b0941d5ce5', 'associatedQuery': 'which genes are typically associated with early aging?'}}, {'id': '17ce11f7-55df-59bd-a801-a6f38ae9a9ef', 'score': 0.7242769763304618, 'metadata': {'text': 'Ly DH, Lockhart DJ, Lerner RA, Schultz PG (2000) Mitotic misregulation and\\nhuman aging. Science 287: 24862492.\\nMcCarroll SA, Murphy CT, Zou S, Pletcher SD, Chin CS, et al. (2004)\\nComparing genomic expression patterns across species identies shared\\ntranscriptional prole in aging. Nat Genet 36: 197204.\\nMurphy CT, McCarroll SA, Bargmann CI, Fraser A, Kamath RS, et al. (2003)\\nGenes that act downstream of DAF-16 to inuence the lifespan of\\nCaenorhabditis elegans Nature 424: 277283.', 'title': '2004 - A Transcriptional Profile of Aging.pdf', 'version': 'v0', 'chunk_order': 155, 'document_id': '4ab656a7-9656-526b-94e1-422875409b44', 'extraction_id': '8b47c304-ee91-5c52-8324-79fd0bd32b27', 'associatedQuery': 'which genes are typically associated with early aging?'}}, {'id': '61baeaa5-d65a-54b5-bfee-9bab8bbf1985', 'score': 0.7208183740593941, 'metadata': {'text': 'genes driving cellular senescence, and perform various integrative analyses. Genes inducing cellular senescence\\ntend to be overexpressed with age in human tissues and are significantly overrepresented in anti-longevity and\\ntumor-suppressor genes, while genes inhibiting cellular senescence overlap with pro-longevity and oncogenes.\\nFurthermore, cellular senescence genes are strongly conserved in mammals but not in invertebrates. We also build', 'title': '2020 - A multidimensional systems biology.pdf', 'version': 'v0', 'chunk_order': 2, 'document_id': 'd040bfe3-e409-5b5c-b8f8-f3dd4fc060e3', 'extraction_id': '9d1656aa-32d2-5094-8232-4817655b1cbd', 'associatedQuery': 'which genes are typically associated with early aging?'}}, {'id': '3414ff44-7d60-5492-9956-353ab9a94a43', 'score': 0.719908313756687, 'metadata': {'text': 'exhibits important alterations in global gene expressionproles with age. In mice, aging is accompanied by changesin expression of genes associated with increased inamma-tion, cellular stress, brosis, altered capacity for apoptosis,xenobiotic metabolism, normal cell-cycle control, and DNAreplication [ 5]. Lifelong calorie restriction reversed the', 'title': '2011 - Metabolism, Genomics, and DNA Repair in the Mouse Aging Liver.pdf', 'version': 'v0', 'chunk_order': 9, 'document_id': 'a94fd15d-373e-51c5-ad74-a17e4260d32a', 'extraction_id': 'a6a6b5ba-3a72-55c5-91bb-abe747624348', 'associatedQuery': 'which genes are typically associated with early aging?'}}, {'id': 'b2d47567-09dc-5c77-be72-9448aa954e6b', 'score': 0.7168636322021535, 'metadata': {'text': 'stance, genes associated with energy production, which decrease\\ntheir expression during aging across various tissues and species\\n(Zahn et al. 2006, 2007; de Magalha es et al. 2009), start decreasing\\nat this transition point in our data (group 5; Fig. 2A). Hence, 25 yr\\nof age in humans may mark the beginning of systemic change\\nassociated with certain senescence processes.\\nConservation of expression changes with age\\nWe observe that both developmental and aging expression pro-', 'title': '2010 - MicroRNA, mRNA, and protein expression link.pdf', 'version': 'v0', 'chunk_order': 85, 'document_id': 'c3ae47b0-42dd-5ab0-8fec-a41831d1bbfa', 'extraction_id': 'fc9974c9-2e48-5a08-9112-0109df9ce096', 'associatedQuery': 'which genes are typically associated with early aging?'}}, {'id': '1c3f7772-e1fa-5063-bda7-04b2f7e7b0e3', 'score': 0.715810554277269, 'metadata': {'text': 'p <10\\n-6; Table 1 shows the top 25 genes. Many of these\\ngenes have been associated with age-related diseases.Several other genes that have been shown to play a role\\nin aging such as lysosomal-associated membrane\\nprotein-2 Lamp2 [19] (p = 5.68\\n-30), Fas [20] (p = 2.70-31)\\nand growth hormone receptor Ghr [21] (p = 1.34-19) also\\nshowed a significant co-expression. Anxa2, Anxa3 and\\nAnxa4 also show a low p-value (p < 10-25) as well as\\nseveral S100 calcium binding proteins which have been', 'title': '2012 - GeneFriends An online co-expression analysis.pdf', 'version': 'v0', 'chunk_order': 27, 'document_id': 'be20af52-c782-5098-893a-9a92000bf5a0', 'extraction_id': '1839dfa6-7080-5de4-96cb-3493ca2056d3', 'associatedQuery': 'which genes are typically associated with early aging?'}}], 'kg_search_results': None}}\n", "\n", "\n", @@ -336,7 +336,7 @@ "\n", "\n", "\n", - "domain_expoert_aging_4\n", + "../data/dataset/domain_expert_aging_4\n", "results --> {'completion': {'id': 'chatcmpl-ABLwlxjoJ15UXMdKPBfDnYfvZNLDD', 'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'content': 'To generate a linkage or association mapping study in mice to understand aging, you can follow these steps:\\n\\n1. **Select Appropriate Mouse Strains**: Choose inbred mouse strains that are known to have variations in lifespan and aging-related traits. Inbred strains are powerful for identifying genes underlying complex traits such as longevity due to their genetic uniformity [9].\\n\\n2. **Identify Aging-Related Traits**: Determine the specific aging-related traits you want to study. This could include longevity, resistance to age-associated diseases, or other biomarkers of aging [4].\\n\\n3. **Cross Mouse Strains**: Perform crosses between different inbred strains to generate F1 and F2 generations. This helps in creating genetic diversity necessary for mapping studies [5].\\n\\n4. **Phenotyping**: Assay the F2 generation (or other relevant generations) for the aging-related traits of interest. This could involve measuring lifespan, resistance to diseases, or other biomarkers [4].\\n\\n5. **Genotyping**: Genotype the mice using molecular markers such as SNPs (Single Nucleotide Polymorphisms) to identify genetic variations across the genome [6].\\n\\n6. **Quantitative Trait Locus (QTL) Mapping**: Use QTL mapping techniques to identify chromosomal regions associated with the aging-related traits. This involves statistical analysis to correlate genetic markers with phenotypic traits [6].\\n\\n7. **Association Studies**: Conduct association studies to further refine the regions identified by QTL mapping. This involves looking for specific polymorphisms within the identified regions that are significantly associated with the traits [1].\\n\\n8. **Replication and Validation**: Validate the findings by replicating the study in different mouse populations or using additional genetic crosses. This helps to confirm the association between the identified genetic regions and aging traits [1].\\n\\nBy following these steps, you can generate a linkage or association mapping study in mice to understand the genetic factors influencing aging.', 'role': 'assistant'}}], 'created': 1727269335, 'model': 'gpt-4o-2024-05-13', 'object': 'chat.completion', 'system_fingerprint': 'fp_3537616b13', 'usage': {'completion_tokens': 387, 'prompt_tokens': 1231, 'total_tokens': 1618}}, 'search_results': {'vector_search_results': [{'id': 'e0cce1c5-8709-5218-99b6-48a6ba242931', 'score': 0.7081564664840698, 'metadata': {'text': 'effect fundamental mechanisms of aging (14, 16). The drawbacksof such studies include the improbability of picking the right geneto study the myriad of known and unknown genes affecting theprocess of interest (17). The linkage study described heremarkedly improves the efficiency of such association studies bydefining a region likely to contain polymorphism(s) with signif-icant influence on life span.\\nAdditional association studies with these families and repli-', 'title': '2001 - A genome-wide scan for linkage to human.pdf', 'version': 'v0', 'chunk_order': 40, 'document_id': '1431984a-82d9-51d4-a23c-5f76a02ab554', 'extraction_id': '17246c43-2e44-579b-867d-3dc7150ceedd', 'associatedQuery': 'How do I generate a linkage or association mapping study in mice to understand aging?'}}, {'id': '9f9fef49-0bda-5948-93bd-0f8f43bbefdf', 'score': 0.6985010712892139, 'metadata': {'text': 'Map contains 1119 and 1459 curated human and mouse aginggenes, respectively, covering almost all scales of aging, rangingfrom molecular damage to genetic predisposition. Cross-speciescomparison revealed a modest overlap between known humanand mouse aging genes, suggesting both conservation of core sen-\\nescence pathways and fundamental differences in aging between\\nmice and humans (Fig. 2E).\\nAging-associated genes can alternatively be identified in a', 'title': '2023 - A transcriptome-based single-cell biological age model.pdf', 'version': 'v0', 'chunk_order': 32, 'document_id': '9be234b7-f37d-5cd5-8895-bfe676441b2f', 'extraction_id': '0fd46f00-d3e1-54f4-9395-6c3e8294ed51', 'associatedQuery': 'How do I generate a linkage or association mapping study in mice to understand aging?'}}, {'id': '09da6f9e-b996-5438-91be-41d9438cb930', 'score': 0.6970219196664155, 'metadata': {'text': '11. Gelman R, Watson A, Bronson R et al (1988) Murine chromo-\\nsomal regions correlated with longevity. Genetics\\n118(4):693704\\n12. Jackson AU, Galecki AT, Burke DT et al (2002) Mouse loci\\nassociated with life span exhibit sex-specic and epistatic effects.\\nJ Gerontol A Biol Sci Med Sci 57(1):B9B15\\n13. Foreman JE, Lionikas A, Lang DH et al (2009) Genetic archi-\\ntecture for hole-board behaviors across substantial time intervalsin young, middle-aged and old mice. Genes Brain Behav', 'title': '2015 - A Chromosome 13 locus is associated with male-specific mortality in mice.pdf', 'version': 'v0', 'chunk_order': 67, 'document_id': 'ad8f2626-87fb-520e-8cef-ee9a9cc3ab0b', 'extraction_id': '5cc56e3b-53ab-5299-814d-014e2ed31d2f', 'associatedQuery': 'How do I generate a linkage or association mapping study in mice to understand aging?'}}, {'id': 'ab0845d4-b4db-53db-927e-b96a52cf7667', 'score': 0.694593608379364, 'metadata': {'text': 'Along with longevity, a select group of potential aging-related biomarkers will be assayed for each of these mouse models. In addition, it should be possible to assay several of these mouse lines for resistance to specific age-associated diseases, such as diabetes and neurological disorders, by \\ncrossing them into the appropriate transgenic disease back-\\nground. \\nCONCLUSION \\n Our understanding of the basic mechanisms of aging \\nhave benefited greatly from the use of simple model systems', 'title': '2007 - Longevity Genomics Across Species.pdf', 'version': 'v0', 'chunk_order': 50, 'document_id': '1ab0b63f-d97c-5f5c-98ee-0bde785fa630', 'extraction_id': '522e2616-daa1-5bf3-8673-a717dfb9b13f', 'associatedQuery': 'How do I generate a linkage or association mapping study in mice to understand aging?'}}, {'id': 'c2299f0f-9e0b-5279-90e5-37c6bd664976', 'score': 0.6905311346054077, 'metadata': {'text': '198\\nthe study of age-related diseases for various reasons: (a) mice are closely related to \\nhumans, with nearly 99% of human orthologous in mice; (b) their relatively short \\nlifespan and small size allow surveillance of the aging process within a pertinent \\ntime frame and make their housing less expensive; (c) the feasibility of performing \\ngenetic manipulations facilitates the engineering of transgenic strains (gain- and \\nloss-of function mice) that model premature aging disorders. In this section, we', 'title': '2020 - Clinical Genetics and Genomics of Aging.pdf', 'version': 'v0', 'chunk_order': 1366, 'document_id': '62b635c3-040e-512a-b016-6ef295308a1e', 'extraction_id': '5c3840bd-45a5-5928-84ab-a1f2d8536691', 'associatedQuery': 'How do I generate a linkage or association mapping study in mice to understand aging?'}}, {'id': '3004d1fd-c5ce-5587-bfab-471e7141952c', 'score': 0.6893202477288406, 'metadata': {'text': 'Hsu HC, Lu L, Yi N, Van Zant G, Williams RW, Mountz JD. Quantitative trait locus (QTL) mapping in \\naging systems. Methods in Molecular Biology (Clifton, NJ ). 2007; 371:321348.\\nHunter KW, Crawford NPS. The future of mouse QTL mapping to diagnose disease in mice in the age \\nof whole-genome association studies. Annual Review of Genetics. 2008; 42:131141.\\nIto R, Robbins TW, Everitt BJ. Differential control over cocaine-seeking behavior by nucleus', 'title': '2017 - Systems genetic analysis in GeneNetwork.org.pdf', 'version': 'v0', 'chunk_order': 114, 'document_id': '41be0f9f-a5af-5586-b6cd-16e56fd89cdc', 'extraction_id': '59121146-02b9-5479-96e2-9fb45cffc81b', 'associatedQuery': 'How do I generate a linkage or association mapping study in mice to understand aging?'}}, {'id': '9082d164-59f8-58a0-ace7-8b3aa9d884e2', 'score': 0.6867029666900635, 'metadata': {'text': 'multiscalar integration of traits. Cell150, 12871299 (2012). [PubMed: 22939713] \\n33. De Haan G & Van Zant G Genetic analysis of hemopoietic cell cycling in mice suggests its \\ninvolvement in organismal life span. FASEB J. Off. Publ. Fed. Am. Soc. Exp. Biol. 13, 707713 \\n(1999).\\n34. Gelman R, Watson A, Bronson R & Yunis E Murine chromosomal regions correlated with \\nlongevity. Genetics 118, 693704 (1988). [PubMed: 3163317] \\n35. Houtkooper RHet al.The metabolic footprint of aging in mice. Sci. Rep1, (2011).', 'title': '2021 - Gene-by-environment modulation of lifespan and weight gain in the murine BXD family.pdf', 'version': 'v0', 'chunk_order': 142, 'document_id': '4d082da4-fa48-5170-8147-c4fea47a5d4b', 'extraction_id': '396683f9-b2e3-5942-bec8-f96fa798c341', 'associatedQuery': 'How do I generate a linkage or association mapping study in mice to understand aging?'}}, {'id': '7abf14d2-cdfe-5c37-8217-6b63bd8fb255', 'score': 0.6810372471809387, 'metadata': {'text': 'mice to identify genetic factors involved in the regulation of\\ncognitive aging that may have gone undetected in either complex\\nhuman studies or murine studies utilizing only a single genetic\\nbackground. Aging is a leading risk factor for age-associated de-\\nmentias such as AD, and our work and others suggest that geneticfactors and mechanisms underlying biological processes during\\nmidlife play a key role in determining an individual s susceptibility', 'title': '2016 - Systems genetics identifies Hp1bp3 as a novel modulator of cognitive aging.pdf', 'version': 'v0', 'chunk_order': 70, 'document_id': '8cde78ac-cb0e-5983-86ee-91074b2fe1e3', 'extraction_id': '382122b9-6922-5d85-9e8c-acfa86aff085', 'associatedQuery': 'How do I generate a linkage or association mapping study in mice to understand aging?'}}, {'id': '380ca35e-b42b-59b4-aef7-aaf2ba3bb59d', 'score': 0.679397661721847, 'metadata': {'text': 'span and have yielded insights into potential biological\\npathways and processes related to aging. Despite these\\nsuccesses, several problems are inherent in human\\nlongevity studies including potentially high degrees ofenvironmental heterogeneity, genetic diversity, and lack of\\nbirth matched controls, among others [ 8].\\nInbred mouse strains represent a powerful alternative for\\nidentifying genes underlying complex trait genes such as\\nlongevity [ 9]. Initial mapping approaches include quanti-', 'title': '2015 - A Chromosome 13 locus is associated with male-specific mortality in mice.pdf', 'version': 'v0', 'chunk_order': 8, 'document_id': 'ad8f2626-87fb-520e-8cef-ee9a9cc3ab0b', 'extraction_id': 'df0b4be9-3393-5642-a722-ccafffb60df8', 'associatedQuery': 'How do I generate a linkage or association mapping study in mice to understand aging?'}}, {'id': 'eea576fd-d766-5ae7-9e63-045869a3f8f7', 'score': 0.6727703809738159, 'metadata': {'text': 'Recently, the Atlas of Gene Expression in Mouse Aging Project\\n(AGEMAP) reported gene expression proles with age for 8932genes in 16 mouse tissues (Zahn et al ., 2007). We chose not to', 'title': '2009 - Meta-analysis of age-related gene expression profiles identifies.pdf', 'version': 'v0', 'chunk_order': 107, 'document_id': '5c2cf97f-a57a-5284-85a3-b8d9c5943113', 'extraction_id': '4d95f551-34bd-5e7a-8702-eb59de73a480', 'associatedQuery': 'How do I generate a linkage or association mapping study in mice to understand aging?'}}], 'kg_search_results': None}}\n", "\n", "\n", @@ -400,7 +400,7 @@ "\n", "\n", "\n", - "domain_expoert_aging_5\n", + "../data/dataset/domain_expert_aging_5\n", "results --> {'completion': {'id': 'chatcmpl-ABLwzkPUEqxCEqW5L5wugbbowvYPv', 'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'content': \"Yes, there are specific genetic variations that can contribute to someone living longer. Research has shown that certain genes and their variations can influence longevity. For example, variations near the genes APOE, FOXO3A, and CHRNA3/5 have been robustly associated with lifespan [10]. These genetic variations can affect how our bodies age and how well we can avoid or delay age-related diseases.\\n\\nIn simpler terms, think of these genes as parts of a car. Just like how certain parts can make a car run more efficiently and last longer, these genetic variations can help our bodies function better and live longer. However, it's important to note that living a long life is usually a combination of both genetic factors and lifestyle choices, such as diet, exercise, and avoiding harmful habits.\", 'role': 'assistant'}}], 'created': 1727269349, 'model': 'gpt-4o-2024-05-13', 'object': 'chat.completion', 'system_fingerprint': 'fp_e375328146', 'usage': {'completion_tokens': 157, 'prompt_tokens': 1228, 'total_tokens': 1385}}, 'search_results': {'vector_search_results': [{'id': 'c2234f77-2268-57d0-a227-e931fc4802c1', 'score': 0.6878040619013285, 'metadata': {'text': 'GENOME-WIDE ASSOCIATION STUDY OF LONGEVITY 479\\nINCREASES in longevity of the general population world -\\nwide are an unprecedented phenomenon with significant \\nhealth and social impact. Although environmental factors \\nhave led to an increase in life span, there is ample evidence \\nthat genetic factors are involved in extreme longevity both \\nin humans (17) and in other organisms (8). The protective \\ngenetic factors that lead to longevity are likely to involve', 'title': '2010 - A Meta-analysis of Four Genome-Wide Association Studies.pdf', 'version': 'v0', 'chunk_order': 12, 'document_id': '8e452186-a71c-5b62-81b2-7681c87c8e1d', 'extraction_id': '8bc54e5b-f45f-54f9-9591-1e26dd80b50d', 'associatedQuery': 'is there a specific genetic variation that can cause someone to live longer? please make your answer accessible to a non-expert'}}, {'id': 'fb0af8f1-5b2a-5ba1-8a53-ee543a9267bf', 'score': 0.6867071390151978, 'metadata': {'text': 'that any genetic variant that contributes strongly to extremelongevity would also be rare. One possibility is that a specificmutation could alter the protein-coding region in a gene andconfer a significant increase in longevity. Such a mutation couldact in a dominant or recessive fashion, and might be shared by asignificant fraction of the supercentenarian genomes but not bycontrol genomes. We created a computational pipeline todetermine whether our supercentenarian genomes are enrichedfor such a variant', 'title': '2014 - Whole-Genome Sequencing of the World?s Oldest People.pdf', 'version': 'v0', 'chunk_order': 56, 'document_id': 'd2a5ec28-873a-5ff3-9cf4-dbec3b52dd21', 'extraction_id': 'c918522d-c0bf-5b7a-9ced-a69d485b2cb6', 'associatedQuery': 'is there a specific genetic variation that can cause someone to live longer? please make your answer accessible to a non-expert'}}, {'id': '754929a6-af78-569a-969c-e750d174b952', 'score': 0.6830184459686279, 'metadata': {'text': 'ever, natural human and animal longevity is presumed to be acomplex trait (Finch & Tanzi, 1997). In humans, both candidategene and genome-wide genetic association approaches havebeen applied in an attempt to identify longevity loci. The fre-quency of genetic variants has been typically compared\\nbetween nonagenarian cases and young controls, revealing', 'title': '2011 - Genome-wide association study identifies a single major locus contributing to survival into old age the APOE locus revisited.pdf', 'version': 'v0', 'chunk_order': 13, 'document_id': '05208abc-5ac0-5d4d-b600-2caf59ce75b7', 'extraction_id': 'a4aa5d3a-81e8-582c-aee6-3ebdd329de86', 'associatedQuery': 'is there a specific genetic variation that can cause someone to live longer? please make your answer accessible to a non-expert'}}, {'id': '4a6d2b9b-9496-5d90-a24a-43c643c4916b', 'score': 0.6809488534927368, 'metadata': {'text': 'genetic makeup of extreme longevity is based on a combination of common and rare variants, with common vari-ants that create the background to survive to relatively common old ages, and specific combinations of uncommon and rare variants that add an additional survival advantage to even older ages. Our analy-sis showed that LAVs discovered through a casecontrol study are not necessarily the variants that make someone live to extreme old age, and additional survival analysis is needed to characterize and', 'title': '2017 - Four Genome-Wide Association Studies Identify New.pdf', 'version': 'v0', 'chunk_order': 122, 'document_id': 'c10653f6-b3d7-5b92-9271-ab8fcc7905a7', 'extraction_id': 'b539194c-50bb-55e5-83b2-e779f63ed363', 'associatedQuery': 'is there a specific genetic variation that can cause someone to live longer? please make your answer accessible to a non-expert'}}, {'id': '1f4437a7-cee1-5dc2-80e1-9924248857d0', 'score': 0.6716829538345337, 'metadata': {'text': 'genetic determination of human exceptional longevity, they arethe rst step toward the generation of a comprehensive referencepanel of exceptionally long-lived individuals. The data also provideinteresting insights into genetic backgrounds that are conduciveto exceptional longevity and allow us to test different models of\\nexceptional longevity.\\nwww.frontiersin.org January 2012 | Volume 2 | Article 90 | 1', 'title': '2012 - Whole genome sequences of a male and female supercentenarian, ages greater than 114 years.pdf', 'version': 'v0', 'chunk_order': 12, 'document_id': '408cdcd5-ab70-520a-b2c4-d9028b0a8d6f', 'extraction_id': '402ab5b5-e6fa-58fe-8f32-7c235be7a746', 'associatedQuery': 'is there a specific genetic variation that can cause someone to live longer? please make your answer accessible to a non-expert'}}, {'id': '91010ff1-43a7-53f6-966d-601913e3b26b', 'score': 0.6682877142257873, 'metadata': {'text': 'tremely long lived individuals. Longevity has a genetic component, with an estimated heritability\\nof average life expectancy of approximately 25% (105, 106). Family studies of centenarians, thosewho live to 100 years or more, suggest that the relationship between genetics and longevity is\\nstronger in the oldest-old adults (107, 108), supporting the utility of long-lived individuals as a\\nmodel system for studying genetic variations that predispose people to longevity.', 'title': '2013 - Genome Instability and Aging.pdf', 'version': 'v0', 'chunk_order': 140, 'document_id': '71e08916-8cc8-5d96-8c06-4461b972b54d', 'extraction_id': 'f33756b1-7d64-5ab9-bcd6-717deaf05339', 'associatedQuery': 'is there a specific genetic variation that can cause someone to live longer? please make your answer accessible to a non-expert'}}, {'id': '63ebd662-9aca-5b8a-b3e3-89860a45da42', 'score': 0.6676895220464765, 'metadata': {'text': 'because of genetic variation that becomes particularly important for sur-\\nvival at advanced age (Hjelmborg et al. , 2006). Epidemiological studies\\nhave revealed that long-lived individuals (LLI), that is, people surviving to\\nthe 95th percentile of the respective birth cohort-specic age distribu-\\ntions (Gudmundsson et al. , 2000), frequently show a favorable (healthy)\\ncourse of the aging process, with the absence or a delayed onset of age-', 'title': '2012 - Genome-wide miRNA signatures of human longevity.pdf', 'version': 'v0', 'chunk_order': 6, 'document_id': '18407659-c241-5f37-8ad2-ab59f6a7e288', 'extraction_id': 'e79b0811-a0f3-5f44-8004-89fe59aa8a3e', 'associatedQuery': 'is there a specific genetic variation that can cause someone to live longer? please make your answer accessible to a non-expert'}}, {'id': '53a8e33f-da6f-5550-bf18-e45f2779f7a9', 'score': 0.6673998633146496, 'metadata': {'text': 'Studies of centenarians have provided strong evidence to sup-port the hypothesis that a genetic contribution to human excep-tional longevity is decisive, although only a small number ofgenetic variants with modest effects have been irrefutably linkedto this phenotype ( Schachter et al., 1994; Barzilai et al., 2003 ;\\nChristensen et al., 2006 ;Wheeler and Kim, 2011 ). The tech-\\nnology of next generation sequencing provides a tool to gen-erate data that may eventually provide an answer ( Metzker,\\n2009).', 'title': '2012 - Whole genome sequences of a male and female supercentenarian, ages greater than 114 years.pdf', 'version': 'v0', 'chunk_order': 10, 'document_id': '408cdcd5-ab70-520a-b2c4-d9028b0a8d6f', 'extraction_id': '402ab5b5-e6fa-58fe-8f32-7c235be7a746', 'associatedQuery': 'is there a specific genetic variation that can cause someone to live longer? please make your answer accessible to a non-expert'}}, {'id': '57227bee-d562-52c9-86dc-f9e2fcea1792', 'score': 0.6669017871080776, 'metadata': {'text': 'genetic contribution to human lifespan variation was estimated\\nat 2530% in twin studies (Gudmundsson et al. , 2000; Skytthe\\net al. , 2003; Hjelmborg et al. , 2006). The most prominent\\ngenetic inuence is observed in families in which the capacity toattain a long lifespan clusters (Perls et al. , 2000; Schoenmaker\\net al. , 2006). Exceptional longevity can be reached with a low\\ndegree of age-related disability (Christensen et al. , 2008; Terry\\net al. , 2008), raising the question whether protective mecha-', 'title': '2011 - Genome-wide association study identifies a single major locus contributing to survival into old age the APOE locus revisited.pdf', 'version': 'v0', 'chunk_order': 11, 'document_id': '05208abc-5ac0-5d4d-b600-2caf59ce75b7', 'extraction_id': 'a4aa5d3a-81e8-582c-aee6-3ebdd329de86', 'associatedQuery': 'is there a specific genetic variation that can cause someone to live longer? please make your answer accessible to a non-expert'}}, {'id': 'b1b9f731-236c-5b4b-8cc6-fcf1e06d866a', 'score': 0.6654460430145264, 'metadata': {'text': 'age, usually de ned by a threshold, such as 90 years). Up to 25%\\nof the variability in human lifespan has been estimated to be\\ngenetic1, but genetic variation at only three loci (near APOE ,\\nFOXO3A and CHRNA3/5 )25have so far been demonstrated to\\nbe robustly associated with lifespan.\\nProspective genomic studies of lifespan have been hampered\\nby the fact that subject participation is often only recent,\\nallowing insuf cient follow-up time for a well-powered analysis of', 'title': '2017 - Genome-wide meta-analysis associates HLA.pdf', 'version': 'v0', 'chunk_order': 5, 'document_id': '3a565ba9-ee5b-5596-b870-ce8c055cb1f1', 'extraction_id': '9c6a9e93-5dc5-571d-b3c2-b600ed95e102', 'associatedQuery': 'is there a specific genetic variation that can cause someone to live longer? please make your answer accessible to a non-expert'}}], 'kg_search_results': None}}\n", "\n", "\n", @@ -464,7 +464,7 @@ "\n", "\n", "\n", - "domain_expoert_aging_6\n" + "../data/dataset/domain_expert_aging_6\n" ] } ], @@ -497,7 +497,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 45, "metadata": {}, "outputs": [ { diff --git a/gnqa/paper2_eval/src/parse_r2r_result.py b/gnqa/paper2_eval/src/parse_r2r_result.py index b30f2e7..a958629 100644 --- a/gnqa/paper2_eval/src/parse_r2r_result.py +++ b/gnqa/paper2_eval/src/parse_r2r_result.py @@ -1,33 +1,45 @@ import json import sys +verbose = 1 + read_file = '/data/code/gn-ai/gnqa/paper2_eval/data/rag_out_1.json' -def iterate_json(obj, thedict): +values_key = { + "text" : {"name": "contexts", "append": 1}, + "associatedQuery": {"name": "question", "append": 0}, + "id": {"name": "id", "append": 1}, + "title": {"name": "titles", "append": 1}, + "document_id": {"name": "document_id", "append": 1}, + "extraction_id": {"name": "extraction_id", "append": 1}, + "content": {"name": "answer", "append": 0} +} + +def get_ragas_out_dict(): + return { "titles": [], + "extraction_id": [], + "document_id": [], + "id": [], + "contexts": [], + "answer": "", + "question": ""} + +def extract_response(obj, values_key, thedict): if isinstance(obj, dict): for key, val in obj.items(): - if (key == "text"): - thedict["contexts"].append(val.replace("\n", " ").strip()) - print("Key -> {0}\tValue -> {1}".format(key,val)) - elif (key == "metadata"): - thedict["answer"] = val#.replace("\n", " ").strip() - print("Key -> {0}\tValue -> {1}".format(key,val)) - elif (key == "id"): - print("Key -> {0}\tValue -> {1}".format(key,val)) - elif (key == "associatedQuery"): - thedict["question"] = val.replace("\n", " ").strip() - print("Key -> {0}\tValue -> {1}".format(key,val)) - elif (key == "title"): - print("Key -> {0}\tValue -> {1}".format(key,val)) - elif (key == "document_id"): - print("Key -> {0}\tValue -> {1}".format(key,val)) + if (key in values_key.keys()): + if (values_key[key]["append"]): + thedict[values_key[key]["name"]].append(val.replace("\n", " ").strip()) + else: + thedict[values_key[key]["name"]] = val.replace("\n", " ").strip() + print(("", "Key -> {0}\tValue -> {1}".format(key,val)) [verbose]) else: if (len(obj.items()) == 1 ): print(key, " --> ", val) - iterate_json(val, thedict) + extract_response(val, values_key, thedict) elif isinstance(obj, list): for item in obj: - iterate_json(item, thedict) + extract_response(item, values_key, thedict) # this should be a json file with a list of input files and an output file with open(read_file, "r") as r_file: @@ -38,7 +50,6 @@ ragas_output = { "titles": [], "answer": "", "question": ""} -vector_search_results = result_file["vector_search_results"] -iterate_json(vector_search_results, ragas_output) +extract_response(result_file, values_key, ragas_output) print(json.dumps(ragas_output, indent=2))
\ No newline at end of file |