
{"id":4927,"date":"2025-03-12T07:33:15","date_gmt":"2025-03-11T23:33:15","guid":{"rendered":"https:\/\/infernews.com\/?page_id=4927"},"modified":"2025-03-12T08:11:38","modified_gmt":"2025-03-12T00:11:38","slug":"medical-graph-rag-%e4%bb%8b%e7%b4%b9","status":"publish","type":"page","link":"https:\/\/infernews.com\/blog\/medical-graph-rag-%e4%bb%8b%e7%b4%b9\/","title":{"rendered":"Medical-Graph-RAG \u4ecb\u7d39"},"content":{"rendered":"<div class=\"vlp-link-container vlp-layout-spotlight-clone wp-block-visual-link-preview-link\"><a href=\"https:\/\/github.com\/SuperMedIntel\/Medical-Graph-RAG\" class=\"vlp-link\" title=\"\u5c08\u70ba\u91ab\u7642\u9818\u57df\u8a2d\u8a08\u7684\u5275\u65b0\u6846\u67b6\" rel=\"nofollow\" target=\"_blank\"><\/a><div class=\"vlp-layout-zone-main\"><span class=\"vlp-block-0 vlp-link-title\">\u5c08\u70ba\u91ab\u7642\u9818\u57df\u8a2d\u8a08\u7684\u5275\u65b0\u6846\u67b6<\/span><div class=\"vlp-block-2 vlp-link-image\"><img decoding=\"async\" src=\"https:\/\/opengraph.githubassets.com\/84c826b0328e96867b153fa060463f2c8084411ea7e060912c30b778022c1ab2\/SuperMedIntel\/Medical-Graph-RAG\" style=\"max-width: 1024px; max-height: 1024px\" \/><\/div><\/div><\/div>\n\n\n<p>Medical-Graph-RAG\uff08\u6216\u7a31 MedGraphRAG\uff09\u662f\u4e00\u7a2e\u5c08\u70ba\u91ab\u7642\u9818\u57df\u8a2d\u8a08\u7684\u5275\u65b0\u6846\u67b6\uff0c\u5b83\u7d50\u5408\u4e86<strong>\u77e5\u8b58\u5716\u8b5c\uff08Knowledge Graph\uff09<\/strong>\u548c<strong>\u6aa2\u7d22\u589e\u5f37\u751f\u6210\uff08Retrieval-Augmented Generation, RAG\uff09<\/strong>\u6280\u8853\uff0c\u65e8\u5728\u63d0\u5347<strong>\u5927\u578b\u8a9e\u8a00\u6a21\u578b\uff08Large Language Models, LLMs\uff09<\/strong>\u5728\u91ab\u7642\u61c9\u7528\u4e2d\u7684\u6027\u80fd\u8207\u53ef\u9760\u6027\u3002\u8a72\u6846\u67b6\u901a\u904e\u69cb\u5efa\u4e00\u500b\u5206\u5c64\u5716\u8b5c\u7d50\u69cb\uff0c\u5c07\u91ab\u7642\u4fe1\u606f\u5f9e\u591a\u500b\u4f86\u6e90\uff08\u5982\u7528\u6236\u63d0\u4f9b\u7684\u6587\u6a94\u3001\u53ef\u9760\u7684\u91ab\u5b78\u8ad6\u6587\u548c\u57fa\u790e\u91ab\u5b78\u8a5e\u5178\uff09\u9032\u884c\u7d44\u7e54\u548c\u6574\u5408\uff0c\u63d0\u4f9b<strong>\u57fa\u65bc\u8b49\u64da<\/strong>\u3001<strong>\u900f\u660e<\/strong>\u4e14<strong>\u53ef\u89e3\u91cb<\/strong>\u7684\u56de\u7b54\uff0c\u7279\u5225\u9069\u7528\u65bc\u8655\u7406\u654f\u611f\u7684\u91ab\u7642\u6578\u64da\u548c\u8907\u96dc\u7684\u91ab\u5b78\u67e5\u8a62\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u80cc\u666f<\/h2>\n\n\n\n<p>\u5927\u578b\u8a9e\u8a00\u6a21\u578b\u5728\u81ea\u7136\u8a9e\u8a00\u8655\u7406\u65b9\u9762\u8868\u73fe\u51fa\u8272\uff0c\u4f46\u5728\u91ab\u7642\u7b49\u5c08\u696d\u9818\u57df\u4e2d\u4ecd\u9762\u81e8\u6311\u6230\uff0c\u4f8b\u5982\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u4e0a\u4e0b\u6587\u8655\u7406\u9650\u5236<\/strong>\uff1a\u96e3\u4ee5\u6709\u6548\u8655\u7406\u5927\u91cf\u91ab\u7642\u6587\u6a94\u4e2d\u7684\u5168\u5c40\u4fe1\u606f\u3002<\/li>\n\n\n\n<li><strong>\u4fe1\u606f\u6e96\u78ba\u6027\u554f\u984c<\/strong>\uff1a\u53ef\u80fd\u751f\u6210\u4e0d\u6e96\u78ba\u6216\u865b\u69cb\u7684\u5167\u5bb9\uff08\u5373\u300c\u5e7b\u89ba\u300d\uff09\u3002<\/li>\n\n\n\n<li><strong>\u9818\u57df\u7279\u5b9a\u6578\u64da\u5229\u7528\u4e0d\u8db3<\/strong>\uff1a\u7121\u6cd5\u5145\u5206\u5229\u7528\u91ab\u7642\u9818\u57df\u7684\u79c1\u6709\u6216\u5c08\u696d\u77e5\u8b58\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u70ba\u4e86\u89e3\u6c7a\u9019\u4e9b\u554f\u984c\uff0c\u50b3\u7d71\u7684 RAG \u6280\u8853\u901a\u904e\u5f9e\u5916\u90e8\u77e5\u8b58\u6e90\u6aa2\u7d22\u76f8\u95dc\u4fe1\u606f\u4f86\u589e\u5f37 LLMs \u7684\u56de\u7b54\u3002\u7136\u800c\uff0c\u6a19\u6e96 RAG \u5728\u8655\u7406\u5168\u5c40\u6027\u67e5\u8a62\u6216\u5927\u91cf\u6587\u6a94\u7684\u67e5\u8a62\u7126\u9ede\u6458\u8981\uff08Query-Focused Summarization, QFS\uff09\u6642\u6548\u679c\u6709\u9650\u3002Medical-Graph-RAG \u5728\u6b64\u57fa\u790e\u4e0a\u5f15\u5165\u4e86\u5716\u8b5c\u7d50\u69cb\uff0c\u9032\u4e00\u6b65\u63d0\u5347\u4e86\u91ab\u7642\u9818\u57df\u7684\u61c9\u7528\u6548\u679c\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Medical-Graph-RAG \u7684\u6838\u5fc3\u7279\u9ede<\/h2>\n\n\n\n<p>Medical-Graph-RAG \u901a\u904e\u4ee5\u4e0b\u5e7e\u500b\u95dc\u9375\u7279\u9ede\u89e3\u6c7a\u4e86\u4e0a\u8ff0\u6311\u6230\uff1a<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u5206\u5c64\u5716\u8b5c\u69cb\u5efa\uff08Hierarchical Graph Construction\uff09<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u4e09\u5c64\u7d50\u69cb<\/strong>\uff1a<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u7b2c\u4e00\u5c64<\/strong>\uff1a\u5f9e\u7528\u6236\u63d0\u4f9b\u7684\u91ab\u7642\u6587\u6a94\uff08\u4f8b\u5982\u96fb\u5b50\u75c5\u6b77\uff09\u4e2d\u63d0\u53d6\u5be6\u9ad4\u3002<\/li>\n\n\n\n<li><strong>\u7b2c\u4e8c\u5c64<\/strong>\uff1a\u5c07\u9019\u4e9b\u5be6\u9ad4\u8207\u5f9e\u53ef\u9760\u91ab\u5b78\u66f8\u7c4d\u548c\u8ad6\u6587\u4e2d\u63d0\u53d6\u7684\u57fa\u790e\u91ab\u5b78\u77e5\u8b58\u76f8\u9023\u3002<\/li>\n\n\n\n<li><strong>\u7b2c\u4e09\u5c64<\/strong>\uff1a\u9032\u4e00\u6b65\u9023\u63a5\u5230\u57fa\u790e\u91ab\u5b78\u8a5e\u5178\u5716\u8b5c\uff0c\u63d0\u4f9b\u8a73\u7d30\u7684\u91ab\u5b78\u8853\u8a9e\u89e3\u91cb\u548c\u8a9e\u7fa9\u95dc\u4fc2\u3002<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5143\u5716\u8b5c\uff08Meta-Graphs\uff09<\/strong>\uff1a\u901a\u904e\u8a9e\u7fa9\u76f8\u4f3c\u6027\u5c07\u63d0\u53d6\u7684\u5be6\u9ad4\u7d44\u7e54\u6210\u5143\u5716\u8b5c\uff0c\u4e26\u6700\u7d42\u5408\u4f75\u6210\u4e00\u500b\u5168\u9762\u7684\u5168\u5c40\u5716\u8b5c\uff0c\u78ba\u4fdd\u77e5\u8b58\u7684\u9023\u8cab\u6027\u548c\u5b8c\u6574\u6027\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u5148\u9032\u7684\u6587\u6a94\u5206\u584a\uff08Advanced Document Chunking\uff09<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6df7\u5408\u975c\u614b-\u8a9e\u7fa9\u65b9\u6cd5<\/strong>\uff1a\u4e0d\u540c\u65bc\u50b3\u7d71\u7684\u57fa\u65bc\u4ee4\u724c\u5927\u5c0f\u6216\u56fa\u5b9a\u5b57\u7b26\u7684\u5206\u584a\uff0cMedical-Graph-RAG \u63a1\u7528\u6df7\u5408\u65b9\u6cd5\uff1a<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u9996\u5148\u901a\u904e\u975c\u614b\u5b57\u7b26\u5206\u9694\u6bb5\u843d\u3002<\/li>\n\n\n\n<li>\u7136\u5f8c\u5c0d\u6bcf\u500b\u6bb5\u843d\u9032\u884c\u8a9e\u7fa9\u5206\u6790\uff0c\u63d0\u53d6\u7368\u7acb\u8a9e\u53e5\uff08\u547d\u984c\uff09\uff0c\u4fdd\u7559\u4e0a\u4e0b\u6587\u5b8c\u6574\u6027\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u5be6\u9ad4\u63d0\u53d6\u8207\u9023\u63a5\uff08Entity Extraction and Linking\uff09<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5be6\u9ad4\u8b58\u5225<\/strong>\uff1a\u5229\u7528 LLMs \u63d0\u793a\u5f9e\u6587\u6a94\u4e2d\u63d0\u53d6\u91ab\u7642\u5be6\u9ad4\uff08\u5982\u75be\u75c5\u3001\u6cbb\u7642\u65b9\u6cd5\uff09\u3002<\/li>\n\n\n\n<li><strong>\u8de8\u5c64\u9023\u63a5<\/strong>\uff1a\u5c07\u5be6\u9ad4\u8207\u4e0d\u540c\u5c64\u6b21\u7684\u91ab\u5b78\u77e5\u8b58\u9023\u63a5\uff0c\u5f62\u6210\u7d50\u69cb\u5316\u7684\u77e5\u8b58\u8868\u793a\uff0c\u63d0\u5347\u4fe1\u606f\u6aa2\u7d22\u7684\u6e96\u78ba\u6027\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">4. \u9ad8\u6548\u7684\u6aa2\u7d22\u65b9\u6cd5\uff08Efficient Retrieval\uff09<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>U-Retrieval<\/strong>\uff1a\u7d50\u5408\u81ea\u4e0a\u800c\u4e0b\u7684\u7cbe\u78ba\u6aa2\u7d22\u548c\u81ea\u4e0b\u800c\u4e0a\u7684\u97ff\u61c9\u512a\u5316\uff0c\u5e73\u8861\u5168\u5c40\u4e0a\u4e0b\u6587\u611f\u77e5\u8207\u7cbe\u78ba\u7d22\u5f15\uff0c\u78ba\u4fdd\u6aa2\u7d22\u7d50\u679c\u65e2\u76f8\u95dc\u53c8\u6e96\u78ba\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">5. \u57fa\u65bc\u8b49\u64da\u7684\u97ff\u61c9\uff08Evidence-Based Responses\uff09<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5f15\u6587\u652f\u6301<\/strong>\uff1a\u56de\u7b54\u9644\u5e36\u539f\u59cb\u4f86\u6e90\u7684\u5f15\u6587\uff0c\u589e\u5f37\u53ef\u4fe1\u5ea6\u548c\u900f\u660e\u5ea6\uff0c\u4fbf\u65bc\u91ab\u5b78\u5c08\u696d\u4eba\u54e1\u9a57\u8b49\u3002<\/li>\n\n\n\n<li><strong>\u8853\u8a9e\u89e3\u91cb<\/strong>\uff1a\u63d0\u4f9b\u6e05\u6670\u7684\u91ab\u5b78\u8853\u8a9e\u89e3\u91cb\uff0c\u5e6b\u52a9\u7528\u6236\u7406\u89e3\u8907\u96dc\u6982\u5ff5\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u512a\u52e2\u8207\u61c9\u7528<\/h2>\n\n\n\n<p>Medical-Graph-RAG \u901a\u904e\u6574\u5408\u5716\u8b5c\u7d50\u69cb\u548c RAG \u6280\u8853\uff0c\u5728\u91ab\u7642\u9818\u57df\u5e36\u4f86\u986f\u8457\u512a\u52e2\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6e96\u78ba\u6027\u63d0\u5347<\/strong>\uff1a\u591a\u5c64\u6b21\u77e5\u8b58\u9023\u63a5\u548c\u7cbe\u78ba\u6aa2\u7d22\u78ba\u4fdd\u56de\u7b54\u57fa\u65bc\u6700\u65b0\u3001\u53ef\u9760\u7684\u91ab\u5b78\u4fe1\u606f\u3002<\/li>\n\n\n\n<li><strong>\u900f\u660e\u5ea6\u548c\u53ef\u89e3\u91cb\u6027<\/strong>\uff1a\u6bcf\u500b\u56de\u7b54\u9644\u5e36\u4f86\u6e90\u5f15\u6587\uff0c\u65b9\u4fbf\u8ffd\u8e64\u4fe1\u606f\u51fa\u8655\uff0c\u9019\u5728\u91ab\u7642\u9818\u57df\u5c24\u70ba\u91cd\u8981\u3002<\/li>\n\n\n\n<li><strong>\u9069\u61c9\u6027\u5f37<\/strong>\uff1a\u7121\u9700\u5c0d LLMs \u9032\u884c\u5ee3\u6cdb\u5fae\u8abf\u5373\u53ef\u61c9\u7528\u65bc\u591a\u7a2e\u6a21\u578b\uff0c\u5305\u62ec\u8f03\u5c0f\u6a21\u578b\uff0c\u964d\u4f4e\u5be6\u65bd\u6210\u672c\u3002<\/li>\n\n\n\n<li><strong>\u61c9\u7528\u5834\u666f\u5ee3\u6cdb<\/strong>\uff1a\u5df2\u5728\u91ab\u7642\u554f\u7b54\u57fa\u6e96\u6e2c\u8a66\u4e2d\u5c55\u73fe\u512a\u65bc\u73fe\u6709\u6a21\u578b\u7684\u6027\u80fd\uff0c\u9069\u7528\u65bc\u8f14\u52a9\u8a3a\u65b7\u3001\u6cbb\u7642\u5efa\u8b70\u548c\u60a3\u8005\u6559\u80b2\u7b49\u5834\u666f\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u7e3d\u7d50<\/h2>\n\n\n\n<p>Medical-Graph-RAG \u662f\u4e00\u7a2e\u5275\u65b0\u7684\u91ab\u7642\u9818\u57df\u6846\u67b6\uff0c\u901a\u904e\u5716\u8b5c\u6aa2\u7d22\u589e\u5f37\u751f\u6210\u6280\u8853\u63d0\u5347\u4e86\u5927\u578b\u8a9e\u8a00\u6a21\u578b\u7684\u53ef\u9760\u6027\u548c\u6709\u6548\u6027\u3002\u5176\u5206\u5c64\u5716\u8b5c\u7d50\u69cb\u3001\u5148\u9032\u6587\u6a94\u8655\u7406\u548c\u9ad8\u6548\u6aa2\u7d22\u65b9\u6cd5\u78ba\u4fdd\u4e86\u56de\u7b54\u7684<strong>\u6e96\u78ba\u6027<\/strong>\u3001<strong>\u900f\u660e\u5ea6<\/strong>\u548c<strong>\u53ef\u89e3\u91cb\u6027<\/strong>\uff0c\u7279\u5225\u9069\u5408\u91ab\u7642\u61c9\u7528\u4e2d\u5c0d\u9ad8\u7cbe\u5ea6\u548c\u53ef\u4fe1\u5ea6\u7684\u9700\u6c42\u3002\u96a8\u8457\u6280\u8853\u7684\u767c\u5c55\uff0cMedical-Graph-RAG \u6709\u671b\u5728\u63d0\u5347\u91ab\u7642\u670d\u52d9\u8cea\u91cf\u3001\u8a3a\u65b7\u6548\u7387\u548c\u60a3\u8005\u5b89\u5168\u65b9\u9762\u767c\u63ee\u91cd\u8981\u4f5c\u7528\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u5982\u4f55\u5b89\u88dd Medical-Graph-RAG<\/h3>\n\n\n\n<p>\u4ee5\u4e0b\u662f\u5b89\u88dd\u548c\u8a2d\u7f6e Medical-Graph-RAG \u7684\u5b8c\u6574\u6b65\u9a5f\uff0c\u5e6b\u52a9\u60a8\u9806\u5229\u958b\u59cb\u4f7f\u7528\u9019\u500b\u5de5\u5177\uff1a<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. <strong>\u5b89\u88dd Python \u5957\u4ef6<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9996\u5148\uff0c\u60a8\u9700\u8981\u5b89\u88dd <code>knowledge_graph_rag<\/code> \u5957\u4ef6\u3002\u8acb\u5728\u7d42\u7aef\u6a5f\u6216\u547d\u4ee4\u884c\u4e2d\u8f38\u5165\u4ee5\u4e0b\u6307\u4ee4\uff1a<\/li>\n<\/ul>\n\n\n\n<div class=\"codecopy-container\">\n                <div class=\"codecopy-header\">\n                    \n                    <button class=\"codecopy-btn\" data-target=\"codecopy-69f8c2ad4cc64\" title=\"Copy code to clipboard\">\n                <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z\" fill=\"currentColor\"\/>\n                <\/svg>\n                <span class=\"codecopy-text\">Copy<\/span>\n            <\/button>\n                <\/div>\n                <pre class=\"line-numbers\" id=\"codecopy-69f8c2ad4cc64\"><code class=\"language-text\">  pip install knowledge_graph_rag<\/code><\/pre>\n            <\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9019\u5c07\u4e0b\u8f09\u4e26\u5b89\u88dd\u6240\u9700\u7684 Python \u5957\u4ef6\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">2. <strong>\u6e96\u5099\u8cc7\u6599<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Medical-Graph-RAG \u9700\u8981\u91ab\u7642\u76f8\u95dc\u7684\u8cc7\u6599\u624d\u80fd\u904b\u4f5c\u3002\u60a8\u53ef\u4ee5\u6e96\u5099\u91ab\u7642\u6587\u4ef6\u6216\u7814\u7a76\u8ad6\u6587\u4f5c\u70ba\u8f38\u5165\u8cc7\u6599\u3002<\/li>\n\n\n\n<li>\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4f86\u81ea <strong>PubMed<\/strong> \u7684\u7814\u7a76\u6587\u7ae0\u4f5c\u70ba\u793a\u4f8b\u8cc7\u6599\u96c6\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">3. <strong>\u5275\u5efa\u77e5\u8b58\u5716\u8b5c<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f7f\u7528 <code>KnowledgeGraph<\/code> \u985e\u5225\u4f86\u5275\u5efa\u77e5\u8b58\u5716\u8b5c\u3002\u4ee5\u4e0b\u662f\u4e00\u500b\u7c21\u55ae\u7684 Python \u7a0b\u5f0f\u78bc\u7bc4\u4f8b\uff1a<\/li>\n<\/ul>\n\n\n\n<div class=\"codecopy-container\">\n                <div class=\"codecopy-header\">\n                    \n                    <button class=\"codecopy-btn\" data-target=\"codecopy-69f8c2ad4cd0e\" title=\"Copy code to clipboard\">\n                <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z\" fill=\"currentColor\"\/>\n                <\/svg>\n                <span class=\"codecopy-text\">Copy<\/span>\n            <\/button>\n                <\/div>\n                <pre class=\"line-numbers\" id=\"codecopy-69f8c2ad4cd0e\"><code class=\"language-text\">  documents = &#91;\n      \"Cardiovascular disease ...\",\n      \"Emerging therapeutic interventions ...\",\n      \"The epidemiological burden ...\",\n      \"Cardiovascular disease also ...\",\n      \"Advanced imaging techniques ...\",\n      \"Role of novel biomarkers ...\"\n  ]\n  knowledge_graph = KnowledgeGraph(documents)\n  knowledge_graph.create()\n  knowledge_graph.plot()<\/code><\/pre>\n            <\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9019\u6bb5\u7a0b\u5f0f\u78bc\u6703\u6839\u64da\u63d0\u4f9b\u7684\u6587\u4ef6\u5217\u8868\u751f\u6210\u77e5\u8b58\u5716\u8b5c\uff0c\u4e26\u53ef\u8996\u5316\u7d50\u679c\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">4. <strong>\u69cb\u5efa\u6587\u6a94\u5716\u8b5c<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f7f\u7528 <code>DocumentsGraph<\/code> \u985e\u5225\u4f86\u69cb\u5efa\u6587\u6a94\u5716\u8b5c\uff1a<\/li>\n<\/ul>\n\n\n\n<div class=\"codecopy-container\">\n                <div class=\"codecopy-header\">\n                    \n                    <button class=\"codecopy-btn\" data-target=\"codecopy-69f8c2ad4cd12\" title=\"Copy code to clipboard\">\n                <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z\" fill=\"currentColor\"\/>\n                <\/svg>\n                <span class=\"codecopy-text\">Copy<\/span>\n            <\/button>\n                <\/div>\n                <pre class=\"line-numbers\" id=\"codecopy-69f8c2ad4cd12\"><code class=\"language-text\">  documents_graph = DocumentsGraph(documents=documents)\n  documents_graph.plot()<\/code><\/pre>\n            <\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9019\u4e00\u6b65\u5c07\u6587\u4ef6\u7d44\u7e54\u6210\u5716\u8b5c\u7d50\u69cb\uff0c\u4fbf\u65bc\u5f8c\u7e8c\u67e5\u8a62\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">5. <strong>\u57f7\u884c\u67e5\u8a62<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u60a8\u53ef\u4ee5\u4f7f\u7528\u77e5\u8b58\u5716\u8b5c\u4f86\u57f7\u884c\u67e5\u8a62\u3002\u4f8b\u5982\uff1a<\/li>\n<\/ul>\n\n\n\n<div class=\"codecopy-container\">\n                <div class=\"codecopy-header\">\n                    \n                    <button class=\"codecopy-btn\" data-target=\"codecopy-69f8c2ad4cd14\" title=\"Copy code to clipboard\">\n                <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z\" fill=\"currentColor\"\/>\n                <\/svg>\n                <span class=\"codecopy-text\">Copy<\/span>\n            <\/button>\n                <\/div>\n                <pre class=\"line-numbers\" id=\"codecopy-69f8c2ad4cd14\"><code class=\"language-text\">  knowledge_graph.search_document(user_query)<\/code><\/pre>\n            <\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9019\u5c07\u8fd4\u56de\u8207\u60a8\u7684\u67e5\u8a62\u76f8\u95dc\u7684\u5be6\u9ad4\u548c\u95dc\u4fc2\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">6. <strong>\u6574\u5408\u5230\u61c9\u7528\u7a0b\u5f0f<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u82e5\u9700\u5c07 Medical-Graph-RAG \u6574\u5408\u5230\u66f4\u5927\u7684 Python \u61c9\u7528\u7a0b\u5f0f\u4e2d\uff0c\u60a8\u9700\u8981\uff1a<\/li>\n\n\n\n<li>\u8a2d\u7f6e\u8a9e\u8a00\u6a21\u578b\u3002<\/li>\n\n\n\n<li>\u52a0\u8f09\u4e0a\u4e0b\u6587\u8cc7\u6599\u3002<\/li>\n\n\n\n<li>\u69cb\u5efa\u641c\u7d22\u529f\u80fd\u3002<\/li>\n\n\n\n<li>\u5177\u9ad4\u5be6\u73fe\u65b9\u5f0f\u53d6\u6c7a\u65bc\u60a8\u7684\u61c9\u7528\u7a0b\u5f0f\u9700\u6c42\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">7. <strong>\u4f7f\u7528 Docker<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5982\u679c\u60a8\u60f3\u5feb\u901f\u8a66\u7528\uff0cMedical-Graph-RAG \u63d0\u4f9b Docker \u6f14\u793a\u7248\u672c\u3002\u8acb\u57f7\u884c\u4ee5\u4e0b\u6307\u4ee4\uff1a<\/li>\n<\/ul>\n\n\n\n<div class=\"codecopy-container\">\n                <div class=\"codecopy-header\">\n                    \n                    <button class=\"codecopy-btn\" data-target=\"codecopy-69f8c2ad4cd16\" title=\"Copy code to clipboard\">\n                <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z\" fill=\"currentColor\"\/>\n                <\/svg>\n                <span class=\"codecopy-text\">Copy<\/span>\n            <\/button>\n                <\/div>\n                <pre class=\"line-numbers\" id=\"codecopy-69f8c2ad4cd16\"><code class=\"language-text\">  docker run -it --rm --storage-opt size=10G -p 7860:7860 -e OPENAI_API_KEY=your_key -e NCBI_API_KEY=your_key medrag-post<\/code><\/pre>\n            <\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6ce8\u610f\uff1a\u8acb\u5c07 <code>your_key<\/code> \u66ff\u63db\u70ba\u60a8\u7684 <strong>OpenAI API \u5bc6\u9470<\/strong> \u548c <strong>NCBI API \u5bc6\u9470<\/strong>\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">8. <strong>\u904b\u884c\u8173\u672c<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u60a8\u4e5f\u53ef\u4ee5\u4f7f\u7528\u63d0\u4f9b\u7684 <code>run.py<\/code> \u8173\u672c\u4f86\u904b\u884c Medical-Graph-RAG\uff1a<\/li>\n<\/ul>\n\n\n\n<div class=\"codecopy-container\">\n                <div class=\"codecopy-header\">\n                    \n                    <button class=\"codecopy-btn\" data-target=\"codecopy-69f8c2ad4cd17\" title=\"Copy code to clipboard\">\n                <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z\" fill=\"currentColor\"\/>\n                <\/svg>\n                <span class=\"codecopy-text\">Copy<\/span>\n            <\/button>\n                <\/div>\n                <pre class=\"line-numbers\" id=\"codecopy-69f8c2ad4cd17\"><code class=\"language-text\">  python run.py -simple True<\/code><\/pre>\n            <\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9019\u5c07\u4f7f\u7528\u9810\u8a2d\u7684 RAG \u6587\u6a94\uff08\u4f8b\u5982 <code>.\/dataset_ex\/report_0.txt<\/code>\uff09\u548c\u63d0\u793a\u4f86\u904b\u884c\u7a0b\u5f0f\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">9. <strong>\u81ea\u5b9a\u7fa9\u8a2d\u7f6e<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u82e5\u9700\u66f4\u9ad8\u7d1a\u7684\u914d\u7f6e\uff0c\u60a8\u53ef\u4ee5\u81ea\u5b9a\u7fa9\u904b\u884c\u53c3\u6578\uff0c\u4f8b\u5982\uff1a<\/li>\n<\/ul>\n\n\n\n<div class=\"codecopy-container\">\n                <div class=\"codecopy-header\">\n                    \n                    <button class=\"codecopy-btn\" data-target=\"codecopy-69f8c2ad4cd19\" title=\"Copy code to clipboard\">\n                <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z\" fill=\"currentColor\"\/>\n                <\/svg>\n                <span class=\"codecopy-text\">Copy<\/span>\n            <\/button>\n                <\/div>\n                <pre class=\"line-numbers\" id=\"codecopy-69f8c2ad4cd19\"><code class=\"language-text\">  python run.py -dataset mimic_ex -data_path .\/dataset\/mimic_ex -grained_chunk -ingraphmerge -construct_graph<\/code><\/pre>\n            <\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9019\u4e9b\u53c3\u6578\u5141\u8a31\u60a8\u6307\u5b9a\u8cc7\u6599\u96c6\u8def\u5f91\u3001\u555f\u7528\u5716\u8b5c\u5408\u4f75\u6216\u7d30\u5206\u8cc7\u6599\u584a\u7b49\u529f\u80fd\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">10. <strong>\u6ce8\u610f\u4e8b\u9805<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f7f\u7528 Medical-Graph-RAG \u6642\uff0c\u8acb\u78ba\u4fdd\u8f38\u5165\u8cc7\u6599\u7684\u6e96\u78ba\u6027\u548c\u53ef\u9760\u6027\u3002<\/li>\n\n\n\n<li>\u8a72\u5de5\u5177\u7684\u512a\u52e2\u5728\u65bc\u63d0\u4f9b\u57fa\u65bc\u8b49\u64da\u7684\u97ff\u61c9\uff0c\u4e26\u78ba\u4fdd\u7d50\u679c\u7684\u53ef\u4fe1\u5ea6\u548c\u900f\u660e\u5ea6\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u7e3d\u7d50<\/h3>\n\n\n\n<p>\u6309\u7167\u4ee5\u4e0a\u6b65\u9a5f\uff0c\u60a8\u53ef\u4ee5\u6210\u529f\u5b89\u88dd\u4e26\u958b\u59cb\u4f7f\u7528 Medical-Graph-RAG\u3002\u5f9e\u5b89\u88dd\u5957\u4ef6\u5230\u6e96\u5099\u8cc7\u6599\u3001\u5275\u5efa\u5716\u8b5c\u3001\u57f7\u884c\u67e5\u8a62\uff0c\u751a\u81f3\u4f7f\u7528 Docker \u6216\u81ea\u5b9a\u7fa9\u8a2d\u7f6e\uff0c\u9019\u4e9b\u6b65\u9a5f\u6db5\u84cb\u4e86\u5f9e\u5165\u9580\u5230\u9032\u968e\u7684\u6240\u6709\u9700\u6c42\u3002\u5e0c\u671b\u9019\u4e9b\u8aaa\u660e\u5c0d\u60a8\u6709\u5e6b\u52a9\uff01<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u672c\u5730<strong>\u5b89\u88dd<\/strong><\/h2>\n\n\n\n<p>\u60a8\u53ef\u4ee5\u4f7f\u7528 <strong>Ollama + DeepSeek<\/strong> \u4f86\u4ee3\u66ff OpenAI API\u3002Ollama \u662f\u4e00\u500b\u529f\u80fd\u5f37\u5927\u7684\u5de5\u5177\uff0c\u5141\u8a31\u60a8\u5728\u672c\u5730\u904b\u884c\u5927\u578b\u8a9e\u8a00\u6a21\u578b\uff08LLMs\uff09\uff0c\u800c DeepSeek \u662f\u4e00\u500b\u958b\u6e90\u7684\u8a9e\u8a00\u6a21\u578b\uff0c\u5177\u5099\u51fa\u8272\u7684\u81ea\u7136\u8a9e\u8a00\u8655\u7406\u80fd\u529b\uff0c\u975e\u5e38\u9069\u5408\u66ff\u4ee3 OpenAI \u7684\u670d\u52d9\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u5b89\u88dd\u548c\u8a2d\u7f6e\u7684\u8a73\u7d30\u6b65\u9a5f\uff1a<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u6b65\u9a5f 1\uff1a\u5b89\u88dd Ollama<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u4e0b\u8f09 Ollama<\/strong><br>\u524d\u5f80 <a href=\"https:\/\/ollama.com\/\">Ollama \u5b98\u65b9\u7db2\u7ad9<\/a>\uff0c\u6839\u64da\u60a8\u7684\u64cd\u4f5c\u7cfb\u7d71\uff08Windows\u3001macOS \u6216 Linux\uff09\u4e0b\u8f09\u5c0d\u61c9\u7684\u5b89\u88dd\u5305\u3002<\/li>\n\n\n\n<li><strong>\u5b8c\u6210\u5b89\u88dd<\/strong><br>\u4e0b\u8f09\u5f8c\uff0c\u6309\u7167\u63d0\u793a\u5b8c\u6210\u5b89\u88dd\u7a0b\u5e8f\u3002<\/li>\n\n\n\n<li><strong>\u9a57\u8b49\u5b89\u88dd<\/strong><br>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u6253\u958b\u7d42\u7aef\u6a5f\uff08\u6216\u547d\u4ee4\u884c\uff09\uff0c\u8f38\u5165\u4ee5\u4e0b\u547d\u4ee4\u78ba\u8a8d\u662f\u5426\u6210\u529f\uff1a<\/li>\n<\/ol>\n\n\n\n<div class=\"codecopy-container\">\n                <div class=\"codecopy-header\">\n                    \n                    <button class=\"codecopy-btn\" data-target=\"codecopy-69f8c2ad4cd1b\" title=\"Copy code to clipboard\">\n                <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z\" fill=\"currentColor\"\/>\n                <\/svg>\n                <span class=\"codecopy-text\">Copy<\/span>\n            <\/button>\n                <\/div>\n                <pre class=\"line-numbers\" id=\"codecopy-69f8c2ad4cd1b\"><code class=\"language-text\">   ollama --version<\/code><\/pre>\n            <\/div>\n\n\n\n<p>\u5982\u679c\u986f\u793a\u7248\u672c\u865f\uff0c\u4ee3\u8868\u5b89\u88dd\u6210\u529f\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u6b65\u9a5f 2\uff1a\u4e0b\u8f09\u4e26\u904b\u884c DeepSeek \u6a21\u578b<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u78ba\u8a8d\u6a21\u578b\u540d\u7a31<\/strong><br>Ollama \u652f\u63f4\u591a\u7a2e\u6a21\u578b\uff0c\u5305\u62ec DeepSeek\u3002\u60a8\u9700\u8981\u78ba\u8a8d Ollama \u6a21\u578b\u5eab\u4e2d\u662f\u5426\u6709 DeepSeek \u6216\u5176\u5177\u9ad4\u7248\u672c\u540d\u7a31\uff08\u53ef\u5728\u5b98\u65b9\u6587\u6a94\u6216\u6a21\u578b\u5eab\u4e2d\u67e5\u8a62\uff09\u3002<\/li>\n\n\n\n<li><strong>\u4e0b\u8f09 DeepSeek \u6a21\u578b<\/strong><br>\u5728\u7d42\u7aef\u6a5f\u4e2d\u8f38\u5165\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u4e0b\u8f09\u6a21\u578b\uff08\u5047\u8a2d\u6a21\u578b\u540d\u7a31\u70ba <code>deepseek<\/code>\uff0c\u8acb\u6839\u64da\u5be6\u969b\u540d\u7a31\u8abf\u6574\uff09\uff1a<\/li>\n<\/ol>\n\n\n\n<div class=\"codecopy-container\">\n                <div class=\"codecopy-header\">\n                    \n                    <button class=\"codecopy-btn\" data-target=\"codecopy-69f8c2ad4cd1d\" title=\"Copy code to clipboard\">\n                <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z\" fill=\"currentColor\"\/>\n                <\/svg>\n                <span class=\"codecopy-text\">Copy<\/span>\n            <\/button>\n                <\/div>\n                <pre class=\"line-numbers\" id=\"codecopy-69f8c2ad4cd1d\"><code class=\"language-text\">   ollama pull deepseek<\/code><\/pre>\n            <\/div>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>\u555f\u52d5\u6a21\u578b<\/strong><br>\u4e0b\u8f09\u5b8c\u6210\u5f8c\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u555f\u52d5 DeepSeek \u6a21\u578b\uff1a<\/li>\n<\/ol>\n\n\n\n<div class=\"codecopy-container\">\n                <div class=\"codecopy-header\">\n                    \n                    <button class=\"codecopy-btn\" data-target=\"codecopy-69f8c2ad4cd1e\" title=\"Copy code to clipboard\">\n                <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z\" fill=\"currentColor\"\/>\n                <\/svg>\n                <span class=\"codecopy-text\">Copy<\/span>\n            <\/button>\n                <\/div>\n                <pre class=\"line-numbers\" id=\"codecopy-69f8c2ad4cd1e\"><code class=\"language-text\">   ollama run deepseek<\/code><\/pre>\n            <\/div>\n\n\n\n<p>\u9019\u5c07\u5728\u672c\u5730\u904b\u884c\u6a21\u578b\uff0c\u4e26\u63d0\u4f9b\u4e00\u500b\u985e\u4f3c OpenAI \u7684 API \u7aef\u9ede\uff08\u9810\u8a2d\u70ba <code>http:\/\/localhost:11434<\/code>\uff09\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u5982\u4f55\u4ee3\u66ff OpenAI API<\/strong><\/h2>\n\n\n\n<p>Ollama \u7684 API \u8207 OpenAI API \u76f8\u4f3c\uff0c\u60a8\u53ef\u4ee5\u901a\u904e\u7c21\u55ae\u4fee\u6539\u4ee3\u78bc\uff0c\u5c07\u73fe\u6709\u4f9d\u8cf4 OpenAI \u7684\u9805\u76ee\u5207\u63db\u5230 Ollama + DeepSeek\u3002\u4ee5\u4e0b\u662f\u5177\u9ad4\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u4fee\u6539\u4ee3\u78bc\u793a\u4f8b<\/strong><br>\u5982\u679c\u60a8\u539f\u672c\u4f7f\u7528 OpenAI API\uff0c\u4f8b\u5982\uff1a<\/li>\n<\/ul>\n\n\n\n<div class=\"codecopy-container\">\n                <div class=\"codecopy-header\">\n                    \n                    <button class=\"codecopy-btn\" data-target=\"codecopy-69f8c2ad4cd20\" title=\"Copy code to clipboard\">\n                <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z\" fill=\"currentColor\"\/>\n                <\/svg>\n                <span class=\"codecopy-text\">Copy<\/span>\n            <\/button>\n                <\/div>\n                <pre class=\"line-numbers\" id=\"codecopy-69f8c2ad4cd20\"><code class=\"language-text\">  import openai\n  openai.api_key = 'your_openai_key'\n  response = openai.Completion.create(\n      model=\"gpt-3.5-turbo\",\n      prompt=\"\u67e5\u8a62\",\n      max_tokens=100\n  )<\/code><\/pre>\n            <\/div>\n\n\n\n<p>\u4fee\u6539\u5f8c\u4f7f\u7528 Ollama API\uff1a<\/p>\n\n\n\n<div class=\"codecopy-container\">\n                <div class=\"codecopy-header\">\n                    \n                    <button class=\"codecopy-btn\" data-target=\"codecopy-69f8c2ad4cd22\" title=\"Copy code to clipboard\">\n                <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z\" fill=\"currentColor\"\/>\n                <\/svg>\n                <span class=\"codecopy-text\">Copy<\/span>\n            <\/button>\n                <\/div>\n                <pre class=\"line-numbers\" id=\"codecopy-69f8c2ad4cd22\"><code class=\"language-text\">  import requests\n  url = \"http:\/\/localhost:11434\/v1\/completions\"\n  headers = {\"Content-Type\": \"application\/json\"}\n  data = {\n      \"model\": \"deepseek\",  # \u78ba\u8a8d\u6a21\u578b\u540d\u7a31\u6b63\u78ba\n      \"prompt\": \"\u67e5\u8a62\",\n      \"max_tokens\": 100\n  }\n  response = requests.post(url, headers=headers, json=data)<\/code><\/pre>\n            <\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6ce8\u610f\u4e8b\u9805<\/strong><br>Ollama API \u7684\u53c3\u6578\u53ef\u80fd\u8207 OpenAI API \u7565\u6709\u4e0d\u540c\uff0c\u8acb\u53c3\u8003 <a href=\"https:\/\/ollama.com\/docs\">Ollama \u5b98\u65b9\u6587\u6a94<\/a> \u78ba\u8a8d\u5177\u9ad4\u53c3\u6578\u683c\u5f0f\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u6b65\u9a5f 3\uff1a\u6e2c\u8a66\u8207\u78ba\u8a8d<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u78ba\u4fdd Ollama \u670d\u52d9\u6b63\u5728\u904b\u884c\uff08\u57f7\u884c <code>ollama run deepseek<\/code>\uff09\u3002<\/li>\n\n\n\n<li>\u904b\u884c\u4fee\u6539\u5f8c\u7684\u4ee3\u78bc\uff0c\u6aa2\u67e5\u662f\u5426\u80fd\u6b63\u5e38\u6536\u5230\u56de\u61c9\u3002<\/li>\n\n\n\n<li>\u5982\u679c\u51fa\u73fe\u554f\u984c\uff0c\u53ef\u67e5\u770b\u7d42\u7aef\u6a5f\u4e2d\u7684 Ollama \u65e5\u8a8c\u6216\u4ee3\u78bc\u932f\u8aa4\u8a0a\u606f\u9032\u884c\u8abf\u8a66\u3002<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u984d\u5916\u5efa\u8b70\uff08\u53ef\u9078\uff09<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u512a\u5316\u6027\u80fd<\/strong><br>\u5982\u679c\u60a8\u7684\u786c\u9ad4\u8cc7\u6e90\u6709\u9650\uff0c\u53ef\u4ee5\u9078\u64c7\u8f03\u5c0f\u7684 DeepSeek \u6a21\u578b\u7248\u672c\uff0c\u4ee5\u6e1b\u5c11\u8a18\u61b6\u9ad4\u548c\u8a08\u7b97\u9700\u6c42\u3002<\/li>\n\n\n\n<li><strong>GPU \u52a0\u901f<\/strong><br>\u5982\u679c\u60a8\u7684\u8a2d\u5099\u652f\u63f4 GPU\uff0cOllama \u63d0\u4f9b GPU \u52a0\u901f\u529f\u80fd\uff0c\u53ef\u986f\u8457\u63d0\u5347\u6a21\u578b\u904b\u884c\u6548\u7387\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u7e3d\u7d50<\/strong><\/h2>\n\n\n\n<p>\u662f\u7684\uff0c<strong>Ollama + DeepSeek<\/strong> \u53ef\u4ee5\u5f88\u597d\u5730\u66ff\u4ee3 OpenAI API\uff0c\u4e14\u5b89\u88dd\u548c\u4f7f\u7528\u90fd\u975e\u5e38\u7c21\u55ae\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5f9e\u5b98\u7db2\u4e0b\u8f09\u4e26\u5b89\u88dd Ollama\u3002<\/li>\n\n\n\n<li>\u4e0b\u8f09\u4e26\u904b\u884c DeepSeek \u6a21\u578b\u3002<\/li>\n\n\n\n<li>\u4fee\u6539\u4ee3\u78bc\uff0c\u5c07 API \u8acb\u6c42\u6307\u5411\u672c\u5730\u7aef\u9ede <code>http:\/\/localhost:11434<\/code>\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u9019\u6a23\uff0c\u60a8\u5c31\u80fd\u5728\u672c\u5730\u904b\u884c\u5f37\u5927\u7684\u8a9e\u8a00\u6a21\u578b\uff0c\u7121\u9700\u4f9d\u8cf4 OpenAI \u7684\u96f2\u7aef\u670d\u52d9\uff0c\u540c\u6642\u4eab\u53d7\u958b\u6e90\u6a21\u578b\u7684\u9748\u6d3b\u6027\u548c\u512a\u52e2\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Medical-Graph-RAG\uff08\u6216\u7a31 MedGraphRAG\uff09\u662f\u4e00\u7a2e\u5c08\u70ba\u91ab\u7642\u9818\u57df\u8a2d\u8a08\u7684\u5275\u65b0\u6846\u67b6\uff0c\u5b83\u7d50\u5408\u4e86\u77e5\u8b58\u5716\u8b5c\uff08Knowledge Graph\uff09\u548c\u6aa2\u7d22\u589e\u5f37\u751f\u6210\uff08Retrieval-Augmented Generation, RAG\uff09\u6280\u8853\uff0c\u65e8\u5728\u63d0\u5347\u5927\u578b\u8a9e\u8a00\u6a21\u578b\uff08Large Language Models, LLMs\uff09\u5728\u91ab\u7642\u61c9\u7528\u4e2d\u7684\u6027\u80fd\u8207\u53ef\u9760\u6027\u3002\u8a72\u6846\u67b6\u901a\u904e\u69cb\u5efa\u4e00\u500b\u5206\u5c64\u5716\u8b5c\u7d50\u69cb\uff0c\u5c07\u91ab\u7642\u4fe1\u606f\u5f9e\u591a\u500b\u4f86\u6e90\uff08\u5982\u7528\u6236\u63d0\u4f9b\u7684\u6587\u6a94\u3001\u53ef\u9760\u7684\u91ab\u5b78\u8ad6\u6587\u548c\u57fa\u790e\u91ab\u5b78\u8a5e\u5178\uff09\u9032\u884c\u7d44\u7e54\u548c\u6574\u5408\uff0c\u63d0\u4f9b\u57fa\u65bc\u8b49\u64da\u3001\u900f\u660e\u4e14\u53ef\u89e3\u91cb\u7684\u56de\u7b54\uff0c\u7279\u5225\u9069\u7528\u65bc\u8655\u7406\u654f\u611f\u7684\u91ab\u7642\u6578\u64da\u548c\u8907\u96dc\u7684\u91ab\u5b78\u67e5\u8a62\u3002 \u80cc\u666f \u5927\u578b\u8a9e\u8a00\u6a21\u578b\u5728\u81ea\u7136\u8a9e\u8a00\u8655\u7406\u65b9\u9762\u8868\u73fe\u51fa\u8272\uff0c\u4f46\u5728\u91ab\u7642\u7b49\u5c08\u696d\u9818\u57df\u4e2d\u4ecd\u9762\u81e8\u6311\u6230\uff0c\u4f8b\u5982\uff1a \u70ba\u4e86\u89e3\u6c7a\u9019\u4e9b\u554f\u984c\uff0c\u50b3\u7d71\u7684 RAG \u6280\u8853\u901a\u904e\u5f9e\u5916\u90e8\u77e5\u8b58\u6e90\u6aa2\u7d22\u76f8\u95dc\u4fe1\u606f\u4f86\u589e\u5f37 LLMs \u7684\u56de\u7b54\u3002\u7136\u800c\uff0c\u6a19\u6e96 RAG \u5728\u8655\u7406\u5168\u5c40\u6027\u67e5\u8a62\u6216\u5927\u91cf\u6587\u6a94\u7684\u67e5\u8a62\u7126\u9ede\u6458\u8981\uff08Query-Focused Summarization, QFS\uff09\u6642\u6548\u679c\u6709\u9650\u3002Medical-Graph-RAG \u5728\u6b64\u57fa\u790e\u4e0a\u5f15\u5165\u4e86\u5716\u8b5c\u7d50\u69cb\uff0c\u9032\u4e00\u6b65\u63d0\u5347\u4e86\u91ab\u7642\u9818\u57df\u7684\u61c9\u7528\u6548\u679c\u3002 Medical-Graph-RAG \u7684\u6838\u5fc3\u7279\u9ede Medical-Graph-RAG \u901a\u904e\u4ee5\u4e0b\u5e7e\u500b\u95dc\u9375\u7279\u9ede\u89e3\u6c7a\u4e86\u4e0a\u8ff0\u6311\u6230\uff1a 1. \u5206\u5c64\u5716\u8b5c\u69cb\u5efa\uff08Hierarchical Graph Construction\uff09 2. \u5148\u9032\u7684\u6587\u6a94\u5206\u584a\uff08Advanced Document Chunking\uff09 3. \u5be6\u9ad4\u63d0\u53d6\u8207\u9023\u63a5\uff08Entity Extraction and Linking\uff09 4. \u9ad8\u6548\u7684\u6aa2\u7d22\u65b9\u6cd5\uff08Efficient Retrieval\uff09 5. \u57fa\u65bc\u8b49\u64da\u7684\u97ff\u61c9\uff08Evidence-Based Responses\uff09 \u512a\u52e2\u8207\u61c9\u7528 Medical-Graph-RAG \u901a\u904e\u6574\u5408\u5716\u8b5c\u7d50\u69cb\u548c RAG \u6280\u8853\uff0c\u5728\u91ab\u7642\u9818\u57df\u5e36\u4f86\u986f\u8457\u512a\u52e2\uff1a \u7e3d\u7d50 Medical-Graph-RAG \u662f\u4e00\u7a2e\u5275\u65b0\u7684\u91ab\u7642\u9818\u57df\u6846\u67b6\uff0c\u901a\u904e\u5716\u8b5c\u6aa2\u7d22\u589e\u5f37\u751f\u6210\u6280\u8853\u63d0\u5347\u4e86\u5927\u578b\u8a9e\u8a00\u6a21\u578b\u7684\u53ef\u9760\u6027\u548c\u6709\u6548\u6027\u3002\u5176\u5206\u5c64\u5716\u8b5c\u7d50\u69cb\u3001\u5148\u9032\u6587\u6a94\u8655\u7406\u548c\u9ad8\u6548\u6aa2\u7d22\u65b9\u6cd5\u78ba\u4fdd\u4e86\u56de\u7b54\u7684\u6e96\u78ba\u6027\u3001\u900f\u660e\u5ea6\u548c\u53ef\u89e3\u91cb\u6027\uff0c\u7279\u5225\u9069\u5408\u91ab\u7642\u61c9\u7528\u4e2d\u5c0d\u9ad8\u7cbe\u5ea6\u548c\u53ef\u4fe1\u5ea6\u7684\u9700\u6c42\u3002\u96a8\u8457\u6280\u8853\u7684\u767c\u5c55\uff0cMedical-Graph-RAG \u6709\u671b\u5728\u63d0\u5347\u91ab\u7642\u670d\u52d9\u8cea\u91cf\u3001\u8a3a\u65b7\u6548\u7387\u548c\u60a3\u8005\u5b89\u5168\u65b9\u9762\u767c\u63ee\u91cd\u8981\u4f5c\u7528\u3002 \u5982\u4f55\u5b89\u88dd Medical-Graph-RAG \u4ee5\u4e0b\u662f\u5b89\u88dd\u548c\u8a2d\u7f6e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"googlesitekit_rrm_CAowvqSiDA:productID":"","footnotes":""},"class_list":["post-4927","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/pages\/4927","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/comments?post=4927"}],"version-history":[{"count":0,"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/pages\/4927\/revisions"}],"wp:attachment":[{"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/media?parent=4927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}