Knowledge graph-based data processing method and device, electronic equipment and medium

By processing the triplet information and question information of the knowledge graph, and using language models for jump judgment and entity recognition, the shortcomings of knowledge graphs in handling complex problems are solved, enabling wider application and more accurate answer provision.

CN116821372BActive Publication Date: 2026-01-09CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310828242.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-07
Publication Date
2026-01-09
Estimated Expiration
2043-07-07

AI Technical Summary

Technical Problem

Existing knowledge graph question answering systems are insufficient in processing complex and diverse natural language questions, and cannot provide accurate answers, which limits their application areas, especially in the financial field where they perform poorly in handling high-frequency data and diverse questions.

Method used

By acquiring triple information and question information from the knowledge graph, performing character segmentation, and then using a pre-defined language model for jump judgment and entity recognition, combined with entity linking and relationship sorting, the target query statement is determined, thus expanding the application scope of knowledge graphs.

Benefits of technology

It improves the accuracy of handling various problems, broadens the application scope of knowledge graphs, and can better address complex financial and unstructured data problems, providing more accurate answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116821372B_ABST
    Figure CN116821372B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a knowledge graph-based data processing method and device, electronic equipment and medium, belonging to the technical field of data processing. The method comprises: obtaining triple information of a knowledge graph and question information; performing character segmentation on the question information to obtain multiple character granularity information; inputting the triple information and the character granularity information into a preset first language model to perform jump determination and obtain a jump type; inputting the character granularity information into a preset second language model to perform entity recognition and obtain entity information; mapping the entity information based on a preset entity link and graph entity information to obtain multiple candidate entities; performing relationship sorting on the candidate entities based on the first language model and relationship information to obtain candidate relationships; and determining a target query sentence based on the jump type, the candidate entities and the candidate relationships. The embodiments of the present application can expand the application field of the knowledge graph and improve the processing accuracy of various questions.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and particularly relates to a data processing method and device based on a knowledge graph, an electronic device and a medium. BACKGROUND

[0002] A knowledge graph is a knowledge retrieval service for search engine users, which uses visualization technology or a structured method to describe entity and entity relationship knowledge. In the financial field, knowledge graphs have been widely used in financial risk control, investment analysis, asset management and other scenarios. Knowledge graphs need to identify entities, and most current knowledge graphs are researched from traditional fields by identifying entities mentioned in user question sentences. A question and answer system based on a knowledge graph can select corresponding answers from a given knowledge base to answer questions. Compared with a search engine that retrieves information based on keyword indexing and text matching, a knowledge graph question and answer system directly returns answers to specific questions, improving the efficiency of knowledge acquisition.

[0003] However, a knowledge graph needs to be based on a large amount of structured data, and existing knowledge graph question and answer systems for agents and customers mainly target specific fields such as insurance, finance and service industries. The processing of these financial data usually needs to consider smaller units, for example, in stock transaction data, there are thousands of transaction information every minute, which needs a higher data granularity to support. This leads to insufficient processing capacity for open domain problems and insufficient processing capacity for complex and diverse natural language problems. In the case of different domain problems raised by customers, accurate answers cannot be given, resulting in limited application fields of question systems relying on knowledge graphs. SUMMARY

[0004] The main purpose of the embodiments of the present application is to provide a data processing method, device, electronic device and medium based on a knowledge graph, which can expand the application field of the knowledge graph and improve the processing accuracy of various problems.

[0005] To achieve the above purpose, a first aspect of the embodiments of the present application provides a data processing method based on a knowledge graph, which comprises:

[0006] Obtaining triple information and question information of the knowledge graph, wherein the triple information comprises graph entity information and relationship information in the knowledge graph;

[0007] Performing character segmentation on the question information to obtain a plurality of character granularity information;

[0008] input the triad information and the character granularity information into a preset first language model to perform jump judgment, to obtain a jump type corresponding to the question information;

[0009] input the character granularity information into a preset second language model to perform entity recognition, to obtain entity information in the question information;

[0010] map the entity information based on a preset entity link and the graph entity information, to obtain a plurality of candidate entities;

[0011] perform relationship sorting on the candidate entities according to the first language model and the relationship information, to obtain a candidate relationship corresponding to the candidate entities;

[0012] determine a target query statement corresponding to the question information according to the jump type, the candidate entities, and the candidate relationship.

[0013] In some embodiments, the first language model includes a linear layer and a full connection layer; and the inputting of the triad information and the character granularity information into the preset first language model to perform jump judgment, to obtain a jump type corresponding to the question information, includes:

[0014] performing label processing on the character granularity information, to obtain a head vector and a tail vector;

[0015] generating a graph jump type according to the triad information, wherein the graph jump type is obtained by querying an input question by using the knowledge graph, obtaining a query result, and classifying the query result;

[0016] inputting the character granularity information into the preset first language model to perform encoding calculation, to obtain character vector information of the question information, and taking character vector information corresponding to the head vector as a sentence vector;

[0017] inputting the sentence vector into the linear layer to perform dimension conversion, to output a target dimension vector;

[0018] inputting the target dimension vector and the graph jump type into the full connection layer to perform probability calculation, to output probability information, wherein the probability information is used to represent a probability that the question information belongs to the graph jump type;

[0019] training the first language model according to the probability information, and inputting the question information into the trained first language model, to obtain a jump type.

[0020] In some embodiments, the second language model comprises a text encoder, a bidirectional long short-term memory network model, and a conditional random field model; the inputting the character granularity information into a preset second language model for entity recognition to obtain entity information in the question information comprises:

[0021] inputting the character granularity information into the text encoder for character mapping to output a first word vector;

[0022] inputting the first word vector into the bidirectional long short-term memory network model for calculation to obtain a plurality of second word vectors;

[0023] performing attention calculation on the second word vectors to obtain an attention vector corresponding to the character granularity information;

[0024] inputting the attention vector into the conditional random field model for category identification to obtain category information corresponding to the character granularity information;

[0025] performing classification calculation on the category information based on a preset category sequence and a sequence formula to obtain all entity information in the question information.

[0026] In some embodiments, the attention calculation on the second word vectors to obtain an attention vector corresponding to the question information comprises:

[0027] for any two second word vectors, performing similarity calculation on the second word vectors to obtain similarity information;

[0028] performing weight conversion on the similarity information to obtain weight information;

[0029] performing average calculation on the second word vectors and the weight information to obtain a weighted average value corresponding to the second word vectors;

[0030] performing vector splicing on the second word vectors and the weighted average value based on a preset model parameter to obtain the attention vector.

[0031] In some embodiments, the entity linking comprises a synonym table; the mapping the entity information based on a preset entity linking and the graph entity information to obtain a plurality of candidate entities comprises:

[0032] mapping the entity information to the graph entity information based on the synonym table to obtain a mapping result;

[0033] performing semantic recall on the mapping result to obtain a plurality of first entities;

[0034] inputting the entity information into the text encoder for calculation to obtain an entity sentence vector corresponding to the entity information;

[0035] performing similarity calculation on the entity sentence vector and the first entity based on a preset first threshold, to obtain a plurality of second entities;

[0036] splicing the second entities and the question information to obtain a first spliced text;

[0037] inputting the first spliced text into the first language model for calculation, to obtain a plurality of entity matching probabilities, wherein the entity matching probabilities are used to represent matching conditions of the second entities and the question information;

[0038] performing probability sorting on all the second entities according to the entity matching probabilities, to obtain an entity probability sequence;

[0039] performing screening on the entity probability sequence based on a preset second threshold, to obtain a plurality of candidate entities.

[0040] In some embodiments, the relationship sorting of the candidate entities according to the first language model and the relationship information, to obtain candidate relationships corresponding to the candidate entities, comprises:

[0041] splicing the candidate entities, the relationship information and the question information to obtain a plurality of second spliced texts;

[0042] inputting the second spliced texts into the first language model for calculation, to obtain a plurality of relationship matching probabilities, wherein the relationship matching probabilities are used to represent matching conditions of the question information and the relationship information;

[0043] performing probability sorting on the relationship information according to the relationship matching probabilities, to obtain a relationship probability sequence;

[0044] performing screening on the relationship probability sequence based on a preset third threshold, to obtain candidate relationships corresponding to the candidate entities.

[0045] In some embodiments, the determining of the target query statement corresponding to the question information according to the jump type, the candidate entities and the candidate relationships comprises:

[0046] generating a plurality of query statements according to the jump type, the candidate entities and the candidate relationships;

[0047] splicing the query statements and the question information to obtain a third spliced text;

[0048] inputting the third spliced text into the first language model for calculation, to obtain a plurality of query matching probabilities, wherein the query matching probabilities are used to represent matching conditions of the question information and the query statements.

[0049] ranking the query sentences according to the query matching probability, to obtain a query probability sequence;

[0050] determining the target query sentence according to the query probability sequence.

[0051] To achieve the above object, a second aspect of the embodiment of the present application provides a data processing device based on a knowledge graph, the device comprising:

[0052] an information acquisition module, configured to acquire triple information of the knowledge graph and question information, wherein the triple information comprises graph entity information and relationship information in the knowledge graph;

[0053] a character segmentation module, configured to perform character segmentation on the question information, to obtain a plurality of character granularity information;

[0054] a jump determination module, configured to input the triple information and the character granularity information into a preset first language model to perform jump determination, to obtain a jump type corresponding to the question information;

[0055] an entity recognition module, configured to input the character granularity information into a preset second language model to perform entity recognition, to obtain entity information in the question information;

[0056] an entity mapping module, configured to map the entity information based on a preset entity link and the graph entity information, to obtain a plurality of candidate entities;

[0057] a target determination module, configured to determine a target query sentence corresponding to the question information according to the jump type, the candidate entities and the candidate relationships.

[0058] To achieve the above object, a third aspect of the embodiment of the present application provides an electronic device, an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the data processing method based on the knowledge graph as described in the first aspect when executing the computer program.

[0059] To achieve the above object, a fourth aspect of the embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, and the computer program implementing the data processing method based on the knowledge graph as described in the first aspect when executed by a processor.

[0060] The data processing method, device, electronic equipment and storage medium based on a knowledge graph provided in the application first acquire triple information of a knowledge graph and question information to be answered, perform character segmentation on the question information, thereby obtaining multiple character granularity information, facilitating subsequent judgment on the type of the question information, then input the triple information and the character granularity information into a first language model for jump judgment, thereby obtaining a jump type corresponding to the question information, and input the character granularity information into a second language model for entity recognition, thereby obtaining entity information in the question information, so as to improve the accuracy of entity recognition in the question information and the accuracy of question processing, further map the entity information based on entity connection and graph entity information, thereby obtaining multiple candidate entities, so as to improve the accuracy of reply to the question information and the ability to process complex questions, and finally determine a target query statement corresponding to the question information according to the jump type, the candidate entities and candidate relationships, thereby improving the types of covered questions and expanding the application field of the knowledge graph. BRIEF DESCRIPTION OF DRAWINGS

[0061] Figure 1 is a flowchart of the data processing method based on a knowledge graph provided in the application embodiment;

[0062] Figure 2 is Figure 1 is a flowchart of step S103 in

[0063] Figure 3 is Figure 1 is a flowchart of step S104 in

[0064] Figure 4 is Figure 3 is a flowchart of step S303 in

[0065] Figure 5 is Figure 1 is a flowchart of step S105 in

[0066] Figure 6 is Figure 1 is a flowchart of step S106 in

[0067] Figure 7 is Figure 1 is a flowchart of step S107 in

[0068] Figure 8 is a structural schematic diagram of the data processing device based on a knowledge graph provided in the application embodiment;

[0069] Figure 9 is a hardware structural schematic diagram of the electronic equipment provided in the application embodiment. DETAILED DESCRIPTION

[0070] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not intended to limit the present application.

[0071] It should be noted that although the functional modules are divided in the device schematic diagram, and the logical sequence is shown in the flowchart, in some cases, the steps shown or described can be performed in a manner different from the module division in the device or the sequence in the flowchart. The terms "first", "second", etc. in the specification and claims and the above-described drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.

[0072] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0073] First, the meanings of several terms involved in the present application are analyzed:

[0074] Natural Language Processing (NLP): NLP uses computers to process, understand and use human languages (such as Chinese, English, etc.). NLP is a branch of artificial intelligence and is an interdisciplinary subject of computer science and linguistics, and is also commonly referred to as computational linguistics. Natural language processing includes syntax analysis, semantic analysis, discourse understanding, etc. Natural language processing is commonly used in machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis and opinion mining, etc. It involves data mining, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research related to language processing, and language computing related linguistic research.

[0075] SPARQL Protocol and RDF Query Language (SPARQL): is a query language and data acquisition protocol developed for RDF. Since RDF data is represented in the form of triples, triples are a very important concept in SPARQL language, and almost all SPARQL statements contain triples.

[0076] Structured Query Language (SQL): Structured Query Language is a database query and programming language used to access data and query, update and manage relational database systems.

[0077] Bidirectional Encoder Representation from Transformers (BERT): The innovation of BERT is that the Transformer Decoder (including Masked Multi-Head Attention) is used as an extractor, and a mask training method is used with it. Although the use of double encoding makes BERT not have the ability of text generation, BERT uses all the context information of each word in the encoding process of the input text, and the semantic information extraction ability of BERT is stronger than that of the unidirectional encoder which can only use the previous information to extract semantics.

[0078] Bi-directional Long Short-Term Memory (BiLSTM): is composed of a forward LSTM and a backward LSTM. Both are often used to model context information in natural language processing tasks.

[0079] Conditional Random Field (CRF): is a discriminative probabilistic model, which is a kind of random field, and is often used to mark or analyze sequence data such as natural language text or biological sequences. Conditional random field is a conditional probability distribution model P(Y|X), which represents the Markov random field of another group of output random variables Y given a group of input random variables X, that is, the feature of CRF is to assume that the output random variable forms a Markov random field. Conditional random field can be regarded as a generalization of maximum entropy Markov model in labeling problem.

[0080] Based on this, the embodiment of the application provides a data processing method and device based on a knowledge graph, an electronic device and a storage medium, which can expand the application field of the knowledge graph and improve the processing accuracy of various problems.

[0081] The data processing method and device based on a knowledge graph, the electronic device and the storage medium provided by the embodiment of the application are specifically explained through the following embodiments. First, the data processing method based on a knowledge graph in the embodiment of the application is described.

[0082] The embodiment of the application can acquire and process related data based on artificial intelligence technology. Artificial intelligence (AI) is the use of digital computers or digital computer-controlled machines to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0083] The artificial intelligence basic technology generally includes technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics, etc. The artificial intelligence software technology mainly includes computer vision technology, robot technology, biometric identification technology, module management technology of online customer reception system, natural language processing technology, and machine learning / deep learning, etc.

[0084] The method for data processing based on a knowledge graph provided in the embodiments of the present application relates to the technical field of data processing. The method for data processing based on a knowledge graph provided in the embodiments of the present application can be applied to a terminal, can also be applied to a server end, and can also be software running in a terminal or a server end. In some embodiments, the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc. The server end can be configured as an independent physical server, can also be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured as a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The software can be an application for implementing the method for data processing based on a knowledge graph, etc., but is not limited to the above forms.

[0085] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in a distributed computing environment, in which tasks are performed by remote processing devices connected by a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

[0086] It should be noted that in various specific embodiments of the present application, when relevant processing needs to be performed on data related to the identity or characteristics of the user, such as user information, user behavior data, user history data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of such data will comply with relevant laws, regulations, and standards in relevant countries and regions. In addition, when the embodiments of the present application need to obtain sensitive personal information of the user, the separate permission or separate consent of the user will be obtained through a pop-up window or a jump to a confirmation page, and after obtaining the separate permission or separate consent of the user, the necessary user-related data for enabling the embodiments of the present application to normally operate will be obtained.

[0087] A knowledge graph is a structured data model used to describe entities, relationships, and attributes, and has been widely applied in many fields. In the financial industry, a knowledge graph can be used for data management, risk control, investment research, etc. However, the application of a knowledge graph in the financial field also has the following disadvantages:

[0088] Data granularity problem: A knowledge graph needs to be built on a large amount of structured data, but the processing of financial data usually needs to consider smaller units. For example, in stock trading data, there are thousands of transaction information every minute, which requires a higher data granularity to support. In addition, the financial market changes very quickly, and the reliability and real-time requirements of data are higher, making it difficult to ensure the timely updating and integrity of data.

[0089] Data quality problem: The application results of a knowledge graph are crucially dependent on its data sources and quality. Many financial data have complexity and noise, which leads to the need for a lot of manpower and material resources to clean and label data. In addition, many financial data are unstructured, such as text, pictures, and voice, etc., which increases the complexity and difficulty of data processing.

[0090] To solve the above technical problems, the present application provides a data processing method based on a knowledge graph, including the following steps:

[0091] Figure 1 is an optional flowchart of the data processing method based on a knowledge graph provided by the embodiments of the present application, Figure 1 The method in can include but is not limited to including steps S101 to S107.

[0092] Step S101, obtaining triple information of a knowledge graph and question information;

[0093] It should be noted that the triple information includes graph entity information and relationship information in the knowledge graph.

[0094] In step S101 of some embodiments, the triple information of the knowledge graph and the question information are obtained, so as to facilitate subsequent determination of the candidate entity in the question information and the jump type.

[0095] It should be noted that the triple information in the knowledge graph includes a head entity, a relationship, and a tail entity, represented as (h, r, t), where h is the head entity, r is the relationship, and t is the tail entity, and the relationship has directionality. For example, in the financial scenario, the triple information can be a transaction triple, a risk control triple, a representation triple, and the like.

[0096] Among them, the transaction triple includes the buyer, the seller, and the transaction amount. These information records the buyer and seller and the transaction amount, which is the most basic triple information in the financial transaction process.

[0097] Risk control triple: including customer information, risk assessment, and credit status related information. These information can be used for risk assessment to ensure the financial safety of financial institutions and the interests of customers.

[0098] Representation triple: specifying value, type, and attribute. These information may involve specific financial instruments or securities, which are very important when analyzing the value of the underlying asset. For example, the representation triple information of a bond usually includes face value, maturity date, and issuer.

[0099] It is worth noting that the question and answer of the knowledge graph involves obtaining answers from the graph, and the general knowledge graph data is stored in a graph database. The query of the graph database uses SPARQL statements, which have a syntax similar to the general database query statement SQL. Therefore, the implementation of the knowledge graph question and answer can be converted into generating a SPARQL query statement according to the question, and then querying in the graph to obtain the answer.

[0100] In step S102, the question information is character segmented to obtain multiple character granularity information;

[0101] In step S102 of some embodiments, before obtaining the jump type corresponding to the question information, the question information needs to be character segmented to obtain multiple character granularity information, so as to facilitate subsequent recognition of the first language model and improve the accuracy of determining the jump type. For example, the question information is "How do I buy endowment insurance?", which is segmented into three character granularity information: "I", "how to buy", and "endowment insurance".

[0102] In step S103, the triple information and the character granularity information are input into a preset first language model for jump determination to obtain the jump type corresponding to the question information.

[0103] It should be noted that the first language model is a BERT model.

[0104] In step S103 of some embodiments, the triplet information and the character granularity information are input into a preset first language model for jump judgment, so as to obtain a jump type corresponding to the question information, facilitating subsequent determination of a target query statement corresponding to the question information.

[0105] In step S104, the character granularity information is input into a preset second language model for entity recognition, so as to obtain entity information in the question information.

[0106] It should be noted that the second language model adopts a model structure of BERT, BiLSTM, attention model (also referred to as AttentionModel) and CRF.

[0107] In step S104 of some embodiments, the character granularity information is input into a preset second language model for entity recognition, so as to obtain a classification result of each character granularity information in the question information, thereby obtaining all entity-involved expressions in the question information.

[0108] In step S105, the entity information is mapped based on a preset entity link and graph entity information, so as to obtain a plurality of candidate entities.

[0109] In step S105 of some embodiments, the entity information is mapped based on a preset entity link and graph entity information, so as to obtain a plurality of candidate entities, thereby avoiding the problem of missing entity information. In the present embodiment, the mapping is performed in a manner of synonym table combined with semantic recall, so as to ensure the accuracy of the link and improve the recall rate of the entity.

[0110] In step S106, the candidate entities are relationally sorted according to the first language model and the relation information, so as to obtain candidate relations corresponding to the candidate entities.

[0111] In step S106 of some embodiments, the candidate entities are relationally sorted according to the first language model and the relation information, so as to obtain candidate relations corresponding to the candidate entities, thereby being able to combine the context of the question information, combine the question information and the candidate entities and perform relational sorting, and improve the accuracy of determining the candidate relations.

[0112] In step S107, a target query statement corresponding to the question information is determined according to the jump type, the candidate entities and the candidate relations.

[0113] In step S107 of some embodiments, a target query statement corresponding to the question information is determined according to the jump type, the candidate entities and the candidate relations, so as to be able to sort the query statements composed of all the candidate entities and the candidate relations under the current jump type, and select the query statement with the highest probability as the target query statement, thereby being able to expand the application field of the knowledge graph and improve the processing accuracy for various questions.

[0114] It can be understood that, taking the financial scenario as an example, the jump type can be information of a financial company that the user is searching for, a page link of a stock exchange, a financial product training link, and the like, the candidate entity can be a bank, an insurance company, a fund, a futures, and the like, and the candidate relationship can be storage, deposit, loan, and the like, and the embodiment is not specifically limited.

[0115] The steps S101 to S107 shown in the embodiment of the application first acquire the triple information of the knowledge graph and the question information to be answered, perform character segmentation on the question information, so as to obtain a plurality of character granularity information, which facilitates subsequent judgment on the type of the question information, then input the triple information and the character granularity information into the first language model to perform jump judgment, so as to obtain the jump type corresponding to the question information, and input the character granularity information into the second language model to perform entity recognition, so as to obtain the entity information in the question information, thereby being able to improve the accuracy of entity recognition in the question information and improve the accuracy of question processing, and then map the entity information based on entity connection and graph entity information, so as to obtain a plurality of candidate entities, thereby improving the accuracy of the reply to the question information and being able to improve the ability to process complex questions, and finally determine the target query statement corresponding to the question information according to the jump type, the candidate entity, and the candidate relationship, so as to improve the types of covered questions and expand the application field of the knowledge graph.

[0116] It should be noted that, after step S107, the data processing method based on the knowledge graph further includes querying in the database of the knowledge graph according to the target query statement to obtain an answer corresponding to the question information, so as to realize the reply to the complex question.

[0117] Please refer to Figure 2 In some embodiments, step S103 can include but is not limited to steps S201 to S206:

[0118] It should be noted that the first language model includes a linear layer and a full connection layer.

[0119] Step S201, performing annotation processing on the character granularity information to obtain a head vector and a tail vector;

[0120] In step S201 of some embodiments, annotation processing is performed on the character granularity information to obtain a head vector and a tail vector, so that the first language model can identify the beginning and the end of the question information, wherein [CLS] represents the beginning of the question information and [SEP] represents the end of the question information.

[0121] Step S202, generating a graph jump type according to the triple information;

[0122] It should be noted that the atlas jump type is obtained by querying the knowledge graph according to the input question, classifying the query result, and classifying the query result.

[0123] In step S202 of some embodiments, the atlas jump type in the triple information is determined, wherein the atlas jump type is obtained by inputting a large number of questions into the knowledge graph to obtain query results corresponding to each question, and classifying the query results, thereby facilitating subsequent determination of the jump type in the question information.

[0124] In step S203, the character granularity information is input into a preset first language model for encoding calculation to obtain character vector information of the question information, and the character vector information corresponding to the first vector is taken as a sentence vector.

[0125] In step S203 of some embodiments, the character granularity information is input into a preset first language model for encoding calculation, and each character granularity information is mapped to a corresponding word vector, thereby obtaining character vector information h i ∈R d of the question information, and the character vector information corresponding to the first vector is taken as a sentence vector h1.

[0126] It should be noted that h i ∈R d , R represents a real number, d represents a vector dimension, and h i is a d-dimensional real number vector.

[0127] In step S204, the sentence vector is input into a linear layer for dimension conversion to output a target dimension vector.

[0128] In step S204 of some embodiments, the sentence vector is input into a linear layer for dimension conversion to output a target dimension vector, so that the sentence vector can be converted from a high-dimensional vector to a low-dimensional vector, wherein the specific formula (1) is as follows:

[0129]

[0130] It should be noted that W is an lxd-dimensional real number matrix, b is an l-dimensional real number vector, h is a sentence vector, and l=5 in the present embodiment.

[0131] In step S205, the target dimension vector and the atlas jump type are input into a fully connected layer for probability calculation to output probability information.

[0132] It should be noted that the probability information is used to represent the probability that the question information belongs to the atlas jump type.

[0133] In step S205 of some embodiments, the target dimension vector and the atlas jump type are input into a full connection layer for probability calculation, and probability information is output, wherein the specific calculation process is shown in formula (2):

[0134]

[0135] wherein p i represents the probability that the problem information belongs to the i-th jump type of the atlas jump type, and e is the atlas jump type.

[0136] In step S206, the first language model is trained according to the probability information, and the problem information is input into the trained first language model to obtain the jump type.

[0137] In step S206 of some embodiments, the probability information and the problem information are input into the first language model for training to obtain a trained first language model, and the jump type corresponding to the problem information is determined according to the trained first language model, wherein the specific process of training the first language model according to the probability information is shown in formula (3):

[0138]

[0139] It should be noted that N is the total amount of data, represents whether the o-th data belongs to the j-th jump type, wherein 1 means belonging, and 0 means not belonging, represents the probability that the i-th data belongs to the j-th jump type.

[0140] It should be noted that the initial weight of the first language model uses an open source result, and the remaining weights are randomly initialized. The weight of the optimal model is obtained by solving through a gradient descent algorithm, which is not specifically limited in the present embodiment.

[0141] Please refer to Figure 3 In some embodiments, step S104 can include but is not limited to steps S301 to S305:

[0142] It should be noted that the second language model includes a text encoder, a bidirectional long short-term memory network model, and a conditional random field model.

[0143] In step S301, the character granularity information is input into the text encoder for character mapping, and a first word vector is output;

[0144] In step S301 of some embodiments, the character granularity information is input into the text encoder for character mapping, so that the text encoder maps each character granularity information in the problem information into a word vector, and the word vector is input into a multi-layer neural network for calculation to obtain a first word vector, which is convenient for subsequent determination of entity information of the problem information.

[0145] In step S302, the first word vector is input into the bidirectional long short-term memory network model for calculation to obtain a plurality of second word vectors.

[0146] In step S302 of some embodiments, the first word vector is input into the bidirectional long short-term memory network model for calculation to obtain a plurality of second word vectors, which facilitates subsequent determination of entity information of the question information.

[0147] In step S303, attention calculation is performed on the second word vector to obtain an attention vector corresponding to the character granularity information.

[0148] In step S303 of some embodiments, attention calculation is performed on the second word vector to obtain an attention vector corresponding to the character granularity information. In the process of attention calculation on the second word vector, similarity calculation, weight conversion, and weighted average operations are required to obtain the attention vector corresponding to the character granularity information.

[0149] In step S304, the attention vector is input into a conditional random field model for category identification to obtain category information corresponding to the character granularity information.

[0150] In step S304 of some embodiments, the attention vector is input into a conditional random field model for category identification to obtain category information corresponding to the character granularity information. The specific calculation process is shown in the following formula (8):

[0151]

[0152] It should be noted that P∈R n×m is the attention vector, A∈R (+2)×(+2) is the model parameter, y={y1,…,y n}, y i =1,…,m represents the category corresponding to each character granularity information.

[0153] In step S305, based on a preset category sequence and a sequence formula, category information is classified and calculated to obtain all entity information in the question information.

[0154] In step S304 of some embodiments, based on a preset category sequence and a sequence formula, category information is classified and calculated to obtain all entity information in the question information, so that the expression of all entities involved in the question information can be obtained, and the accuracy of answering the question information is improved.

[0155] It should be noted that the category sequence is obtained from the correct category sequence marked by humans, and the sequence formula is shown in the following formula (9):

[0156]

[0157] It can be understood that p(y|X) represents the probability that the class sequence of the i-th data is equal to y, y X For all possible class sequences, based on the preset class sequence and the sequence formula, the class information is classified and calculated as shown in the following formula (10):

[0158]

[0159] It should be noted that the initial weight of BERT uses an open source result, and the remaining model parameters are randomly initialized. Through the gradient descent algorithm, the optimal model parameters are obtained. After the model training is completed, the optimal sequence can be obtained according to the following formula (11), that is, the final classification result of each character granularity information, and the expression of all entities involved in the question can be obtained:

[0160]

[0161] Please refer to Figure 4 In some embodiments, step S303 can include but is not limited to steps S401 to S404:

[0162] Step S401, for any two second word vectors, similarity calculation is performed on the second word vectors to obtain similarity information;

[0163] In step S401 of some embodiments, for any two second word vectors, similarity calculation is performed on the second word vectors to obtain similarity information s ij , and the specific process is shown in the following formula (4):

[0164]

[0165] It should be noted that h i , h j are any two second word vectors, W a ∈R is a model parameter, h i is the second word vector of the i-th character, and h j is the second word vector of the j-th character.

[0166] Step S402, weight conversion is performed on the similarity information to obtain weight information;

[0167] In step S402 of some embodiments, weight conversion is performed on the similarity information obtained in step S401 to obtain weight information a ij , wherein the weight information is a value in the interval of 0 to 1, and the specific process is shown in the following formula (5):

[0168]

[0169] It should be noted that s ij is the second word vector h i and the weight information of h j . ik is the second word vector h i and the weight information of h k .

[0170] Step S403, according to the second word vector and the weight information, an average calculation is performed to obtain a weighted average value corresponding to the second word vector;

[0171] In step S403 of some embodiments, according to the second word vector and the weight information, a weighted average calculation is performed to obtain a weighted average value g i , wherein the specific calculation process is shown in the following formula (6):

[0172]

[0173] Step S404, based on the preset model parameters, the second word vector and the weighted average value are vector spliced to obtain an attention vector.

[0174] In step S404 of some embodiments, based on the preset model parameters, the second word vector and the weighted average value are vector spliced to obtain an attention vector, wherein the specific calculation process is shown in the following formula (7):

[0175] p i = tanh(W g [g i , h i ]) (7)

[0176] It should be noted that [g i , h i ] represents the spliced vector of g i and h i , W g ∈R m×d is the model parameter, m is the number of categories, and d is the number of characters.

[0177] It can be understood that the second language model input is a character granularity problem, and the output is a character granularity classification result. There are a total of 7 categories of results: "O", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC". Among them, O represents non-entity, B represents the first word of the entity, I represents the middle word of the entity, PER refers to the name, ORG refers to the organization, LOC refers to the location, and m=7 in this embodiment.

[0178] Please refer to Figure 5In some embodiments, step S105 can further include, but is not limited to, steps S501-S508:

[0179] It should be noted that the entity linking includes a synonym table, and the synonym table is used to map the entity information to an entity in the knowledge graph.

[0180] Step S501, mapping the entity information to the graph entity information based on the synonym table to obtain a mapping result;

[0181] Step S502, performing semantic recall on the mapping result to obtain a plurality of first entities;

[0182] Step S503, inputting the entity information into a text encoder for calculation to obtain an entity sentence vector corresponding to the entity information;

[0183] Step S504, performing similarity calculation on the entity sentence vector and the first entity based on a preset first threshold to obtain a plurality of second entities;

[0184] Step S505, splicing the second entity and the question information to obtain a first spliced text;

[0185] Step S506, inputting the first spliced text into a first language model for calculation to obtain a plurality of entity matching probabilities;

[0186] It should be noted that the entity matching probability is used to represent the matching condition of the second entity and the question information.

[0187] Step S507, performing probability sorting on all second entities according to the entity matching probability to obtain an entity probability sequence;

[0188] Step S508, filtering the entity probability sequence based on a preset second threshold to obtain a plurality of candidate entities.

[0189] In steps S501 to S508 of some embodiments, first, the entity information is mapped to the graph entity information based on the synonym table to obtain a mapping result, and then the mapping result is subjected to semantic recall to obtain a plurality of first entities, thereby maintaining the mapping relationship between the entity information and the graph entity information, accurately determining the entity information corresponding to the question information, and then inputting the entity information into the text encoder for calculation to obtain an entity sentence vector corresponding to the entity information, thereby avoiding the problem of missing entity information. Based on the preset first threshold, the similarity of the entity sentence vector and the first entity is calculated, and screening is performed to obtain a plurality of second entities, and then the second entities and the question information are spliced to obtain a first spliced text, and the first spliced text is input into the first language model for calculation. After linear layer and full connection layer calculation, a plurality of entity matching probabilities are obtained, so that the matching of the second entities and the question information can be obtained. Finally, according to the entity matching probability, all the second entities are subjected to probability sorting to obtain an entity probability sequence, which is convenient for screening to obtain candidate entities, and then the entity probability sequence is screened based on the preset second threshold to obtain a plurality of candidate entities, so that the entity link in the question information can be determined.

[0190] It should be noted that in the present embodiment, the synonym table and the semantic recall are combined to determine the candidate entities. The synonym table can be constructed according to domain knowledge and professional terms. For example, the synonym table can include synonyms such as "loan", "credit", and "redeem". The synonym table can maintain the mapping relationship between the entity information and the graph entity information. The first entity is an entity included in the graph entity information. For entity information not included in the graph entity information, the semantic recall method is used to map the relationship, that is, the entity information is input into the text encoder for calculation, and then the first threshold is used for screening to obtain the second entity not included in the knowledge graph.

[0191] It can be understood that the first threshold and the second threshold can be set by the user as needed, and the present embodiment does not make specific limitations.

[0192] It should be noted that in the process of calculating the similarity of the entity sentence vector and the first entity based on the preset first threshold, the similarity between each vector in the entity sentence vector and the graph entity information needs to be calculated, thereby avoiding the problem of missing entity information.

[0193] Please refer to Figure 6 In some embodiments, step S106 includes but is not limited to steps S601 to S604:

[0194] Step S601, splicing the candidate entity, the relationship information and the question information to obtain a plurality of second spliced texts;

[0195] Step S602, input the second spliced text into the first language model for calculation to obtain a plurality of relationship matching probabilities;

[0196] It should be noted that the relationship matching probability is used to represent the matching condition of the question information and the relationship information.

[0197] Step S603, according to the relationship matching probability, the relationship information is probabilistically sorted to obtain a relationship probability sequence;

[0198] Step S604, based on the third preset threshold, the relationship probability sequence is screened to obtain the candidate relationship corresponding to the candidate entity.

[0199] In steps S601 to S604 of some embodiments, first, the candidate entity, the relationship information and the question information are spliced to obtain a plurality of second spliced texts, and then the second spliced texts are input into the first language model for calculation, and a plurality of relationship matching probabilities corresponding to the candidate entity are obtained through the calculation of the linear layer and the full connection layer, so as to facilitate the subsequent screening of the candidate relationship. Then, according to the relationship matching probability, the relationship information is probabilistically sorted to obtain a relationship probability sequence, so as to obtain the matching probability of the question information and the relationship information. Finally, based on the third preset threshold, the relationship probability sequence is screened to obtain the candidate relationship corresponding to the candidate entity.

[0200] It should be noted that in the structure of the knowledge graph, each entity has one or more relationships, but only a part of the entities are related to the question information, so it is necessary to sort the relationships and screen the corresponding candidate relationship. For example, in the financial scenario, there are the following entities and relationship categories:

[0201] Financial entity: The financial entity includes banks, insurance companies, stock exchanges, fund companies, etc. These entities play an important role in the financial market and have their own attributes and characteristics.

[0202] Financial statements: Financial statements are important public information of enterprises, including balance sheets, profit and loss statements, cash flow statements, etc. Analyzing these statements helps to assess the health of the enterprise and the potential for future development.

[0203] Investment products: Investment products include stocks, bonds, funds, futures, foreign exchange, etc. These products provide different levels of risk and return, and can meet the different needs of investors.

[0204] Entity relationship: In the financial scenario, there are various relationships between a large number of entities. For example, there are deposit, loan, etc. between the bank and the customer; there are equity, debt, etc. between the enterprise and the investor; there are listing, delisting, etc. between the stock exchange and the listed company.

[0205] It can be understood that the third threshold value can be set by the user as needed, and the embodiment is not specifically limited.

[0206] Referring to Figure 7 In some embodiments, step S107 includes but is not limited to steps S701 to S705:

[0207] Step S701, generating a plurality of query statements according to the jump type, the candidate entity and the candidate relationship;

[0208] Step S702, splicing the query statement and the question information to obtain a third spliced text;

[0209] Step S703, inputting the third spliced text into the first language model to calculate a plurality of query matching probabilities;

[0210] It should be noted that the query matching probability is used to represent the matching of the question information and the query statement.

[0211] Step S704, sorting the query statements according to the query matching probability to obtain a query probability sequence;

[0212] Step S705, determining a target query statement according to the query probability sequence.

[0213] In steps S701 to S705 of some embodiments, a plurality of query statements are first generated according to the jump type, the candidate entity and the candidate relationship, but due to the diversity of the jump type, the candidate entity and the candidate relationship, the plurality of query statements cannot accurately determine the corresponding relationship between the jump type and the candidate entity or the candidate relationship. Therefore, the query statement needs to be spliced with the question information to obtain a third spliced text, so as to facilitate subsequent judgment of the target query statement corresponding to the question information. Then, the third spliced text is input into the first language model for calculation, and a plurality of query matching probabilities are obtained through the calculation of the linear layer and the full connection layer. Then, the query statements are sorted according to the query matching probability to obtain a query probability sequence. Finally, the query statement with the highest probability in the query probability sequence is selected as the target query statement, thereby improving the query accuracy of the question information in different fields.

[0214] Referring to Figure 8 The embodiment of the application also provides a data processing device based on a knowledge graph, which can implement the above-mentioned data processing method based on the knowledge graph. The device comprises:

[0215] The information acquisition module 801 is configured to acquire triple information of the knowledge graph and question information, wherein the triple information comprises graph entity information and relationship information in the knowledge graph.

[0216] The character segmentation module 802 is configured to perform character segmentation on the question information to obtain a plurality of character granularity information.

[0217] The jump determination module 803 is configured to input the triple information and the character granularity information into a preset first language model to perform jump determination, and obtain a jump type corresponding to the question information.

[0218] The entity recognition module 804 is configured to input the character granularity information into a preset second language model to perform entity recognition, and obtain entity information in the question information.

[0219] The entity mapping module 805 is configured to map the entity information based on a preset entity link and graph entity information to obtain a plurality of candidate entities.

[0220] The relationship determination module 806 is configured to perform relationship sorting on the candidate entities according to the first language model and relationship information, and obtain a candidate relationship corresponding to the candidate entities.

[0221] The target determination module 807 is configured to determine a target query statement corresponding to the question information according to the jump type, the candidate entities, and the candidate relationship.

[0222] The specific implementation of the data processing apparatus based on the knowledge graph is basically the same as the specific embodiments of the data processing method based on the knowledge graph described above, and will not be repeated here.

[0223] The embodiments of the present application also provide an electronic device, which includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing the connection and communication between the processor and the memory. The program is executed by the processor to realize the data processing method based on the knowledge graph. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.

[0224] Please refer to Figure 9 , Figure 9 The hardware structure of the electronic device of another embodiment is illustrated, which includes:

[0225] The processor 901 can be implemented in a general-purpose CPU (Central Processing Unit), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute related programs to realize the technical solutions provided by the embodiments of the present application.

[0226] The memory 902 can be implemented in the form of a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM), etc. The memory 902 can store an operating system and other application programs. When the technical solutions provided by the embodiments of the present specification are implemented by software or firmware, the related program codes are stored in the memory 902 and are called and executed by the processor 901 to implement the knowledge graph-based data processing method according to the embodiments of the present application.

[0227] The input / output interface 903 is configured to realize information input and output.

[0228] The communication interface 904 is configured to realize the communication interaction between the device and other devices. The communication can be realized by a wired manner (for example, a USB, a network cable, etc.) or a wireless manner (for example, a mobile network, WIFI, Bluetooth, etc.).

[0229] The bus 905 is configured to transmit information between various components (for example, the processor 901, the memory 902, the input / output interface 903, and the communication interface 904) of the device.

[0230] The processor 901, the memory 902, the input / output interface 903, and the communication interface 904 are connected to each other through the bus 905 to realize the communication connection between the device.

[0231] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the above-mentioned knowledge graph-based data processing method.

[0232] The memory is a non-transitory computer readable storage medium, which can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory can include a high-speed random access memory and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory remotely arranged relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0233] The method, device, and electronic device provided by the embodiments of the present application are based on a knowledge graph, and the method comprises the following steps: obtaining triad information of the knowledge graph and question information to be answered, performing character segmentation on the question information to obtain a plurality of character granularity information, facilitating subsequent judgment of the type of the question information; inputting the triad information and the character granularity information into a first language model to perform jump judgment, thereby obtaining a jump type corresponding to the question information; inputting the character granularity information into a second language model to perform entity recognition, thereby obtaining entity information in the question information, improving the accuracy of entity recognition in the question information and the accuracy of question processing; mapping the entity information based on entity connection and graph entity information to obtain a plurality of candidate entities, thereby improving the accuracy of the reply to the question information and the ability to process complex questions; and finally, determining a target query statement corresponding to the question information according to the jump type, the candidate entities, and candidate relationships, thereby improving the types of covered questions and expanding the application field of the knowledge graph.

[0234] The embodiments described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

[0235] Those skilled in the art can understand that, Figures 1-7 The technical solutions shown in the foregoing embodiments do not constitute a limitation on the embodiments of the present application, and can include more or fewer steps than those shown in the drawings, or combine certain steps or different steps.

[0236] The device embodiments described above are only schematic, and the units described as separate components can or can not be physically separate, that is, can be located in one place or distributed on a plurality of network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0237] Those skilled in the art can understand that all or some of the steps in the method disclosed above, the function modules / units in the system and the device can be implemented as software, firmware, hardware, and appropriate combinations thereof.

[0238] The terms "first", "second", "third", "fourth", and the like in the description and in the claims of this application, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of the terms so termed is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of orderly or chronological mundane operation, reverse order operation, based on circuitry availability, based on stated preference or the like, and that "default" or other orderings are thus permissible. Further, the terms "comprise", "comprising", "include", "including", and the like, are specifically intended to be open-ended. That is, references to individual steps and the like do not suhstantially exclude the presence of two or more of a recited step or its integral sub-steps or additional steps whether or not readily ascertainable from the description or the like. Further, the words "a" or "an", as used herein in the disclosure and elsewhere, are used indiscriminately and are to be interpreted in the same way, i.e. as meaning "one or more".

[0239] It should be understood that, in this application, "at least one" means one or more, "multiple" means two or more. "And / or" is used to describe the relationship between associated objects, which means that there can be three relationships, for example, "A and / or B" can mean that there are only A, only B, and A and B at the same time. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or the like means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c can mean a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0240] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the above-mentioned units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be omitted or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed objects can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0241] The units described above as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e. they can be located in one place or distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0242] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.

[0243] If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in part, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes multiple instructions used to cause a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various other media that can store programs.

[0244] The preferred embodiments of the embodiments of the present application are described above with reference to the accompanying drawings, and are not limited to the scope of the embodiments of the present application. Any modifications, equivalent replacements and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of the embodiments of the present application.

Claims

1. A knowledge graph-based data processing method, characterized in that, The method comprises: acquiring triple information of the knowledge graph and question information, wherein the triple information comprises graph entity information and relationship information in the knowledge graph; performing character segmentation on the question information to obtain multiple character granularity information; inputting the triple information and the character granularity information into a preset first language model to perform jump judgment, to obtain a jump type corresponding to the question information; inputting the character granularity information into a preset second language model to perform entity recognition, to obtain entity information in the question information; mapping the entity information based on a preset entity link and the graph entity information, to obtain multiple candidate entities; performing relationship sorting on the candidate entities based on the first language model and the relationship information, to obtain a candidate relationship corresponding to the candidate entities; determining a target query statement corresponding to the question information according to the jump type, the candidate entities, and the candidate relationship; wherein the first language model comprises a linear layer and a full connection layer; the inputting of the triple information and the character granularity information into the preset first language model to perform jump judgment, to obtain a jump type corresponding to the question information, comprises: performing label processing on the character granularity information to obtain a head vector and a tail vector; generating a graph jump type according to the triple information, wherein the graph jump type is obtained by querying the knowledge graph based on an input question, classifying a query result, and classifying the query result; inputting the character granularity information into the preset first language model to perform encoding calculation, to obtain character vector information of the question information, and taking character vector information corresponding to the head vector as a sentence vector; inputting the sentence vector into the linear layer to perform dimension conversion, to output a target dimension vector; inputting the target dimension vector and the graph jump type into the full connection layer to perform probability calculation, to output probability information, wherein the probability information is used to represent a probability that the question information belongs to the graph jump type; training the first language model according to the probability information, and inputting the question information into the trained first language model to obtain a jump type; the second language model comprises a text encoder, a bidirectional long short-term memory network model, and a conditional random field model; the inputting of the character granularity information into the preset second language model to perform entity recognition, to obtain entity information in the question information, comprises: inputting the character granularity information into the text encoder to perform character mapping, to output a first word vector; inputting the first word vector into the bidirectional long short-term memory network model to perform calculation, to obtain multiple second word vectors; performing attention calculation on the second word vectors, to obtain an attention vector corresponding to the character granularity information; inputting the attention vector into the conditional random field model to perform category identification, to obtain category information corresponding to the character granularity information; performing classification calculation on the category information based on a preset category sequence and a sequence formula, to obtain all entity information in the question information. 2.The knowledge graph based data processing method of claim 1, wherein, The attention calculation on the second word vector obtains an attention vector corresponding to the question information, and the attention calculation on the second word vector comprises: For any two second word vectors, similarity calculation is performed on the second word vectors to obtain similarity information; The weight conversion is performed on the similarity information to obtain weight information; According to the second word vector and the weight information, an average calculation is performed to obtain a weighted average value corresponding to the second word vector; Based on the preset model parameters, the second word vector and the weighted average value are spliced to obtain the attention vector. 3.The knowledge graph based data processing method of claim 1, wherein, The entity linking includes a synonym table; the entity information is mapped based on the preset entity linking and the graph entity information to obtain a plurality of candidate entities, and the mapping comprises: The entity information is mapped to the graph entity information based on the synonym table to obtain a mapping result; The mapping result is subjected to semantic recall to obtain a plurality of first entities; The entity information is input into the text encoder for calculation to obtain an entity sentence vector corresponding to the entity information; Based on a preset first threshold, similarity calculation is performed on the entity sentence vector and the first entity to obtain a plurality of second entities; The second entity and the question information are spliced to obtain a first spliced text; The first spliced text is input into the first language model for calculation to obtain a plurality of entity matching probabilities, wherein the entity matching probability is used to represent the matching condition of the second entity and the question information; According to the entity matching probability, all the second entities are subjected to probability sorting to obtain an entity probability sequence; Based on a preset second threshold, the entity probability sequence is filtered to obtain a plurality of candidate entities. 4.The knowledge graph based data processing method of claim 1, wherein, The candidate entities are subjected to relationship sorting based on the first language model and the relationship information to obtain a candidate relationship corresponding to the candidate entity, and the relationship sorting comprises: The candidate entity, the relationship information and the question information are spliced to obtain a plurality of second spliced texts; The second spliced text is input into the first language model for calculation to obtain a plurality of relationship matching probabilities, wherein the relationship matching probability is used to represent the matching condition of the question information and the relationship information; According to the relationship matching probability, the relationship information is subjected to probability sorting to obtain a relationship probability sequence; Based on a preset third threshold, the relationship probability sequence is filtered to obtain a candidate relationship corresponding to the candidate entity. 5.The knowledge graph based data processing method of claim 1, wherein, The target query statement corresponding to the question information is determined according to the jump type, the candidate entity and the candidate relationship, and the determination comprises: A plurality of query statements are generated according to the jump type, the candidate entity and the candidate relationship; The query statement and the question information are spliced to obtain a third spliced text; The third spliced text is input into the first language model for calculation to obtain a plurality of query matching probabilities, wherein the query matching probability is used to represent the matching condition of the question information and the query statement; According to the query matching probability, the query statement is sorted to obtain a query probability sequence; Determine the target query statement according to the query probability sequence. 6.A data processing apparatus based on a knowledge graph, characterized in that, The device comprises: An information acquisition module is configured to acquire triple information of the knowledge graph and question information, wherein the triple information comprises graph entity information and relationship information in the knowledge graph; A character segmentation module is configured to perform character segmentation on the question information to obtain character granularity information; A jump determination module is configured to input the triple information and the character granularity information into a preset first language model to determine a jump type corresponding to the question information; An entity recognition module is configured to input the character granularity information into a preset second language model to recognize entity information in the question information; An entity mapping module is configured to map the entity information based on preset entity linking and the graph entity information to obtain candidate entities; A relationship determination module is configured to sort the candidate entities based on the first language model and the relationship information to obtain candidate relationships corresponding to the candidate entities; A target determination module is configured to determine a target query statement corresponding to the question information based on the jump type, the candidate entities, and the candidate relationships. The first language model comprises a linear layer and a full connection layer; the inputting of the triple information and the character granularity information into the preset first language model to determine the jump type corresponding to the question information comprises: Performing annotation processing on the character granularity information to obtain a head vector and a tail vector; Generating a graph jump type based on the triple information, wherein the graph jump type is obtained by querying an input question based on the knowledge graph, classifying the query result, and classifying the query result; Inputting the character granularity information into the preset first language model to perform encoding calculation to obtain character vector information of the question information, and taking character vector information corresponding to the head vector as a sentence vector; Inputting the sentence vector into the linear layer to perform dimension conversion and output a target dimension vector; Inputting the target dimension vector and the graph jump type into the full connection layer to perform probability calculation and output probability information, wherein the probability information is used to represent a probability that the question information belongs to the graph jump type; Training the first language model based on the probability information, and inputting the question information into the trained first language model to obtain a jump type; The second language model comprises a text encoder, a bidirectional long short-term memory network model, and a conditional random field model; the inputting of the character granularity information into the preset second language model to recognize the entity information in the question information comprises: Inputting the character granularity information into the text encoder to perform character mapping and output a first word vector; Inputting the first word vector into the bidirectional long short-term memory network model to perform calculation and obtain a plurality of second word vectors; Performing attention calculation on the second word vectors to obtain an attention vector corresponding to the character granularity information; Input the attention vector into the conditional random field model to perform category identification, to obtain category information corresponding to the character granularity information; Based on a preset category sequence and a sequence formula, the category information is classified and calculated to obtain all entity information in the question information.

7. An electronic device, comprising: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the knowledge graph-based data processing method of any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium storing a computer program, the computer-readable storage medium comprising: The computer program is executed by the processor to implement the knowledge graph-based data processing method of any one of claims 1 to 5. The computer program is executed by the processor to implement the knowledge graph-based data processing method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Question answering method, question answering device, computer equipment and storage medium

    CN110502621A

  • Knowledge graph question-answering method and system based on entity relationship disambiguation, and terminal

    CN111259653A