Path sorting question parsing method based on information extraction
Through the path sorting question analysis method based on information extraction, candidate entities are extracted and extended, and semantic similarity calculation is performed in combination with BERT and double tower models, the problem of finding direct answers in massive data is solved, and efficient question analysis and answer recognition is achieved.
Patent Information
- Application Number
- CN202411428547.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-25
AI Technical Summary
It is difficult to find direct answers in massive data, especially when there are different ways to ask questions on the same question, and the existing technology is difficult to effectively analyze.
The path sorting question analysis method based on information extraction is adopted, candidate entities are extracted through model recognition, dictionary recognition and heuristic rules, and candidate entities are expanded in combination with synonyms. The BERT classification model is used to judge the question type and calculate the diffusion value. Finally, the double tower model is used to calculate the semantic similarity for path sorting.
On the premise of ensuring the speed of question analysis, the recognition rate of different questioning methods for the same question is effectively improved, and the accuracy and efficiency of question analysis are improved.
Smart Images

Figure CN119513241A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of natural language processing, and in particular relates to a path sorting question parsing method based on information extraction. Background Art
[0002] With the development of science and technology, the number of digital publications has continued to increase, and the number of journal articles has also increased. For new researchers, it may take a long time to sort out the connections between multiple systems, and it is even more difficult to start with a large number of field articles. This is undoubtedly a challenge for people who want to quickly master a certain system. Therefore, a question analysis method that can answer researchers' questions about the research field is very necessary.
[0003] Question-answering related technologies are an important direction of natural language processing. The question-answering system based on this technology is an information retrieval system that integrates cutting-edge technologies such as data mining and deep learning. It has higher retrieval efficiency and returns more accurate results.
[0004] Knowledge graph is called knowledge domain visualization or knowledge domain mapping map in the library and information industry. It is a series of various graphics that show the development process and structural relationship of knowledge. It uses visualization technology to describe knowledge resources and their carriers, and mines, analyzes, constructs, draws and displays knowledge and their mutual connections, so that information can be efficiently organized and managed. From an engineering perspective, knowledge graph is like an information management architecture, and the question-answering system based on this architecture can effectively utilize the data information therein. In the process of question parsing, many related technologies are required, such as entity linking and path sorting. Combining the question-answering system based on knowledge graph with domain knowledge can more efficiently utilize the professional knowledge of knowledge graph, assist scientific researchers to do their work better, and quickly obtain the target answer through simple query operations. With the development of knowledge graph technology, question-answering technology based on knowledge graph has gradually become a hot topic.
[0005] Compared with the semantic parsing-based method, which is overly dependent on the construction of data sets, the vector modeling-based method is still relatively immature. Although the question parsing method based on template rules can effectively bypass complex semantic parsing, it still has a lot of room for improvement in actual application scenarios. For example, for different ways of asking the same question, if the preset template does not consider the situation carefully, it will cause the question parsing to fail; in addition, there are also cases where multiple templates can parse the same question, and developers need to determine the template usage strategy, which further increases the labor cost. Summary of the invention
[0006] The purpose of the present invention is to provide a path sorting question parsing solution based on information extraction to solve the problem that it is difficult for users to find direct answers in massive data. The technical solution proposed by the present invention aims at the situation that the same question has different questioning methods in the prior art. Under the premise of ensuring the question parsing speed, the question parsing process is improved based on semantic similarity combined with a method based on information extraction.
[0007] The first aspect of the present invention provides a path sorting question parsing method based on information extraction. The method comprises:
[0008] Step S1, extracting candidate entity mentions from the question based on model recognition, dictionary recognition, and heuristic rules;
[0009] Step S2: using a synonym library, expanding the candidate entity mentions, wherein the candidate entity mentions and the expanded candidate entity mentions constitute a candidate entity set;
[0010] Step S3, determining the entity type of the question by the number of candidate entities in the candidate entity set, judging the jump type of the question by a BERT-based classification model, and calculating the diffusion value of the candidate entity based on the entity type and the jump type of the question, thereby obtaining a candidate path;
[0011] Step S4: using the twin-tower model, calculating the semantic similarity between the question and the candidate paths, and ranking the candidate paths based on the semantic similarity;
[0012] Step S5: According to the ranking result, select the candidate path ranked first as the search path, and query the answer to the question through the search path.
[0013] According to the method of the first aspect of the present invention, in step S1:
[0014] Extracting candidate entity mentions in the question sentence according to the ALBERT-Bi LSTM-CRF model;
[0015] Based on the entity dictionary library of the knowledge graph, keyword text matching is performed on the question to obtain matching candidate entity mentions;
[0016] The candidate entity mentions are extracted from the question sentence by using the longest matching rule, and the candidate entity mentions in numbers, dates, and book titles are extracted from the question sentence by using regular matching;
[0017] At the same time, based on the stop word mechanism, the question is filtered.
[0018] According to the method of the first aspect of the present invention, in step S2, the candidate entity mention is associated with an entity corresponding to the candidate entity mention in a knowledge graph database, thereby expanding the candidate entity mention, and the synonym library includes the knowledge graph database.
[0019] According to the method of the first aspect of the present invention, in step S3:
[0020] Determining the entity type of the question sentence by the number of candidate entities in the candidate entity set, wherein the entity type includes a single-entity question sentence, a double-entity question sentence, and a triple-entity question sentence;
[0021] Determining the jump type of the question sentence by using the BERT-based classification model, where the jump type includes a one-hop question sentence and a multi-hop question sentence;
[0022] Among them, the question sentence that only involves the head entity and relationship in a knowledge graph triple and uses the tail entity in the knowledge graph triple as the answer is the one-hop question sentence, and the question sentence that involves multiple entities or multiple relationships and uses the query entity as the answer is the multi-hop question sentence
[0023] Calculate the diffusion value of the candidate entity based on the entity type and jump type of the question;
[0024] Diffusion refers to the process of diffusing values around the candidate entity, and the diffusion value represents the correlation or probability value between the candidate entity and the question involved in the question.
[0025] According to the method of the first aspect of the present invention, in step S4:
[0026] The dual-tower model is based on the SBERT model and has a dual-tower structure;
[0027] The question and the candidate paths are input into two models of the dual-tower model respectively.
[0028] To obtain a representation vector of the question and a representation vector of the candidate path;
[0029] The SBERT model is used to calculate the semantic similarity between the representation vector of the question and the representation vector of the candidate path.
[0030] According to the method of the first aspect of the present invention, in step S4, the semantic similarity is Jaccard similarity.
[0031] According to the method of the first aspect of the present invention, in step S5:
[0032] The first-ranked candidate path is selected as the search path, and the search path is executed in the knowledge graph to obtain data information related to the question involved in the question;
[0033] Based on a query operation on the knowledge graph, query the data information for information or entities related to the question involved in the question;
[0034] Parsing the queried information or entities, including filtering, sorting, and integrating, to obtain an answer to the question;
[0035] Return the answer to the question obtained by parsing.
[0036] The candidate path ranked first is selected as the search path, and the answer to the question is searched through the search path.
[0037] The second aspect of the present invention provides a path sorting question parsing system based on information extraction. The system includes a processing unit, and the processing unit is configured to execute:
[0038] Extract candidate entity mentions from questions based on model recognition, dictionary recognition, and heuristic rules;
[0039] Using a synonym library, the candidate entity mention is expanded, and the candidate entity mention and the expanded candidate entity mention constitute a candidate entity set;
[0040] Determine the entity type of the question by the number of candidate entities in the candidate entity set, judge the jump type of the question by a BERT-based classification model, and calculate the diffusion value of the candidate entity based on the entity type and the jump type of the question, so as to obtain a candidate path;
[0041] Using the twin-tower model, the semantic similarity between the question and the candidate paths is calculated, and the candidate paths are sorted based on the semantic similarity;
[0042] According to the ranking result, the candidate path ranked first is selected as the search path, and the answer to the question is searched through the search path.
[0043] The third aspect of the present invention discloses an electronic device. The electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps in the path sorting question parsing method based on information extraction disclosed in the present invention are implemented.
[0044] The fourth aspect of the present invention discloses a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the path sorting question parsing method based on information extraction disclosed in the present invention are implemented.
[0045] In summary, the technical solution of the present invention uses deep learning, character matching and heuristic rules to extract candidate entity mentions of questions, and uses the obtained candidate entity mention set to query the knowledge base, retains the queried subset set as the candidate entity set, and determines the scope of subgraph extraction in combination with question classification. After obtaining the candidate path set from the subgraph, it sorts them, and combines the dual-tower model structure to improve the sorting efficiency, and finally takes the first ranked one as the final answer retrieval path.
[0046] Compared with the prior art, the present invention uses semantic similarity to effectively improve the recognition rate of different question-asking methods for the same question, and improves the efficiency of semantic similarity calculation in a pre-operation manner based on the Sentence-BERT pre-training model combined with the dual-tower structure, thereby enabling the current design to be implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 The figure is a schematic diagram of the steps of a method for parsing question sentences in path sorting based on information extraction according to an embodiment of the present invention.
[0049] Figure 2 Schematic diagram of the question parsing process according to an embodiment of the present invention.
[0050] Figure 3 The figure is a schematic diagram of a process of obtaining candidate entity mentions according to an embodiment of the present invention.
[0051] Figure 4 The figure is a schematic diagram of a process of sorting paths according to an embodiment of the present invention.
[0052] Figure 5 The figure is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0054] The first aspect of the present invention provides a path sorting question parsing method based on information extraction. The method comprises:
[0055] Step S1, extracting candidate entity mentions from the question based on model recognition, dictionary recognition, and heuristic rules;
[0056] Step S2: using a synonym library, expanding the candidate entity mentions, wherein the candidate entity mentions and the expanded candidate entity mentions constitute a candidate entity set;
[0057] Step S3, determining the entity type of the question by the number of candidate entities in the candidate entity set, judging the jump type of the question by a BERT-based classification model, and calculating the diffusion value of the candidate entity based on the entity type and the jump type of the question, thereby obtaining a candidate path;
[0058] Step S4: using the twin-tower model, calculating the semantic similarity between the question and the candidate paths, and ranking the candidate paths based on the semantic similarity;
[0059] Step S5: According to the ranking result, select the candidate path ranked first as the search path, and query the answer to the question through the search path.
[0060] In one embodiment, if Figure 1 As shown, the method mainly includes question input, candidate entity recognition, entity linking, question classification, candidate path generation, candidate path ranking and answer retrieval.
[0061] In one embodiment, if Figure 2 As shown in the figure, first the central entity in the question is extracted, then the knowledge base is queried based on the extracted candidate entity set, a subset of the query results is retained, and after question classification, subgraph extraction is performed with the candidate entity as the center to generate candidate paths. Finally, the candidate paths are sorted, and the path with the highest score is taken as the answer query path. The query statement is constructed and the answer is returned.
[0062] According to the method of the first aspect of the present invention, in step S1:
[0063] Extracting candidate entity mentions in the question sentence according to the ALBERT-Bi LSTM-CRF model;
[0064] Based on the entity dictionary library of the knowledge graph, keyword text matching is performed on the question to obtain matching candidate entity mentions;
[0065] The candidate entity mentions are extracted from the question sentence by using the longest matching rule, and the candidate entity mentions in numbers, dates, and book titles are extracted from the question sentence by using regular matching;
[0066] At the same time, based on the stop word mechanism, the question is filtered.
[0067] In one embodiment, the candidate entity is a set of named entities and attributes mentioned in the question. In order to comprehensively extract relevant information in the question and avoid missing key information, the system adopts a strategy combining model recognition + dictionary recognition + heuristic rules. The extraction order of candidate entity mentions in the question is model recognition, dictionary matching, and heuristic rules. The specific flow chart is as follows: Figure 3 shown.
[0068] The system first extracts candidate entity mentions in the question based on the ALBERT-Bi LSTM-CRF model. In addition, the system maintains an entity dictionary based on the knowledge graph for question keyword text matching and uses the longest matching rule to extract candidate entity mentions. At the same time, in order to reduce the noise text in the text matching results, the system sets a stop word mechanism, and the matching of these words will be ignored during matching. For some special entities and attribute values such as numbers, dates, book titles and article titles, the system uses regular matching to extract keywords.
[0069] According to the method of the first aspect of the present invention, in step S2, the candidate entity mention is associated with an entity corresponding to the candidate entity mention in a knowledge graph database, thereby expanding the candidate entity mention, and the synonym library includes the knowledge graph database.
[0070] In one embodiment, entity linking is the task of associating the entity mentions extracted in the previous step to the system knowledge graph database. The task at this stage mainly solves the synonym problem of candidate mentions. Synonyms are expanded based on the synonym library maintained by the system, for example, mapping the word CNN to the convolutional neural network entity stored in the graph.
[0071] According to the method of the first aspect of the present invention, in step S3:
[0072] Determining the entity type of the question sentence by the number of candidate entities in the candidate entity set, wherein the entity type includes a single-entity question sentence, a double-entity question sentence, and a triple-entity question sentence;
[0073] Determining the jump type of the question sentence by using the BERT-based classification model, where the jump type includes a one-hop question sentence and a multi-hop question sentence;
[0074] Among them, the question sentence that only involves the head entity and relationship in a knowledge graph triple and uses the tail entity in the knowledge graph triple as the answer is the one-hop question sentence, and the question sentence that involves multiple entities or multiple relationships and uses the query entity as the answer is the multi-hop question sentence
[0075] Calculate the diffusion value of the candidate entity based on the entity type and jump type of the question;
[0076] Diffusion refers to the process of diffusing values around the candidate entity, and the diffusion value represents the correlation or probability value between the candidate entity and the question involved in the question.
[0077] In one embodiment, first determine whether the question is a single / double / triple entity type question by the number of entities included in the candidate entity set of the entity link, then determine whether it is a one-hop or multi-hop type question by using a pre-trained BERT-based classification model, and finally, based on the above information, diffuse the value around the identified entity. Among them, only the head entity and relationship in a knowledge graph triple are involved, and the tail entity is used as the answer. This kind of question is called a one-hop question. Involving multiple entities or multiple relationships, the query entity is used as the answer is called a multi-hop question. Among them, the diffusion value is the process of diffusing the value around the entity as the center, and the value reflects the correlation or probability between the candidate entity and the question.
[0078] According to the method of the first aspect of the present invention, in step S4:
[0079] The dual-tower model is based on the SBERT model and has a dual-tower structure;
[0080] The question and the candidate paths are input into two models of the dual-tower model respectively.
[0081] To obtain a representation vector of the question and a representation vector of the candidate path;
[0082] The SBERT model is used to calculate the semantic similarity between the representation vector of the question and the representation vector of the candidate path.
[0083] According to the method of the first aspect of the present invention, in step S4, the semantic similarity is Jaccard similarity.
[0084] In one embodiment, by drawing on the structure of a dual-tower network model, two models with shared parameters are prepared in advance, two sentences are input into the two models respectively, and a representation vector of each sentence is obtained through model calculation to calculate the semantic similarity of the two sentences.
[0085] For the model with two shared parameters, it can be understood that the same model is used in two places. The advantage of this approach is that for different questions, the same candidate answer has the same calculated representation vector, so the calculated representation vector of each candidate answer can be cached in advance, so that each subsequent use only needs to calculate the representation vector of the input question and then use the cosine similarity to calculate the similarity with the cached candidate answer representations u and v. The amount of calculation for this similarity calculation is very small. Compared with using only the SBERT model for calculation, the dual-tower model structure can greatly improve the matching efficiency.
[0086] In order to further improve the accuracy of question answer retrieval results, the system introduces Jaccard similarity to sort the candidate answers after semantic similarity screening, and selects the candidate path with the highest degree of repetition with the question characters as the final answer retrieval path, such as Figure 4 shown.
[0087] In one embodiment, Jaccard similarity is an indicator for comparing the similarity between two sets, and is calculated by dividing the size of the intersection of the two sets by the size of their union. In this scenario, a candidate path can be regarded as a set that contains entities or relationships in the path. Jaccard similarity can be used to compare the similarity between two candidate paths.
[0088] The specific steps are as follows:
[0089] Calculate Jaccard similarity: For each pair of candidate paths, calculate the Jaccard similarity between them and the question. The set here refers to the entity or relationship in the path.
[0090] For example, suppose there are two candidate paths A and B, whose entity or relationship sets are {entity 1, entity 2, relationship 1} and {entity 2, entity 3, relationship 2} respectively, then their Jaccard similarity can be calculated by the following formula:
[0091]
[0092] Among them, A∪B represents the number of entities or relationships shared by paths A and B, and |A∪B| represents the total number of non-repeated entities or relationships in paths A and B.
[0093] Sorting based on Jaccard similarity: Sort all candidate paths according to the calculated Jaccard similarity. The higher the Jaccard similarity, the higher the overlap between the entities or relationships of the two paths. Therefore, the paths with higher similarity are placed in front during sorting.
[0094] For example, a group of candidate paths may be sorted from high to low according to their Jaccard similarities with the question, and then the sorting result is returned to step S5 so that the candidate path ranked first is selected as the retrieval path.
[0095] In this way, the candidate paths can be sorted using Jaccard similarity, so that when retrieving paths, paths with higher similarity to the question can be given priority, thereby improving the accuracy and relevance of the answer.
[0096] According to the method of the first aspect of the present invention, in step S5:
[0097] The first-ranked candidate path is selected as the search path, and the search path is executed in the knowledge graph to obtain data information related to the question involved in the question;
[0098] Based on a query operation on the knowledge graph, query the data information for information or entities related to the question involved in the question;
[0099] Parsing the queried information or entities, including filtering, sorting, and integrating, to obtain an answer to the question;
[0100] Return the answer to the question obtained by parsing.
[0101] The candidate path ranked first is selected as the search path, and the answer to the question is searched through the search path.
[0102] In one embodiment, according to the sorting results, the path ranked first is used as the search path, and a search statement is constructed to perform result query. Specifically, it includes:
[0103] Execute the search path: select the candidate path ranked first as the search path and execute this path in the knowledge graph to obtain information related to the question.
[0104] Query answers: Use the retrieval path to query answers from the data source. This involves querying the knowledge graph to obtain information or entities related to the question.
[0105] Parse the answer: Parse the queried information or entity to obtain the final answer to the question. This includes filtering, sorting, and integrating the returned information to ensure that the answer meets the user's needs.
[0106] Return answer: Return the final answer obtained through parsing to the user.
[0107] Specific example 1 (using deep learning framework PyTorch)
[0108] Dataset: The experimental evaluation is conducted on a manually constructed question-answer pair validation dataset. The self-constructed validation dataset consists of 300 question-answer pairs, including 50 of each of the six types: single entity one hop, double entity one hop, triple entity one hop, single entity multiple hops, double entity multiple hops, and triple entity multiple hops.
[0109] Experiment: To prove the effectiveness of the path sorting question parsing method based on information extraction, the accuracy is tested on an artificially constructed data set. The results are shown in Table 1. The experiment proves that the method of the present invention can effectively improve the results.
[0110] Accuracy (%) Response time (average) Rule-based template approach 61% 0.5s Method of the present invention 78% 1.2s
[0111] Table 1 Results analysis
[0112] Specific example 2 (path sorting)
[0113] (1) Candidate path generation:
[0114] After determining the scope of subgraph extraction according to the question central entity and question classification, expand outward from the entity as the center, concatenate the entity name with the relationship name, and form a subgraph path set.
[0115] (2) Subgraph path pre-calculation:
[0116] In the graph import stage, each node is taken as the center, and the node name and its one-hop and two-hop names are concatenated as the path name. Sentence-Bert is used to convert the sentence vector. Then, the path name is used as the key and the calculated sentence vector is used as the value to store it in a relational database, which facilitates subsequent sorting calculation and value acquisition and improves sorting efficiency.
[0117] (3) Path sorting:
[0118] For different questions, the same candidate answer has the same calculated representation vector. Therefore, we can use the calculated representation vectors of each candidate answer cached in advance. In this way, each subsequent use only requires calculating the representation vector of the input question and then using cosine similarity to calculate the similarity with the cached candidate answer representations u and v. The amount of computational complexity of this similarity calculation is very small. Compared with using only the SBERT model for calculation, the dual-tower model structure can also greatly improve the matching efficiency.
[0119] The second aspect of the present invention provides a path sorting question parsing system based on information extraction. The system includes a processing unit, and the processing unit is configured to execute:
[0120] Extract candidate entity mentions from questions based on model recognition, dictionary recognition, and heuristic rules;
[0121] Using a synonym library, the candidate entity mention is expanded, and the candidate entity mention and the expanded candidate entity mention constitute a candidate entity set;
[0122] Determine the entity type of the question by the number of candidate entities in the candidate entity set, judge the jump type of the question by a BERT-based classification model, and calculate the diffusion value of the candidate entity based on the entity type and the jump type of the question, so as to obtain a candidate path;
[0123] Using the twin-tower model, the semantic similarity between the question and the candidate paths is calculated, and the candidate paths are sorted based on the semantic similarity;
[0124] According to the ranking result, the candidate path ranked first is selected as the search path, and the answer to the question is searched through the search path.
[0125] The third aspect of the present invention discloses an electronic device. The electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps in the path sorting question parsing method based on information extraction disclosed in the present invention are implemented.
[0126] Figure 5 is a structural diagram of an electronic device according to an embodiment of the present invention, such as Figure 5 As shown, the electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, near field communication (NFC) or other technologies. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covered on the display screen, or a button, a trackball or a touch pad set on the housing of the electronic device, or an external keyboard, touch pad or mouse, etc.
[0127] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a structural diagram of the part related to the technical solution of the present disclosure, and does not constitute a limitation on the electronic device to which the technical solution of the present application is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0128] The fourth aspect of the present invention discloses a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the path sorting question parsing method based on information extraction disclosed in the present invention are implemented.
[0129] In summary, the technical solution of the present invention uses deep learning, character matching and heuristic rules to extract candidate entity mentions of questions, and uses the obtained candidate entity mention set to query the knowledge base, retains the queried subset set as the candidate entity set, and determines the scope of subgraph extraction in combination with question classification. After obtaining the candidate path set from the subgraph, it sorts them, and combines the dual-tower model structure to improve the sorting efficiency, and finally takes the first ranked one as the final answer retrieval path.
[0130] Compared with the prior art, the present invention uses semantic similarity to effectively improve the recognition rate of different question-asking methods for the same question, and improves the efficiency of semantic similarity calculation in a pre-operation manner based on the Sentence-BERT pre-training model combined with the dual-tower structure, thereby enabling the current design to be implemented.
[0131] Please note that the technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above embodiments only express several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several variations and improvements can be made, which all belong to the scope of protection of the present application. Therefore, the scope of protection of the patent in this application shall be based on the attached claims.
Claims
1. A path sorting question parsing method based on information extraction, characterized in that: The method comprises: Step S1, extracting candidate entity mentions from the question based on model recognition, dictionary recognition, and heuristic rules; Step S2: using a synonym library, expanding the candidate entity mentions, wherein the candidate entity mentions and the expanded candidate entity mentions constitute a candidate entity set; Step S3, determining the entity type of the question by the number of candidate entities in the candidate entity set, judging the jump type of the question by a BERT-based classification model, and calculating the diffusion value of the candidate entity based on the entity type and the jump type of the question, thereby obtaining a candidate path; Step S4: using the twin-tower model, calculating the semantic similarity between the question and the candidate paths, and ranking the candidate paths based on the semantic similarity; Step S5: According to the ranking result, select the candidate path ranked first as the search path, and query the answer to the question through the search path.
2. According to the information extraction-based path sorting question parsing method of claim 1, it is characterized in that: In step S1: Extracting candidate entity mentions in the question sentence according to the ALBERT-Bi LSTM-CRF model; Based on the entity dictionary library of the knowledge graph, keyword text matching is performed on the question to obtain matching candidate entity mentions; The candidate entity mentions are extracted from the question sentence by using the longest matching rule, and the candidate entity mentions in numbers, dates, and book titles are extracted from the question sentence by using regular matching; At the same time, based on the stop word mechanism, the question is filtered.
3. The method for parsing path-sorted question sentences based on information extraction according to claim 2, characterized in that: In the step S2, the candidate entity mention is associated with an entity corresponding to the candidate entity mention in a knowledge graph database, thereby expanding the candidate entity mention, and the synonym library includes the knowledge graph database.
4. The method for parsing path-sorted question sentences based on information extraction according to claim 3 is characterized in that: In step S3: Determining the entity type of the question sentence by the number of candidate entities in the candidate entity set, wherein the entity type includes a single-entity question sentence, a double-entity question sentence, and a triple-entity question sentence; Determining the jump type of the question sentence by using the BERT-based classification model, where the jump type includes a one-hop question sentence and a multi-hop question sentence; Among them, the question sentence that only involves the head entity and relationship in a knowledge graph triple and uses the tail entity in the knowledge graph triple as the answer is the one-hop question sentence, and the question sentence that involves multiple entities or multiple relationships and uses the query entity as the answer is the multi-hop question sentence Calculate the diffusion value of the candidate entity based on the entity type and jump type of the question; Diffusion refers to the process of diffusing values around the candidate entity, and the diffusion value represents the correlation or probability value between the candidate entity and the question involved in the question.
5. The method for parsing path-sorted question sentences based on information extraction according to claim 4 is characterized in that: In step S4: The dual-tower model is based on the SBERT model and has a dual-tower structure; Inputting the question and the candidate path into two models in the dual-tower model respectively to obtain a representation vector of the question and a representation vector of the candidate path; The SBERT model is used to calculate the semantic similarity between the representation vector of the question and the representation vector of the candidate path.
6. The method for parsing path-sorted question sentences based on information extraction according to claim 5, characterized in that: In the step S4, the semantic similarity is Jaccard similarity.
7. The method for parsing question sentences by path sorting based on information extraction according to claim 6, characterized in that: The step S5 specifically includes: The first-ranked candidate path is selected as the search path, and the search path is executed in the knowledge graph to obtain data information related to the question involved in the question; Based on a query operation on the knowledge graph, query the data information for information or entities related to the question involved in the question; Parsing the queried information or entities, including filtering, sorting, and integrating, to obtain an answer to the question; Return the answer to the question obtained by parsing. The candidate path ranked first is selected as the search path, and the answer to the question is searched through the search path.
8. A path sorting question parsing system based on information extraction, characterized in that: The system comprises a processing unit configured to perform: Extract candidate entity mentions from questions based on model recognition, dictionary recognition, and heuristic rules; Using a synonym library, the candidate entity mention is expanded, and the candidate entity mention and the expanded candidate entity mention constitute a candidate entity set; Determine the entity type of the question by the number of candidate entities in the candidate entity set, judge the jump type of the question by a BERT-based classification model, and calculate the diffusion value of the candidate entity based on the entity type and the jump type of the question, so as to obtain a candidate path; Using the twin-tower model, the semantic similarity between the question and the candidate paths is calculated, and the candidate paths are sorted based on the semantic similarity; According to the ranking result, the candidate path ranked first is selected as the search path, and the answer to the question is searched through the search path.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps in the path sorting question parsing method based on information extraction according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps in the path sorting question parsing method based on information extraction according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Self-adaptive reasoning question and answer method and system based on industrial cognitive map
CN113010663A
Intelligent question and answer method and device suitable for open source software supply chain
CN115658845A
Knowledge graph-based intention multi-classification question and answer method, apparatus and device, and medium
CN115934914A
Domain knowledge graph question answering method and system based on query path sorting
CN115982338A
Knowledge question and answer method and device, electronic equipment and storage medium
CN117033595A
Cited By
Entity link adaptation method, system and equipment for general information extraction model
CN121597815A