{"id":56551,"date":"2025-02-22T10:27:38","date_gmt":"2025-02-22T02:27:38","guid":{"rendered":"https:\/\/fwq.ai\/blog\/56551\/"},"modified":"2025-02-22T10:27:38","modified_gmt":"2025-02-22T02:27:38","slug":"itext2kg%e6%a0%b8%e5%bf%83%e6%8f%90%e7%a4%ba%e6%8c%87%e4%bb%a4%ef%bc%9a%e6%8f%90%e5%8f%96%e7%9f%a5%e8%af%86%e5%9b%be%e8%b0%b1%e5%ae%9e%e4%bd%93%e5%85%b3%e7%b3%bb%e5%92%8c%e5%ae%9e%e4%bd%93-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/56551\/","title":{"rendered":"iText2KG\u6838\u5fc3\u63d0\u793a\u6307\u4ee4\uff1a\u63d0\u53d6\u77e5\u8bc6\u56fe\u8c31\u5b9e\u4f53\u5173\u7cfb\u548c\u5b9e\u4f53"},"content":{"rendered":"<blockquote>\n<p>\u4e00\u6b3e\u4e0d\u9519\u7684\u57fa\u4e8eLLM\u6784\u5efa\u589e\u91cf\u5f0f\u77e5\u8bc6\u56fe\u8c31\u7684\u5de5\u5177\uff1aitext2kg<\/p>\n<p>iText2KG\u5373\u63d2\u5373\u7528\uff0c\u9002\u7528\u4e8e\u591a\u79cd\u573a\u666f\uff0c\u6bd4\u5982\u79d1\u5b66\u8bba\u6587\u3001\u7f51\u7ad9\u3001\u7b80\u5386\u7684\u56fe\u8c31\u8f6c\u6362\uff0c\u6027\u80fd\u4f18\u4e8e\u73b0\u6709\u57fa\u7ebf<\/p>\n<p> <\/p>\n<p>\u7279\u70b9\uff1a<br \/> 1\u3001\u53ef\u4ee5\u6839\u636e\u65b0\u6587\u6863\u4e0d\u65ad\u66f4\u65b0\u77e5\u8bc6\u56fe\u8c31\uff0c\u5c06\u65b0\u4fe1\u606f\u6574\u5408\u5230\u5df2\u6709\u7ed3\u6784\u4e2d<br \/> 2\u3001\u4e0d\u9700\u8981\u9488\u5bf9\u7279\u5b9a\u9886\u57df\u8fdb\u884c\u8bad\u7ec3\uff0c\u53ef\u4ee5\u8de8\u9886\u57df\u63d0\u53d6\u77e5\u8bc6<br \/> 3\u3001\u5305\u542b\u6a21\u5757\u7528\u4e8e\u6587\u6863\u63d0\u70bc\u3001\u5b9e\u4f53\u63d0\u53d6\u548c\u5173\u7cfb\u63d0\u53d6\uff0c\u786e\u4fdd\u63d0\u53d6\u7684\u5b9e\u4f53\u548c\u5173\u7cfb\u662f\u552f\u4e00\u4e14\u89e3\u6790\u8fc7\u7684\uff0c\u51cf\u5c11\u9519\u8bef\u548c\u91cd\u590d\u4fe1\u606f<br \/> 4\u3001\u652f\u6301\u5c06\u63d0\u53d6\u7684\u5b9e\u4f53\u548c\u5173\u7cfb\u6574\u5408\u5230 Neo4j \u6570\u636e\u5e93\u4e2d\uff0c\u5e76\u63d0\u4f9b\u53ef\u89c6\u5316\u754c\u9762<\/p>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<h2>\u63d0\u53d6\u5b9e\u4f53\u5173\u7cfb<\/h2>\n<pre>Act like an expert in Information Extraction. If you don\u2019t find the information, keep its place empty in the json. If the text is in English or French, translate it to English.  \r\n\nQuestion:\r\n    # Directives\r\n    - Adhere completely to the provided entities list.\r\n    - Do not add any entity outside the provided list.\r\n    - Extract ONE predicate per subject and object.\r\n    - ALL entities in the provided list should have a relation.\r\n\nFormat Instructions:The output should be formatted as a JSON instance that conforms to the JSON schema below.\r\n\nAs an example, for the schema `{\"properties\": {\"foo\": {\"title\": \"Foo\", \"description\": \"a list of strings\", \"type\": \"array\", \"items\": {\"type\": \"string\"}},\"required\": [\"foo\"]}}`  \r\nThe object `{\"foo\": [\"bar\", \"baz\"]}` is a well-formatted instance of the schema.  \r\nThe object `{\"properties\": {\"foo\": [\"bar\", \"baz\"]}}` is not well-formatted.\r\n\nHere is the output schema: \r\n```json\r\n{\r\n  \"properties\": {\r\n    \"relationships\": {\r\n      \"title\": \"Relationships\",\r\n      \"default\": \"Given the provided entities and context, try to find the predicates between these entities. They should be chosen carefully to accurately represent the relationship being expressed.\",\r\n      \"type\": \"array\",\r\n      \"items\": {\r\n        \"$ref\": \"#\/definitions\/Relationship\"\r\n      }\r\n    }\r\n  },\r\n  \"definitions\": {\r\n    \"Relationship\": {\r\n      \"title\": \"Relationship\",\r\n      \"type\": \"object\",\r\n      \"properties\": {\r\n        \"startNode\": {\r\n          \"title\": \"Startnode\",\r\n          \"default\": \"The start entity, found in the entities list\",\r\n          \"type\": \"string\"\r\n        },\r\n        \"endNode\": {\r\n          \"title\": \"Endnode\",\r\n          \"default\": \"The end entity, found in the entities list\",\r\n          \"type\": \"string\"\r\n        },\r\n        \"name\": {\r\n          \"title\": \"Name\",\r\n          \"default\": \"The predicate between the two entities. The predicate should encode ONE relation.\",\r\n          \"type\": \"string\"\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n\tAnswer:\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>\u63d0\u53d6\u5b9e\u4f53\u5173\u7cfb\u4e2d\u6587\u7248<\/strong><\/p>\n<pre>\u5145\u5f53\u4fe1\u606f\u63d0\u53d6\u4e13\u5bb6\u3002\u5982\u679c\u672a\u627e\u5230\u4fe1\u606f\uff0c\u8bf7\u5728json\u4e2d\u4fdd\u7559\u8be5\u4f4d\u7f6e\u4e3a\u7a7a\u3002\u5982\u679c\u6587\u672c\u662f\u82f1\u6587\u6216\u6cd5\u6587\uff0c\u5219\u5c06\u5176\u7ffb\u8bd1\u4e3a\u82f1\u6587\u3002  \r\n&lt;\u4e0a\u4e0b\u6587&gt;  \r\n\u95ee\u9898\uff1a  \r\n    # \u6307\u4ee4  \r\n    - \u5b8c\u5168\u9075\u5faa\u63d0\u4f9b\u7684\u5b9e\u4f53\u5217\u8868\u3002  \r\n    - \u4e0d\u6dfb\u52a0\u4efb\u4f55\u63d0\u4f9b\u5217\u8868\u4e4b\u5916\u7684\u5b9e\u4f53\u3002  \r\n    - \u6bcf\u4e2a\u4e3b\u9898\u548c\u5bf9\u8c61\u63d0\u53d6\u4e00\u4e2a\u8c13\u8bcd\u3002  \r\n    - \u6240\u6709\u63d0\u4f9b\u5217\u8868\u4e2d\u7684\u5b9e\u4f53\u5fc5\u987b\u6709\u5173\u7cfb\u3002  \r\n\n\u683c\u5f0f\u8bf4\u660e\uff1a\u8f93\u51fa\u5e94\u683c\u5f0f\u5316\u4e3a\u7b26\u5408\u4ee5\u4e0bJSON\u6a21\u5f0f\u7684JSON\u5b9e\u4f8b\u3002  \r\n\n\u4f8b\u5982\uff0c\u5bf9\u4e8e\u6a21\u5f0f `{\"properties\": {\"foo\": {\"title\": \"Foo\", \"description\": \"a list of strings\", \"type\": \"array\", \"items\": {\"type\": \"string\"}},\"required\": [\"foo\"]}}`  \r\n\u5bf9\u8c61 `{\"foo\": [\"bar\", \"baz\"]}` \u662f\u7b26\u5408\u8be5\u6a21\u5f0f\u7684\u683c\u5f0f\u826f\u597d\u7684\u5b9e\u4f8b\u3002  \r\n\u5bf9\u8c61 `{\"properties\": {\"foo\": [\"bar\", \"baz\"]}}` \u4e0d\u662f\u683c\u5f0f\u826f\u597d\u7684\u3002  \r\n\n\u8fd9\u662f\u8f93\u51fa\u6a21\u5f0f\uff1a  \r\n```json  \r\n{  \r\n  \"properties\": {  \r\n    \"relationships\": {  \r\n      \"title\": \"Relationships\",  \r\n      \"default\": \"\u6839\u636e\u63d0\u4f9b\u7684\u5b9e\u4f53\u548c\u4e0a\u4e0b\u6587\uff0c\u5c1d\u8bd5\u627e\u51fa\u8fd9\u4e9b\u5b9e\u4f53\u4e4b\u95f4\u7684\u8c13\u8bcd\u3002\u5e94\u4ed4\u7ec6\u9009\u62e9\u4ee5\u51c6\u786e\u8868\u793a\u6240\u8868\u8fbe\u7684\u5173\u7cfb\u3002\",  \r\n      \"type\": \"array\",  \r\n      \"items\": {  \r\n        \"$ref\": \"#\/definitions\/Relationship\"  \r\n      }  \r\n    }  \r\n  },  \r\n  \"definitions\": {  \r\n    \"Relationship\": {  \r\n      \"title\": \"Relationship\",  \r\n      \"type\": \"object\",  \r\n      \"properties\": {  \r\n        \"startNode\": {  \r\n          \"title\": \"Startnode\",  \r\n          \"default\": \"\u8d77\u59cb\u5b9e\u4f53\uff0c\u89c1\u4e8e\u5b9e\u4f53\u5217\u8868\",  \r\n          \"type\": \"string\"  \r\n        },  \r\n        \"endNode\": {  \r\n          \"title\": \"Endnode\",  \r\n          \"default\": \"\u7ed3\u675f\u5b9e\u4f53\uff0c\u89c1\u4e8e\u5b9e\u4f53\u5217\u8868\",  \r\n          \"type\": \"string\"  \r\n        },  \r\n        \"name\": {  \r\n          \"title\": \"Name\",  \r\n          \"default\": \"\u4e24\u4e2a\u5b9e\u4f53\u4e4b\u95f4\u7684\u8c13\u8bcd\u3002\u8c13\u8bcd\u5e94\u7f16\u7801\u4e00\u4e2a\u5173\u7cfb\u3002\",  \r\n          \"type\": \"string\"  \r\n        }  \r\n      }  \r\n    }  \r\n  }  \r\n}  \r\n\t\u7b54\u6848\uff1a  \r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2>\u63d0\u53d6\u5b9e\u4f53<\/h2>\n<pre>Act like an expert in Information Extraction. If you don\u2019t find the information, keep its place empty in the json. If the text is not in English or French, translate it to English.  \r\n\nQuestion:\r\nFormat Instructions:The output should be formatted as a JSON instance that conforms to the JSON schema below.\r\n\nAs an example, for the schema `{\"properties\": {\"foo\": {\"title\": \"Foo\", \"description\": \"a list of strings\", \"type\": \"array\", \"items\": {\"type\": \"string\"}},\"required\": [\"foo\"]}}`  \r\nThe object `{\"foo\": [\"bar\", \"baz\"]}` is a well-formatted instance of the schema.  \r\nThe object `{\"properties\": {\"foo\": [\"bar\", \"baz\"]}}` is not well-formatted.\r\n\nHere is the output schema:  \r\n```json\r\n{\r\n  \"properties\": {\r\n    \"entities\": {\r\n      \"title\": \"Entities\",\r\n      \"default\": \"All the entities presented in the context. The entities should encode ONE concept.\",\r\n      \"type\": \"array\",\r\n      \"items\": {\r\n        \"$ref\": \"#\/definitions\/Entity\"\r\n      }\r\n    }\r\n  },\r\n  \"definitions\": {\r\n    \"Entity\": {\r\n      \"title\": \"Entity\",\r\n      \"type\": \"object\",\r\n      \"properties\": {\r\n        \"label\": {\r\n          \"title\": \"Label\",\r\n          \"default\": \"The type or category of the entity, such as 'Process', 'Technique', 'Data Structure', 'Methodology', 'Person', etc. This field helps in classifying and organizing entities within the knowledge graph.\",\r\n          \"type\": \"string\"\r\n        },\r\n        \"name\": {\r\n          \"title\": \"Name\",\r\n          \"default\": \"The specific name of the entity. It should represent a single, distinct concept and must not be an empty string. For example, if the entity is a 'Technique', the name could be 'Neural Networks'.\",\r\n          \"type\": \"string\"\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n\tAnswer:\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>\u63d0\u53d6\u5b9e\u4f53\u4e2d\u6587\u7248<\/strong><\/p>\n<pre>\u626e\u6f14\u4e00\u4e2a\u4fe1\u606f\u63d0\u53d6\u4e13\u5bb6\u3002\u5982\u679c\u627e\u4e0d\u5230\u76f8\u5173\u4fe1\u606f\uff0c\u8bf7\u5728JSON\u4e2d\u5c06\u5bf9\u5e94\u4f4d\u7f6e\u4fdd\u7559\u4e3a\u7a7a\u3002\u5982\u679c\u6587\u672c\u4e0d\u662f\u82f1\u8bed\u6216\u6cd5\u8bed\uff0c\u8bf7\u5c06\u5176\u7ffb\u8bd1\u6210\u82f1\u8bed\u3002\r\n\n\u95ee\u9898\uff1a\r\n\u683c\u5f0f\u8bf4\u660e\uff1a\u8f93\u51fa\u5e94\u8be5\u683c\u5f0f\u5316\u4e3a\u7b26\u5408\u4ee5\u4e0bJSON\u6a21\u5f0f\u7684JSON\u5b9e\u4f8b\u3002\r\n\n\u4f8b\u5982\uff0c\u5bf9\u4e8e\u6a21\u5f0f`{\"properties\": {\"foo\": {\"title\": \"Foo\", \"description\": \"a list of strings\", \"type\": \"array\", \"items\": {\"type\": \"string\"}},\"required\": [\"foo\"]}}`\r\n\u5bf9\u8c61`{\"foo\": [\"bar\", \"baz\"]}`\u662f\u8be5\u6a21\u5f0f\u7684\u683c\u5f0f\u6b63\u786e\u7684\u5b9e\u4f8b\u3002\r\n\u5bf9\u8c61`{\"properties\": {\"foo\": [\"bar\", \"baz\"]}}`\u683c\u5f0f\u4e0d\u6b63\u786e\u3002\r\n\n\u4ee5\u4e0b\u662f\u8f93\u51fa\u6a21\u5f0f\uff1a\r\n```json\r\n{\r\n  \"properties\": {\r\n    \"entities\": {\r\n      \"title\": \"\u5b9e\u4f53\",\r\n      \"default\": \"\u4e0a\u4e0b\u6587\u4e2d\u51fa\u73b0\u7684\u6240\u6709\u5b9e\u4f53\u3002\u6bcf\u4e2a\u5b9e\u4f53\u5e94\u8be5\u8868\u793a\u4e00\u4e2a\u72ec\u7acb\u7684\u6982\u5ff5\u3002\",\r\n      \"type\": \"array\",\r\n      \"items\": {\r\n        \"$ref\": \"#\/definitions\/Entity\"\r\n      }\r\n    }\r\n  },\r\n  \"definitions\": {\r\n    \"Entity\": {\r\n      \"title\": \"\u5b9e\u4f53\",\r\n      \"type\": \"object\",\r\n      \"properties\": {\r\n        \"label\": {\r\n          \"title\": \"\u6807\u7b7e\",\r\n          \"default\": \"\u5b9e\u4f53\u7684\u7c7b\u578b\u6216\u7c7b\u522b\uff0c\u5982'\u8fc7\u7a0b'\u3001'\u6280\u672f'\u3001'\u6570\u636e\u7ed3\u6784'\u3001'\u65b9\u6cd5\u8bba'\u3001'\u4eba\u7269'\u7b49\u3002\u6b64\u5b57\u6bb5\u6709\u52a9\u4e8e\u5728\u77e5\u8bc6\u56fe\u8c31\u4e2d\u5bf9\u5b9e\u4f53\u8fdb\u884c\u5206\u7c7b\u548c\u7ec4\u7ec7\u3002\",\r\n          \"type\": \"string\"\r\n        },\r\n        \"name\": {\r\n          \"title\": \"\u540d\u79f0\",\r\n          \"default\": \"\u5b9e\u4f53\u7684\u5177\u4f53\u540d\u79f0\u3002\u5b83\u5e94\u4ee3\u8868\u4e00\u4e2a\u5355\u4e00\u7684\u3001\u660e\u786e\u7684\u6982\u5ff5\uff0c\u4e14\u4e0d\u80fd\u4e3a\u7a7a\u5b57\u7b26\u4e32\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5b9e\u4f53\u7c7b\u578b\u662f'\u6280\u672f'\uff0c\u540d\u79f0\u53ef\u80fd\u662f'\u795e\u7ecf\u7f51\u7edc'\u3002\",\r\n          \"type\": \"string\"\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n\u56de\u7b54\uff1a\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u6b3e\u4e0d\u9519\u7684\u57fa\u4e8eLLM\u6784\u5efa\u589e\u91cf\u5f0f\u77e5\u8bc6\u56fe\u8c31\u7684\u5de5\u5177\uff1aitext2kg iText2KG\u5373\u63d2\u5373\u7528\uff0c\u9002\u7528\u4e8e\u591a\u79cd\u573a\u666f\uff0c\u6bd4\u5982\u79d1\u5b66\u8bba\u6587\u3001\u7f51\u7ad9\u3001\u7b80\u5386\u7684\u56fe\u8c31\u8f6c\u6362\uff0c\u6027\u80fd\u4f18\u4e8e\u73b0\u6709\u57fa\u7ebf \u7279\u70b9\uff1a 1\u3001\u53ef\u4ee5\u6839\u636e\u65b0\u6587\u6863\u4e0d\u65ad\u66f4\u65b0\u77e5\u8bc6\u56fe\u8c31\uff0c\u5c06\u65b0\u4fe1\u606f\u6574\u5408\u5230\u5df2\u6709\u7ed3\u6784\u4e2d 2\u3001\u4e0d\u9700\u8981\u9488\u5bf9\u7279\u5b9a\u9886\u57df\u8fdb\u884c\u8bad\u7ec3\uff0c\u53ef\u4ee5\u8de8\u9886\u57df\u63d0\u53d6\u77e5\u8bc6 3\u3001\u5305\u542b\u6a21\u5757\u7528\u4e8e\u6587\u6863\u63d0\u70bc\u3001\u5b9e\u4f53\u63d0\u53d6\u548c\u5173\u7cfb\u63d0\u53d6\uff0c\u786e\u4fdd\u63d0\u53d6\u7684\u5b9e\u4f53\u548c\u5173\u7cfb\u662f\u552f\u4e00\u4e14\u89e3\u6790\u8fc7\u7684\uff0c\u51cf\u5c11\u9519\u8bef\u548c\u91cd\u590d\u4fe1\u606f 4\u3001\u652f\u6301\u5c06\u63d0\u53d6\u7684\u5b9e\u4f53\u548c\u5173\u7cfb\u6574\u5408\u5230 Neo4j \u6570\u636e\u5e93\u4e2d\uff0c\u5e76\u63d0\u4f9b\u53ef\u89c6\u5316\u754c\u9762 &nbsp; \u63d0\u53d6\u5b9e\u4f53\u5173\u7cfb Act like an expert in Information Extraction. If you don\u2019t find the information, keep its place empty in the json. If the text is in English or French, translate it to English. Question: # Directives &#8211; Adhere completely to the provided entities list. &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-56551","post","type-post","status-publish","format-standard","hentry","category-ai"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/56551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=56551"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/56551\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=56551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=56551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=56551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}