An AI-based intelligent question-answering method and system
By using knowledge graphs and word segmentation technology in the question-answering system, the semantic strength of labeled words is quantified, and the parsing process is adjusted, which solves the problem of inaccurate ranking of keyword semantic importance and achieves a more efficient and accurate question-answering system.
Patent Information
- Application Number
- CN202510478798.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2045-04-16
AI Technical Summary
Existing question-answering systems based on the Transformer model suffer from inaccurate ranking of the semantic importance of keywords when faced with different input word order and different narrative habits, leading to semantic ambiguity and affecting the accuracy of question answering.
By segmenting user query text into words, combining word vector similarity and node tags in the knowledge graph, the semantic strength of the tagged words is quantified, a parsing channel and buffer space are established, the parsing process is adjusted to determine semantic weights, and core words are selected to generate response text.
It improves the efficiency and accuracy of semantic parsing in the question-answering system, ensures more accurate semantic weights for keywords, and generates responses that better match user intent.
Smart Images

Figure CN120407741B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of semantic processing and knowledge graph technology, specifically to an AI-based intelligent question answering method and system. Background Technology
[0002] Existing question-answering systems based on Transformer and Transformer-like models process keywords in the user's input question in parallel to achieve fast and accurate semantic understanding. However, in actual applications, question-answering systems face different input word orders and different narration habits from users, resulting in different distribution positions of the main keywords and the influence and correlation between words. Therefore, when question-answering models identify user keywords in parallel, there is a problem of ambiguity in understanding caused by the semantic importance of keywords identified later being higher than that of keywords identified earlier.
[0003] In existing technologies, attention allocation methods for semantic recognition processes addressing semantic ambiguity issues use the word order of keywords as the analysis order of question-and-answer content. This means that when a keyword in the earlier part of the word order is analyzed, the analysis of subsequent keywords has only just begun. This results in the semantic weight of later keywords failing to influence the analysis results of earlier keywords, leading to differences in the knowledge domains of the keywords and causing the semantic focus of the output answer text to differ from the semantics of the question. However, by setting a buffer in the keyword parsing process and further using the semantic information between the current keyword and other keywords contained in the parameters returned from the keyword parsing results within the buffer, and by controlling the return of the parsed parameters in the network based on the semantic tendency of descriptive words, the actual semantic focus of the question-and-answer can be parsed under different query methods. Summary of the Invention
[0004] This invention provides an AI-based intelligent question-answering method and system to solve the problem of inaccurate semantic weight acquisition caused by word order interference in existing text keyword parsing. The specific technical solution adopted is as follows:
[0005] This invention proposes an AI-based intelligent question-answering method, which includes the following steps:
[0006] Collect the knowledge graph of the intelligent question-answering database and obtain the user's query text;
[0007] The query text is segmented to obtain several words; based on the similarity between each word and the word vector of the node in the knowledge graph, the number of times each node is marked is quantified and several marked words are obtained; combined with the distribution of marked nodes, the response design scale of the query text is obtained; combined with the proportion of marked words in the query text, the number of parsing queues is determined and several parsing channels are established.
[0008] Based on the distribution of marked words in the query text, the analysis scope of each marked word is determined; based on the word vector similarity between other words in the analysis scope and the marked words, as well as the occurrence probability of the same other words in different analysis scopes of the same marked word, the semantic strength of each marked word is obtained; the marked words are filtered by semantic strength in descending order to obtain a high-intensity semantic word sequence.
[0009] The high-intensity semantic word sequence is input into the parsing network to obtain the parsing process of each step at each time step. Based on the parsing process corresponding to the marked words, the parsing contribution of each marked word at each time step and the initial parsing constraints at each time step are quantified, thereby obtaining the buffer semantic integrity preservation degree at each time step. Based on the buffer semantic integrity preservation degree, the buffer space is established in real time and the parsing process is adjusted. Finally, the semantic weight of each word is output.
[0010] Based on the semantic weights, several core words are selected, and the relationship paths are obtained by combining them with the knowledge graph, thereby generating the response text.
[0011] Optionally, the specific method for quantifying the number of tags for each node and obtaining several tags is as follows:
[0012] Obtain the word vectors of each word in the query text and the word vectors of the corresponding words at each node in the knowledge graph;
[0013] If the similarity between the word vector of any word in the query text and the word vector of the corresponding word of any node is greater than the matching threshold, the word in the query text is used as a labeled word, and the word in the query text is labeled once for that node.
[0014] Similarly, obtain all tagged words in the query text, tag the nodes, and obtain the number of tags for each node.
[0015] Optionally, the specific methods for obtaining the response design scale of the query text include:
[0016] Obtain the distance between any two labeled nodes in a knowledge graph;
[0017] Based on the number of times a node is marked and its average distance to other marked nodes, the marking size of each marked node is obtained. The marking size is positively correlated with the number of times a node is marked and negatively correlated with the average distance.
[0018] The sum of the tag sizes of all tagged nodes is used to obtain the response design size for the query text.
[0019] Optionally, the number of parsing queues can be obtained using the following method:
[0020] Based on the proportion of marked words in the query text among all words, and combined with the response design scale, the number of parsing queues is obtained. The number of parsing queues is positively correlated with both the proportion of marked words and the response design scale.
[0021] Optionally, the analysis scope of each marked word is obtained by the following method:
[0022] For any marked word in the query text, obtain several other words before and after the marked word in the word order. These other words are unmarked words. The process continues until all other marked words are encountered. All other words obtained constitute the analysis scope of the marked word.
[0023] Optionally, the specific method for obtaining the semantic strength of each marked word includes:
[0024] For any other word within the analysis scope of any marked word, obtain the similarity between the word vector of the other word and the word vector of the marked word, and use it as the semantic relevance of the other word;
[0025] Obtain several marked words in the query text that have the same word vector as the marked word, and use them as several reference words for the marked word. Use the frequency of the other words appearing in the analysis range of the marked word and all its reference words as the co-occurrence probability of the other words and the marked word.
[0026] All other words within the analysis scope of the marked word are weighted and summed using the co-occurrence probability as a weight. The ratio of the sum to the number of words within the analysis scope of the marked word is taken as the semantic strength of the marked word.
[0027] Optionally, the specific method for quantifying the parsing contribution of each labeled word at each time step and the initial parsing constraints at each time step, and thus obtaining the buffer semantic integrity preservation degree at each time step, includes:
[0028] The parsing process at each time step includes parsing or back-transmission of each word. For any time and any high-intensity semantic word, the difference between the number of steps to complete parsing of the high-intensity semantic word at that time and the number of steps to complete back-transmission is obtained. Combined with the semantic intensity of the high-intensity semantic word, the parsing contribution of the high-intensity semantic word is obtained.
[0029] The ratio of the number of words that have entered the parsing process at this moment to the number of words in the high-intensity semantic word sequence is obtained as the initial parsing constraint at this moment.
[0030] For a number of words that have entered the parsing process at a given moment, the skewness is calculated based on the parsing contribution of each word. Combined with the initial parsing constraints at that moment, the buffer semantic integrity retention is obtained. The buffer semantic integrity retention is positively correlated with both the skewness and the initial parsing constraints.
[0031] Optionally, the specific methods for establishing a buffer space based on the real-time determination of the buffer semantic integrity preservation degree, adjusting the parsing process, and finally outputting the semantic weight of each word include:
[0032] Set a buffer threshold. When the buffer semantic integrity retention rate is greater than the buffer threshold for the first time during the parsing network operation, establish a buffer space and put the entire parsing process at that time into the buffer space. For several words in the parsing process in the buffer space, reorder them in descending order according to their corresponding semantic strength and reallocate the parsing process for subsequent time steps.
[0033] Continue parsing and back-transmitting high-intensity semantic words until the next time the buffer semantic integrity retention rate is greater than the buffer threshold, then establish a buffer space and reallocate the parsing process;
[0034] Similarly, once all high-intensity semantic words have been parsed and returned, other tagged words and other words are input into the parsing network for parsing and return, and no more buffer space is established until all words in the query text have been parsed and returned. The parsing network then outputs the semantic weights of each word.
[0035] Optionally, the specific method for filtering several core words based on the semantic weights and obtaining relationship paths by combining them with a knowledge graph includes:
[0036] All words in the query text are sorted in descending order of semantic weight to obtain a semantic weight word sequence; the top K words in the semantic weight word sequence are obtained by the Top-K method and used as the core words;
[0037] Obtain the nodes marked in the knowledge graph for each core word, sort the nodes corresponding to each core word in descending order of semantic weight, and obtain the core word node traversal sequence.
[0038] For each core vocabulary node, the shortest path between adjacent nodes in the knowledge graph is obtained. The shortest paths are then connected in the order of the nodes to obtain the relationship paths.
[0039] The present invention also proposes an AI-based intelligent question-answering system, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the above method.
[0040] The beneficial effects of this invention are as follows: This invention obtains labeled words and labeled nodes by matching words in the query text with nodes in the knowledge graph. Based on the distribution of labeled nodes and the number of times they are labeled, the design scale of the response text is determined, and the resource scale required for keyword parsing in the query text is initially assessed. Furthermore, considering the number of labeled words, labeled words are allocated for subsequent parsing, thereby establishing a parsing channel. Other words before and after the labeled words are related to the descriptive hints of the labeled words. During the knowledge graph matching overlap process, this can further analyze the relationship between labeled words and corresponding labeled nodes. The association, such as multiple simultaneous occurrences and the semantic similarity reflected by word vectors, further indicates the semantic strength of the labeled words. High-intensity semantic words are selected as the basis for semantic parsing to extract the main keyword structure of the query text. Through the parsing network constructed by the parsing channel and the parsing process at each time step, the necessity of establishing a buffer space at each time step is quantified, that is, the degree of preservation of the semantic integrity of the buffer, and the possibility that the semantic result of the word at the corresponding time step is affected by other semantics. Furthermore, the parsing process is adjusted by combining the buffer space with semantic intensity to ensure that the semantics parsed by words with higher semantic intensity are more accurate. The parsing network outputs the semantic weight of each word, which can be used to select the most critical words for answer generation as core words and combine them with the corresponding nodes of the knowledge graph to generate relationship paths, thereby optimizing the semantic parsing efficiency of the query text and improving the accuracy, and finally completing efficient intelligent question answering. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is a schematic diagram of an AI-based intelligent question-answering method provided in one embodiment of the present invention;
[0043] Figure 2 A diagram illustrating how users input query text through the client;
[0044] Figure 3 This is a diagram illustrating the results of word segmentation of the query text.
[0045] Figure 4 This is a schematic diagram illustrating the parsing process of each step in the network analysis. Detailed Implementation
[0046] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0047] Please see Figure 1 The diagram illustrates a flowchart of an AI-based intelligent question-answering method according to an embodiment of the present invention, which includes the following steps:
[0048] Step S001: Collect the knowledge graph of the intelligent question-answering database and obtain the user's query text.
[0049] The purpose of this embodiment is to match the user's query text with the knowledge graph of the intelligent question-answering database, and then generate a response text to achieve AI intelligent question answering. In the matching analysis process, it is necessary to consider the influence of word order on the semantic weight of keywords in the query text. Therefore, it is necessary to first obtain the corresponding knowledge graph and the query text input by the user.
[0050] Specifically, users input text into the intelligent question-answering client as their question text, such as... Figure 2 As shown.
[0051] Step S002: Obtain several words from the query text through word segmentation; based on the similarity relationship between each word and the word vector of the node in the knowledge graph, quantify the number of times each node is marked and obtain several marked words; combine the distribution of marked nodes to obtain the response design scale of the query text; combine the proportion of marked words in the query text to determine the number of parsing queues and establish several parsing channels.
[0052] It should be noted that the user's question format and the number of knowledge points required are related to the number of parsing steps. Therefore, it is necessary to match and overlap several words obtained from word segmentation in the query text with the knowledge graph, and mark the corresponding nodes. The number of times and distribution of the marked nodes reflect the scale involved in the parsing process of the query text, thus obtaining the response design scale. The establishment of the parsing channel needs to take into account the number of important words, that is, the words of successfully marked nodes, on the basis of the design scale. In other words, the parsing mainly targets important words, thereby completing the establishment of the parsing channel.
[0053] Preferably, in one embodiment of the present invention, the query text is segmented to obtain several words, including the following specific method:
[0054] Jieba word segmentation was used to segment the user's query text, resulting in several words, such as Figure 3As shown; Jieba word segmentation is an existing technology, and will not be described in detail in this embodiment; it should be noted that when the words are completely identical, they are still treated as multiple words for subsequent processing, and identical words are not merged.
[0055] It should be noted that during the word-node matching process, matching is based on the similarity relationship of word vectors. When a certain similarity is reached, the word is successfully marked as a node and then processed further.
[0056] Preferably, in one embodiment of the present invention, based on the similarity relationship between each word and the word vectors of nodes in the knowledge graph, the number of times each node is labeled is quantified to obtain a number of labeled words, including the following specific method:
[0057] Obtain the word vectors of each word in the query text and the word vectors of the corresponding words in the knowledge graph; preset the matching threshold, which is described as 0.8 in this embodiment; if the similarity between the word vector of any word in the query text and the word vector of any word corresponding to a node is greater than the matching threshold, the word in the query text is taken as a labeled word, and the word in the query text is labeled once for that node; and so on, obtain all labeled words in the query text and label the nodes to obtain the number of times each node is labeled.
[0058] It should be noted that the word vector similarity in this embodiment is calculated using the Pearson correlation coefficient; and different words in the query text may be successfully labeled with the same node in the knowledge graph, so the number of node labels may be greater than 1; at the same time, if any word is successfully matched with multiple nodes in the knowledge graph, the node with the highest similarity is taken as the node labeled for that word.
[0059] Preferably, in one embodiment of the present invention, the method for obtaining the response design scale of the query text by combining the distribution of marked nodes includes:
[0060] Obtain the distance between any two labeled nodes in the knowledge graph; based on the number of times a node is labeled and its average distance to other labeled nodes, obtain the label size of each labeled node, wherein the label size is positively correlated with the number of labels and negatively correlated with the average distance; sum up the label sizes of all labeled nodes to obtain the response design size of the query text.
[0061] As an example, the calculation method for the design size m is as follows:
[0062]
[0063] Where G represents the number of labeled nodes, n g This represents the number of times the g-th node that is marked. This represents the average distance between the g-th marked node and other marked nodes. This represents the size of the label of the g-th node that has a label.
[0064] It should be noted that the more times a node is tagged, the larger the design scale of the response text needs to be to accommodate the parsing of more words. Conversely, the smaller the distance between tagged nodes, i.e., the denser the distribution, the more parsing channels need to be established for parsing in a densely distributed knowledge graph, thus requiring a larger design scale.
[0065] Preferably, in one embodiment of the present invention, the number of parsing queues and the establishment of several parsing channels are determined by combining the proportion of marked words in the query text, including the following specific methods:
[0066] Based on the proportion of marked words in the query text among all words, and combined with the response design scale, the number of parsing queues is obtained. The number of parsing queues is positively correlated with both the proportion of marked words and the response design scale.
[0067] As an example, the method for calculating the number of parsing queues F is as follows:
[0068]
[0069] Where m represents the response design size, N h This represents the number of tagged words, where N0 represents the total number of words in the query text. This represents the function for rounding up.
[0070] It should be noted that, based on the design scale, the parsing channels are constructed in combination with the proportion of marked words, that is, the parsing channels are allocated to marked words.
[0071] Furthermore, the intelligent question-answering database server allocates idle computing resources to establish F parsing channels.
[0072] Thus, by matching the words in the query text with the nodes in the knowledge graph, the marked words and marked nodes are obtained. Based on the distribution of marked nodes and the number of markings, the design scale of the response text is determined, and the scale of resources required for keyword parsing in the query text is initially judged. Furthermore, based on the number of marked words, marked words are allocated for subsequent parsing, thereby establishing a parsing channel.
[0073] Step S003: Based on the distribution of marked words in the query text, determine the analysis scope of each marked word; based on the word vector similarity between other words in the analysis scope and the marked words, and the probability of occurrence of the same other words in different analysis scopes of the same marked word, obtain the semantic strength of each marked word; filter the marked words in descending order of semantic strength to obtain a high-intensity semantic word sequence.
[0074] It should be noted that after a node is successfully tagged with a term, it is necessary to combine the descriptions of the tagged term with other untagged terms in order to further overlap with the knowledge graph and thus determine the user's query request. This requires determining the analysis scope of the tagged term through other untagged terms and further quantifying the semantic strength of the tagged term based on the association between other terms and the tagged term. In the subsequent parsing process, the parsing is performed according to the semantic strength order.
[0075] Preferably, in one embodiment of the present invention, the analysis scope of each marked word is determined based on the distribution of marked words in the query text, including the following specific method:
[0076] For any marked word in the query text, obtain several other words before and after the marked word in the word order. These other words are unmarked words. The process continues until all other marked words are encountered. All other words obtained constitute the analysis scope of the marked word.
[0077] Preferably, in one embodiment of the present invention, the semantic strength of each marked word is obtained based on the word vector similarity between other words in the analysis scope and the marked word, and the probability of occurrence of the same other words in different analysis scopes of the same marked word. The specific method includes:
[0078] For any other word within the analysis scope of any marked word, obtain the similarity between the word vector of the other word and the word vector of the marked word, and use it as the semantic relevance of the other word.
[0079] Furthermore, several marked words in the query text that have the same word vector as the marked word are obtained, that is, the same words in the query text corresponding to different word segments, and these are used as several reference words for the marked word. The frequency of the other words appearing in the analysis range of the marked word and all its reference words is used as the co-occurrence probability of the other words and the marked word. It should be noted that if the other words appear multiple times in an analysis range, that is, other words with the same word vector appear multiple times in the same analysis range, they are only counted once. Then the frequency is the ratio of the number of times the other words appear in the analysis range of the marked word and all its reference words to the number of analysis ranges of the marked word and all its reference words.
[0080] Furthermore, for all other words in the analysis scope of the marked word, the semantic relevance is weighted and summed using the co-occurrence probability as the weight. The ratio of the sum to the number of words in the analysis scope of the marked word is taken as the semantic strength of the marked word.
[0081] As an example, the semantic strength Q of the tagged word w w The calculation method is as follows:
[0082]
[0083] Where, N′ w P represents the number of words in the analysis scope of the marked word w. w,i c represents the co-occurrence probability of the i-th other word and the labeled word w within the analysis range of the labeled word w. w,i This represents the semantic relevance of the i-th other word within the analysis scope of the tagged word w.
[0084] It should be noted that in the process of quantifying the semantic strength of the marked words, the correlation between the marked words and other words in the analysis scope is comprehensively quantified. At the same time, for other words, the co-occurrence probability is used as a reference weight. That is, the more times the two words appear together, the greater the correlation between them, and the greater the correlation, the greater the semantic strength.
[0085] It should be further noted that, without following word order in the vocabulary analysis, words with higher semantic intensity should be analyzed with higher priority. This requires selecting high-intensity semantic words. The structure between high-intensity semantic words forms the main semantic structure of the query text. During the analysis process, attention should be paid to the main semantic structure of the text first, so as to highlight the actual question key points of the query text, rather than analyzing all words at the same time, which would interfere with the influence of word order distribution on the actual semantic structure.
[0086] Preferably, in one embodiment of the present invention, the method for obtaining a high-intensity semantic word sequence by filtering the marked words in descending order of semantic strength includes:
[0087] Sort all marked words in descending order according to semantic intensity to obtain a semantic intensity word sequence; obtain a semantic intensity difference sequence through first-order difference, the difference process is to subtract the semantic intensity of the next marked word from the semantic intensity of the previous marked word in the semantic intensity word sequence, then the semantic intensity difference sequence contains several differences arranged in order; take the two marked words corresponding to the maximum difference in the semantic intensity difference sequence as segment words; take the first segment word of the two segment words in the semantic intensity word sequence and all the marked words before it as high-intensity semantic words, and sort them in descending order of semantic intensity to obtain a high-intensity semantic word sequence.
[0088] At this point, all other words before and after the marked word are related to the description prompts of the marked word. In the process of knowledge graph matching overlap, it can play a role in further analyzing the relationship between the marked word and the corresponding marked node. The association performance, such as multiple simultaneous occurrences and the similarity between semantics reflected by word vectors, further indicates the semantic strength of the marked word. High-strength semantic words are selected as the basis for semantic parsing to extract the main structure of keywords in the query text.
[0089] Step S004: Input the labeled words into the parsing network based on the high-intensity semantic word sequence to obtain the parsing process of each step at each time step; according to the parsing process corresponding to the labeled words, quantify the parsing contribution of each labeled word at each time step and the initial parsing limit at each time step, and then obtain the buffer semantic integrity preservation degree at each time step; based on the buffer semantic integrity preservation degree, determine and establish a buffer space in real time, adjust the parsing process, and finally output the semantic weight of each word.
[0090] It should be noted that after filtering high-intensity semantic words, parsing is performed in the following order: high-intensity semantic words, other marked words, and other words. The parsing channel has already been established, and the parsing process involves inputting words sequentially and parsing them step-by-step. Then, the semantic weights generated by the parsing are fed back to the previous processes (steps), such as... Figure 4 As shown, it illustrates the process of parsing and transmitting words X1, X2, and X3 one by one, taking three parsing channels as an example; the parsing and transmission ensure the parsing accuracy when the same word, such as X1, appears again.
[0091] It should be further noted that during the process of parsing high-intensity semantic words step by step, a buffer space should be established when a large number of high-intensity semantic words have completed the later parsing process, while fewer have completed the entire return process. The parsing process and return process in the buffer space should be adjusted according to the semantic intensity to avoid the impact of the order on the semantic weight of high-intensity semantic words.
[0092] Preferably, in one embodiment of the present invention, the parsing process for each step at each time step is obtained by inputting labeled words based on high-intensity semantic word sequences into the parsing network, including the following specific methods:
[0093] Based on the established F parsing channels, high-intensity semantic words are input into the parsing network one by one according to the sequence of high-intensity semantic words, and the parsing proceeds downwards channel by channel. After all parsing channels are completed, backpropagation begins, that is, backpropagation occurs channel by channel. After the input of high-intensity semantic words is completed, other marked words are input according to the sequence of semantic intensity words. After all marked words are input, the words in the query text other than the marked words are input according to the word order in the query text. Thus, for each parsing channel in the parsing network, each parsing channel corresponds to a step, generating the parsing process for each step at each time point, that is, which word is being parsed or backpropagated at each time point.
[0094] It should be noted that, based on the parsing process at each time step, it is necessary to determine in real time the necessity of establishing a buffer space. That is, how many words have not yet completed all the backhaul steps and have completed a lot of parsing steps. In this case, their semantics are easily affected by the semantic parsing results of other words. In this case, it is necessary to adjust the parsing or backhaul process by establishing a buffer space to eliminate this influence.
[0095] Preferably, in one embodiment of the present invention, based on the parsing process corresponding to the marked words, the parsing contribution of each marked word at each time step and the initial parsing constraints at each time step are quantified, thereby obtaining the buffer semantic integrity preservation degree at each time step. The specific method includes:
[0096] For any given moment and any high-intensity semantic word, obtain the difference between the number of steps to complete the parsing of the high-intensity semantic word at that moment and the number of steps to complete the backhaul. Combine this difference with the semantic intensity of the high-intensity semantic word to obtain the parsing contribution of the high-intensity semantic word.
[0097] As an example, the parsing contribution γ of a high-intensity semantic word v at time t. v,t The calculation method is as follows:
[0098]
[0099] Among them, Q v Q represents the semantic strength of a high-intensity semantic word v. max H represents the maximum semantic strength among all marked words. v,t R represents the number of steps required to parse a high-intensity semantic word v at time t. v,t This represents the number of steps that a high-intensity semantic word v completes its backhaul at time t.
[0100] It should be noted that after subtracting the number of backhaul steps from the number of parsing steps to obtain the difference, it reflects the parsing depth of high-intensity semantic words at the corresponding time. The greater the parsing depth, the more easily it is affected by the semantics of other words. Combined with the greater semantic intensity, the corresponding parsing contribution is greater.
[0101] Furthermore, the ratio of the number of words that have entered the parsing process at any given time to the number of words in the high-intensity semantic word sequence is obtained as the initial parsing limit at that time. It should be noted that the words that have entered the parsing process are those that have been input into the parsing network, that is, they have started the parsing process from the first parsing channel (step), and the number of words that have entered the parsing process includes the high-intensity semantic words that have completed the entire backhaul process.
[0102] Furthermore, for several words that have entered the parsing process at that moment, the skewness is calculated based on the parsing contribution of each word, and the buffer semantic integrity retention degree at that moment is obtained by combining the initial parsing constraints at that moment. The buffer semantic integrity retention degree is positively correlated with both the skewness and the initial parsing constraints.
[0103] As an example, the buffer semantic integrity retention δ at time t. t The calculation method is as follows:
[0104]
[0105] Among them, y t p represents the initial analytical constraint at time t. t γ represents the number of words that have entered the parsing process at time t. q,t This represents the parsing contribution of the q-th high-intensity semantic word at time t. σ(γ) represents the average parsing contribution of all words that have entered the parsing process at time t. t ) represents the standard deviation of the parsing contribution of all words that have entered the parsing process at time t.
[0106] It should be noted that the greater the initial parsing constraint, i.e. the more input words there are, and the greater the skewness, i.e. the more the parsing contribution is biased towards the same value, the similar the parsing contributions will be. In this case, it is easier to reduce the influence between semantic results by establishing a buffer space to adjust the parsing process.
[0107] Preferably, in one embodiment of the present invention, a buffer space is established in real time based on the buffer semantic integrity preservation degree, and the parsing process is adjusted to finally output the semantic weight of each word. The specific method includes:
[0108] A buffer threshold is set; in this embodiment, a buffer threshold of 3 is used. During the parsing network operation, when the first instance occurs where the buffer semantic integrity retention exceeds the buffer threshold, a buffer space is established, and the entire parsing process at that moment is placed into the buffer space. For several words in the parsing process within the buffer space (both in parsing or both in postback), they are reordered in descending order of their corresponding semantic strength, and the parsing processes for subsequent moments are reallocated. For example... Figure 4 At time T6, both words X1 and X2 are in the backhaul process, and the semantic strength of X1 is greater than that of X2. After reallocation, the backhaul process of X1 will be executed first.
[0109] Furthermore, the high-intensity semantic words continue to be parsed and back-transmitted until the buffer semantic integrity retention rate at the next moment exceeds the buffer threshold. At this point, a buffer space is established and the parsing process is reallocated. This process continues until all high-intensity semantic words have been parsed and back-transmitted. Other tagged words and other words are then input into the parsing network for parsing and back-transmission without establishing a buffer space. This continues until all words in the query text have been parsed and back-transmitted. The parsing network then outputs the semantic weights of each word.
[0110] It should be noted that after the parsing network has input all the high-intensity semantic words, it inputs, parses, and returns other marked words and other words in a fixed order. The input order has been shown in the above steps. Other marked words are the marked words other than the high-intensity semantic words among all marked words. Other words are the words in the query text other than the marked words.
[0111] Thus, by constructing the parsing network through the parsing channel and the parsing process at each time step, the necessity of establishing the buffer space at each time step is quantified, that is, the degree of preservation of the semantic integrity of the buffer, and the possibility that the semantic result of the word at the corresponding time step is affected by other semantics is presented. Furthermore, the parsing process is adjusted by combining the buffer space with the semantic strength to ensure that the semantics of words with higher semantic strength are parsed more accurately.
[0112] Step S005: Based on the semantic weights, select several core words and combine them with the knowledge graph to obtain the relationship path, and then generate the response text.
[0113] Specifically, all words in the query text are sorted in descending order of semantic weight to obtain a semantic weight word sequence; the top K words in the semantic weight word sequence are obtained using the Top-K method and used as core words. In this embodiment, K=5 is used for description; the nodes marked by each core word in the knowledge graph are obtained, and the nodes corresponding to each core word are sorted in descending order of semantic weight to obtain a core word node traversal sequence; the shortest path between adjacent nodes in the core word node traversal sequence is obtained in the knowledge graph, and the shortest paths are connected according to the node order to obtain the relationship path.
[0114] Furthermore, the system retrieves the language library vocabulary corresponding to each core vocabulary node in the intelligent question-answering database according to the relationship path, and selects the vocabulary with the highest similarity to all keywords in the relationship path for matching. This completes the full parsing of the query text, and then the intelligent question-answering database generates the corresponding response text based on the parsing results.
[0115] At this point, the semantic weights of each word output by the parsing network are used to filter out the most crucial words for answer generation. These words are then used as core words and combined with the corresponding nodes in the knowledge graph to generate relationship paths. This optimizes the semantic parsing efficiency of the query text and improves its accuracy, ultimately achieving efficient intelligent question answering.
[0116] Another embodiment of the present invention provides an AI-based intelligent question-answering system, which includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the above-described method steps S001 to S005.
[0117] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An AI-based intelligent question-answering method, characterized by, The method comprises the following steps: Collect the knowledge graph of the intelligent question and answer library and obtain the inquiry text of the user; A plurality of words are obtained by segmenting the inquiry text; the number of labels of each node is quantified and a plurality of labeled words are obtained according to the word vector similarity relationship between each word and the nodes in the knowledge graph; the reply design scale of the inquiry text is obtained in combination with the distribution of the nodes with labels; the number of analysis queues is determined and a plurality of analysis channels are established in combination with the proportion of the number of labeled words in the inquiry text; The analysis range of each labeled word is determined according to the distribution of the labeled words in the inquiry text; the semantic intensity of each labeled word is obtained based on the word vector similarity between other words and the labeled words in the analysis range and the appearance probability of the same other words in different analysis ranges of the same labeled word; a high-intensity semantic word sequence is obtained by screening the labeled words in descending order of semantic intensity; The labeled words are input into the analysis network based on the high-intensity semantic word sequence to obtain the analysis process of each step at each time; the analysis contribution of each labeled word at each time and the initial analysis limit at each time are quantified according to the analysis process corresponding to the labeled words, and then the buffer semantic integrity retention degree at each time is obtained; the buffer space is established in real time based on the buffer semantic integrity retention degree, and the analysis process is adjusted, and finally the semantic weight of each word is output; A plurality of core words are selected based on the semantic weight, and a relationship path is obtained in combination with the knowledge graph, and then a reply text is generated; The specific method for quantifying the analysis contribution of each labeled word at each time and the initial analysis limit at each time, and then obtaining the buffer semantic integrity retention degree at each time comprises: The analysis process of each step at each time comprises analysis or return of each word; for any time and any high-intensity semantic word, the difference between the number of steps completed by analysis and the number of steps completed by return of the high-intensity semantic word at the time is obtained, and the analysis contribution of the high-intensity semantic word is obtained in combination with the semantic intensity of the high-intensity semantic word; The ratio of the number of words that have entered the analysis process at the time to the number of words in the high-intensity semantic word sequence is obtained as the initial analysis limit at the time; For a plurality of words that have entered the analysis process at the time, the skewness is calculated based on the analysis contribution of each word, the buffer semantic integrity retention degree at the time is obtained in combination with the initial analysis limit at the time, and the buffer semantic integrity retention degree is in positive correlation with the skewness and the initial analysis limit; The specific method for establishing the buffer space in real time based on the buffer semantic integrity retention degree, adjusting the analysis process, and finally outputting the semantic weight of each word comprises: A buffer threshold is set; during the running of the analysis network, when the buffer semantic integrity retention degree at a time is greater than the buffer threshold for the first time, a buffer space is established, and the analysis process at the time is put into the buffer space; a plurality of words in the buffer space are reordered in descending order of corresponding semantic intensity and are re-allocated the analysis process at the subsequent time. Continue to parse and return the high-intensity semantic vocabulary until the buffer semantic integrity retention degree of the next occurrence of a moment is greater than the buffer threshold, establish a buffer space and reassign the parsing process; By analogy, when the high-intensity semantic vocabulary is completely parsed and returned, other marked vocabularies and other vocabularies are normally input into the parsing network for parsing and returning, and no buffer space is established until the parsing and returning of all vocabularies in the query text are completed, and the parsing network outputs the semantic weight of each vocabulary.
2. The AI-based intelligent question answering method of claim 1, wherein, The specific method for quantifying the number of marks of each node and obtaining a plurality of marked vocabularies comprises: Obtain the word vector of each vocabulary in the query text and the word vector of the corresponding vocabulary of each node in the knowledge graph; If the similarity between the word vector of any vocabulary in the query text and the word vector of the corresponding vocabulary of any node is greater than the matching threshold, the vocabulary in the query text is regarded as a marked vocabulary, and the vocabulary in the query text marks the node once; By analogy, all marked vocabularies in the query text are obtained, and the nodes are marked to obtain the number of marks of each node.
3. The AI-based intelligent question answering method of claim 1, wherein, The specific method for obtaining the reply design scale of the query text comprises: Obtain the distance between any two nodes with marks in the knowledge graph; According to the number of marks of the node and the average distance between the node and other nodes with marks, obtain the mark scale of each node with marks, the mark scale is positively correlated with the number of marks, and the mark scale is negatively correlated with the average distance; Accumulate the mark scale of all nodes with marks to obtain the reply design scale of the query text.
4. The AI-based intelligent question answering method of claim 1, wherein, The specific method for obtaining the number of parsing queues comprises: According to the proportion of the number of marked vocabularies in the query text in all vocabularies, and combining the reply design scale, the number of parsing queues is obtained, and the number of parsing queues is positively correlated with the proportion and the reply design scale.
5. The AI-based intelligent question answering method of claim 1, wherein, The specific method for obtaining the analysis range of each marked vocabulary comprises: For any marked vocabulary in the query text, obtain a plurality of other vocabularies before and after the marked vocabulary in the order, the other vocabularies are non-marked vocabularies, and the acquisition stops when other marked vocabularies are traversed, and all the obtained other vocabularies constitute the analysis range of the marked vocabulary.
6. The AI-based intelligent question answering method of claim 1, wherein, The specific method for obtaining the semantic intensity of each marked vocabulary comprises: For any other vocabulary in the analysis range of any marked vocabulary, obtain the similarity between the word vector of the other vocabulary and the word vector of the marked vocabulary, and regard it as the semantic correlation of the other vocabulary; Obtain a plurality of marked vocabularies with the same word vector as the marked vocabulary in the query text, and regard them as a plurality of reference vocabularies of the marked vocabulary, and regard the frequency of the other vocabulary in the analysis range of the marked vocabulary and all reference vocabularies of the marked vocabulary as the co-occurrence probability of the other vocabulary and the marked vocabulary; Weight the sum of the semantic correlations in the analysis range of the marked vocabulary by using the co-occurrence probability as the weight, and regard the ratio of the sum value to the number of vocabularies in the analysis range of the marked vocabulary as the semantic intensity of the marked vocabulary.
7. The AI-based intelligent question answering method of claim 1, wherein, The method comprises the following steps of: arranging all the words in the query text in descending order of semantic weight to obtain a sequence of words with semantic weight; and obtaining the first K words in the sequence of words with semantic weight as core words by using a Top-K method; obtaining the nodes marked by each core word in the knowledge graph, and sorting the nodes corresponding to each core word in descending order of semantic weight to obtain a core word node traversal sequence; obtaining the shortest paths between adjacent nodes in the core word node traversal sequence in the knowledge graph, and connecting the shortest paths in the order of nodes to obtain a relationship path.
8. An AI-based intelligent question-answering system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, The processor executes the computer program to implement the steps of the AI-based intelligent question answering method according to any one of claims 1-7.
Citation Information
Patent Citations
Knowledge graph intelligent question-answer method fusing pointer generation network
CN113010693A
Construction method and device of knowledge base question-answering system, equipment and storage medium
CN119293164A