Intelligent question-answering system and question-answering method
Through neural network models and keyword recognition technology, the difficulties faced by traditional question-answering systems in processing complex and diverse queries are solved, and more accurate and personalized question-answering services are achieved.
Patent Information
- Application Number
- CN202411430739.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-10-14
AI Technical Summary
Traditional question answering systems have difficulty handling complex and diverse queries, require a lot of manual work to build and maintain rules and templates, have difficulty adapting to new domains or new types of queries, and perform poorly when dealing with fuzzy or ambiguous questions.
A neural network model is used in combination with keyword recognition and relevance calculation. By collecting question training data, performing data preprocessing and annotation, calculating the relevance between question keywords and knowledge base documents, generating multiple answers and sorting them according to confidence scores, and finally adjusting the model based on user feedback to improve accuracy.
It improves the accuracy and relevance of the question-answering system, provides convenient, personalized, efficient, and real-time services, and generates more accurate answers.
Smart Images

Figure CN119294521B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to an intelligent question-answering system and a question-answering method. Background Art
[0002] With the development of machine learning and deep learning, modern artificial intelligence systems have made significant progress, capable of handling more complex and diverse questions. Traditional question-answering systems struggle to handle complex and diverse queries, requiring extensive manual work to build and maintain rules and templates. They also struggle to adapt to new domains or types of queries and perform poorly when handling fuzzy or ambiguous questions.
[0003] The introduction of neural network models enables intelligent question-answering systems to learn complex patterns from large amounts of data, learn common knowledge points from training data, and apply them to unseen questions, thereby improving the accuracy and relevance of answers and providing convenient, personalized, efficient, and real-time services. Summary of the Invention
[0004] The present invention provides an intelligent question-answering method, comprising:
[0005] S10, collect problem training data and perform data preprocessing;
[0006] S20, performing data annotation and data segmentation on the question text to obtain keywords in the question;
[0007] S30, calculating the relevance score between the question keywords and the knowledge base documents, thereby finding the most relevant document set;
[0008] S40, applying the neural network model to generate multiple answers based on the relevant fragments in the document collection, and calculating a confidence score for each answer;
[0009] S50, sorting the answers according to the confidence scores, and selecting the answer with the highest score as the final answer;
[0010] S60. Adjust the neural network model based on user feedback to improve the accuracy of future answers.
[0011] As described above, an intelligent question-answering method is provided, in which obtaining keywords in a question is specifically divided into the following sub-steps: segmenting the question text into a series of words; assigning a part-of-speech tag to each word; constructing a dependency syntax tree to represent the dependency relationship between words; identifying sentence boundaries to segment the question text into multiple sentences; and using a keyword recognition function to identify keywords in the question.
[0012] As described above, an intelligent question-answering method, in which obtaining the most relevant document set is specifically divided into the following sub-steps: calculating the correlation score between the question keyword and a document in the knowledge base; traversing until the correlation scores of all documents in the knowledge base are calculated; and judging whether the document enters the relevant document set based on the correlation score.
[0013] As described above, in an intelligent question-answering method, in order to calculate the correlation score between a question keyword and a document in a knowledge base, it is necessary to first calculate the keyword occurrence score and the related fragment length score, and then comprehensively calculate the correlation score based on the keyword occurrence score and the related fragment length score.
[0014] In the intelligent question-answering method described above, a document is determined to be included in a set of relevant documents based on its relevance score. To be included in the set, the relevance of the document must be greater than a set relevance threshold. The threshold is adjusted based on actual results. If the recall rate is too low, the threshold is appropriately lowered; if the precision is insufficient, the threshold is increased.
[0015] As described above, an intelligent question-answering method, in which the confidence score of each answer is calculated, is specifically divided into the following sub-steps: relevant fragments in the document collection are input into the encoder, and the forgotten fragments are calculated; multiple answers are intelligently generated from the highly relevant fragments output by the encoder; the incoherence of the answers is minimized using an optimization objective function; and the confidence score of each answer is calculated.
[0016] In the intelligent question-answering method described above, the composition of forgotten fragments requires first using an encoder to encode relevant fragments in a document collection into a vector of fixed length, and then filtering out descriptions in the fragments that are not related to keywords and forgetting them, and combining the forgotten descriptions into forgotten fragments.
[0017] The present invention also provides an intelligent question-answering system, comprising: a data collection and processing module, a keyword module, a relevance module, an answer module, and a feedback module.
[0018] Data collection and processing module: used to collect question text data and related answer data and perform data preprocessing.
[0019] Keyword module: used to perform data annotation and data segmentation on question text to obtain question keywords.
[0020] Relevance module: used to calculate the relevance score between question keywords and knowledge base documents, so as to find the most relevant document set.
[0021] The answer module applies a neural network model to generate multiple answers based on relevant snippets in a document collection and calculates a confidence score for each answer. The answers are ranked by confidence score, and the highest-scoring answer is selected as the final answer.
[0022] Feedback module: used to adjust the neural network model based on user feedback to improve the accuracy of future answers.
[0023] The present invention also provides a computer storage medium comprising at least one memory and at least one processor;
[0024] a memory for storing one or more program instructions;
[0025] The processor is used to run one or more program instructions to execute a method for implementing an intelligent question-answering system.
[0026] The beneficial effects achieved by the present invention are as follows: the present invention selects highly relevant fragments based on the correlation between question keywords and knowledge base documents, and applies a neural network model to generate answers to questions, making the generated answers more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments described in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0028] Figure 1 This is a flow chart of an intelligent question-answering method provided in Example 1 of the present application.
[0029] Figure 2 This is a schematic diagram of an intelligent question-answering system provided in Example 2 of this application. DETAILED DESCRIPTION
[0030] The following is a clear and complete description of the technical solutions in the embodiments of the present invention, in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0031] Example 1
[0032] like Figure 1 As shown, the first embodiment of the present application provides an intelligent question-answering method, including:
[0033] S10. Collect problem training data and perform data preprocessing.
[0034] We collect large amounts of question text and related answer data from the internet, databases, and other sources. We compare the question text content, remove duplicate questions, clean up HTML tags, and unify the text format, including converting it to lowercase, removing punctuation, removing stop words, and checking and deleting duplicate data rows. The preprocessed text is represented by T.
[0035] S20: perform data annotation and data segmentation on the question text to obtain keywords in the question.
[0036] S21. For the question text T, use the formula W=Seg(T) to split the question text T into a series of words, Seg is the word segmentation function, and the word sequence after segmentation is T'={w1,w2,...,w i}express.
[0037] S22. For each word w i Assign a part-of-speech tag t i , specifically using the formula P = POS (T'), POS is the part-of-speech tagging function, and the word sequence with part-of-speech tags uses T" = {(w1, t1), (w2, t2), ..., (w i ,t i )}express.
[0038] S23. Construct a dependency syntax tree D to represent the dependency relationship between words. Specifically, the formula D=DepParse(T") is used. DepParse is a dependency syntax analysis function.
[0039] S24, identify sentence boundaries and segment the question text T into sentences. Specifically, use the formula B = Boundaries(T,D). Boundaries is a sentence boundary detection function. The segmented sentence sequence is S = {S1, S2, ..., S n}express.
[0040] Identify the key words in the question, using the formula K = Keywords(T", D, S β |S), where Keywords is the keyword recognition function, T" is the word sequence with part-of-speech tags, D is the dependency syntax tree, and S β Represents the βth sentence, K is the set of keywords that are considered important, and keywords are searched in each sentence of the sentence set S based on the part of speech and the dependency relationship between words, and the found keywords are stored in the K set.
[0041] S30. Calculate the relevance score between the question keywords and the knowledge base documents to find the most relevant document set.
[0042] Knowledge base documents are sourced from public databases, online resources, and specialized databases, covering a wide range of topics, such as demographic data, geographic information, weather forecasts, and news articles. These resources are freely available online or through APIs. Experts or research teams in specific fields maintain their own knowledge bases, such as medical, legal, and financial databases. These databases are typically regularly updated by professionals and provide high-quality information.
[0043] S31. Calculate the relevance score between the question keyword and a document in the knowledge base.
[0044] Formula for calculating the relevance score between question keywords and a document in the knowledge base where Y γ Indicates the score of the number of times a keyword appears. Indicates the score of the relevant fragment length. The formula for calculating the score of the number of times the keyword appears is: Where M represents the number of keywords in the question keyword set. i represents the i-th keyword, γ(k i ) represents the keyword k i The number of times it appears in the document, N represents the total number of words in the document.
[0045] Related fragment length score calculation formula Where M represents the number of keywords in the question keyword set, Indicates that it contains the keyword k i The total number of words in the fragment, N represents the total number of words in the document.
[0046] S32. Traverse step S31 until the relevance scores of all documents in the knowledge base are calculated.
[0047] S33. Determine whether the document is included in the relevant document set based on the relevance score.
[0048] Using the formula Determine whether a document is included in the relevant document set. If the relevance score is greater than or equal to 40%, it is included in the relevant document set. The threshold is adjusted based on actual performance. If the recall rate is too low, lower the threshold appropriately; if the precision is insufficient, increase the threshold.
[0049] S40. Apply the neural network model to generate multiple answers based on relevant fragments in the document collection, and calculate the confidence score of each answer.
[0050] Relevant snippets from these document collections are fed into a neural network model, which is trained to generate answers.
[0051] This neural network model consists of an encoder and a decoder.
[0052] S41. Input relevant segments in the document collection into the encoder and calculate the forgotten segments.
[0053] The encoder encodes the relevant segments into a fixed-length vector. It is necessary to filter out the descriptions that are not related to the keywords and forget them. The forgotten descriptions are combined into forgotten segments. The specific formula is: E forgotten ={H j |g(f j )=1∧R(H j ,K) <T r}, where H j Indicates an independent sentence in the fragment, g(f j ) represents the forgetting function, and the formula is f j Represents the output of the forget gate, which is a component of the recurrent neural network and determines the strength of the association between the sentence and the keyword. f Represents the forgetting threshold. If the correlation between the sentence and the keyword is greater than the forgetting threshold, the correlation is weak, then g(f j )=1. g(f j ) indicates that the forgetting value of the sentence in the segment is greater than the forgetting threshold, R(H j ,K) represents sentence H j The correlation score between keyword K, T r Represents the correlation threshold.
[0054] S42. Intelligently generate multiple answers based on the highly correlated segments output by the encoder.
[0055] The set of highly correlated segments output by the encoder is F = {F1, F2, ..., F n}, each fragment F n Represents a part of a potential answer, and calculates the relevance score of the fragments in the fragment set. The specific formula is Where K is the keyword and TF_IDF is the relevance calculation function. The decoder generates the answer based on the fragment output by the encoder. The specific formula is:
[0056] The fragment set is F = {F1, F2, ..., F n}, Q represents the whole question, Q δ Represents the non-keyword part of the question, and the keyword set is K = {K1, K2, ..., K η}, R(F I ,K j ) represents the relevance between the text segment F and the keyword K, V(F I ,Q δ ) is a semantic similarity function, which represents the similarity between the text segment F and the non-keyword part Q in the questionδ semantic similarity.
[0057] S43. Use an optimization objective function to minimize the incoherence of the answer.
[0058] The specific formula is where p=(p1,p2,...,p χ ) represents the permutation vector of the fragment, L(p) represents the loss function, χ represents the number of fragments, cos(L(F λ ),L(F λ+1 )) represents fragment F λ and the next fragment F λ+1 The cosine similarity between vectors,adjacent segments are very close in semantics, then their similarity score will be relatively high,,leading to better coherence of the whole answer.
[0059] S44. Calculate the confidence score for each answer.
[0060] For each generated answer a i , using a scoring mechanism to measure its similarity with the reference answers in the training data. The confidence score Z(a i ) can be calculated by the following formula: in, The difference between the generated answer and the reference answer is calculated, p n is the exact match rate of n-grams of length n in the candidate answer. n-gram refers to a combination of items of length n extracted continuously from the answer text. r n is the ratio of n-grams of length n in the reference answer, where N is the maximum n-gram length. It is used to measure the richness and diversity of n-grams in the generated answers. The higher the score, the more n-grams are contained in the generated answers, and the higher the similarity with the reference answers. n Represents the weight factor.
[0061] S50. Sort the answers according to the confidence scores, and select the answer with the highest score as the final answer.
[0062] Using the formula The answer with the highest score is selected as the final answer, where a p Represents the permutation function, used to rearrange the order of the answers, arg max 1≤i≤n s i Indicates finding the answer with the highest confidence score from the 1st answer to the nth answer, s i represents the confidence score of the i-th answer.
[0063] S60. Adjust the neural network model based on user feedback to improve the accuracy of future answers.
[0064] Record user satisfaction ratings or direct feedback on answers, including positive and negative comments and suggestions for improvement. Analyze the collected feedback to identify answers with high satisfaction ratings. This involves evaluating answers for length, content, grammar, logic, and other aspects. Based on the analysis results, adjust the neural network model used to generate answers to improve the accuracy of future answers.
[0065] Example 2
[0066] like Figure 2 As shown, the second embodiment of the present application provides an intelligent question-answering system, including:
[0067] Data collection and processing module: used to collect question text data and related answer data and perform data preprocessing.
[0068] We collect large amounts of question text and related answer data from the internet, databases, and other sources. We compare the question text content, remove duplicate questions, clean up HTML tags, and unify the text format, including converting it to lowercase, removing punctuation, removing stop words, and checking and deleting duplicate data rows. The preprocessed text is represented by T.
[0069] Keyword module: includes segmentation submodule, part-of-speech tag submodule, dependency syntax tree submodule, boundary recognition submodule, and keyword submodule.
[0070] The segmentation submodule divides the question text into a series of words.
[0071] For the question text T, the formula W=Seg(T) is used to split the question text T into a series of words, Seg is the word segmentation function, and the word sequence after segmentation is T'={w1,w2,...,w i}express.
[0072] The part-of-speech tag submodule assigns a part-of-speech tag to each word.
[0073] For each word w i Assign a part-of-speech tag t i , specifically using the formula P = POS (T'), POS is the part-of-speech tagging function, and the word sequence with part-of-speech tags uses T" = {(w1, t1), (w2, t2), ..., (w i ,t i )}express.
[0074] The dependency syntactic tree submodule represents the dependency relationship between words.
[0075] Construct a dependency syntax tree D to represent the dependency relationship between words. Specifically, use the formula D=DepParse(T”), where DepParse is a dependency syntax analysis function.
[0076] The identification boundary submodule segments the question text into sentences.
[0077] Identify sentence boundaries and segment the question text T into sentences. Specifically, use the formula B = Boundaries(T,D). Boundaries is the sentence boundary detection function. The segmented sentence sequence is S = {S1, S2, ..., S n}express.
[0078] The keyword submodule is used to identify key words in the question.
[0079] Identify the key words in the question, using the formula K = Keywords(T", D, S β |S), where Keywords is the keyword recognition function, T" is the word sequence with part-of-speech tags, D is the dependency syntax tree, and S β Represents the βth sentence, K is the set of keywords that are considered important, and keywords are searched in each sentence of the sentence set S based on the part of speech and the dependency relationship between words, and the found keywords are stored in the K set.
[0080] Relevance module: includes knowledge base sub-module, calculation sub-module, and relevance document collection sub-module.
[0081] The knowledge base submodule is used to collect knowledge base document data.
[0082] Knowledge base documents are sourced from public databases, online resources, and specialized databases, covering a wide range of topics, such as demographic data, geographic information, weather forecasts, and news articles. These resources are freely available online or through APIs. Experts or research teams in specific fields maintain their own knowledge bases, such as medical, legal, and financial databases. These databases are typically regularly updated by professionals and provide high-quality information.
[0083] The calculation submodule is used to calculate the relevance score between the question keyword and a document in the knowledge base.
[0084] Formula for calculating the relevance score between question keywords and a document in the knowledge base where Y γ Indicates the score of the number of times a keyword appears. Indicates the score of the relevant fragment length. The formula for calculating the score of the number of times the keyword appears is: Where M represents the number of keywords in the question keyword set. irepresents the i-th keyword, γ(k i ) represents the keyword k i The number of times it appears in the document, N represents the total number of words in the document.
[0085] Related fragment length score calculation formula Where M represents the number of keywords in the question keyword set, Indicates that it contains the keyword k i The total number of words in the fragment, N represents the total number of words in the document.
[0086] The above steps are repeated until the relevance scores of all documents in the knowledge base are calculated.
[0087] The relevance document collection submodule is used to determine whether a document meets the conditions for entering the relevance document collection.
[0088] Using the formula Determine whether a document is included in the relevant document set. If the relevance score is greater than or equal to 40%, it is included in the relevant document set. The threshold is adjusted based on actual performance. If the recall rate is too low, lower the threshold appropriately; if the precision is insufficient, increase the threshold.
[0089] Answer module: includes encoder sub-module, decoder sub-module, optimization objective function sub-module, and confidence sub-module.
[0090] The encoder submodule computes the forgotten segments based on the relevant segments in the document set input to the encoder.
[0091] The encoder encodes the relevant segments into a fixed-length vector. It is necessary to filter out the descriptions that are not related to the keywords and forget them. The forgotten descriptions are combined into forgotten segments. The specific formula is: E forgotten ={H j |g(f j )=1∧R(H j ,K) <T r}, where H j Indicates an independent sentence in the fragment, g(f j ) represents the forgetting function, and the formula is f j Represents the output of the forget gate, which is a component of the recurrent neural network and determines the strength of the association between the sentence and the keyword. f Represents the forgetting threshold. If the correlation between the sentence and the keyword is greater than the forgetting threshold, the correlation is weak, then g(f j )=1. g(f j ) indicates that the forgetting value of the sentence in the segment is greater than the forgetting threshold, R(H j ,K) represents sentence H j The correlation score between keyword K, Tr Represents the correlation threshold.
[0092] The decoder submodule generates the answer based on the segments output by the encoder.
[0093] The set of highly correlated segments output by the encoder is F = {F1, F2, ..., F n}, each fragment F n Represents a part of a potential answer, and calculates the relevance score of the fragments in the fragment set. The specific formula is Where K is the keyword and TF_IDF is the correlation calculation function.
[0094] The decoder generates the answer based on the fragments output by the encoder. The specific formula is:
[0095] The fragment set is F = {F1, F2, ..., F n}, Q represents the whole question, Q δ Represents the non-keyword part of the question, and the keyword set is K = {K1, K2, ..., K η}, R(F I ,K j ) represents the relevance between the text segment F and the keyword K, V(F I ,Q δ ) is a semantic similarity function, which represents the similarity between the text segment F and the non-keyword part Q in the question δ semantic similarity.
[0096] The Optimization Objective Function submodule uses the optimization objective function to minimize the incoherence of the answer.
[0097] The specific formula is where p=(p1,p2,...,p χ ) represents the permutation vector of the fragment, L(p) represents the loss function, χ represents the number of fragments, cos(L(F λ ),L(F λ+1 )) represents fragment F λ and the next fragment F λ+1 The cosine similarity between vectors,adjacent segments are very close in semantics, then their similarity score will be relatively high,,leading to better coherence of the whole answer.
[0098] The confidence submodule calculates the confidence score of each answer, sorts the answers according to the confidence score, and selects the answer with the highest score as the final answer.
[0099] For each generated answer a i, using a scoring mechanism to measure its similarity with the reference answers in the training data. The confidence score Z(a i ) can be calculated by the following formula: in, The difference between the generated answer and the reference answer is calculated, p n is the exact match rate of n-grams of length n in the candidate answer. n-gram refers to a combination of items of length n extracted continuously from the answer text. r n is the ratio of n-grams of length n in the reference answer, where N is the maximum n-gram length. It is used to measure the richness and diversity of n-grams in the generated answers. The higher the score, the more n-grams are contained in the generated answers, and the higher the similarity with the reference answers. n Represents the weight factor.
[0100] Using the formula The answer with the highest score is selected as the final answer, where a p Represents the permutation function, used to rearrange the order of the answers, arg max 1≤i≤n s i Indicates finding the answer with the highest confidence score from the 1st answer to the nth answer, s i represents the confidence score of the i-th answer.
[0101] Feedback module: used to adjust the neural network model based on user feedback to improve the accuracy of future answers.
[0102] Record user satisfaction ratings or direct feedback on answers, including positive and negative comments and suggestions for improvement. Analyze the collected feedback to identify answers with high satisfaction ratings. This involves evaluating answers for length, content, grammar, logic, and other aspects. Based on the analysis results, adjust the neural network model used to generate answers to improve the accuracy of future answers.
[0103] Corresponding to the above embodiment, an embodiment of the present invention provides a computer storage medium, comprising: at least one memory and at least one processor;
[0104] The memory is used to store one or more program instructions;
[0105] The processor is used to run one or more program instructions to execute a method for implementing an intelligent question-answering system.
[0106] Corresponding to the above embodiment, an embodiment of the present invention provides a computer-readable storage medium, which contains one or more program instructions, and the one or more program instructions are used by a processor to execute a method for implementing an intelligent question-answering system.
[0107] The embodiments disclosed in the present invention provide a computer-readable storage medium, in which computer program instructions are stored. When the computer program instructions are executed on a computer, the computer executes the above-mentioned method for implementing an intelligent question-answering system.
[0108] In the embodiments of the present invention, the processor may be an integrated circuit chip having signal processing capabilities. The processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0109] The methods, steps, and logic diagrams disclosed in the embodiments of the present invention can be implemented or executed. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules within the decoding processor. The software modules can be located in a storage medium well-established in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. The processor reads the information from the storage medium and, in conjunction with its hardware, completes the steps of the aforementioned methods.
[0110] The storage medium may be a memory and may be, for example, a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory.
[0111] Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.
[0112] Volatile memory may be random access memory (RAM), which is used as an external cache memory. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM).
[0113] The storage media described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memory.
[0114] Those skilled in the art will appreciate that in one or more of the above examples, the functions described herein can be implemented using a combination of hardware and software. When software is used, the corresponding functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media includes any medium that facilitates the transmission of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0115] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. An intelligent question-answering method, characterized in that: include: S10, collect problem training data and perform data preprocessing; S20, performing data annotation and data segmentation on the question text to obtain keywords in the question; S30, calculating the relevance score between the question keywords and the knowledge base documents, thereby finding the most relevant document set; S40, applying the neural network model to generate multiple answers based on the relevant fragments in the document collection, and calculating a confidence score for each answer; S50, sorting the answers according to the confidence scores, and selecting the answer with the highest score as the final answer; S60, adjusting the neural network model based on user feedback to improve the accuracy of future answers; The neural network model is applied to generate multiple answers based on relevant fragments in the document collection and the confidence score of each answer is calculated, including: S44. Calculate the confidence score of each answer; For each generated answer , using a scoring mechanism to measure its similarity to the reference answers in the training data; the confidence score of each answer Calculated by the following formula: ,in, The difference between the generated answer and the reference answer is calculated. is the exact match rate of n-grams of length n in the candidate answer. n-gram refers to a combination of items of length n extracted continuously from the answer text. is the ratio of n-grams of length n in the reference answer, where N is the maximum n-gram length; It is used to measure the richness and diversity of n-grams in the generated answers. The higher the score, the more n-grams are contained in the generated answers, and the higher the similarity with the reference answers. Represents the weight factor.
2. An intelligent question-answering method according to claim 1, characterized in that: Obtaining the keywords in the question is divided into the following sub-steps: segmenting the question text into a series of words; assigning a part-of-speech tag to each word; building a dependency syntax tree to represent the dependency relationship between words; identifying sentence boundaries and segmenting the question text into multiple sentences; and using the keyword recognition function to identify the keywords in the question.
3. The intelligent question-answering method according to claim 1, wherein: Obtaining the most relevant document set is specifically divided into the following sub-steps: calculating the relevance score between the question keyword and a document in the knowledge base; traversing until the relevance scores of all documents in the knowledge base are calculated; and determining whether the document should be included in the relevant document set based on the relevance score.
4. An intelligent question-answering method according to claim 3, characterized in that: To calculate the relevance score between the question keyword and a document in the knowledge base, you need to first calculate the keyword occurrence score and the relevant fragment length score, and then calculate the relevance score based on the keyword occurrence score and the relevant fragment length score.
5. The intelligent question-answering method according to claim 3, wherein: The relevance score is used to determine whether a document should be included in the relevance document set. The relevance of a document that is included in the relevance document set should be greater than the set relevance threshold. The threshold is adjusted based on the actual effect. If the recall rate is too low, the threshold is appropriately lowered; if the accuracy is not enough, the threshold is increased.
6. The intelligent question-answering method according to claim 1, wherein: Calculating the confidence score of each answer is divided into the following sub-steps: input relevant fragments in the document collection into the encoder and calculate the forgotten fragments; intelligently generate multiple answers based on the highly relevant fragments output by the encoder; use the optimization objective function to minimize the incoherence of the answers; and calculate the confidence score of each answer.
7. An intelligent question-answering method according to claim 6, characterized in that: To form forgotten segments, an encoder is first used to encode relevant segments in a document collection into a fixed-length vector. The descriptions in the segments that are not related to keywords are then filtered out and forgotten. The forgotten descriptions are combined into forgotten segments.
8. An intelligent question-answering system, characterized in that: include: Data collection and processing module: used to collect question text data and related answer data and perform data preprocessing; Keyword module: used to perform data annotation and data segmentation on the question text to obtain question keywords; Relevance module: used to calculate the relevance score between question keywords and knowledge base documents, so as to find the most relevant document set; Answer module: This module applies a neural network model to generate multiple answers based on relevant fragments in a document collection, calculates the confidence score for each answer, sorts the answers based on the confidence score, and selects the answer with the highest score as the final answer. Feedback module: used to adjust the neural network model based on user feedback to improve the accuracy of future answers; The neural network model is applied to generate multiple answers based on relevant fragments in the document collection and the confidence score of each answer is calculated, including: S44. Calculate the confidence score of each answer; For each generated answer , using a scoring mechanism to measure its similarity to the reference answers in the training data; the confidence score of each answer Calculated by the following formula: ,in, The difference between the generated answer and the reference answer is calculated. is the exact match rate of n-grams of length n in the candidate answer. n-gram refers to a combination of items of length n extracted continuously from the answer text. is the ratio of n-grams of length n in the reference answer, where N is the maximum n-gram length; It is used to measure the richness and diversity of n-grams in the generated answers. The higher the score, the more n-grams are contained in the generated answers, and the higher the similarity with the reference answers. Represents the weight factor.
9. A computer storage medium, characterized in that include: at least one memory and at least one processor; a memory for storing one or more program instructions; A processor, configured to run one or more program instructions to execute an intelligent question-answering method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Judgment guide information pushing method and device, computer device and storage medium
CN110362592A
Document data retrieval method and device based on MRC, equipment and storage medium
CN111930895A
Question and answer method and device based on keywords and semantic model and storage medium
CN118520089A