Knowledge graph construction method and device based on artificial intelligence, equipment and medium
Through automated processing of insurance knowledge texts based on artificial intelligence, and using entity extraction and graph database to build knowledge graphs, the problems of low efficiency and low accuracy of manual construction in the existing technology are solved, and efficient and accurate knowledge graph construction is achieved.
Patent Information
- Application Number
- CN202411254476.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2025-01-03
AI Technical Summary
The knowledge graphs in the existing insurance field are usually constructed manually, which are inefficient and have low accuracy, and are prone to editing errors due to staff negligence.
Using an artificial intelligence-based method, the original insurance knowledge text is obtained and preprocessed, and the text is extracted and mapped using entity extraction, attribute extraction, relationship extraction model and entity link model, and the knowledge graph is constructed in combination with the graph database to realize automated data. Storage and verification.
It improves the efficiency and accuracy of the construction of knowledge graphs, avoids waste of time and errors during manual collection and editing, and enhances the overall quality of the graph.
Smart Images

Figure CN119250191A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of artificial intelligence development technology and financial technology, and in particular to methods, devices, computer equipment and storage media for constructing knowledge graphs based on artificial intelligence. Background Art
[0002] In today's rapidly developing financial technology field, the insurance industry is experiencing an unprecedented wave of digital transformation. As an advanced data organization and knowledge management technology, knowledge graphs provide the insurance industry with unprecedented data processing and analysis methods with powerful association analysis capabilities, intelligent reasoning capabilities, and visual display characteristics, which is expected to significantly improve the efficiency and accuracy of risk assessment, product design, customer service anti-fraud, and other aspects.
[0003] However, currently, knowledge graphs in the insurance field are usually constructed manually. This method of manually constructing knowledge graphs requires staff to spend a lot of time and energy in advance to collect, organize and edit data related to graph construction. Since the data related to graph construction is complex and constantly updated, the efficiency of manually editing knowledge graphs is low. At the same time, due to the negligence of staff, errors in knowledge graph editing may occur, resulting in low editing accuracy of knowledge graphs. Summary of the invention
[0004] The purpose of the embodiments of the present application is to propose a method, device, computer equipment and storage medium for constructing a knowledge graph based on artificial intelligence, so as to solve the technical problems of low efficiency and low accuracy in the existing manual construction of knowledge graphs.
[0005] In order to solve the above technical problems, the present application embodiment provides a method for constructing a knowledge graph based on artificial intelligence, which adopts the following technical solution:
[0006] Obtaining pre-collected original insurance knowledge texts;
[0007] Preprocessing the original insurance knowledge text to obtain a corresponding insurance knowledge text;
[0008] Perform entity extraction on the insurance knowledge text based on the trained entity extraction model to obtain insurance entities in the insurance knowledge text;
[0009] Extracting attributes from the insurance knowledge text and the insurance entity based on the trained entity attribute extraction model to obtain attribute values of the insurance entity;
[0010] Performing relation extraction on the insurance knowledge text based on the trained relation extraction model to obtain the insurance relation corresponding to the insurance knowledge text;
[0011] Based on the trained entity linking model, the insurance entity, the attribute value of the insurance entity, and the insurance relationship are used to perform data mapping processing on the preset ontology model to obtain a corresponding mapping result;
[0012] The mapping result is subjected to knowledge storage processing based on a preset graph database to obtain a target knowledge graph corresponding to the insurance knowledge text.
[0013] Furthermore, the step of performing data mapping processing on the preset ontology model based on the trained entity linking model using the insurance entity, the attribute value of the insurance entity, and the insurance relationship to obtain the corresponding mapping result specifically includes:
[0014] Loading a pre-built ontology model; wherein the ontology model includes pre-defined entity nouns, pre-defined entity attribute nouns and pre-defined relationship nouns;
[0015] For a designated insurance entity, a similarity value between the designated insurance entity and an entity noun predefined in the ontology model is calculated based on the entity linking model; wherein the designated insurance entity is any one of all the insurance entities;
[0016] Based on the similarity value, linking the designated insurance entity to a corresponding designated entity noun in the ontology model;
[0017] Acquire a designated attribute value corresponding to the designated insurance entity, and map the designated attribute value to a corresponding designated entity attribute noun in the ontology model;
[0018] Obtain a specified insurance relationship, and map the specified insurance relationship to a corresponding specified relationship noun in the ontology model, until the data mapping processing of all the insurance entities, all the attribute values of the insurance entities, and all the insurance relationships is completed, and the mapping result is obtained; wherein the specified insurance relationship is any one of all the insurance relationships.
[0019] Furthermore, the step of performing knowledge storage processing on the mapping result based on a preset graph database to obtain a target knowledge graph corresponding to the insurance knowledge text specifically includes:
[0020] Formatting the mapping result to obtain a corresponding target mapping result;
[0021] Calling the graph database, and defining node types and relationship types corresponding to the ontology model in the graph database;
[0022] Based on the node type and the relationship type, converting the target mapping result into node data and edge data in the graph database;
[0023] Importing the node data and the edge data into the graph database to obtain a corresponding specified knowledge graph;
[0024] Performing data verification on the specified knowledge graph based on preset verification rules;
[0025] If the designated knowledge graph passes the data verification, the designated knowledge graph is used as the target knowledge graph corresponding to the insurance knowledge text.
[0026] Furthermore, the step of preprocessing the original insurance knowledge text to obtain the corresponding insurance knowledge text specifically includes:
[0027] Obtain preset data cleaning strategies and data integration strategies;
[0028] Performing data cleaning processing on the original insurance knowledge text based on the data cleaning strategy to obtain a corresponding first insurance knowledge text;
[0029] Performing data integration processing on the first insurance knowledge text based on the data integration strategy to obtain a corresponding second insurance knowledge text;
[0030] The second insurance knowledge text is used as the insurance knowledge text.
[0031] Furthermore, before the step of extracting entities from the insurance knowledge text based on the trained entity extraction model to obtain insurance entities in the insurance knowledge text, the step further includes:
[0032] Collecting the first textual data in the insurance field;
[0033] Performing annotation processing on the text data to obtain corresponding second text data;
[0034] Arrange the second text data into sample data conforming to a preset entity recognition data format;
[0035] Get the preset large language model;
[0036] Using the sample data and a low-rank adaptation-based fine-tuning algorithm to train and fine-tune the large language model, to obtain a specified large language model that meets preset model building requirements;
[0037] The designated large language model is used as the entity extraction model.
[0038] Furthermore, before the step of performing relation extraction on the insurance knowledge text based on the trained relation extraction model to obtain the insurance relation corresponding to the insurance knowledge text, the step further includes:
[0039] Collect data sets containing entities, attribute values, and relationships from multiple pre-defined data sources;
[0040] Constructing a mapping relationship between the data set and the nouns included in the ontology model;
[0041] Generate an output label corresponding to the data set based on the mapping relationship;
[0042] Get the preset classification model;
[0043] Using the data set as a model input and the output label as a model output to train the classification model, thereby obtaining a corresponding specified classification model;
[0044] Performing model evaluation on the specified classification model based on a preset evaluation data set;
[0045] If the specified classification model passes the model evaluation, the specified classification model is used as the entity linking model.
[0046] Furthermore, after the step of performing knowledge storage processing on the mapping result based on the preset graph database to obtain a target knowledge graph corresponding to the insurance knowledge text, the method further includes:
[0047] Get the preset graph test data set;
[0048] Performing evaluation and testing on the target knowledge graph based on the graph test data set to obtain corresponding evaluation results;
[0049] Generate a corresponding assessment report based on the assessment result;
[0050] Send the assessment report to the preset target team.
[0051] In order to solve the above technical problems, the embodiment of the present application also provides a knowledge graph construction device based on artificial intelligence, which adopts the following technical solution:
[0052] The first acquisition module is used to acquire the original insurance knowledge text collected in advance;
[0053] A preprocessing module, used for preprocessing the original insurance knowledge text to obtain a corresponding insurance knowledge text;
[0054] A first extraction module, configured to perform entity extraction on the insurance knowledge text based on a trained entity extraction model to obtain insurance entities in the insurance knowledge text;
[0055] A second extraction module is used to extract attributes from the insurance knowledge text and the insurance entity based on the trained entity attribute extraction model to obtain the attribute value of the insurance entity;
[0056] A third extraction module is used to perform relationship extraction on the insurance knowledge text based on the trained relationship extraction model to obtain the insurance relationship corresponding to the insurance knowledge text;
[0057] A mapping module, used to perform data mapping processing on a preset ontology model using the insurance entity, the attribute value of the insurance entity, and the insurance relationship based on the trained entity linking model to obtain a corresponding mapping result;
[0058] A storage module is used to perform knowledge storage processing on the mapping results based on a preset graph database to obtain a target knowledge graph corresponding to the insurance knowledge text.
[0059] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0060] The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method for constructing a knowledge graph based on artificial intelligence proposed in any one of the embodiments of the present application are implemented.
[0061] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0062] The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of any one of the methods for constructing a knowledge graph based on artificial intelligence proposed in the embodiments of the present application.
[0063] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0064] First, obtain the original insurance knowledge text collected in advance; and pre-process the original insurance knowledge text to obtain the corresponding insurance knowledge text; then perform entity extraction on the insurance knowledge text based on the trained entity extraction model to obtain the insurance entity in the insurance knowledge text; then perform attribute extraction on the insurance knowledge text and the insurance entity based on the trained entity attribute extraction model to obtain the attribute value of the insurance entity; subsequently, perform relationship extraction on the insurance knowledge text based on the trained relationship extraction model to obtain the insurance relationship corresponding to the insurance knowledge text; further based on the trained entity linking model, use the insurance entity, the attribute value of the insurance entity, and the insurance relationship to perform data mapping processing on the preset ontology model to obtain the corresponding mapping result; finally, perform knowledge storage processing on the mapping result based on the preset graph database to obtain the target knowledge graph corresponding to the insurance knowledge text. This application processes the insurance knowledge text based on the use of entity extraction model, entity attribute extraction model, relationship extraction model, entity linking model and graph database, and can realize the rapid and accurate construction of the corresponding target knowledge graph. This can avoid wasting time on manually collecting, organizing and editing graph data, thereby effectively improving the efficiency of knowledge graph construction. At the same time, it can also avoid graph editing errors caused by staff negligence, thereby improving the accuracy of knowledge graph construction. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0066] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0067] Figure 2 A flowchart of an embodiment of a method for constructing a knowledge graph based on artificial intelligence according to the present application;
[0068] Figure 3 It is a structural schematic diagram of an embodiment of a knowledge graph construction device based on artificial intelligence according to the present application;
[0069] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0070] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0071] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0072] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0073] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0074] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0075] The terminal device 101 can be various electronic devices with a display screen and supporting web browsing. In addition to the laptop computer 1011, the tablet computer 1012 or the mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer, a desktop computer, etc.
[0076] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .
[0077] It should be noted that the artificial intelligence-based knowledge graph construction method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the artificial intelligence-based knowledge graph construction device is generally set in the server / terminal device.
[0078] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0079] Continue to refer Figure 2 , showing a flowchart of an embodiment of the method for constructing a knowledge graph based on artificial intelligence according to the present application. According to different needs, the order of the steps in the flowchart can be changed, and some steps can be omitted. The method for constructing a knowledge graph based on artificial intelligence provided in the embodiment of the present application can be applied to any scenario where product recommendations are required, and the method for constructing a knowledge graph based on artificial intelligence can be applied to products in these scenarios, for example, product recommendations in the field of finance and insurance. The method for constructing a knowledge graph based on artificial intelligence comprises the following steps:
[0080] Step S201, obtaining the original insurance knowledge text collected in advance.
[0081] In this embodiment, the method for constructing a knowledge graph based on artificial intelligence is executed on an electronic device (e.g. Figure 1The server / terminal device shown in the figure) can obtain the original insurance knowledge text through a wired connection or a wireless connection. It should be noted that the above-mentioned wireless connection method may include but is not limited to 3G / 4G / 5G connection, Wi F i connection, Bluetooth connection, Wi MAX connection, Zigbee connection, UWB (ultrawi deband) connection, and other wireless connection methods currently known or to be developed in the future. The present application can be applied to business scenarios for building a knowledge graph about insurance products in the insurance field. Among them, detailed documents of insurance products, such as insurance contracts, insurance policy descriptions, news reports, product descriptions and other data, can be collected from various data channels (such as insurance companies, regulatory agencies, market reports, etc.), and ensure that the data covers different insurance types, insurance companies, insurance products, etc. Each document not only describes the corresponding technical insurance product in detail, but also contains a wealth of relevant additional information. This measure ensures the consistency and integrity of the collected data, and realizes real-time synchronization updates with market dynamics.
[0082] Step S202, preprocessing the original insurance knowledge text to obtain a corresponding insurance knowledge text.
[0083] In the present embodiment, the above-mentioned specific implementation process of preprocessing the original insurance knowledge text to obtain the corresponding insurance knowledge text will be described in further detail in the subsequent specific embodiments of the present application, and will not be elaborated in detail here.
[0084] Step S203: extracting entities from the insurance knowledge text based on the trained entity extraction model to obtain insurance entities in the insurance knowledge text.
[0085] In this embodiment, the entity extraction model is a pre-built model responsible for automatically identifying and extracting key entities from documents. The input of the entity extraction model is a piece of insurance knowledge text. The insurance knowledge text is input into the entity extraction model, and the corresponding insurance entity is output. In addition, the construction process of the entity extraction model will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated on here.
[0086] Step S204: extracting attributes from the insurance knowledge text and the insurance entity based on the trained entity attribute extraction model to obtain attribute values of the insurance entity.
[0087] In this embodiment, the entity attribute extraction model is a pre-built model responsible for extracting specific attributes of entities from documents. The input of the entity attribute extraction model is a piece of insurance knowledge text and the entities contained in the insurance knowledge text, and the output is the attribute values of these entities. In addition, the construction process of the entity attribute extraction model can refer to the construction process of the above-mentioned entity extraction model. The specific process will not be described in detail. It is only necessary to change the format of the annotation data to <insurance text, entity name, entity attribute value>.
[0088] Step S205, performing relationship extraction on the insurance knowledge text based on the trained relationship extraction model to obtain the insurance relationship corresponding to the insurance knowledge text.
[0089] In this embodiment, the above-mentioned relationship extraction model is a pre-built model responsible for identifying and extracting the relationship between entities from the document. Among them, the input of the relationship extraction model is a piece of insurance knowledge text, the insurance knowledge text is input into the relationship extraction model, and the corresponding multiple insurance relationships are output. In addition, the construction process of the relationship extraction model can refer to the construction process of the above-mentioned entity extraction model. The specific process will not be described in detail. It is only necessary to change the format of the annotation data to <insurance text, relationship>.
[0090] Step S206, based on the trained entity linking model, use the insurance entity, the attribute value of the insurance entity, and the insurance relationship to perform data mapping processing on the preset ontology model to obtain a corresponding mapping result.
[0091] In this embodiment, the entity linking model is a pre-built model responsible for matching and linking the extracted entities, attributes, and relationships with the nouns in the preset ontology model. The ontology model is a pre-built model responsible for defining the conceptual system and relationship framework in the insurance field, which may specifically include pre-defined entity nouns, pre-defined entity attribute nouns, and pre-defined relationship nouns. Among them, the specific implementation process of the above-mentioned trained entity linking model, using the insurance entity, the attribute value of the insurance entity, and the insurance relationship to perform data mapping processing on the preset ontology model to obtain the corresponding mapping result, will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated on here.
[0092] Step S207: perform knowledge storage processing on the mapping result based on a preset graph database to obtain a target knowledge graph corresponding to the insurance knowledge text.
[0093] In this embodiment, Neo4j can be used as a graph database for storing knowledge graphs. Neo4j has advantages in processing highly connected data and supports Cypher query language. The specific implementation process of performing knowledge storage processing on the mapping results based on the preset graph database to obtain the target knowledge graph corresponding to the insurance knowledge text will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated on here.
[0094] This application processes insurance knowledge text based on the use of entity extraction model, entity attribute extraction model, relationship extraction model, entity link model and graph database, and can quickly and accurately construct the corresponding target knowledge graph. This can avoid the time wasted in manually collecting, organizing and editing graph data, thereby effectively improving the efficiency of knowledge graph construction. At the same time, it can also avoid graph editing errors caused by negligence of staff, thereby improving the accuracy of knowledge graph construction.
[0095] In some optional implementations of this embodiment, step S206 includes the following steps:
[0096] Load a pre-built ontology model, wherein the ontology model includes pre-defined entities, pre-defined entity attributes, and pre-defined relationships.
[0097] In this embodiment, an ontology model suitable for constructing an insurance product knowledge graph can be constructed through a preset ontology construction model. Specifically, (1) Based on the concept of technology insurance products as the center, the entities in the knowledge graph are clarified: technology insurance products, market insurance products, packages, insurance types, liabilities and clauses (2) Based on the concept of technology insurance products as the center, the entity attributes of the entities in the knowledge graph are clarified: (i) Technology insurance products: insurance product ID, name, effective time, etc.; (ii) Market insurance products: product ID, name, price, coverage, applicable population, etc.; (iii) Insurance types: insurance type ID, name, covered risk type, compensation conditions, etc.; (iv) Liability: liability ID, description, trigger conditions, compensation limit, etc.; (v) Clauses: clause ID, text content, applicable conditions, excluded liability, etc. (vi) Packages: package ID, name, effective time, etc. (3) Based on the concept of technology insurance products as the center, clarify the relationships in the knowledge graph: market insurance products of technology insurance products, packages of market insurance products, types of market insurance products, responsibilities of market insurance products, terms of market insurance products, types of packages, responsibilities of packages, terms of packages, responsibilities of types of insurance, and terms of types of insurance. By building an ontology model based on the above predefined entities, predefined entity attributes, and predefined relationships, then build a knowledge graph corresponding to the insurance product with the ontology model as the core.
[0098] For a designated insurance entity, a similarity value between the designated insurance entity and an entity predefined in the ontology model is calculated based on the entity linking model, wherein the designated insurance entity is any one of all the insurance entities.
[0099] In this embodiment, for each extracted insurance entity, the similarity between it and the predefined entity in the ontology model is calculated. Specifically, the similarity calculation process can be implemented through string matching, semantic similarity algorithm (such as Word2Vec, BERT, etc.) or custom rules.
[0100] Based on the similarity value, the designated insurance entity is linked to a corresponding designated entity in the ontology model.
[0101] In this embodiment, the extracted insurance entities are linked to the corresponding entities in the ontology model according to the similarity values. Specifically, if the similarity values of two entities are higher than the preset similarity threshold, they are considered to represent the same entity; otherwise, manual intervention may be required to confirm or create a new entity. There is no specific limitation on the value of the similarity threshold, which can be set according to the actual similarity analysis requirements.
[0102] A designated attribute value corresponding to the designated insurance entity is obtained, and the designated attribute value is mapped to a corresponding designated entity attribute noun in the ontology model.
[0103] In this embodiment, the above-mentioned specified attribute value refers to the attribute value of the specified insurance entity. For the extracted entity successfully linked to the entity noun of the ontology model, its attribute value is matched and mapped with the attribute noun defined in the ontology model, specifically including matching of attribute names, verification of attribute types, and conversion and standardization of attribute values.
[0104] Obtain a specified insurance relationship, and map the specified insurance relationship to a corresponding specified relationship noun in the ontology model, until the data mapping processing of all the insurance entities, all the attribute values of the insurance entities, and all the insurance relationships is completed, and the mapping result is obtained; wherein the specified insurance relationship is any one of all the insurance relationships.
[0105] In this embodiment, the designated insurance relationship is any one of all insurance relationships. By matching and mapping the extracted insurance relationships with the relationship nouns defined in the ontology model, the type, direction and entities involved of the relationship can be analyzed to ensure that they are consistent with the definition in the ontology model. Specifically, after all the extracted insurance entities are mapped to the corresponding predefined entity nouns in the ontology model, all the extracted attribute values and insurance relationships are also mapped to the corresponding predefined entity attribute nouns and relationship nouns in the ontology model, and it is ensured that they are consistent with the predefined nouns of the ontology model, thereby completing the data mapping process and obtaining the corresponding mapping results.
[0106] The present application loads a pre-built ontology model including predefined entity nouns, predefined entity attribute nouns and predefined relationship nouns, and then based on the use of an entity linking model, uses a similarity calculation method to map all extracted insurance entities to the corresponding predefined entity nouns in the ontology model, and also maps all extracted attribute values and insurance relationships to the corresponding predefined entity attribute nouns and relationship nouns in the ontology model, thereby quickly and accurately completing the data mapping processing corresponding to the ontology model and ensuring the data accuracy of the obtained mapping results.
[0107] In some optional implementations, step S207 includes the following steps:
[0108] The mapping result is formatted to obtain a corresponding target mapping result.
[0109] In this embodiment, the graph database may be a Neo4j graph database. The formatting process refers to formatting the data of the mapping result into a format that Neo4j can understand, usually in the form of CSV, JSON or Cypher query statements.
[0110] The graph database is called, and node types and relationship types corresponding to the ontology model are defined in the graph database.
[0111] In this embodiment, the node type definition in the graph database is as follows: According to the ontology model, corresponding node types are created in Neo4j, such as "insurance product", "customer", "insurance agent", etc. The relationship type definition in the graph database is as follows: Possible relationship types between nodes are defined, such as "include" (used to indicate the insurance product includes the protection items), "purchase" (used to indicate that the customer has purchased a certain insurance product), etc.
[0112] Based on the node type and the relationship type, the target mapping result is converted into node data and edge data in the graph database.
[0113] In this embodiment, the process of converting the target mapping result into node data and edge data in the graph database includes: Node creation: For each entity in the mapping result, a corresponding node is created in Neo4j and attributes are added to it. Attributes may include entity attributes defined in the ontology model and attribute values extracted from the insurance knowledge text. Edge creation: Based on the relationship information in the mapping data, edges representing these relationships are created in Neo4j. Each edge connects two nodes and may contain additional attributes to describe the details of the relationship.
[0114] The node data and the edge data are imported into the graph database to obtain the corresponding specified knowledge graph.
[0115] In this embodiment, node data and edge data can be imported into the graph database in batches by using tools or APIs provided by Neo4j. Specifically, Cypher query statements can be written to create nodes and relationships in batches. This can be done through the command line interface or graphical interface of Neo4j (such as Neo4j Browser). Alternatively, the Neo4j Data Import Tool (Neo4j-admin import) can be used, which provides efficient data loading performance. In addition, third-party tools or scripting languages (such as Python) combined with Neo4j drivers (such as Neo4j Python Driver) can be used to import data in batches.
[0116] The specified knowledge graph is subjected to data verification based on preset verification rules.
[0117] In this embodiment, the rule content of the above verification rules includes: checking whether the imported nodes and relationships are complete and accurate, and whether the attribute values are correct.
[0118] If the designated knowledge graph passes the data verification, the designated knowledge graph is used as the target knowledge graph corresponding to the insurance knowledge text.
[0119] In this embodiment, if the designated knowledge graph passes the data verification, it is determined that the designated knowledge graph is accurate, and the designated knowledge graph is used as the target knowledge graph corresponding to the insurance knowledge text.
[0120] The present application defines node types and relationship types corresponding to the ontology model in the graph database, and then converts the formatted target mapping results into node data and edge data in the graph database based on the node types and the relationship types, imports the node data and the edge data into the graph database to obtain the corresponding designated knowledge graph, and after detecting that the designated knowledge graph passes the data verification of the verification rules, uses the designated knowledge graph as the target knowledge graph corresponding to the insurance knowledge text, thereby realizing the intelligent and accurate completion of the process of constructing the target knowledge graph according to the insurance knowledge text, improving the intelligence of the construction of the target knowledge graph, and ensuring the accuracy of the obtained target knowledge graph.
[0121] In some optional implementations, step S202 includes the following steps:
[0122] Get preset data cleaning strategies and data integration strategies.
[0123] In this embodiment, the policy content of the above-mentioned data cleaning strategy includes: Duplicate data identification and deletion: Use hash tables, database queries and other technologies to identify and delete duplicate data records. Error data correction: Correct erroneous data fields, such as spelling errors, inconsistent formats, etc. through manual inspection or using data cleaning tools. Incomplete data processing: For data records that are missing key information, try to complete them through other channels, or fill them according to business rules (such as using default values, average values, etc.). The policy content of the above-mentioned data integration strategy includes: Data standardization: Integrate data from different sources into a unified format, including field names, data types, encoding methods, etc. Data denoising: Remove data noise that is not related to the construction of the knowledge graph in the insurance field, such as advertising information, irrelevant links, etc.
[0124] The original insurance knowledge text is subjected to data cleaning processing based on the data cleaning strategy to obtain a corresponding first insurance knowledge text.
[0125] In this embodiment, data cleaning processing may be performed on the original insurance knowledge text according to the policy content of the above-mentioned data cleaning policy, so as to obtain the corresponding first insurance knowledge text.
[0126] The first insurance knowledge text is subjected to data integration processing based on the data integration strategy to obtain a corresponding second insurance knowledge text.
[0127] In this embodiment, data integration processing may be performed on the first insurance knowledge text according to the policy content of the above-mentioned data integration policy, thereby obtaining a corresponding second insurance knowledge text.
[0128] The second insurance knowledge text is used as the insurance knowledge text.
[0129] In this embodiment, when the insurance knowledge text is obtained after cleaning and integration, the insurance knowledge text can be stored in a database or data warehouse suitable for subsequent processing.
[0130] The present application performs data cleaning and data integration processing on the original insurance knowledge text based on the use of data cleaning strategies and data integration strategies, thereby completing the rapid and accurate preprocessing of the original insurance knowledge text, which is beneficial to ensuring the data accuracy of the obtained insurance knowledge text, and further beneficial to ensuring the accuracy of the target knowledge graph subsequently generated based on the insurance knowledge text.
[0131] In some optional implementations, before step S203, the electronic device may further perform the following steps:
[0132] Collecting the first textual data in the insurance field.
[0133] In this embodiment, detailed documents of insurance products, such as insurance contracts, insurance policy descriptions, news reports, product descriptions and other data, are collected from various channels (such as insurance companies, regulatory agencies, market reports, etc.), and the data is ensured to cover different insurance types, insurance companies, insurance products, etc., so as to improve the generalization ability of the model, thereby obtaining the above-mentioned first text data.
[0134] The text data is annotated to obtain corresponding second text data.
[0135] In this embodiment, the annotation process includes: Tool selection: Use professional text annotation tools (such as Doccano, Product, etc.) for annotation. Annotation specifications: Define clear annotation specifications, including entity types (such as "product name", "company name", "insurance type", etc.) and boundaries. Annotation team: Organize an experienced annotation team or use a crowdsourcing platform to annotate the text with high quality.
[0136] The second text data is organized into sample data that conforms to a preset entity recognition data format.
[0137] In this embodiment, the annotated data is organized into a <insurance text, entity list> format, where the entity list includes the type, start position, and end position of the entity.
[0138] Get the preset large language model.
[0139] In this embodiment, the above-mentioned large language model can adopt a model with strong language comprehension ability, and specifically the qwen2-72b (Tongyi Qianwen) model can be adopted.
[0140] The large language model is trained and fine-tuned using the sample data and a low-rank adaptation-based fine-tuning algorithm to obtain a specified large language model that meets preset model building requirements.
[0141] In this embodiment, the above-mentioned fine-tuning algorithm based on low-rank adaptation is specifically the LORA algorithm. The process of building a specified large language model includes: 1. Model loading. Use an appropriate library (such as Hugging Face's Transformers library) to load the qwen2-72b model. 2. LORA fine-tuning. Prepare the LORA layer: According to the LORA algorithm, initialize the low-rank matrix as a parameter. Modify the model architecture: Insert the LORA layer into the model to allow only these low-rank matrices to be updated during fine-tuning. Data preprocessing: Convert the sample data into a format acceptable to the model, such as converting to token ids, and prepare the necessary input features. Training settings: Set parameters such as learning rate, batch size, and training rounds. Consider using a smaller learning rate to avoid destroying the knowledge of the pre-trained model. Training process: Use sample data to train the model, monitor the loss function during training and the performance indicators on the validation set. 3. Model evaluation. Evaluation data set: Prepare an independent, non-training data set for evaluating model performance. Evaluation indicators: Calculate indicators such as accuracy, recall, and F1 score, which can fully reflect the performance of the model on the entity extraction task. Analyze errors: Analyze the errors of the model on the evaluation data set and identify common error types and causes. 4. Adjustment and optimization. Adjust the model structure or parameters: Adjust the parameters of the LORA layer, training parameters, or model architecture based on the evaluation results and error analysis. Iterative training: Repeat the process of training, evaluation, and optimization until the model performance reaches a satisfactory level, that is, the model building requirements are met, thereby obtaining the specified large language model.
[0142] The designated large language model is used as the entity extraction model.
[0143] In this embodiment, after the entity extraction model is obtained, the entity extraction model is deployed to a production environment or a specific application, and the performance of the entity extraction model in the actual application is monitored, and further optimization and adjustment are performed as needed.
[0144] The present application obtains sample data by annotating and organizing the first text data collected in the insurance field, and then uses the sample data and a fine-tuning algorithm based on low-rank adaptation to train and fine-tune the preset large language model, and uses the obtained designated large language model that meets the model construction requirements as the final entity extraction model, thereby completing the construction of the entity extraction model, effectively improving the construction efficiency of the entity extraction model, and ensuring the model effect of the obtained entity extraction model.
[0145] In some optional implementations of this embodiment, before step S206, the electronic device may further perform the following steps:
[0146] Collect data sets containing entities, attribute values, and relationships from multiple pre-defined data sources.
[0147] In this embodiment, the data sources may include knowledge bases, text documents, databases, etc. By collecting data sets containing entities, attribute values, and relationships from multiple data sources, and ensuring that the data coverage is extensive and diverse, the generalization ability of the model is supported. In addition, the data set may be further cleaned to remove noise data, such as duplicate records, irrelevant information, etc., and to standardize the formats of entity names and attribute values.
[0148] A mapping relationship between the data set and the nouns included in the ontology model is constructed.
[0149] In this embodiment, a mapping relationship is established between the entities, attribute values and relationships in the above data set and the nouns (including entity nouns, entity attribute nouns and relationship nouns) pre-defined in the ontology model.
[0150] An output label corresponding to the data set is generated based on the mapping relationship.
[0151] In this embodiment, the unique identifier in the ontology model, that is, the noun corresponding to the data set is used as the output label.
[0152] Get the preset classification model.
[0153] In this embodiment, a model suitable for classification or matching tasks can be selected, such as the BERT model with strong context understanding ability, or FastText with fast training ability, or the qwen2-72b model can also be selected. Among them, considering that the entity linking task requires understanding the context of entity mentions, BERT or similar Transformer models are usually better choices.
[0154] The classification model is trained by taking the data set as a model input and the output label as a model output to obtain a corresponding specified classification model.
[0155] In this embodiment, the training process of a specified classification model may include: 1. Preprocessing: Convert a data set containing entities, attribute values, and relationships into an input format acceptable to the model (such as token IDs). Prepare label data, i.e., nouns in the ontology model. 2. Model configuration: Load a selected pre-trained model (such as BERT). Configure the model to accept input (entities, attribute values, and relationships) and output nouns in the ontology model. 3. Set training parameters: Determine hyperparameters such as learning rate, batch size, and training rounds, and cross-validation can be used to optimize these parameters. 4. Training process: Train the model using the training set. Monitor the loss function during training and performance indicators on the validation set (such as accuracy, recall, etc.). Adjust the learning rate or stop training early as needed to avoid overfitting. 5. Model saving: Save the trained model weights and configuration information for subsequent evaluation and deployment.
[0156] The specified classification model is evaluated based on a preset evaluation data set.
[0157] In this embodiment, the above-mentioned data set can be divided into a training set and a test set in advance according to a preset ratio, and the test set can be used as the above-mentioned evaluation data set. The performance of the specified classification model can be evaluated by using the test set, and performance indicators such as accuracy, recall rate, F1 score, etc. can be calculated, and it can be detected whether all performance indicators are greater than the corresponding performance threshold. If all performance indicators are greater than the corresponding performance threshold, it is determined that the specified classification model has passed the model evaluation, otherwise it is determined that the specified classification model has not passed the model evaluation. Among them, there is no specific limitation on the value of the above-mentioned preset ratio, for example, it can be set to 7:3. Similarly, there is no specific limitation on the value of the above-mentioned performance threshold, which can be set according to the actual performance test requirements.
[0158] If the specified classification model passes the model evaluation, the specified classification model is used as the entity linking model.
[0159] In this embodiment, after the entity linking model is obtained, the entity linking model can be further deployed to an online environment, such as a server or cloud service, and necessary APIs or service interfaces can be configured so that external systems can call them.
[0160] The present application constructs a mapping relationship between a pre-collected data set containing entities, attribute values and relationships and the nouns contained in the ontology model, and generates an output label corresponding to the data set according to the mapping relationship, and then uses the data set as a model input and the output label as a model output to train a preset classification model to obtain a corresponding designated classification model, and then uses a preset evaluation data set to perform model evaluation on the designated classification model, and when it is detected that the designated classification model passes the model evaluation, the designated classification model is used as the entity link model, thereby completing the construction of the entity link model, effectively improving the construction efficiency of the entity link model, and ensuring the model effect of the obtained entity link model.
[0161] In some optional implementations of this embodiment, after step S207, the electronic device may further perform the following steps:
[0162] Get the preset graph test dataset.
[0163] In this embodiment, a set of test data sets for evaluating the target knowledge graph are prepared in advance. These test data sets cover various aspects of the target knowledge graph, including common queries, boundary conditions, abnormal situations, etc.
[0164] The target knowledge graph is evaluated and tested based on the graph test data set to obtain corresponding evaluation results.
[0165] In this embodiment, the target knowledge graph is evaluated and tested by using a test data set, the actual performance of each indicator in the target knowledge graph is recorded, and the existing problems and deficiencies are found out by analyzing the test results, and the corresponding evaluation results are generated. Among them, the accuracy, completeness and availability evaluation indicators of the target knowledge graph are defined according to business needs. For example, accuracy can be evaluated using indicators such as accuracy, recall rate, and F1 score; completeness can be evaluated using indicators such as coverage and redundancy; availability can be evaluated using indicators such as response time and concurrent processing capability.
[0166] A corresponding evaluation report is generated based on the evaluation results.
[0167] In this embodiment, the evaluation results are organized into a corresponding evaluation report, which may at least include evaluation indicators, test methods, test results, problem analysis, improvement suggestions and other contents.
[0168] Send the assessment report to the preset target team.
[0169] In this embodiment, the target team may specifically refer to the operation and maintenance team responsible for the operation and maintenance of the knowledge graph. By sharing the evaluation report with the target team, the personnel in the target team can understand the current status of the target knowledge graph and the future improvement direction.
[0170] After performing knowledge storage processing on the mapping results based on a preset graph database to obtain the target knowledge graph corresponding to the insurance knowledge text, the present application will also intelligently use a preset graph test data set to perform evaluation test processing on the target knowledge graph to obtain the corresponding evaluation results, and generate a corresponding evaluation report based on the evaluation results, and then send the evaluation report to the preset target team, so as to help the personnel in the target team to timely understand the current status and future improvement directions of the target knowledge graph, and then take corresponding processing measures for the target knowledge graph, which is conducive to ensuring the stable operation of the target knowledge graph, and ensuring the performance and quality of the target knowledge graph, and improving the work efficiency and work experience of the target team.
[0171] This application constructs a multi-dimensional knowledge graph. This knowledge graph takes technology insurance products as the core nodes, and expands to a wider range of insurance product market levels through logical and structured link paths. More importantly, it can further establish deep associations with specific insurance packages, types of insurance, liabilities, and clauses. In addition, in response to the professional knowledge characteristics of the insurance field, this application has developed customized entity extraction models and relationship extraction models. By using advanced large language models, we can deeply understand the specific context of the insurance field and significantly improve the relevance and accuracy of the extraction results. Compared with the BERT-based entity extraction model in the prior art, the large language model can capture more subtle semantic differences, help identify more specific or abstract entities, and improve the accuracy of entity extraction.
[0172] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0173] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned target knowledge graph, the above-mentioned target knowledge graph can also be stored in a node of a blockchain.
[0174] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0175] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0176] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0177] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a knowledge graph construction device based on artificial intelligence. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0178] like Figure 3 As shown, the knowledge graph construction device 300 based on artificial intelligence described in this embodiment includes: a first acquisition module 301, a preprocessing module 302, a first extraction module 303, a second extraction module 304, a third extraction module 305, a mapping module 306 and a storage module 307. Among them:
[0179] The first acquisition module 301 is used to acquire the original insurance knowledge text collected in advance;
[0180] A preprocessing module 302 is used to preprocess the original insurance knowledge text to obtain a corresponding insurance knowledge text;
[0181] The first extraction module 303 is used to extract entities from the insurance knowledge text based on the trained entity extraction model to obtain insurance entities in the insurance knowledge text;
[0182] The second extraction module 304 is used to extract attributes from the insurance knowledge text and the insurance entity based on the trained entity attribute extraction model to obtain the attribute value of the insurance entity;
[0183] The third extraction module 305 is used to perform relationship extraction on the insurance knowledge text based on the trained relationship extraction model to obtain the insurance relationship corresponding to the insurance knowledge text;
[0184] A mapping module 306 is used to perform data mapping processing on a preset ontology model using the insurance entity, the attribute value of the insurance entity, and the insurance relationship based on the trained entity linking model to obtain a corresponding mapping result;
[0185] The storage module 307 is used to perform knowledge storage processing on the mapping result based on a preset graph database to obtain a target knowledge graph corresponding to the insurance knowledge text.
[0186] In some optional implementations of this embodiment, the mapping module 306 includes:
[0187] A loading submodule, used to load a pre-built ontology model; wherein the ontology model includes pre-defined entities, pre-defined entity attributes and pre-defined relationships;
[0188] A calculation submodule, configured to calculate, for a specified insurance entity, a similarity value between the specified insurance entity and an entity predefined in the ontology model based on the entity linking model; wherein the specified insurance entity is any one of all the insurance entities;
[0189] A linking submodule, for linking the designated insurance entity to a corresponding designated entity in the ontology model based on the similarity value;
[0190] A first acquisition submodule is used to acquire a designated attribute value corresponding to the designated insurance entity, and map the designated attribute value to a corresponding designated entity attribute noun in the ontology model;
[0191] The first processing submodule is used to obtain a specified insurance relationship and map the specified insurance relationship to a corresponding specified relationship noun in the ontology model until the data mapping processing of all the insurance entities, all the attribute values of the insurance entities and all the insurance relationships is completed and the mapping result is obtained; wherein the specified insurance relationship is any one of all the insurance relationships.
[0192] In some optional implementations of this embodiment, the storage module 307 includes:
[0193] A second processing submodule is used to format the mapping result to obtain a corresponding target mapping result;
[0194] A definition submodule is used to call the graph database and define node types and relationship types corresponding to the ontology model in the graph database;
[0195] A conversion submodule, used for converting the target mapping result into node data and edge data in the graph database based on the node type and the relationship type;
[0196] An import submodule, used to import the node data and the edge data into the graph database to obtain a corresponding specified knowledge graph;
[0197] A verification submodule, used to perform data verification on the specified knowledge graph based on preset verification rules;
[0198] The first determination submodule is used to use the specified knowledge graph as the target knowledge graph corresponding to the insurance knowledge text if the specified knowledge graph passes the data verification.
[0199] In some optional implementations of this embodiment, the preprocessing module 302 includes:
[0200] The second acquisition submodule is used to acquire the preset data cleaning strategy and data integration strategy;
[0201] A cleaning submodule, configured to perform data cleaning processing on the original insurance knowledge text based on the data cleaning strategy to obtain a corresponding first insurance knowledge text;
[0202] An integration submodule, configured to perform data integration processing on the first insurance knowledge text based on the data integration strategy to obtain a corresponding second insurance knowledge text;
[0203] The second determining submodule is used to use the second insurance knowledge text as the insurance knowledge text.
[0204] In some optional implementations of this embodiment, the artificial intelligence-based knowledge graph construction device further includes:
[0205] A first collection module, used to collect first text data in the insurance field;
[0206] A marking module, used for marking the text data to obtain corresponding second text data;
[0207] A sorting module, used for sorting the second text data into sample data conforming to a preset entity recognition data format;
[0208] The second acquisition module is used to acquire a preset large language model;
[0209] A fine-tuning module, used to train and fine-tune the large language model using the sample data and a fine-tuning algorithm based on low-rank adaptation to obtain a specified large language model that meets preset model construction requirements;
[0210] The first determination module is used to use the specified large language model as the entity extraction model.
[0211] In some optional implementations of this embodiment, the artificial intelligence-based knowledge graph construction device further includes:
[0212] A second collection module is used to collect data sets including entities, attribute values and relationships from a plurality of preset data sources;
[0213] A construction module, used to construct a mapping relationship between the data set and the nouns included in the ontology model;
[0214] A first generating module, configured to generate an output label corresponding to the data set based on the mapping relationship;
[0215] The third acquisition module is used to acquire a preset classification model;
[0216] A training module, used to use the data set as a model input and the output label as a model output to train the classification model to obtain a corresponding specified classification model;
[0217] An evaluation module, used to perform model evaluation on the specified classification model based on a preset evaluation data set;
[0218] The second determination module is used to use the specified classification model as the entity linking model if the specified classification model passes the model evaluation.
[0219] In some optional implementations of this embodiment, the artificial intelligence-based knowledge graph construction device further includes:
[0220] The fourth acquisition module is used to acquire a preset graph test data set;
[0221] A testing module, used to perform evaluation test processing on the target knowledge graph based on the graph test data set to obtain corresponding evaluation results;
[0222] A second generating module, used to generate a corresponding evaluation report based on the evaluation result;
[0223] The sending module is used to send the evaluation report to the preset target team.
[0224] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0225] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital processors (DSPs), embedded devices, etc.
[0226] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0227] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the knowledge graph construction method based on artificial intelligence, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0228] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for running the artificial intelligence-based knowledge graph construction method.
[0229] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0230] The present application also provides another implementation, namely, providing a computer-readable storage medium, which stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the above-mentioned artificial intelligence-based knowledge graph construction method.
[0231] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0232] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A method for constructing a knowledge graph based on artificial intelligence, characterized in that: The steps include: Obtaining pre-collected original insurance knowledge texts; Preprocessing the original insurance knowledge text to obtain a corresponding insurance knowledge text; Perform entity extraction on the insurance knowledge text based on the trained entity extraction model to obtain insurance entities in the insurance knowledge text; Extracting attributes from the insurance knowledge text and the insurance entity based on the trained entity attribute extraction model to obtain attribute values of the insurance entity; Performing relation extraction on the insurance knowledge text based on the trained relation extraction model to obtain the insurance relation corresponding to the insurance knowledge text; Based on the trained entity linking model, the insurance entity, the attribute value of the insurance entity, and the insurance relationship are used to perform data mapping processing on the preset ontology model to obtain a corresponding mapping result; The mapping result is subjected to knowledge storage processing based on a preset graph database to obtain a target knowledge graph corresponding to the insurance knowledge text.
2. The method for constructing a knowledge graph based on artificial intelligence according to claim 1, characterized in that: The step of performing data mapping processing on a preset ontology model based on the trained entity linking model using the insurance entity, the attribute value of the insurance entity, and the insurance relationship to obtain a corresponding mapping result specifically includes: Loading a pre-built ontology model; wherein the ontology model includes pre-defined entity nouns, pre-defined entity attribute nouns and pre-defined relationship nouns; For a designated insurance entity, a similarity value between the designated insurance entity and an entity noun predefined in the ontology model is calculated based on the entity linking model; wherein the designated insurance entity is any one of all the insurance entities; Based on the similarity value, linking the designated insurance entity to a corresponding designated entity noun in the ontology model; Acquire a designated attribute value corresponding to the designated insurance entity, and map the designated attribute value to a corresponding designated entity attribute noun in the ontology model; Obtain a specified insurance relationship, and map the specified insurance relationship to a corresponding specified relationship noun in the ontology model, until the data mapping processing of all the insurance entities, all the attribute values of the insurance entities, and all the insurance relationships is completed, and the mapping result is obtained; wherein the specified insurance relationship is any one of all the insurance relationships.
3. The method for constructing a knowledge graph based on artificial intelligence according to claim 1, characterized in that: The step of performing knowledge storage processing on the mapping result based on a preset graph database to obtain a target knowledge graph corresponding to the insurance knowledge text specifically includes: Formatting the mapping result to obtain a corresponding target mapping result; Calling the graph database, and defining node types and relationship types corresponding to the ontology model in the graph database; Based on the node type and the relationship type, converting the target mapping result into node data and edge data in the graph database; Importing the node data and the edge data into the graph database to obtain a corresponding specified knowledge graph; Performing data verification on the specified knowledge graph based on preset verification rules; If the designated knowledge graph passes the data verification, the designated knowledge graph is used as the target knowledge graph corresponding to the insurance knowledge text.
4. The method for constructing a knowledge graph based on artificial intelligence according to claim 1, characterized in that: The step of preprocessing the original insurance knowledge text to obtain the corresponding insurance knowledge text specifically includes: Obtain preset data cleaning strategies and data integration strategies; Performing data cleaning processing on the original insurance knowledge text based on the data cleaning strategy to obtain a corresponding first insurance knowledge text; Performing data integration processing on the first insurance knowledge text based on the data integration strategy to obtain a corresponding second insurance knowledge text; The second insurance knowledge text is used as the insurance knowledge text.
5. The method for constructing a knowledge graph based on artificial intelligence according to claim 1, characterized in that: Before the step of extracting entities from the insurance knowledge text based on the trained entity extraction model to obtain insurance entities in the insurance knowledge text, the method further includes: Collecting the first textual data in the insurance field; Performing annotation processing on the text data to obtain corresponding second text data; Arrange the second text data into sample data conforming to a preset entity recognition data format; Get the preset large language model; Using the sample data and a low-rank adaptation-based fine-tuning algorithm to train and fine-tune the large language model, to obtain a specified large language model that meets preset model building requirements; The designated large language model is used as the entity extraction model.
6. The method for constructing a knowledge graph based on artificial intelligence according to claim 1, characterized in that: Before the step of performing relation extraction on the insurance knowledge text based on the trained relation extraction model to obtain the insurance relation corresponding to the insurance knowledge text, the step further includes: Collect data sets containing entities, attribute values, and relationships from multiple pre-defined data sources; Constructing a mapping relationship between the data set and the nouns included in the ontology model; Generate an output label corresponding to the data set based on the mapping relationship; Get the preset classification model; Using the data set as a model input and the output label as a model output to train the classification model, thereby obtaining a corresponding specified classification model; Performing model evaluation on the specified classification model based on a preset evaluation data set; If the specified classification model passes the model evaluation, the specified classification model is used as the entity linking model.
7. The method for constructing a knowledge graph based on artificial intelligence according to claim 1, characterized in that: After the step of performing knowledge storage processing on the mapping result based on the preset graph database to obtain a target knowledge graph corresponding to the insurance knowledge text, the method further includes: Get the preset graph test data set; Performing evaluation and testing on the target knowledge graph based on the graph test data set to obtain corresponding evaluation results; Generate a corresponding assessment report based on the assessment result; Send the assessment report to the preset target team.
8. A knowledge graph construction device based on artificial intelligence, characterized in that: include: The first acquisition module is used to acquire the original insurance knowledge text collected in advance; A preprocessing module, used for preprocessing the original insurance knowledge text to obtain a corresponding insurance knowledge text; A first extraction module, configured to extract entities from the insurance knowledge text based on a trained entity extraction model to obtain insurance entities in the insurance knowledge text; A second extraction module is used to extract attributes from the insurance knowledge text and the insurance entity based on the trained entity attribute extraction model to obtain the attribute value of the insurance entity; A third extraction module is used to perform relationship extraction on the insurance knowledge text based on the trained relationship extraction model to obtain the insurance relationship corresponding to the insurance knowledge text; A mapping module, used to perform data mapping processing on a preset ontology model using the insurance entity, the attribute value of the insurance entity, and the insurance relationship based on the trained entity linking model to obtain a corresponding mapping result; A storage module is used to perform knowledge storage processing on the mapping results based on a preset graph database to obtain a target knowledge graph corresponding to the insurance knowledge text.
9. A computer device, characterized in that: It includes a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, it implements the steps of the method for constructing a knowledge graph based on artificial intelligence as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the method for constructing a knowledge graph based on artificial intelligence as described in any one of claims 1 to 7.
Citation Information
Cited By
Knowledge graph construction method and device based on entity chain finger and storage medium
CN120409640A
Knowledge graph construction method and device based on entity chain and storage medium
CN120409640B
A knowledge graph analysis method, device, and storage medium based on transportation scheduling
CN122733828A
