CN113268563B - Semantic recall method, device, equipment and medium based on graph neural network - Google Patents

Semantic recall method, device, equipment and medium based on graph neural network Download PDF

Info

Publication number
CN113268563B
CN113268563B CN202110566914.4A CN202110566914A CN113268563B CN 113268563 B CN113268563 B CN 113268563B CN 202110566914 A CN202110566914 A CN 202110566914A CN 113268563 B CN113268563 B CN 113268563B
Authority
CN
China
Prior art keywords
standard
information
question
neighbor
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110566914.4A
Other languages
Chinese (zh)
Other versions
CN113268563A (en
Inventor
陆林炳
刘志慧
金培根
林加新
李炫�
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202110566914.4A priority Critical patent/CN113268563B/en
Publication of CN113268563A publication Critical patent/CN113268563A/en
Application granted granted Critical
Publication of CN113268563B publication Critical patent/CN113268563B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Software Systems (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a semantic recall method, a semantic recall device, semantic recall equipment and a semantic recall medium based on a graph neural network, which are used in the field of artificial intelligence, relate to the field of block chains and comprise the following steps: the method comprises the steps of obtaining a user question sent by a user through terminal equipment, obtaining a plurality of standard questions according to a target keyword of the user question, constructing the user question, the target keyword and the plurality of standard questions into a first network graph taking the user question as a center in a graph form, obtaining a second network graph taking the standard questions as the center, determining the target similarity of each standard question and the user question according to the first network graph and the second network graph, using the standard question with the maximum target similarity as the standard question corresponding to the user question, and recalling the answer of the user question according to the standard question corresponding to the user question; according to the invention, the information supplement is effectively carried out on the questions, so that the matching accuracy of the user questions is improved, and the accuracy of the answers to the recalled questions is further improved.

Description

Semantic recall method, device, equipment and medium based on graph neural network
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a semantic recall method, a semantic recall device, semantic recall equipment and a semantic recall medium based on a graph neural network.
Background
The question-answering system is a high-level form of an information retrieval system, can understand the natural language of human beings and answer the questions of users through accurate and concise natural language, and is an important application direction of artificial intelligence. When a user proposes a question by using a natural language, the question-answering system identifies the question of the user through the semantic recall model, recalls a standard question matched with the question of the user, and replies a corresponding answer to the user piece according to the standard question.
The traditional deep semantic recall model generally adopts a problem pair form to construct training data, and builds a model based on a twin network mode to obtain the similarity between sentences. When training data is constructed, question-answer records and original question data extracted from an artificial question bank are scattered, and then question pairs of questions A-B are constructed, and structural relations between the questions are lost in the process. When the deep semantic recall model is used for semantic recall in the follow-up process, only the semantic similarity between two input questions is considered, the structural relationship constructed between the questions is lost, and the recall effect of the system on the answer to the question is poor.
Disclosure of Invention
The invention provides a semantic recall method, a semantic recall device, semantic recall equipment and a semantic recall medium based on a graph neural network, which aim to solve the problem that in the existing deep semantic recall model, the recall effect of answer to a problem is poor due to the fact that only semantic similarity between two input problems is considered.
A semantic recall method based on a graph neural network comprises the following steps:
the method comprises the steps of obtaining a user question sent by a user through terminal equipment, and obtaining a plurality of standard questions according to target keywords of the user question, wherein the standard questions are user question templates which are constructed in advance;
constructing the user question, the target keyword and the plurality of standard questions into a first network graph taking the user question as a center in a graph form, wherein the user question in the first network graph establishes a connection relation with each standard question through the target keyword;
acquiring a second network graph centered on the standard problem, wherein the second network graph is constructed by the standard problem and neighbor information of the standard problem in a graph form, the neighbor information comprises first-order neighbor information and second-order neighbor information, the first-order neighbor information is a keyword and a similar problem of the standard problem, the keyword and the similar problem are directly connected with the standard problem, the second-order neighbor information is connected with the standard problem through the first-order neighbor information, and the similar problem of the standard problem is a problem which is constructed in advance according to the standard problem and has similar semantics with the standard problem;
determining a target similarity of each standard question and the user question according to the first network graph and the second network graph;
and taking the standard question pointed by the maximum target similarity as the standard question corresponding to the user question, and recalling the answer of the user question according to the standard question corresponding to the user question.
A graph neural network-based semantic recall apparatus comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a user question sent by a user through terminal equipment and acquiring a plurality of standard questions according to a target keyword of the user question, and the standard questions are user question templates which are constructed in advance;
a building module, configured to build the user question, the target keyword, and the plurality of standard questions into a first network graph with the user question as a center in a graph form, where the user question in the first network graph establishes a connection relationship with each of the standard questions through the target keyword;
a second obtaining module, configured to obtain a second network graph centered on the standard problem, where the second network graph is constructed in a graph form by the standard problem and neighbor information of the standard problem, where the neighbor information includes first-order neighbor information and second-order neighbor information, the first-order neighbor information is a keyword and a similar problem of the standard problem that directly establish a connection relationship with the standard problem, the second-order neighbor information establishes a connection relationship with the standard problem through the first-order neighbor information, and the similar problem of the standard problem is a problem that is constructed in advance according to the standard problem and is similar to the standard problem;
a determining module, configured to determine a target similarity between each standard question and the user question according to the first network graph and the second network graph;
and the recalling module is used for taking the standard question pointed by the maximum target similarity as the standard question corresponding to the user question so as to recall the answer of the user question according to the standard question corresponding to the user question.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the above-described graph neural network-based semantic recall method when executing the computer program.
A computer-readable storage medium, which stores a computer program that, when executed by a processor, implements the steps of the graph neural network-based semantic recall method described above.
In one scheme provided by the semantic recall method, the semantic recall device, the semantic recall equipment and the semantic recall media based on the graph neural network, a user question sent by a user through terminal equipment is obtained, a plurality of standard questions are obtained according to a target keyword of the user question, then the user question, the target keyword and the standard questions are constructed into a first network graph taking the user question as a center in a graph form, a second network graph taking the standard question as a center is obtained, the target similarity of each standard question and the user question is determined according to the first network graph and the second network graph, and finally the standard question with the maximum target similarity is used as the standard question corresponding to the user question so as to recall the answer of the user question according to the standard question corresponding to the user question; the invention provides a semantic recall method of a graph neural network fusing keywords, establishes network connection by using the keywords of user problems and a problem template constructed in advance, can effectively supplement information for the user problems, and also supplements information for standard problems, and has good expansibility, thereby improving the matching accuracy of the user problems and further improving the accuracy of the answers to the recall problems.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a diagram illustrating an application environment of a semantic recall method based on a graph neural network according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating a semantic recall method based on a graph neural network according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating an implementation of step S40 in FIG. 2;
FIG. 4 is a flowchart illustrating an implementation of step S43 in FIG. 3;
FIG. 5 is a flowchart illustrating an implementation of step S433 in FIG. 4;
FIG. 6 is a flowchart illustrating an implementation of step S432 in FIG. 4;
FIG. 7 is a flowchart illustrating an implementation of step S4323 in FIG. 6;
FIG. 8 is a flowchart illustrating an implementation of step S10 in FIG. 2;
FIG. 9 is a schematic structural diagram of a semantic recall device based on a graph neural network according to an embodiment of the present invention;
FIG. 10 is a schematic diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The semantic recall method based on the graph neural network provided by the embodiment of the invention can be applied to the application environment shown in the figure 1, wherein the terminal equipment is communicated with a server through a network. The method comprises the steps that a server acquires user problems sent by a user through terminal equipment, acquires a plurality of standard problems according to target keywords of the user problems, constructs the user problems, the target keywords and the standard problems into a first network graph taking the user problems as a center in a graph form, acquires a second network graph taking the standard problems as the center, determines the target similarity of each standard problem and the user problems according to the first network graph and the second network graph, and finally takes the standard problem pointed by the maximum target similarity as the standard problem corresponding to the user problems so as to recall answers of the user problems according to the standard problems corresponding to the user problems; the network connection is established by using the keywords of the user questions and the pre-established question template, so that the information supplement can be effectively carried out on the user questions, meanwhile, the information supplement is carried out on the standard questions, and the good expansibility is achieved, so that the matching accuracy of the user questions is improved, the accuracy of the answers to the recalled questions is improved, the artificial intelligence of the question-answering system is further improved, and the user experience is improved.
The relevant data such as the standard questions, the second network graph and answers of the questions are stored in a database of the server, and when the answers of the user questions need to be recalled, the relevant data are directly obtained from the database of the server, so that the answer recall efficiency of the user questions is improved.
The database in this embodiment is stored in the blockchain network, and is configured to store data used and generated in the graph neural network-based semantic recall method, such as relevant data of a standard question, a second network graph, and an answer to a question. The block chain referred by the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like. The database is deployed in the blockchain, so that the safety of data storage can be improved.
The terminal device may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers.
In an embodiment, as shown in fig. 2, a graph neural network based semantic recall method is provided, which is described by taking the method as an example applied to the server in fig. 1, and includes the following steps:
s10: the method comprises the steps of obtaining a user question sent by a user through terminal equipment, and obtaining a plurality of standard questions according to a target keyword of the user question.
In the intelligent question-answering system, a server can acquire a user question sent by a user through terminal equipment, then carries out keyword extraction on the user question, determines a target keyword of the user question, and then acquires a plurality of candidate standard questions according to the target keyword of the user question.
The standard questions are pre-constructed user question templates, namely the standard questions are stored in the database, standard expressions corresponding to the pre-constructed user questions are stored in the database, meanwhile, standard question answers corresponding to the standard questions are also stored in the database, and when the server determines the standard questions corresponding to the user questions, the standard question answers can be directly recalled according to the standard questions corresponding to the user questions and fed back to the terminal equipment used by the user. Wherein, the database is a block chain database.
S20: and constructing the user question, the target keyword and the plurality of standard questions into a first network graph centering on the user question in a graph form.
After a user question sent by a user through terminal equipment is obtained, and a plurality of standard questions are obtained according to a target keyword of the user question, the target keyword and the plurality of standard questions are constructed into a first network graph with the user question as a center in a graph mode, wherein the user question in the first network graph establishes a connection relation with each standard question through the target keyword.
In the first network diagram, a user problem, a target keyword and a plurality of standard problems are all nodes, a central node is the user problem, the user problem establishes a connection relation with the standard problems through the target keyword, namely, edges exist between the user problem and the three target keywords, and edges exist between the target keywords and the standard problems; the target keywords are first-order neighbor information of the user problems, namely the target keywords and the user problems directly form a connection relation, each standard problem is second-order neighbor information of the user problems, the standard problems corresponding to the target keywords are first-order neighbor information of the target keywords, namely each standard problem and the user problems form a connection relation by taking the keywords as intermediate nodes. The structural relationship among the user question, the target keyword and the standard question is as follows: user questions-keywords-criteria questions.
For example, the user problems are: if the user wants to put on safety insurance, the target keyword of the user question is safety insurance, and the user question is inquired in the database according to the target keyword, a plurality of candidate standard questions corresponding to the user question are determined as follows: the safety blessing has the advantages of safety blessing, how to put the safety blessing into the safety blessing and safety blessing. Then, the user question, the target keyword and a plurality of standard questions are constructed into a first network graph with the user question as the center in a graph form, and the first-order neighbor information of the user who wants to apply the security is three target keywords: safety insurance, and the first-order neighbor information of the three target keywords has the advantages of safety insurance application, how safety insurance is applied and safety insurance.
S30: a second network graph centered on the criteria problem is obtained.
After a plurality of standard questions are obtained according to the target keywords of the user question, a second network graph centering on the standard questions is obtained. The second network graph is constructed by a standard problem and neighbor information of the standard problem in a graph form, the neighbor information comprises first-order neighbor information and second-order neighbor information, the first-order neighbor information is a keyword and a similar problem of the standard problem, the first-order neighbor information directly establishes a connection relation with the standard problem, the second-order neighbor information establishes a connection relation with the standard problem through the first-order neighbor information, and the second-order neighbor information and the first-order neighbor information have the same phrase. The relationship between the neighbor information of the standard problem and the standard problem is: standard questions-keywords or similar questions of the standard questions-other phrases or other questions.
The similar problem of the standard problem is a problem which is constructed in advance according to the standard problem and has similar semantics with the standard problem.
The method comprises the steps of constructing keywords and similar problems of the standard problems according to the standard problems when the standard problems are constructed in advance, then constructing the standard problems, the keywords and the similar problems of the standard problems into a second network graph in a graph mode, wherein in the second network graph, the central nodes of the standard problems, the keywords and the similar problems of the standard problems are first-order neighbor information of the standard problems, namely the keywords and the similar problems of the standard problems directly form a connection relation with the standard problems, then the key problems corresponding to the keywords of the standard problems directly form a connection relation with the keywords of the standard problems, the similar problems corresponding to the similar problems of the standard problems directly form a connection relation with the similar problems of the standard problems, and the connection relation with the similar problems of the standard problems directly form a connection relation as second-order neighbor information of the standard problems. After the second network problem of the standard problem is generated, the standard problem and the corresponding first network graph are directly stored in the database in a correlated mode, so that the standard problem can be extracted from the database according to the standard problem in the subsequent use process, one thread of the server processes the user problem to obtain the first network graph, the other thread of the server obtains the second network graph corresponding to the standard problem from the database, the calculation amount is saved, and the recall speed is improved.
For example, if the standard question is a security process of peaceful, the keywords of the standard question are peaceful and security processes, and similar problems of the standard question are as follows: in a second network diagram of the safety good insurance, a central node is the safety good insurance, and first-order neighbor information of the safety good insurance is the safety good insurance, the safety good insurance and the safety good insurance; the second-order neighbor information and the first-order neighbor information of the safety insurance have the same phrase, which can be: safety, insurance, how to apply insurance, safety and fortune applying and the like.
In this embodiment, the keywords, the similar questions, and the second-order neighbor information of the standard question are only exemplary illustrations, and in other embodiments, the keywords, the similar questions, and the second-order neighbor information of the standard question may be other, and are not described herein again.
S40: and determining the target similarity of each standard question and the user question according to the first network graph and the second network graph.
After the first network graph and the second network graph are obtained, the target similarity of each standard question and the user question is determined according to the first network graph and the second network graph. The first network diagram and the second network diagram can be used as two input problems, the two input problems are input into a twin network, two vectors with N dimensions are obtained through processing of an Embedding layer (Embedding layer) and an aggregation layer which share parameters, and the similarity between the two vectors with N dimensions is calculated, so that the target similarity between the standard problem and the user problem can be obtained.
S50: and taking the standard question pointed by the maximum target similarity as the standard question corresponding to the user question so as to recall the answer of the user question according to the standard question corresponding to the user question.
And after the target similarity of the user question and each standard question is obtained, determining the standard question corresponding to the user question according to the target similarity of the user question and the standard question. The server selects the standard question with the maximum target similarity as the standard question corresponding to the user question, outputs the standard question, and directly recalls the standard question corresponding to the user question in the database after outputting the standard question corresponding to the user question, and the answer of the corresponding standard question is used as the answer of the user question.
In the embodiment, a user question sent by a user through a terminal device is acquired, a plurality of standard questions are acquired according to a target keyword of the user question, then the user question, the target keyword and the plurality of standard questions are constructed into a first network diagram taking the user question as a center in a graph form, a second network diagram taking the standard question as the center is acquired, the target similarity of each standard question and the user question is determined according to the first network diagram and the second network diagram, and finally the standard question pointed by the maximum target similarity is used as the standard question corresponding to the user question so as to recall the answer of the user question according to the standard question corresponding to the user question; the embodiment of the invention provides a semantic recall method of a graph neural network fusing keywords, and establishes network connection by using the keywords of user problems and a problem template constructed in advance, so that information supplement can be effectively carried out on the user problems, and meanwhile, information supplement is carried out on standard problems, and the semantic recall method has good expansibility, thereby improving the matching accuracy of the user problems and further improving the accuracy of the answers to the recall problems.
In an embodiment, as shown in fig. 3, in step S40, that is, determining the target similarity between each standard question and the user question according to the first network graph and the second network graph, the method specifically includes the following steps:
s41: and inputting the first network graph and the second network graph into the embedding layer to obtain a word vector of each first node in the first network graph and obtain a word vector of each second node in the second network graph.
After the first network graph and the second network graph are obtained, the first network graph and the second network graph are input into the embedding layer to obtain word vectors of all first nodes in the first network graph and obtain word vectors of all second nodes in the second network graph, wherein the first nodes comprise user questions, target keywords and standard questions, and the second nodes comprise standard questions, keywords of the standard questions and similar questions.
For example, user question a may be split into: after the words a1, a2, … and an are processed by the Embedding layer, the word vectors of the user questions are: vector a1, vectors a2, … and vector an, n are the phrase number of the user question A.
S42: and aggregating the first network graph according to the word vector of the first node to obtain a first semantic vector of the first network graph.
After the word vectors of each first node in the first network graph are obtained, the first network graph is subjected to layer-by-layer aggregation according to the word vectors of the first nodes, and a first semantic vector of the first network graph is obtained, wherein the first semantic vector is a vector with a dimension of N.
S43: and aggregating the second network graph according to the word vector of the second node to obtain a second semantic vector of the second network graph.
After the word vectors of each second node in the second network graph are obtained, the second network graph is aggregated layer by layer according to the word vectors of the second nodes, so that a second semantic vector of the second network graph is obtained, and the second semantic vector is also a vector with a dimension of N.
S44: and determining the target similarity of the standard question and the user question according to the first semantic vector and the second semantic vector.
And after the first semantic vector and the second semantic vector are obtained, determining the target similarity of the user problem and the standard problem according to the first semantic vector and the second semantic vector. And calculating cosine similarity (cosine similarity) of the first semantic vector and the second semantic vector, and taking the cosine similarity of the first semantic vector and the second semantic vector as the target similarity of the standard problem and the user problem. And then determining a standard question corresponding to the user question according to the score (score) of the target similarity.
Wherein, score is cosine (embedded _ out _1, embedded _ out _2), embedded _ out _1 is a first semantic vector, and embedded _ out _2 is a second semantic vector.
In this embodiment, the word vectors of each first node in the first network graph and the word vectors of each second node in the second network graph are obtained by inputting the first network graph and the second network graph into the embedding layer, wherein the first node comprises a user question, a target keyword and a standard question, the second node comprises a standard question, a keyword of a standard question and similar questions, aggregating the first network graph according to the word vector of the first node to obtain a first semantic vector of the first network graph, and according to the word vector of second node making aggregation to second network graph to obtain second semantic vector of second network graph, and determining the target similarity between the standard problem and the user problem according to the first semantic vector and the second semantic vector, and performing similarity calculation on the first network diagram and the second network diagram by adopting a twin network mechanism, so that the calculation speed is improved.
In an embodiment, as shown in fig. 4, in step S43, aggregating the second network graph according to the word vector of the second node to obtain a second semantic vector of the second network graph, which specifically includes the following steps:
s431: and aggregating the word vectors of the second nodes in the second network graph to obtain the original aggregation information of the second nodes.
After the word vectors of the second nodes are obtained, the word vectors of the second nodes in the second network graph are aggregated to obtain original aggregation information of the second nodes.
For example, standard problem B can be split into: after the words b1, b2, … and bn are processed by the Embedding layer, the word vectors of the user questions are: vector B1, vector B2, …, vector bn, and then weighted average the vectors of the standard problem, the original aggregate information of standard problem B: the embedded _ B is a reduce _ mean (vector B1, vector B2, …, vector bn), and n is the phrase number of the standard problem B. And the original aggregation information of all nodes can be obtained by analogy.
S432: and carrying out hierarchical aggregation on the neighbor information of the standard problem according to the original aggregation information of the second node to obtain neighbor aggregation information.
After the original aggregation information of the second node is obtained, the neighbor information of the standard problem is hierarchically aggregated according to the original aggregation information of the second node, and the neighbor aggregation information is obtained.
The method comprises the steps that neighbor information of a standard problem is divided into two layers, first-order neighbor information and corresponding second-order neighbors are taken as a whole to conduct second-order neighbor information aggregation to obtain a plurality of second-order neighbor aggregation results, then the second-order neighbor aggregation results are aggregated to obtain neighbor aggregation information of the standard problem, so that neighbor information aggregation steps are simplified, and aggregation efficiency is improved; the first-order neighbor information and the corresponding second-order neighbor are taken as a whole to perform second-order neighbor information aggregation to obtain a plurality of second-order neighbor aggregation results, then the original aggregation information of the first-order neighbor aggregation information is added into the corresponding second-order neighbor aggregation results to perform aggregation to obtain a plurality of first-order neighbor aggregation results, the first-order neighbor information is aggregated to obtain the neighbor aggregation information of the standard problem, and the information amount of the first-order neighbor information of the standard problem is enhanced.
S433: and aggregating the original aggregation information and the neighbor aggregation information of the standard problem to obtain a second semantic vector.
After the neighbor aggregation information of the standard problem is obtained, the original aggregation information and the neighbor aggregation information of the standard problem are aggregated to obtain a second semantic vector.
In this embodiment, the original aggregation information of each second node is obtained by aggregating the word vectors of each second node in the second network graph, the neighbor information of the standard problem is hierarchically aggregated according to the original aggregation information of the second node to obtain neighbor aggregation information, then the original aggregation information of the standard problem and the neighbor aggregation information are aggregated to obtain a second semantic vector, the process of aggregating the second network graph according to the word vectors of the second node to obtain the second semantic vector of the second network graph is refined, a basis is provided for obtaining the second semantic vector, the neighbor information of the standard problem is used as the word vectors to be hierarchically aggregated, and good expansibility of the second semantic vector is ensured.
In an embodiment, as shown in fig. 5, in step S433, aggregating the original aggregation information and the neighbor aggregation information of the standard problem to obtain a second semantic vector, specifically includes the following steps:
s4331: determining a product of original aggregation information of the standard problem and a hyperparameter of the standard problem as a third product;
s4332: determining the product of the neighbor aggregation information and the neighbor information hyper-parameter as a fourth product, wherein the sum of the standard problem hyper-parameter and the neighbor information hyper-parameter is 1;
s4333: and taking the sum of the third product and the fourth product as the neighbor aggregation information.
After acquiring original aggregation information of the standard problem and neighbor aggregation information of the standard problem, determining a product of the original aggregation information of the standard problem and a hyper-parameter of the standard problem as a third product, then determining a product of the neighbor aggregation information and a hyper-parameter of the neighbor information as a fourth product, wherein the sum of the hyper-parameter of the standard problem and the hyper-parameter of the neighbor information is 1, and taking the sum of the third product and the fourth product as the neighbor aggregation information.
Wherein, the calculation formula is:
embed_out=a1*embed_B+a2*embed_B_neigh;
wherein a1 is a standard problem hyper-parameter, a2 is a neighbor information hyper-parameter, which represents the importance of neighbor information, wherein a1 and a2 can be designed as required, and a1+ a2 is 1.
In this embodiment, a process of aggregating the original aggregation information and the neighbor aggregation information of the standard problem to obtain a second semantic vector is defined by determining a product of the original aggregation information of the standard problem and the hyper-parameter of the standard problem as a third product, determining a product of the neighbor aggregation information and the hyper-parameter of the neighbor information as a fourth product, where a sum of the hyper-parameter of the standard problem and the hyper-parameter of the neighbor information is 1, and finally, taking a sum of the third product and the fourth product as the neighbor aggregation information, thereby providing a basis for subsequently determining the multidimensional vector of the standard problem according to the neighbor aggregation information and the aggregation information of the standard problem.
In an embodiment, as shown in fig. 6, in step S432, that is, performing hierarchical aggregation on the neighbor information of the standard problem according to the original aggregation information of the second node, to obtain the neighbor aggregation information, the method specifically includes the following steps:
s4321: and taking the first-order neighbor information and the corresponding second-order neighbor information as aggregation target information, and aggregating the original aggregation information corresponding to the aggregation target information to obtain a plurality of second-order neighbor aggregation information of the standard problem.
In this embodiment, after the original aggregation information of each second node is obtained, the first-order neighbor information and the second-order neighbor information corresponding to the first-order neighbor information are used as aggregation target information, and then the original aggregation information corresponding to the aggregation target information is aggregated to obtain a plurality of second-order neighbor aggregation information of a standard problem, where the number of the second-order neighbor aggregation information is the same as that of the first-order neighbor information.
For example, the first order neighbor information for standard problem B includes: a keyword I of the standard problem B, a similar problem L of the standard problem B and a similar problem K of the standard problem B; the second-order neighbor information of the standard problem B includes: word J of the keyword I,
Taking the node I and the node J as first aggregation target information, and adding and averaging original aggregation information corresponding to the node I and the node J to obtain an aggregation result of the first aggregation target information: the embedded _1 is (embedded _ I + embedded _ J)/2), wherein the embedded _ I is the original aggregation information of the node I, and the embedded _ J is the original aggregation information of the node J; taking the node L and the node M as second aggregation target information, and adding and averaging original aggregation information corresponding to the node L and the node M to obtain an aggregation result embed _2 of the second aggregation target information; taking the node K and the node N as third aggregation target information, adding and averaging original aggregation information corresponding to the node K and the node N to obtain an aggregation result embed _3 of the third aggregation target information, and taking the aggregation result of each aggregation target information as second-order neighbor aggregation information, namely, the second-order neighbor aggregation information with the embed _1, the embed _2 and the embed _3 as standard problems.
S4322: and determining the neighbor information type of the second-order neighbor aggregation information, wherein the neighbor information type comprises keyword neighbor information and similar problem neighbor information.
After obtaining a plurality of second-order neighbor aggregation information of a standard problem, a neighbor information type of the second-order neighbor aggregation information needs to be determined, wherein the neighbor information type includes keyword neighbor information and similar problem neighbor information.
The neighbor information type of the second-order neighbor aggregation information is determined according to the type of the corresponding first-order neighbor information, and if the first-order neighbor information aggregated in the second-order neighbor aggregation information is a keyword, the second-order neighbor aggregation information is keyword neighbor information; and if the first-order neighbor information aggregated in the second-order neighbor aggregation information is similar, the second-order neighbor aggregation information is similar neighbor information.
For example, the first order neighbor information for standard problem B includes: the keyword I of the standard problem B, the similar problem L of the standard problem B, and the similar problem K of the standard problem B are the second-order neighbor aggregation information corresponding to the keyword I, the corresponding neighbor information type is the keyword neighbor information, the second-order neighbor aggregation information corresponding to the similar problem L, K, the corresponding neighbor information type is the similar problem neighbor information, that is, the neighbor information type of the embed _1 is the keyword neighbor information, and the neighbor information types of the embed _2 and the embed _3 are the similar problem neighbor information.
S4323: and classifying and aggregating the second-order neighbor aggregation information according to the neighbor information type of the second-order neighbor aggregation information to obtain neighbor aggregation information.
After determining the neighbor information types of each second-order neighbor aggregation information, because the neighbor information of different types is different in degree, the second-order neighbor aggregation information of different types needs to be classified and aggregated to obtain neighbor aggregation results of different types, and then the neighbor aggregation results of different types are aggregated to finally obtain neighbor aggregation information of the labeling problem, so that different information supplement degrees to the standard problem can be designed for the neighbor information of different types.
In the embodiment, the first-order neighbor information and the corresponding second-order neighbor information are used as aggregation target information, and the original aggregation information corresponding to the aggregation target information is aggregated to obtain a plurality of second-order neighbor aggregation information of the standard problem, wherein the number of the second-order neighbor aggregation information is the same as that of the first-order neighbor information, and the neighbor information type of the second-order neighbor aggregation information is determined, wherein the neighbor information type comprises keyword neighbor information and similar problem neighbor information, then the second-order neighbor aggregation information is classified and aggregated according to the neighbor information type of the second-order neighbor aggregation information to obtain neighbor aggregation information, so that the specific process of obtaining the neighbor aggregation information by hierarchically aggregating the neighbor information of the standard problem according to the original aggregation information of the second node is defined, the neighbor aggregation steps are simplified, and the aggregation speed is improved, thereby improving the speed of subsequently recalling answers to the questions.
In an embodiment, as shown in fig. 7, in step S4323, that is, performing classification and aggregation on the second-order neighbor aggregation information according to the neighbor information type of the second-order neighbor aggregation information to obtain the neighbor aggregation information, the method specifically includes the following steps:
s4301: aggregating the keyword neighbor information in the second-order neighbor aggregation information to obtain a keyword aggregation result;
s4302: aggregating the similar problem neighbor information in the second-order neighbor aggregation information to obtain a similar problem aggregation result;
s4303: determining a product of the keyword aggregation result and the keyword hyperparameter as a first product;
s4304: determining the product of the similar problem aggregation result and the similar problem hyperparameter as a second product, wherein the sum of the keyword hyperparameter and the similar problem hyperparameter is 1;
s4305: and taking the sum of the first product and the second product as the neighbor aggregation information.
In this embodiment, the keyword neighbor information in the second-order neighbor aggregation information is aggregated to obtain a keyword aggregation result, the similar problem neighbor information in the second-order neighbor aggregation information is aggregated to obtain a similar problem aggregation result, a product of the keyword aggregation result and a keyword hyperparameter is determined as a first product, a product of the similar problem aggregation result and the similar problem hyperparameter is determined as a second product, and the sum of the keyword hyperparameter and the similar problem hyperparameter is 1; and taking the sum of the first product and the second product as the neighbor aggregation information.
For example, if the neighbor information type of the embed _1 is keyword neighbor information, and the neighbor information types of the embed _2 and the embed _3 are similar problem neighbor information, the keyword aggregation result embed _ B _ kw is: the embedded _ B _ kw is embedded _ 1;
the similar problem aggregation result embed _ B _ send is: the embedded _ B _ sent is (embedded _2+ embedded _ 3)/2;
the neighbor aggregation information embed _ B _ neighbor of the standard problem B obtained by calculation is: the embedded _ B _ neighbor ═ p1 ═ embedded _ B _ kw + p2 · embedded _ B _ sent;
wherein, p1 is keyword hyperparameter, p2 is similar problem hyperparameter, p1 and p2 have represented the relative importance of keyword neighbor information and similar problem neighbor information respectively, p1 and p2 can design as required, need satisfy: p1+ p2 is 1.
In the embodiment, the keyword neighbor information in the second-order neighbor aggregation information is aggregated to obtain a keyword aggregation result, the similar problem neighbor information in the second-order neighbor aggregation information is aggregated to obtain a similar problem aggregation result, then, the product of the keyword aggregation result and the keyword hyperparameter is determined to be used as a first product, meanwhile, the product of the similar problem aggregation result and the similar problem hyperparameter is determined to be used as a second product, the sum of the keyword hyperparameter and the similar problem hyperparameter is 1, and finally, the sum of the first product and the second product is used as the neighbor aggregation information, so that the classification and aggregation of the second-order neighbor aggregation information according to the neighbor information type of the second-order neighbor aggregation information are determined, the obtained neighbor aggregation information, and a basis is provided for subsequent similarity calculation.
In this embodiment, a specific process of aggregating the first network graph according to the word vector of the first node to obtain the first semantic vector of the first network graph is substantially the same as a process of aggregating the second network graph according to the word vector of the second node to obtain the first semantic vector of the second network graph. Firstly, aggregating word vectors of all first nodes in a first network graph to obtain original aggregation information of all first nodes, and then performing hierarchical aggregation on neighbor information of a user problem according to the original aggregation information of the first nodes to obtain neighbor aggregation information of the user problem; and finally, aggregating the original aggregation information and the neighbor aggregation information of the user problem to obtain a first semantic vector.
The method for acquiring the neighbor aggregation information of the user problem by performing hierarchical aggregation on the neighbor information of the user problem according to the original aggregation information of the first node comprises the following steps of: taking the first-order neighbor information and the corresponding second-order neighbor information as aggregation target information, and aggregating the original aggregation information corresponding to the aggregation target information to obtain a plurality of second-order neighbor aggregation information of the user problem, wherein the number of the second-order neighbor aggregation information is the same as that of the first-order neighbor information; and classifying and aggregating the second-order neighbor aggregation information to obtain the neighbor aggregation information of the user problem.
In this embodiment, since the user problem establishes a connection relationship with each standard problem through the target keyword in the first network diagram, all the neighbor types of the second-order neighbor aggregation information are the same and are all the keyword neighbor information, and therefore, classification and aggregation do not need to be performed according to the neighbor types of the second-order neighbor aggregation information, a process of repeated calculation is reduced, and a calculation speed is increased.
In an embodiment, as shown in fig. 8, in step S10, the obtaining a plurality of standard questions according to the target keyword of the user question specifically includes the following steps:
s11: inputting the user question into a preset keyword extraction model, and acquiring a plurality of keywords and corresponding keyword coefficients of the user question.
After the user question is obtained, the user question is input into a preset keyword extraction model, and a plurality of keywords and corresponding keyword coefficients of the user question are obtained.
For example, the user questions are: inputting the peaceful blessing to a preset keyword extraction model, wherein the preset keyword extraction model outputs keyword data of user problems: safety and good fortune: 0.96; and (3) application of insurance: 0.8, the keywords representing the user problems are safety and insurance, the keyword coefficient of safety is 0.96, and the keyword coefficient of insurance is 0.8.
In this embodiment, the user question, the corresponding keyword, and the keyword coefficient are only exemplary illustrations, and in other embodiments, the user question and the corresponding keyword may be other, and the corresponding keyword coefficient may also be other coefficients, which are not described herein again.
S12: determining a target keyword among the plurality of keywords according to the keyword coefficients.
After obtaining a plurality of keywords and corresponding keyword coefficients for a user question, a target keyword is determined among the plurality of keywords according to the keyword coefficients. For example, the keyword with the largest keyword coefficient may be used as the target keyword, a keyword with a keyword coefficient meeting a preset requirement may be selected from the plurality of keywords as the target keyword, and all keywords may be selected as the target keyword.
S13: and matching the target keywords with all standard questions in the database, and taking the successfully matched standard questions as the standard questions of the user questions.
After the target keywords of the user questions are determined, the target keywords are matched with all the standard questions stored in the database, and the successfully matched standard questions are used as the standard questions of the user questions, so that the processing amount of the standard questions can be reduced, and the recall speed is increased.
In the embodiment, the user questions are input into the preset keyword extraction model, a plurality of keywords and corresponding keyword coefficients of the user questions are obtained, the target keywords are determined in the keywords according to the keyword coefficients, the target keywords are matched with all standard questions in the database, the successfully matched standard questions are used as the standard questions of the user questions, the step of obtaining the standard questions according to the target keywords of the user questions is defined, the corresponding standard questions are quickly obtained from a plurality of pre-constructed question template libraries, the calculated amount is reduced, the speed of determining the corresponding standard questions is improved, and a foundation is provided for subsequently calculating the similarity between the user questions and the standard questions and recalling the answers of the user questions.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In one embodiment, a semantic recall device based on a graph neural network is provided, and the semantic recall device based on the graph neural network corresponds to the semantic recall method based on the graph neural network in the above embodiment one to one. As shown in fig. 9, the semantic recall apparatus based on the graph neural network includes a first obtaining module 901, a constructing module 902, a second obtaining module 903, a determining module 904 and a recall module 905. The functional modules are explained in detail as follows:
a first obtaining module 901, configured to obtain a user question sent by a user through a terminal device, and obtain a plurality of standard questions according to a target keyword of the user question, where the standard questions are user question templates constructed in advance;
a building module 902, configured to build the user question, the target keyword, and the plurality of standard questions into a first network graph with the user question as a center in a graph form, where the user question in the first network graph establishes a connection relationship with each standard question through the target keyword;
a second obtaining module 903, configured to obtain a second network graph centered on the standard problem, where the second network graph is constructed in a graph form by the standard problem and neighbor information of the standard problem, the neighbor information includes first-order neighbor information and second-order neighbor information, the first-order neighbor information is a keyword of the standard problem and a similar problem that directly establishes a connection relationship with the standard problem, the second-order neighbor information establishes a connection relationship with the standard problem through the first-order neighbor information, and the similar problem of the standard problem is a problem that is constructed in advance according to the standard problem and is similar to the standard problem;
a determining module 904, configured to determine a target similarity between each standard question and the user question according to the first network graph and the second network graph;
a recalling module 905, configured to take the standard question pointed by the maximum target similarity as the standard question corresponding to the user question, so as to recall an answer to the user question according to the standard question corresponding to the user question.
Further, the determining module 904 is specifically configured to:
inputting the first network graph and the second network graph into an embedding layer to obtain a word vector of each first node in the first network graph and obtain a word vector of each second node in the second network graph, wherein the first nodes comprise the user question, the target keyword and the standard question, and the second nodes comprise the standard question, the keyword of the standard question and similar questions;
aggregating the first network graph according to the word vector of the first node to obtain a first semantic vector of the first network graph;
aggregating the second network graph according to the word vector of the second node to obtain a second semantic vector of the second network graph;
and determining the target similarity of the standard question and the user question according to the first semantic vector and the second semantic vector.
Further, the determining module 904 is specifically further configured to:
aggregating the word vectors of each second node in the second network graph to obtain original aggregation information of each second node;
performing hierarchical aggregation on the neighbor information of the standard problem according to the original aggregation information of the second node to obtain neighbor aggregation information;
and aggregating the original aggregation information of the standard problem and the neighbor aggregation information to obtain the second semantic vector.
Further, the determining module 904 is specifically further configured to:
taking the first-order neighbor information and the corresponding second-order neighbor information as aggregation target information, and aggregating the original aggregation information corresponding to the aggregation target information to obtain a plurality of second-order neighbor aggregation information of the standard problem, wherein the number of the second-order neighbor aggregation information is the same as that of the first-order neighbor information;
determining the neighbor information type of the second-order neighbor aggregation information, wherein the neighbor information type comprises keyword neighbor information and similar problem neighbor information;
and classifying and aggregating the second-order neighbor aggregation information according to the neighbor information type of the second-order neighbor aggregation information to obtain the neighbor aggregation information.
Further, the determining module 904 is specifically further configured to:
aggregating the keyword neighbor information in the second-order neighbor aggregation information to obtain a keyword aggregation result;
aggregating the similar problem neighbor information in the second-order neighbor aggregation information to obtain a similar problem aggregation result;
determining a product of the keyword aggregation result and a keyword hyperparameter as a first product;
determining a product of the similar problem aggregation result and a similar problem hyperparameter as a second product, wherein the sum of the keyword hyperparameter and the similar problem hyperparameter is 1;
taking a sum of the first product and the second product as the neighbor aggregation information.
Further, the determining module 904 is specifically further configured to:
determining a product of the original aggregation information of the standard problem and the hyperparameter of the standard problem as a third product;
determining the product of the neighbor aggregation information and the neighbor information hyperparameter as a fourth product, wherein the sum of the standard problem hyperparameter and the neighbor information hyperparameter is 1;
taking the sum of the third product and the fourth product as the neighbor aggregation information.
Further, the first obtaining module 901 is specifically configured to:
inputting the user question into a preset keyword extraction model, and acquiring a plurality of keywords and corresponding keyword coefficients of the user question;
determining the target keyword in the plurality of keywords according to the keyword coefficient;
and matching the target keyword with all standard questions in a database, and taking the successfully matched standard questions as the standard questions of the user questions.
For specific definition of the semantic recall device based on the graph neural network, reference may be made to the above definition of the semantic recall method based on the graph neural network, and details are not repeated here. The various modules in the above semantic recall device based on the graph neural network can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 10. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and the computer program to run on the non-volatile storage medium. The database of the computer device is used for storing relevant data used and generated by the semantic recall method based on the graph neural network. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a graph neural network-based semantic recall method.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
the method comprises the steps of obtaining a user question sent by a user through terminal equipment, and obtaining a plurality of standard questions according to a target keyword of the user question, wherein the standard questions are user question templates which are constructed in advance;
constructing the user question, the target keyword and the plurality of standard questions into a first network graph taking the user question as a center in a graph form, wherein the user question in the first network graph establishes a connection relation with each standard question through the target keyword;
acquiring a second network graph centered on the standard problem, wherein the second network graph is constructed by the standard problem and neighbor information of the standard problem in a graph form, the neighbor information comprises first-order neighbor information and second-order neighbor information, the first-order neighbor information is a keyword and a similar problem of the standard problem, the keyword and the similar problem are directly connected with the standard problem, the second-order neighbor information is connected with the standard problem through the first-order neighbor information, and the similar problem of the standard problem is a problem which is constructed in advance according to the standard problem and has similar semantics with the standard problem;
determining a target similarity of each of the criteria to the user question according to the first network graph and the second network graph;
and taking the standard question pointed by the maximum target similarity as the standard question corresponding to the user question, and recalling the answer of the user question according to the standard question corresponding to the user question.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
the method comprises the steps of obtaining a user question sent by a user through terminal equipment, and obtaining a plurality of standard questions according to target keywords of the user question, wherein the standard questions are user question templates which are constructed in advance;
constructing the user question, the target keyword and the plurality of standard questions into a first network graph taking the user question as a center in a graph form, wherein the user question in the first network graph establishes a connection relation with each standard question through the target keyword;
acquiring a second network graph centered on the standard problem, wherein the second network graph is constructed by the standard problem and neighbor information of the standard problem in a graph form, the neighbor information comprises first-order neighbor information and second-order neighbor information, the first-order neighbor information is a keyword and a similar problem of the standard problem, the keyword and the similar problem are directly connected with the standard problem, the second-order neighbor information is connected with the standard problem through the first-order neighbor information, and the similar problem of the standard problem is a problem which is constructed in advance according to the standard problem and has similar semantics with the standard problem;
determining a target similarity of each standard question and the user question according to the first network graph and the second network graph;
and taking the standard question pointing to the maximum target similarity as the standard question corresponding to the user question, and recalling the answer of the user question according to the standard question corresponding to the user question.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above-mentioned embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A semantic recall method based on a graph neural network is characterized by comprising the following steps:
the method comprises the steps of obtaining a user question sent by a user through terminal equipment, and obtaining a plurality of standard questions according to target keywords of the user question, wherein the standard questions are user question templates which are constructed in advance;
constructing the user question, the target keyword and the plurality of standard questions into a first network graph taking the user question as a center in a graph form, wherein the user question in the first network graph establishes a connection relation with each standard question through the target keyword;
acquiring a second network graph centered on the standard problem, wherein the second network graph is constructed by the standard problem and neighbor information of the standard problem in a graph form, the neighbor information comprises first-order neighbor information and second-order neighbor information, the first-order neighbor information is a keyword and a similar problem of the standard problem, the keyword and the similar problem are directly connected with the standard problem, the second-order neighbor information is connected with the standard problem through the first-order neighbor information, and the similar problem of the standard problem is a problem which is constructed in advance according to the standard problem and has similar semantics with the standard problem;
determining a target similarity of each standard question and the user question according to the first network graph and the second network graph;
and taking the standard question pointed by the maximum target similarity as the standard question corresponding to the user question, and recalling the answer of the user question according to the standard question corresponding to the user question.
2. The graph neural network-based semantic recall method of claim 1 wherein the determining a target similarity of each of the standard questions to the user question from the first network graph and the second network graph comprises:
inputting the first network graph and the second network graph into an embedding layer to obtain a word vector of each first node in the first network graph and obtain a word vector of each second node in the second network graph, wherein the first nodes comprise the user question, the target keyword and the standard question, and the second nodes comprise the standard question, the keyword of the standard question and similar questions;
aggregating the first network graph according to the word vector of the first node to obtain a first semantic vector of the first network graph;
aggregating the second network graph according to the word vector of the second node to obtain a second semantic vector of the second network graph;
and determining the target similarity of the standard question and the user question according to the first semantic vector and the second semantic vector.
3. The graph neural network-based semantic recall method of claim 2 wherein the aggregating the second network graph according to the word vector of the second node to obtain a second semantic vector of the second network graph comprises:
aggregating the word vectors of each second node in the second network graph to obtain original aggregation information of each second node;
performing hierarchical aggregation on the neighbor information of the standard problem according to the original aggregation information of the second node to obtain neighbor aggregation information;
and aggregating the original aggregation information of the standard problem and the neighbor aggregation information to obtain the second semantic vector.
4. The graph neural network-based semantic recall method according to claim 3, wherein the hierarchically aggregating the neighbor information of the standard problem according to the original aggregation information of the second node to obtain neighbor aggregation information comprises:
taking the first-order neighbor information and the corresponding second-order neighbor information as aggregation target information, and aggregating the original aggregation information corresponding to the aggregation target information to obtain a plurality of second-order neighbor aggregation information of the standard problem, wherein the number of the second-order neighbor aggregation information is the same as that of the first-order neighbor information;
determining a neighbor information type of the second-order neighbor aggregation information, wherein the neighbor information type comprises keyword neighbor information and similar problem neighbor information;
and classifying and aggregating the second-order neighbor aggregation information according to the neighbor information type of the second-order neighbor aggregation information to obtain the neighbor aggregation information.
5. The graph neural network-based semantic recall method of claim 4, wherein the classifying and aggregating the second-order neighbor aggregation information according to the neighbor information type of the second-order neighbor aggregation information to obtain the neighbor aggregation information comprises:
aggregating the keyword neighbor information in the second-order neighbor aggregation information to obtain a keyword aggregation result;
aggregating the similar problem neighbor information in the second-order neighbor aggregation information to obtain a similar problem aggregation result;
determining a product of the keyword aggregation result and a keyword hyperparameter as a first product;
determining a product of the similar problem aggregation result and a similar problem hyperparameter as a second product, wherein the sum of the keyword hyperparameter and the similar problem hyperparameter is 1;
taking a sum of the first product and the second product as the neighbor aggregation information.
6. The graph neural network-based semantic recall method of claim 3 wherein the aggregating the raw aggregated information of the standard problem and the neighbor aggregated information to obtain the second semantic vector comprises:
determining a product of the original aggregation information of the standard problem and the hyperparameter of the standard problem as a third product;
determining the product of the neighbor aggregation information and the neighbor information hyperparameter as a fourth product, wherein the sum of the standard problem hyperparameter and the neighbor information hyperparameter is 1;
taking the sum of the third product and the fourth product as the neighbor aggregation information.
7. The graph neural network-based semantic recall method of any one of claims 1-6 wherein the obtaining a plurality of standard questions according to the target keywords of the user question comprises:
inputting the user question into a preset keyword extraction model, and acquiring a plurality of keywords and corresponding keyword coefficients of the user question;
determining the target keyword in the plurality of keywords according to the keyword coefficient;
and matching the target keyword with all standard questions in a database, and taking the successfully matched standard questions as the standard questions of the user questions.
8. A semantic recall apparatus based on a graph neural network, comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring user questions sent by a user through terminal equipment and acquiring a plurality of standard questions according to target keywords of the user questions, and the standard questions are pre-constructed user question templates;
a building module, configured to build the user question, the target keyword, and the plurality of standard questions into a first network graph with the user question as a center in a graph form, where the user question in the first network graph establishes a connection relationship with each of the standard questions through the target keyword;
a second obtaining module, configured to obtain a second network graph centered on the standard problem, where the second network graph is constructed in a graph form by the standard problem and neighbor information of the standard problem, where the neighbor information includes first-order neighbor information and second-order neighbor information, the first-order neighbor information is a keyword and a similar problem of the standard problem that directly establish a connection relationship with the standard problem, the second-order neighbor information establishes a connection relationship with the standard problem through the first-order neighbor information, and the similar problem of the standard problem is a problem that is constructed in advance according to the standard problem and is similar to the standard problem;
a determining module, configured to determine a target similarity between each standard question and the user question according to the first network graph and the second network graph;
and the recalling module is used for taking the standard question pointed by the maximum target similarity as the standard question corresponding to the user question so as to recall the answer of the user question according to the standard question corresponding to the user question.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor when executing the computer program implements the steps of the graph neural network-based semantic recall method of any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the graph neural network-based semantic recall method according to any one of claims 1 to 7.
CN202110566914.4A 2021-05-24 2021-05-24 Semantic recall method, device, equipment and medium based on graph neural network Active CN113268563B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110566914.4A CN113268563B (en) 2021-05-24 2021-05-24 Semantic recall method, device, equipment and medium based on graph neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110566914.4A CN113268563B (en) 2021-05-24 2021-05-24 Semantic recall method, device, equipment and medium based on graph neural network

Publications (2)

Publication Number Publication Date
CN113268563A CN113268563A (en) 2021-08-17
CN113268563B true CN113268563B (en) 2022-06-17

Family

ID=77232517

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110566914.4A Active CN113268563B (en) 2021-05-24 2021-05-24 Semantic recall method, device, equipment and medium based on graph neural network

Country Status (1)

Country Link
CN (1) CN113268563B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107562918A (en) * 2017-09-12 2018-01-09 北京点易通科技有限公司 A kind of mathematical problem knowledge point discovery and batch label acquisition method
CN109033305A (en) * 2018-07-16 2018-12-18 深圳前海微众银行股份有限公司 Question answering method, equipment and computer readable storage medium
CN110399457A (en) * 2019-07-01 2019-11-01 吉林大学 A kind of intelligent answer method and system
CN110647614A (en) * 2019-08-01 2020-01-03 平安科技(深圳)有限公司 Intelligent question and answer method, device, medium and electronic equipment
WO2020063092A1 (en) * 2018-09-30 2020-04-02 北京国双科技有限公司 Knowledge graph processing method and apparatus
CN111444724A (en) * 2020-03-23 2020-07-24 腾讯科技(深圳)有限公司 Medical question-answer quality testing method and device, computer equipment and storage medium
CN112632257A (en) * 2020-12-29 2021-04-09 深圳赛安特技术服务有限公司 Question processing method and device based on semantic matching, terminal and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11423093B2 (en) * 2019-09-25 2022-08-23 Microsoft Technology Licensing, Llc Inter-document attention mechanism

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107562918A (en) * 2017-09-12 2018-01-09 北京点易通科技有限公司 A kind of mathematical problem knowledge point discovery and batch label acquisition method
CN109033305A (en) * 2018-07-16 2018-12-18 深圳前海微众银行股份有限公司 Question answering method, equipment and computer readable storage medium
WO2020063092A1 (en) * 2018-09-30 2020-04-02 北京国双科技有限公司 Knowledge graph processing method and apparatus
CN110399457A (en) * 2019-07-01 2019-11-01 吉林大学 A kind of intelligent answer method and system
CN110647614A (en) * 2019-08-01 2020-01-03 平安科技(深圳)有限公司 Intelligent question and answer method, device, medium and electronic equipment
CN111444724A (en) * 2020-03-23 2020-07-24 腾讯科技(深圳)有限公司 Medical question-answer quality testing method and device, computer equipment and storage medium
CN112632257A (en) * 2020-12-29 2021-04-09 深圳赛安特技术服务有限公司 Question processing method and device based on semantic matching, terminal and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
2000年以来国内柬埔寨研究的知识图谱分析;郑星 等;《大理大学学报》;20200515;第63-71页 *
基于医疗知识图谱的应用系统设计与实现;李振飞;《中国优秀硕士学位论文全文数据库 医药卫生科技辑》;20210515;第E054-64页 *

Also Published As

Publication number Publication date
CN113268563A (en) 2021-08-17

Similar Documents

Publication Publication Date Title
WO2021047535A1 (en) Method, apparatus and system for secure vertical federated learning
CN111859960B (en) Semantic matching method, device, computer equipment and medium based on knowledge distillation
CN108920654B (en) Question and answer text semantic matching method and device
WO2020057022A1 (en) Associative recommendation method and apparatus, computer device, and storage medium
US11763093B2 (en) Systems and methods for a privacy preserving text representation learning framework
US20180341862A1 (en) Integrating a memory layer in a neural network for one-shot learning
CN111061847A (en) Dialogue generation and corpus expansion method and device, computer equipment and storage medium
WO2021120677A1 (en) Warehousing model training method and device, computer device and storage medium
US10943068B2 (en) N-ary relation prediction over text spans
CN111767400A (en) Training method and device of text classification model, computer equipment and storage medium
WO2023065632A1 (en) Data desensitization method, data desensitization apparatus, device, and storage medium
CN110019216B (en) Intellectual property data storage method, medium and computer device based on block chain
WO2022105123A1 (en) Text classification method, topic generation method, apparatus, device, and medium
CN111859986A (en) Semantic matching method, device, equipment and medium based on multitask twin network
CN112580352B (en) Keyword extraction method, device and equipment and computer storage medium
Yu et al. Incremental knowledge discovering in interval-valued decision information system with the dynamic data
CN113408706B (en) Method and device for training user interest mining model and user interest mining
US20220398500A1 (en) Partially local federated learning
CN113886550A (en) Question-answer matching method, device, equipment and storage medium based on attention mechanism
CN113112282A (en) Method, device, equipment and medium for processing consult problem based on client portrait
CN111291563A (en) Word vector alignment method and training method of word vector alignment model
CN112085091B (en) Short text matching method, device, equipment and storage medium based on artificial intelligence
CN113158047A (en) Recommendation model training and information pushing method, device, equipment and medium
CN109086386A (en) Data processing method, device, computer equipment and storage medium
CN113268563B (en) Semantic recall method, device, equipment and medium based on graph neural network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant