Automatic question answering method and device, computer equipment and readable storage medium
By dynamically adjusting the decision threshold and weighted similarity calculation, the problem of inaccurate answers caused by the lack of document fragment vectors in the vector database is solved, thus improving the accuracy and efficiency of the intelligent question answering system.
Patent Information
- Application Number
- CN202511382290.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-25
- Publication Date
- 2026-01-13
AI Technical Summary
In traditional intelligent question-answering systems, the lack of document fragment vectors similar to the question vector in the vector database leads to insufficient accuracy in the answers.
By acquiring the question text, candidate answers are identified, and the decision threshold is dynamically adjusted based on the question type and context length. The target answer is then determined from the candidate answers. A weighted sum is calculated based on semantic similarity, keyword similarity, and entity matching, and the recall quantity is dynamically adjusted to improve the relevance of the answer.
It improves the accuracy of intelligent responses from large models, adapts to different question types and context lengths, and enhances the relevance and accuracy of the responses.
Smart Images

Figure CN121327078A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to an automatic question-answering method, apparatus, computer device, and computer-readable storage medium. Background Technology
[0002] In traditional technologies, the development of business support systems for enterprises typically relies on manual operations, resulting in significant efficiency bottlenecks in areas such as data model design and operational process configuration. With the development of artificial intelligence technology, using intelligent question answering to assist in the development of business support systems can improve efficiency.
[0003] The current process for intelligent question answering is as follows: the enterprise's knowledge documents are divided into document fragments, the segmented document fragments are vectorized and stored in a vector database. When a customer queries a related question, the question is vectorized and input into the vector database. A similarity search is performed between the question vector and the document fragment vectors in the vector database. The most similar document fragments are retrieved and submitted to a large model for reasoning and summarization, forming the final answer and providing feedback to the user.
[0004] However, the above process relies on a sufficient number of document fragment vectors in the vector database. When the vector database lacks document fragment vectors similar to the question vector, the accuracy of the answer is easily insufficient due to the low knowledge matching degree. Summary of the Invention
[0005] Therefore, it is necessary to provide an automatic question-answering method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve the accuracy of answers to the above-mentioned technical problems.
[0006] Firstly, this application provides an automatic question-answering method, including:
[0007] Get the input question text;
[0008] Determine candidate answers to the question text;
[0009] The decision threshold for the candidate answer is determined based on the question type of the question text and the pre-set context length.
[0010] Based on the decision threshold, the target answer to the question text is determined from the candidate answers.
[0011] In one embodiment, determining candidate answers to the question text includes:
[0012] Determine the mixed similarity between the question text and pre-stored question samples;
[0013] Based on the mixed similarity, the answer samples corresponding to the question samples are sorted to obtain the sorted answer samples;
[0014] Clustering is performed on the sorted answer samples to obtain the candidate answers to the question text.
[0015] In one embodiment, determining the mixed similarity between the question text and pre-stored question samples includes:
[0016] Determine the semantic vector of the question text, as well as the keywords and entities contained in the question text;
[0017] Based on the semantic vector, the keywords, and the entities, the semantic similarity, keyword similarity, and entity matching degree between the question text and the question sample are determined respectively.
[0018] The semantic similarity, keyword similarity, and entity matching degree are weighted and summed to obtain the mixed similarity.
[0019] In one embodiment, the weighted summation of the semantic similarity, the keyword similarity, and the entity matching degree to obtain the mixed similarity includes:
[0020] The first weight corresponding to the semantic similarity is determined based on the word vector variance of the question text;
[0021] Based on the term density of the question text, determine the second weight corresponding to the keyword similarity;
[0022] Based on the number of entities in the question text, determine the third weight corresponding to the entity matching degree;
[0023] The semantic similarity, keyword similarity, and entity matching degree are weighted and summed according to the first weight, the second weight, and the third weight to obtain the mixed similarity.
[0024] In one embodiment, determining the decision threshold for the candidate answer based on the question type of the question text and a pre-set context length includes:
[0025] Based on the problem type, determine a first adjustment value to adjust the pre-set baseline threshold;
[0026] Based on the context length, a second adjustment value is determined to adjust the baseline threshold;
[0027] The decision threshold is obtained based on the baseline threshold, the first adjustment value, and the second adjustment value.
[0028] In one embodiment, determining a first adjustment value for adjusting a pre-set baseline threshold based on the problem type includes:
[0029] If the question type is identified as factual, the first adjustment value for raising the baseline threshold is determined based on the proportion of keywords in the question text among the candidate answers; or...
[0030] If the question type is identified as open-ended, a first adjustment value for lowering the baseline threshold is determined based on the word vector variance of the keywords in the question text; or,
[0031] If the question type is identified as process-oriented, the first adjustment value is determined based on the process feature words in the candidate answers.
[0032] In one embodiment, the method further includes:
[0033] Based on the semantic similarity between the question text and pre-stored question samples, the target question sample corresponding to the question text is determined;
[0034] Based on the question sample type corresponding to the target question sample, the question type of the question text is obtained.
[0035] Secondly, this application also provides an automatic question-and-answer device, comprising:
[0036] The question acquisition module is used to acquire the input question text;
[0037] A candidate answer module is used to determine candidate answers to the question text;
[0038] The threshold determination module is used to determine the decision threshold of the candidate answer based on the question type of the question text and the pre-set context length.
[0039] The answer output module is used to determine the target answer to the question text from the candidate answers based on the decision threshold.
[0040] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0041] Get the input question text;
[0042] Determine candidate answers to the question text;
[0043] The decision threshold for the candidate answer is determined based on the question type of the question text and the pre-set context length.
[0044] Based on the decision threshold, the target answer to the question text is determined from the candidate answers.
[0045] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0046] Get the input question text;
[0047] Determine candidate answers to the question text;
[0048] The decision threshold for the candidate answer is determined based on the question type of the question text and the pre-set context length.
[0049] Based on the decision threshold, the target answer to the question text is determined from the candidate answers.
[0050] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0051] Get the input question text;
[0052] Determine candidate answers to the question text;
[0053] The decision threshold for the candidate answer is determined based on the question type of the question text and the pre-set context length.
[0054] Based on the decision threshold, the target answer to the question text is determined from the candidate answers.
[0055] The aforementioned automatic question answering method, apparatus, computer equipment, computer-readable storage medium, and computer program product acquire input question text, determine candidate answers to the question text, determine a decision threshold for the candidate answers based on the question type and a pre-set context length, and determine the target answer to the question text from the candidate answers based on the decision threshold. The decision threshold can be dynamically adjusted based on the type of question asked by the user and the context length, thereby adjusting the number of responses recalled from the candidate answers. This makes the candidate answers input into the large model for reasoning more relevant to the question, improving the accuracy of the large model's intelligent answering. Attached Figure Description
[0056] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0057] Figure 1 A flowchart illustrating a traditional retrieval enhancement generation model for knowledge question answering.
[0058] Figure 2 This is a flowchart illustrating an automatic question-and-answer method in one embodiment;
[0059] Figure 3 This is a schematic diagram of the user query process in one embodiment;
[0060] Figure 4 This is a flowchart illustrating the process of automatic IT knowledge question answering in one embodiment;
[0061] Figure 5 This is a structural block diagram of an automatic question-and-answer device in one embodiment;
[0062] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0063] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0064] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0065] Retrieval-augmented generation (RAG), as a cutting-edge technology for large models, combines language models and information retrieval techniques. When the model needs to generate text or answer questions, it first retrieves relevant information from a large collection of documents and then uses this retrieved information to guide the generation of text, thereby improving the quality and accuracy of predictions. Figure 1 This provides a traditional RAG implementation method for knowledge-based question answering models. (See reference) Figure 1 The method includes the following steps:
[0066] Step S101: Divide the enterprise's knowledge documents (e.g., data model-related documents) into blocks to form multiple document fragments;
[0067] Step S102: Vectorize the segmented document fragments and save them to the vector database;
[0068] Step S103: When a user queries IT solution knowledge and other related questions, the user's query questions are vectorized and then stored in a vector database.
[0069] Step S104: Perform a similarity search on the question vector and the document fragment vector in the vector database to retrieve the n most similar (e.g., the top n, where n is configurable) related fragments.
[0070] Step S105: Combine the relevant fragments and ask the Large Language Model (LLM) a question. The Large Language Model generates m answers (m is configurable).
[0071] Step S106: Submit the m answers generated by the large model back to the large model. After the large model summarizes them, it forms the final answer and provides feedback to the user.
[0072] The above process relies on a sufficient number of document fragment vectors in the vector database. When the vector database lacks document fragment vectors similar to the question vector, the accuracy of the answer is easily insufficient due to the low knowledge matching degree. Based on this, there is a problem of inaccurate answers in traditional technologies for intelligent question answering.
[0073] Based on the aforementioned traditional technologies, the automatic question answering method provided in this application obtains the input question text, determines candidate answers to the question text, determines a decision threshold for the candidate answers based on the question type and a pre-set context length, and determines the target answer to the question text from the candidate answers based on the decision threshold. The decision threshold can be dynamically adjusted according to the type of question asked by the user and the context length, thereby adjusting the number of responses recalled from the candidate answers, making the candidate answers input to the large model for reasoning more relevant to the question and improving the accuracy of the large model's intelligent answering.
[0074] It should be noted that the beneficial effects or technical problems solved by the embodiments of this application are not limited to this one, but may also be other implicit or related problems. For details, please refer to the description of the embodiments below.
[0075] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0076] In one exemplary embodiment, such as Figure 2 As shown, an automatic question-answering method is provided. This embodiment illustrates the method applied to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0077] Step S202: Obtain the input question text.
[0078] The question text can be the text of the question that the user enters into the terminal.
[0079] Optionally, the user can input a question text into the terminal, and the terminal will then receive the question text. In practical applications, users can directly input questions in text format into the terminal, or they can input questions in non-text formats such as voice or video. For non-text questions, the terminal can convert them into question text using technologies such as voice recognition and video recognition.
[0080] Step S204: Determine candidate answers to the question text.
[0081] The candidate answers can be possible answers selected from a pre-built knowledge base based on the question text.
[0082] Optionally, the terminal can pre-build a knowledge base to record answers corresponding to multiple question instances. The question instances can be specific questions entered historically by the user or automatically generated by the terminal. The answers corresponding to the question instances can be answers entered historically by the user or answers automatically generated by the terminal based on a preset algorithm. The terminal can calculate the similarity between the question text and each question instance in the knowledge base, select several question instances similar to the question text based on the similarity, and use the answers corresponding to these question instances as candidate answers. In some embodiments, a mixed similarity can be calculated based on the semantic similarity, keyword similarity, and entity matching degree between the question text and question instances. The weights corresponding to semantic similarity, keyword similarity, and entity matching degree can be dynamically adjusted according to the actual application to improve the rationality of the mixed similarity calculation, thereby increasing the rationality of the candidate answers selected from the knowledge base.
[0083] Step S206: Determine the decision threshold for candidate answers based on the question type in the question text and the pre-set context length.
[0084] The question type can be the type of question input by the user to the terminal. In some embodiments, question types include, but are not limited to, factual, open-ended, and process-oriented questions. Factual questions ask about objective facts and directly obtain a definitive answer; open-ended questions ask about attitudes, cognition, etc., allowing for subjective interpretations or innovative answers; process-oriented questions ask about operational procedures, causal logic, etc. The context length can be the maximum length of question text that a large model can process at one time. The decision threshold can be the similarity threshold between the question instance corresponding to the candidate answer and the question text, for example, the lower limit of the mixed similarity between the question instance corresponding to the candidate answer and the question text.
[0085] Optionally, the terminal can determine the question type corresponding to the question text and obtain a pre-set context length. Based on the question type and context length, it can adjust a pre-set baseline threshold to obtain a decision threshold for candidate answers. In practical applications, question instances in the knowledge base can be pre-labeled with question types. The question instance with the highest semantic similarity to the question text can be selected, and its corresponding question type can be used as the question type of the question text. For factual and process-oriented questions, the baseline threshold can be increased to enhance the targeting of recalled candidate answers. For open-ended questions, the baseline threshold can be decreased to enhance the divergence of recalled candidate answers. Furthermore, the baseline threshold can be logarithmically decayed as the context length increases, increasing the number of recalled candidate answers while improving the performance of the large model. This ensures that the amount of data processed by the large model matches its performance, improving the efficiency of intelligent question answering.
[0086] Step S208: Determine the target answer to the question text from the candidate answers based on the decision threshold.
[0087] The target answer can be a candidate answer from the selected input large model.
[0088] Optionally, the terminal can compare the similarity between the question instance corresponding to the candidate answer and the question text with a decision threshold. Based on the comparison result, it can select the target answer from the candidate answers, input the selected target answer into a large model for processing, and then output it to the user. For example, the terminal can obtain the mixed similarity between the corresponding question instance and the question text for each candidate answer, select the mixed similarity that exceeds the decision threshold, and use the candidate answers corresponding to these mixed similarities as the target answers. The large model summarizes and refines the target answers and then outputs them to the user. The number of target answers can be one or more, which is not limited here.
[0089] The aforementioned automatic question answering method acquires the input question text, determines candidate answers to the question text, determines a decision threshold for the candidate answers based on the question type and a pre-set context length, and then determines the target answer to the question text from the candidate answers based on the decision threshold. The decision threshold can be dynamically adjusted according to the type of question asked by the user and the context length, thereby adjusting the number of responses recalled from the candidate answers, making the candidate answers input to the large model for reasoning more relevant to the question and improving the accuracy of the large model's intelligent answering.
[0090] In an exemplary embodiment, step S204 may specifically include: determining the mixed similarity between the question text and the pre-stored question samples; sorting the answer samples corresponding to the question samples according to the mixed similarity to obtain sorted answer samples; and performing clustering processing on the sorted answer samples to obtain candidate answers to the question text.
[0091] The question samples can be multiple question instances from the knowledge base. The mixed similarity can be a combination of semantic similarity, keyword similarity, and entity matching, representing the similarity between the question text and each question sample. The answer samples can be the answers corresponding to each question instance in the knowledge base. The sorted answer samples can be those sorted according to the mixed similarity from high to low, or from low to high.
[0092] Optionally, the terminal can determine the semantic similarity, keyword similarity, and entity matching degree between the question text and each question sample. It then performs a weighted sum of these three similarities to obtain a mixed similarity. The terminal sorts the answer samples corresponding to the question samples according to the mixed similarity from high to low or low to high, resulting in sorted answer samples. Candidate answers are then selected from the sorted answer samples through clustering. For example, the calculated mixed similarity corresponds one-to-one with the question samples, and the question samples correspond one-to-one with the answer samples. Therefore, the mixed similarity also corresponds one-to-one with the answer samples. The mixed similarities are sorted from high to low, and the answer samples corresponding to the sorted mixed similarities are used as the sorted answer samples. Clustering can merge answer samples with mixed similarities higher than a preset threshold, and the merged answer samples are used as candidate answers. Furthermore, the sorted answer samples can be deduplicated to reduce duplicate answers among the candidate answers.
[0093] In this embodiment, by determining the mixed similarity between the question text and the pre-stored question samples, the answer samples corresponding to the question samples are sorted according to the mixed similarity to obtain the sorted answer samples. The sorted answer samples are then clustered to obtain candidate answers to the question text. Candidate answers can be filtered based on mixed similarity. Since mixed similarity reflects the semantic similarity, keyword similarity, and entity matching degree between the question text and the question samples, it increases the accuracy of the filtered candidate answers and improves the accuracy of the output answers.
[0094] In an exemplary embodiment, the step of determining the mixed similarity between the question text and the pre-stored question samples may specifically include: determining the semantic vector of the question text, as well as the keywords and entities contained in the question text; determining the semantic similarity, keyword similarity, and entity matching degree between the question text and the question samples based on the semantic vector, keywords, and entities; and performing a weighted summation of the semantic similarity, keyword similarity, and entity matching degree to obtain the mixed similarity.
[0095] Semantic vectors can be numerical vector representations of text. Keywords can be condensed expressions of the core semantics of the text. Entities can be objects with independent meaning in the text, such as names of people or places. Semantic similarity can be the strength of semantic connections between texts. Keyword similarity can be the degree of keyword overlap or similarity between texts. Entity matching can be an indicator of whether entities in different texts refer to the same object.
[0096] Optionally, the terminal can generate semantic vectors of the question text based on a pre-trained model, extract keywords and entities from the question text, calculate the semantic similarity between the question text and each question sample based on the semantic vectors, and calculate the keyword similarity and entity matching degree between the question text and each question sample. The weights of semantic similarity, keyword similarity and entity matching degree are dynamically adjusted according to the specific situation of the question text and the actual application. The semantic similarity, keyword similarity and entity matching degree are weighted and summed according to the weights to obtain the mixed similarity.
[0097] For example, pre-trained models such as Sentence-Bidirectional Encoder Representations from Transformers (Sentence-BERT) and Transformer can be used to generate semantic vectors for user-submitted questions. Keyword extraction can be performed using term frequency-inverse document frequency (TF-IDF) and jieba word segmentation combined with a domain terminology. Entity recognition can be performed using domain-specific fine-tuned Named Entity Recognition (NER) and Unified Information Extraction (UIE) models. Based on the semantic vectors, keywords, and entities, the semantic similarity, keyword similarity, and entity matching degree between the user-submitted question and existing questions in the knowledge base can be calculated. Based on a pre-defined benchmark, the weights can be dynamically adjusted to obtain the final result of the mixed similarity calculation.
[0098] The formula for calculating the dynamic weight can be:
[0099] .
[0100] in, This is the normalization factor. For questions raised by users. The terminology density of a user's question can be calculated, for example, the ratio of the number of terms in the user's question to the total number of words. It can be the number of entities in the question asked by the user. It can score the abstractness of the questions asked by users, for example, the variance of the word vectors of the questions asked by users. The adjustment coefficient can be manually set based on the domain of the question raised by the user.
[0101] set up Let semantic similarity, keyword similarity, and entity matching be the three components, then the formula for calculating the mixed similarity is:
[0102] .
[0103] in, This indicates the sequence number of the existing question in the knowledge base. The semantic similarity is squared to strengthen high-confidence semantic matching, the entity matching score is squared to avoid excessive influence from low-frequency entities, and keywords are linearly weighted to ensure accurate matching.
[0104] In practical applications, when a user's question precisely matches an existing question in the knowledge base, a high mixed similarity should be set. Therefore, a lower threshold can also be set for the mixed similarity. The formula for calculating the mixed similarity can also be:
[0105] .
[0106] in, exist When it is 1, in The value is 0. Based on this formula, if the entity matching degree is not less than 0.95, then the mixed similarity is not less than 0.9; if the entity matching degree is less than 0.95, then the mixed similarity is 0. .
[0107] In this embodiment, by determining the semantic vector of the question text, as well as the keywords and entities contained in the question text, the semantic similarity, keyword similarity, and entity matching degree between the question text and the question sample are determined based on the semantic vector, keywords, and entities, respectively. The semantic similarity, keyword similarity, and entity matching degree are weighted and summed to obtain a mixed similarity. The semantic similarity, keyword similarity, and entity matching degree can be comprehensively used to determine the similarity between the user's question and the existing questions in the knowledge base, thereby improving the accuracy of similarity determination and thus improving the accuracy of intelligent answering.
[0108] In an exemplary embodiment, the step of weighted summation of semantic similarity, keyword similarity, and entity matching to obtain a mixed similarity may specifically include: determining a first weight corresponding to semantic similarity based on the word vector variance of the question text; determining a second weight corresponding to keyword similarity based on the term density of the question text; determining a third weight corresponding to entity matching based on the number of entities in the question text; and weighted summation of semantic similarity, keyword similarity, and entity matching according to the first, second, and third weights to obtain a mixed similarity.
[0109] Here, word vector variance represents the degree of dispersion of text word vectors along a specific dimension, reflecting the abstractness of the text when dealing with abstract problems. The first weight can be the weight of semantic similarity. Term density represents the density of domain-specific terms in the text, which can be obtained by calculating the proportion of the number of terms in the question text to the total number of words in the question text. The second weight can be the weight of keyword similarity. Entity count represents the number of entities identified from the text. The third weight can be the weight of entity matching.
[0110] Optionally, the terminal can calculate the word vector variance of the question text and determine the first weight based on the word vector variance. It can also calculate the term density of the question text and determine the second weight based on the term density. It can also count the number of entities in the question text and determine the third weight based on the number of entities. The semantic similarity, keyword similarity, and entity matching degree are weighted and summed according to the first weight, the second weight, and the third weight respectively to obtain the mixed similarity.
[0111] For example, for the questions asked by users, the variance of word vectors can be calculated. , obtain the first weight It can also calculate term density. , thus obtaining the second weight It can also count the number of entities. , thus obtaining the third weight ,set up Let semantic similarity, keyword similarity, and entity matching be the three components, then the formula for calculating the mixed similarity is: .
[0112] In this embodiment, a first weight corresponding to semantic similarity is determined based on the word vector variance of the question text, a second weight corresponding to keyword similarity is determined based on the term density of the question text, and a third weight corresponding to entity matching degree is determined based on the number of entities in the question text. The semantic similarity, keyword similarity, and entity matching degree are weighted and summed according to the first, second, and third weights to obtain a mixed similarity. The weights for calculating the mixed similarity can be dynamically adjusted according to the questions raised by users, thereby improving the accuracy of similarity calculation and thus improving the accuracy of intelligent answers.
[0113] In an exemplary embodiment, step S206 may specifically include: determining a first adjustment value for adjusting a pre-set baseline threshold based on the problem type; determining a second adjustment value for adjusting the baseline threshold based on the context length; and obtaining a decision threshold based on the baseline threshold, the first adjustment value, and the second adjustment value.
[0114] The baseline threshold can be a pre-set benchmark for dynamically adjusting the decision threshold. The first adjustment value can be a value that increases or decreases the baseline threshold based on the problem type. The second adjustment value can be a value that increases or decreases the baseline threshold based on the context length.
[0115] Optionally, the terminal can identify the question type in the question text and determine a first adjustment value based on the question type. For example, if the user's question is identified as a factual question, the proportion of keywords in the user's question in each candidate answer can be calculated, and the largest proportion can be selected as the first adjustment value to increase the baseline threshold. In this case, the upper limit of the first adjustment value can be set to 0.2. If the user's question is identified as an open-ended question, keywords can be extracted from the user's question, and the variance of the keyword vectors can be used as the first adjustment value to decrease the baseline threshold. In this case, the lower limit of the first adjustment value can be set to -0.2. If the user's question is identified as a process-oriented question, process feature words and step markers can be detected from the candidate answers. The mixed similarity corresponding to the candidate answer containing the fewest process feature words and step markers is subtracted from the baseline threshold to obtain the first adjustment value. Thus, the first adjustment value for process-oriented questions effectively replaces the baseline threshold with mixed similarity. Setting the baseline threshold to 0.8, since the mixed similarity is usually not lower than 0.9, can be regarded as having an effect of increasing the baseline threshold.
[0116] Furthermore, the terminal can determine a second adjustment value to lower the baseline threshold based on the context length of the problem being processed by the large model. The decision threshold is then obtained based on the baseline threshold, the first adjustment value, and the second adjustment value, calculated using the following formula:
[0117] ;
[0118] .
[0119] in, This is an intermediate result. As the baseline threshold, The first adjustment value, As the decision threshold, and having , This is the base adjustment value for the second adjustment value, with a default value of -0.02. For context length, This is the second adjustment value.
[0120] In this embodiment, a first adjustment value is determined based on the question type to adjust the pre-set baseline threshold, and a second adjustment value is determined based on the context length to adjust the baseline threshold. Based on the baseline threshold, the first adjustment value, and the second adjustment value, a decision threshold is obtained. The number of candidate answers input to the large model can be dynamically determined according to the type of question raised by the user and the context length of the question processed by the large model, so that the number of candidate answers is adapted to the question raised by the user and the processing capacity of the large model, thereby improving the accuracy of intelligent answering.
[0121] In an exemplary embodiment, the step of determining a first adjustment value for adjusting a pre-set baseline threshold based on the question type may specifically include: if the question type is identified as factual, determining a first adjustment value to increase the baseline threshold based on the proportion of keywords in the question text among candidate answers; or, if the question type is identified as open-ended, determining a first adjustment value to decrease the baseline threshold based on the variance of the word vectors of keywords in the question text; or, if the question type is identified as process-oriented, determining a first adjustment value based on process feature words in candidate answers.
[0122] Among them, process feature words can be words related to sequence, such as first, last, steps, etc.
[0123] Optionally, if the terminal identifies the question text as a factual question, it can calculate the proportion of keywords in the question text in each candidate answer and select the largest proportion as the first adjustment value to increase the baseline threshold. The upper limit of the first adjustment value can be set to 0.2. If the terminal identifies the question text as an open-ended question, it can extract keywords from the question text and use the variance of the keyword vectors as the first adjustment value to decrease the baseline threshold. The lower limit of the first adjustment value can be set to -0.2. If the terminal identifies the question text as a process-oriented question, it can detect process feature words and step markers from the candidate answers. The mixed similarity corresponding to the candidate answer containing the fewest process feature words and step markers is subtracted from the baseline threshold and used as the first adjustment value. Since the first adjustment value for process-oriented questions uses mixed similarity instead of the baseline threshold, the baseline threshold is set to 0.8. Since the mixed similarity is usually not lower than 0.9, it can be regarded as having an effect on increasing the baseline threshold.
[0124] In this embodiment, when the question type is identified as factual, a first adjustment value is determined based on the proportion of keywords in the question text among the candidate answers to increase the baseline threshold. Alternatively, when the question type is identified as open-ended, a first adjustment value is determined based on the variance of the word vectors of the keywords in the question text to decrease the baseline threshold. Or, when the question type is identified as process-oriented, a first adjustment value is determined based on process feature words in the candidate answers. The baseline threshold can be increased or decreased for different question types. For factual and process-oriented questions, increasing the baseline threshold enhances the targeting of the recalled candidate answers. For open-ended questions, decreasing the baseline threshold enhances the diversity of the recalled candidate answers, thereby improving the accuracy of selecting the target answer from the candidate answers and improving the accuracy of the intelligent answer.
[0125] In an exemplary embodiment, prior to step S206, the method may further include: determining the target question sample corresponding to the question text based on the semantic similarity between the question text and the pre-stored question samples; and obtaining the question type of the question text based on the question sample type corresponding to the target question sample.
[0126] The target question sample can be the question sample with the highest semantic similarity to the question text. The question sample type can be the question type of the target question sample.
[0127] Optionally, the terminal can pre-label each question sample in the knowledge base with a question type, forming a question sample type corresponding to the question sample. It can then calculate the semantic similarity between the question text and each question sample, selecting the question sample with the highest semantic similarity as the target question sample, and using the question sample type corresponding to the target question sample as the question type of the question text. For example, each question instance in the knowledge base can be labeled as a factual question, an open-ended question, or a process-oriented question. If the question instance with the highest semantic similarity to the user's question is labeled as a factual question, then the user's question is determined to be a factual question.
[0128] In this embodiment, the target question sample corresponding to the question text is determined based on the semantic similarity between the question text and the pre-stored question sample. The question type of the question text is obtained based on the question sample type corresponding to the target question sample. This can quickly determine the question type of the question text and improve the efficiency of decision threshold adjustment.
[0129] To facilitate a deeper understanding of the embodiments of this application by those skilled in the art, a specific example will be used for illustration below.
[0130] This application employs a hybrid similarity calculation method that combines semantic similarity, keyword similarity, and entity matching with dynamic weights. Building upon semantic similarity, it incorporates specialized vocabulary and abstraction level scores to more accurately retrieve knowledge base content. Simultaneously, it dynamically adjusts the threshold for returned results based on the user's question category and the length of the existing context, optimizing the results according to the query type. For factual and process-related questions, the threshold is increased to enhance the relevance of the returned results; for open-ended questions, the threshold is decreased to increase the diversity of the returned results. This method requires no additional deep learning model training, uses fewer resources, and is more suitable for small to medium-scale applications.
[0131] In one exemplary embodiment, an optimized retrieval and enhanced data model automatic question answering method and apparatus are provided. For IT solution-related questions raised by users, the method can dynamically adjust the similarity weight by combining factors such as domain knowledge and question classification to optimize the recall of relevant documents, and dynamically adjust the number of recalled documents by question classification, thereby performing more accurate and precise intelligent question answering of data model-related questions, which can significantly improve the user acceptance of intelligent question answering results.
[0132] The device module mainly includes:
[0133] Input preprocessing: Preprocessing the input text;
[0134] Semantic vector generation: Using pre-trained models such as Sentence-BERT and Transformer to generate semantic vectors for user questions;
[0135] Keyword extraction: Keyword extraction is performed based on TF-IDF, jieba word segmentation, and a domain terminology list;
[0136] Entity recognition: Entity recognition is performed using a NER model (UIE model) finely tuned for the specific domain;
[0137] Calculate the semantic similarity, keyword similarity, and entity matching degree with the existing questions in the knowledge base.
[0138] Hybrid similarity calculation: Based on a set benchmark, the similarity weights are dynamically adjusted and the final similarity result is calculated.
[0139] Dynamic weight adjustment: Generate mixed similarity calculation weights based on the dynamic weight calculation formula;
[0140] ;
[0141] in, Normalization factor;
[0142] : Term density in the query (number of terms / total number of words);
[0143] The number of entities identified;
[0144] Abstraction score (word vector variance) - for handling abstract problems;
[0145] Domain adjustment coefficient (manually set value).
[0146] Similarity calculation: These are semantic similarity, keyword similarity, and entity matching: ;
[0147] Among them, the square of semantic similarity is used to strengthen high-confidence semantic matching, the square root of entity matching is used to avoid the excessive influence of low-frequency entities, and the linear weighting of keywords is used to ensure accurate matching characteristics.
[0148] Final similarity score: ;
[0149] When entities are exactly matched, the minimum similarity is 0.9.
[0150] Question Classification: Based on the organization rules and the semantic similarity of existing labeled question categories in the knowledge base, questions are classified into model fact-based question answering, open-ended question answering, and process-based question answering.
[0151] Results ranking and clustering: The results are ranked according to the similarity calculation results, and clustering algorithms are used to perform cluster analysis on the results. Results with high similarity are merged, and the final clustered results are used as candidates for the answer.
[0152] Dynamic threshold decision: Based on the baseline threshold (set to 0.8), a dynamic threshold is generated according to the user's question classification, combined with existing answer candidates and existing conversation context, to determine the final answer result.
[0153] ;
[0154] .
[0155] in, As the baseline threshold, The first item is the adjustment value for the question type, and the last item is the adjustment value for the context length feature. The final decision threshold, .
[0156] For factual questions: Calculate the proportion of keywords and technical terms in the candidate answers, and select the largest proportion as the threshold for raising factual questions, with a maximum upper limit of 0.2;
[0157] Open-ended questions: The threshold for reducing open-ended questions is determined based on the variance of the word vectors extracted from the questions, with a minimum threshold of -0.2.
[0158] For process-oriented questions: detect process feature words and step markers from existing answers (using sequential keyword recognition and regular expression matching). In the detected results, select the mixed similarity value with the lowest ranking (the fewest detected process feature words and step markers), and subtract the baseline threshold from this value to obtain the adjustment threshold.
[0159] Context length feature: (logarithmic decay), where This is the baseline adjustment value, with a default value of -0.02. For context length.
[0160] Answer generation: Answers that meet a threshold requirement (e.g., mixed similarity exceeding a certain threshold) will be generated. The results are output to the large model, which then refines the results before outputting them to the user.
[0161] The above methods address the problem that existing business support system development processes rely heavily on manual design, especially when launching new products or services. The lack of AI assistance or guidance in designing data models and operational processes leads to low development efficiency, increased human error, and difficulty in handling complex and ever-changing challenges. Furthermore, over-reliance on manual labor limits the speed of response to business needs, making it difficult for development to keep pace with the times. Therefore, the empowerment and innovation of large-scale AI technology is urgently needed.
[0162] This method addresses the insufficient accuracy of traditional RAG retrieval by introducing factors such as domain knowledge and question classification to dynamically adjust similarity weights and optimize the recall of relevant documents. It also dynamically adjusts the number of recalled documents based on question classification, resulting in more precise and accurate question answering related to IT solutions and knowledge. It is suitable for the IT solution design phase during the development of new systems or new requirements in business support systems, leveraging AI large-scale models to enhance R&D efficiency. It can also be extended to other fields, supporting automated question answering and design for system operation capabilities in various domains.
[0163] In one exemplary embodiment, such as Figure 3 As shown, a user query process is provided, which includes the following steps:
[0164] Step S301: The user inquires about issues related to data model design and operational process design in the IT solution;
[0165] Step S302: The user query question first enters the preprocessing stage, including question semantic vector generation, keyword extraction, entity recognition, question classification, etc.
[0166] Step S303: Calculate the semantic similarity, keyword similarity, and entity matching degree between the question and existing questions in the knowledge base, and perform a mixed similarity calculation: Based on the set benchmark, dynamically adjust the similarity weights and calculate the final similarity result.
[0167] Step S304: Sort the results according to the similarity calculation results, and use a clustering algorithm to perform cluster analysis on the results, merge the results with high similarity, and use the final clustered results as candidates for the answer;
[0168] Step S305, Dynamic threshold decision: Based on the baseline threshold (set to 0.8), a dynamic threshold is generated according to the user's question classification, combined with existing answer candidates and existing session context, to determine the final answer result.
[0169] In one exemplary embodiment, such as Figure 4 As shown, a process for developing an IT domain expert domain keyword and domain entity knowledge base is provided, which includes the following steps:
[0170] Step S401: The IT solution knowledge document is sliced, and the processed slices are vectorized and saved to the vector database.
[0171] Step S402: IT domain experts construct a domain keyword database based on domain knowledge for keyword matching during subsequent searches;
[0172] Step S403: IT domain experts construct a domain entity database based on domain knowledge for entity matching during subsequent retrieval.
[0173] The above embodiments introduce factors such as domain knowledge and question classification to dynamically adjust similarity weights to optimize the recall of relevant documents, and dynamically adjust the number of recalled documents by question classification, which can greatly improve the accuracy of intelligent question answering retrieval. This method and device provide the main input for the design of IT solutions for new requirements / new businesses, and can accelerate the efficiency of launching new requirements / new businesses. This device and method have pioneered a new paradigm for system development and operation using intelligent robots based on large models.
[0174] In one exemplary embodiment, an automatic question-answering method is provided, the method comprising the following steps:
[0175] Step S501: Obtain the input question text;
[0176] Step S502: Determine the semantic vector of the question text, as well as the keywords and entities contained in the question text;
[0177] Step S503: Based on the semantic vector, keywords, and entities, determine the semantic similarity, keyword similarity, and entity matching degree between the question text and the question sample, respectively.
[0178] Step S504: Weighted summation of semantic similarity, keyword similarity, and entity matching to obtain the mixed similarity between the question text and the question sample;
[0179] Step S505: Sort the answer samples corresponding to the question samples according to the mixed similarity to obtain the sorted answer samples;
[0180] Step S506: Cluster the sorted answer samples to obtain candidate answers to the question text;
[0181] Step S507: Based on the question type in the question text, determine the first adjustment value for adjusting the pre-set baseline threshold.
[0182] Step S508: Determine a second adjustment value for adjusting the baseline threshold based on a pre-set context length;
[0183] Step S509: Determine the decision threshold for candidate answers based on the baseline threshold, the first adjustment value, and the second adjustment value;
[0184] Step S510: Determine the target answer to the question text from the candidate answers based on the decision threshold.
[0185] Optionally, after obtaining the question text input by the user, the terminal can generate a semantic vector of the question text based on a pre-trained model, and extract keywords and entities from the question text. For each question sample in the knowledge base, the semantic similarity between the question text and the question sample is calculated based on the semantic vector, the keyword similarity between the question text and the question sample is calculated based on the keywords, and the entity matching degree between the question text and the question sample is calculated based on the entities. The semantic similarity, keyword similarity, and entity matching degree are weighted and summed to obtain the mixed similarity between the question text and the question sample. The answer samples corresponding to the question sample are sorted according to the mixed similarity to obtain the sorted answer samples. The sorted answer samples are clustered to obtain candidate answers to the question text. Then, the question type corresponding to the question text can be determined. Based on the question type, a first adjustment value is determined to increase or decrease the baseline threshold, and a second adjustment value is determined to decrease the baseline threshold based on the context length that the large model can handle. The baseline threshold is adjusted using the first and second adjustment values to obtain the decision threshold of the candidate answers. The candidate answers are filtered using the decision threshold to obtain the target answer of the question text. The target answer is input into the large model for further processing to obtain the final output intelligent answer.
[0186] The above-mentioned automatic question answering method can dynamically adjust the decision threshold according to the type of question asked by the user and the length of the context, thereby adjusting the number of candidate answers recalled from the candidate answers, making the candidate answers input into the large model for reasoning more relevant to the question and improving the accuracy of the large model's intelligent answer.
[0187] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0188] Based on the same inventive concept, this application also provides an automatic question-answering device for implementing the automatic question-answering method described above. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more automatic question-answering device embodiments provided below can be found in the limitations of the automatic question-answering method above, and will not be repeated here.
[0189] In one exemplary embodiment, such as Figure 5 As shown, an automatic question-answering device is provided, including: a question acquisition module 602, a candidate answer module 604, a threshold determination module 606, and an answer output module 608, wherein:
[0190] Problem acquisition module 602 is used to acquire the input problem text;
[0191] The candidate answer module 604 is used to determine candidate answers to the question text;
[0192] The threshold determination module 606 is used to determine the decision threshold of the candidate answer based on the question type of the question text and the pre-set context length.
[0193] The answer output module 608 is used to determine the target answer to the question text from the candidate answers based on the decision threshold.
[0194] In an exemplary embodiment, the candidate answer module 604 is further configured to determine the mixed similarity between the question text and the pre-stored question samples; sort the answer samples corresponding to the question samples according to the mixed similarity to obtain sorted answer samples; and perform clustering processing on the sorted answer samples to obtain the candidate answers to the question text.
[0195] In an exemplary embodiment, the candidate answer module 604 is further configured to determine the semantic vector of the question text, as well as the keywords and entities contained in the question text; determine the semantic similarity, keyword similarity, and entity matching degree between the question text and the question sample based on the semantic vector, the keywords, and the entities; and perform a weighted summation of the semantic similarity, the keyword similarity, and the entity matching degree to obtain the mixed similarity.
[0196] In an exemplary embodiment, the candidate answer module 604 is further configured to determine a first weight corresponding to the semantic similarity based on the word vector variance of the question text; determine a second weight corresponding to the keyword similarity based on the term density of the question text; determine a third weight corresponding to the entity matching degree based on the number of entities in the question text; and perform a weighted summation of the semantic similarity, the keyword similarity, and the entity matching degree according to the first weight, the second weight, and the third weight to obtain the mixed similarity.
[0197] In an exemplary embodiment, the threshold determination module 606 is further configured to determine a first adjustment value for adjusting a pre-set baseline threshold based on the problem type; determine a second adjustment value for adjusting the baseline threshold based on the context length; and obtain the decision threshold based on the baseline threshold, the first adjustment value, and the second adjustment value.
[0198] In an exemplary embodiment, the threshold determination module 606 is further configured to, when the question type is identified as factual, determine a first adjustment value for increasing the baseline threshold based on the proportion of keywords in the question text in the candidate answers; or, when the question type is identified as open-ended, determine a first adjustment value for decreasing the baseline threshold based on the word vector variance of keywords in the question text; or, when the question type is identified as process-oriented, determine the first adjustment value based on process feature words in the candidate answers.
[0199] In an exemplary embodiment, the above-described automatic question answering device further includes a type determination module, configured to determine a target question sample corresponding to the question text based on the semantic similarity between the question text and a pre-stored question sample; and to obtain the question type of the question text based on the question sample type corresponding to the target question sample.
[0200] Each module in the aforementioned automatic question-and-answer device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0201] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements an automatic question-and-answer method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0202] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0203] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0204] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above-described method embodiments.
[0205] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0206] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0207] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0208] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0209] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. An automatic question-answering method, characterized in that, The method includes: Get the input question text; Determine candidate answers to the question text; The decision threshold for the candidate answer is determined based on the question type and the pre-set context length of the question text. Based on the decision threshold, the target answer to the question text is determined from the candidate answers.
2. The method according to claim 1, characterized in that, The process of determining candidate answers to the question text includes: Determine the mixed similarity between the question text and pre-stored question samples; Based on the mixed similarity, the answer samples corresponding to the question samples are sorted to obtain the sorted answer samples; Clustering is performed on the sorted answer samples to obtain the candidate answers to the question text.
3. The method according to claim 2, characterized in that, Determining the mixed similarity between the question text and pre-stored question samples includes: Determine the semantic vector of the question text, as well as the keywords and entities contained in the question text; Based on the semantic vector, the keywords, and the entities, the semantic similarity, keyword similarity, and entity matching degree between the question text and the question sample are determined respectively. The semantic similarity, keyword similarity, and entity matching degree are weighted and summed to obtain the mixed similarity.
4. The method according to claim 3, characterized in that, The weighted summation of the semantic similarity, the keyword similarity, and the entity matching degree to obtain the mixed similarity includes: The first weight corresponding to the semantic similarity is determined based on the word vector variance of the question text; Based on the term density of the question text, determine the second weight corresponding to the keyword similarity; Based on the number of entities in the question text, determine the third weight corresponding to the entity matching degree; The semantic similarity, keyword similarity, and entity matching degree are weighted and summed according to the first weight, the second weight, and the third weight to obtain the mixed similarity.
5. The method according to claim 1, characterized in that, The step of determining the decision threshold for the candidate answer based on the question type and pre-set context length of the question text includes: Based on the problem type, determine a first adjustment value to adjust the pre-set baseline threshold; Based on the context length, a second adjustment value is determined to adjust the baseline threshold; The decision threshold is obtained based on the baseline threshold, the first adjustment value, and the second adjustment value.
6. The method according to claim 5, characterized in that, The step of determining a first adjustment value for adjusting a pre-set baseline threshold based on the problem type includes: If the question type is identified as factual, the first adjustment value for raising the baseline threshold is determined based on the proportion of keywords in the question text among the candidate answers; or... If the question type is identified as open-ended, a first adjustment value for lowering the baseline threshold is determined based on the word vector variance of the keywords in the question text; or, If the question type is identified as process-oriented, the first adjustment value is determined based on the process feature words in the candidate answers.
7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: Based on the semantic similarity between the question text and pre-stored question samples, the target question sample corresponding to the question text is determined; Based on the question sample type corresponding to the target question sample, the question type of the question text is obtained.
8. An automatic question-and-answer device, characterized in that, The device includes: The question acquisition module is used to acquire the input question text; A candidate answer module is used to determine candidate answers to the question text; The threshold determination module is used to determine the decision threshold of the candidate answer based on the question type of the question text and the pre-set context length. The answer output module is used to determine the target answer to the question text from the candidate answers based on the decision threshold.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
