Input rewriting method and device of intelligent question answering system and computer equipment
Through the input rewriting method of the intelligent question-answer system, candidate rewriting results are generated using preset models, templates and rules, and the target results are filtered through the scoring model, which solves the problems of semantic incomplete and fuzzy information in user input, and improves the semantic accuracy and context coherence of the question-answer system.
Patent Information
- Application Number
- CN202510006698.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-04-08
AI Technical Summary
When processing user input, existing intelligent question-and-answer systems face problems such as semantic incompleteness, fuzzy information and pronoun reference, resulting in poor semantic accuracy of the answer.
It provides an input rewriting method for an intelligent question-and-answer system. By obtaining the conversation data input by the user, it determines whether it needs to be rewrite, uses preset rewriting models, templates and rules to generate candidate rewriting results, and filters out the target rewriting results through the pre-trained rewriting scoring model.
It significantly improves the semantic accuracy and contextual coherence of the answers generated by the intelligent question-and-answer system, ensures that the content entered by the user can better reflect the user's true intentions and improves the accuracy and reliability of the answers.
Smart Images

Figure CN119782485A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to an input rewriting method, device, computer equipment, computer-readable storage medium and computer program product for an intelligent question-answering system. Background Art
[0002] With the development of artificial intelligence and natural language processing technology, multi-round question-answering systems have been widely used in intelligent customer service, search engines and other fields. However, since user input often contains ambiguous information such as abbreviations, incomplete expressions or pronoun references, it is extremely challenging for the system to accurately understand the user's intentions. In addition, user input often depends on the previous and next contexts, making it impossible for a single round of dialogue to fully express the user's real needs. As a result, the answers generated by the question-answering system have poor semantic accuracy. Summary of the invention
[0003] Based on this, it is necessary to provide an input rewriting method, device, computer equipment, computer-readable storage medium and computer program product for an intelligent question and answer system that can improve the accuracy of answers generated by the intelligent question and answer system in response to the above technical problems.
[0004] In a first aspect, the present application provides an input rewriting method for an intelligent question-answering system, comprising:
[0005] Obtaining the dialogue data input by the user to the intelligent question-answering system, and determining whether the dialogue data needs to be rewritten;
[0006] In the case where it is determined that the dialog data needs to be rewritten, a preset rewriting model, a predefined rewriting template and a preset rewriting rule are used to generate a plurality of candidate rewriting results;
[0007] Inputting the plurality of candidate rewriting results into a pre-trained rewriting scoring model to obtain rewriting scores corresponding to the plurality of candidate rewriting results;
[0008] According to the rewriting score, a target rewriting result is determined from the multiple candidate rewriting results, and the target rewriting result is input into the intelligent question answering system.
[0009] In one embodiment, the method of using a preset rewriting model, a predefined rewriting template, and a preset rewriting rule to generate a plurality of candidate rewriting results includes:
[0010] Using a preset rewriting model, rewriting the conversation data into a semantically complete candidate rewriting result;
[0011] According to a predefined rewriting template, the semantics of the dialogue data are matched to generate a candidate rewriting result that conforms to the rewriting template;
[0012] Based on the preset rewriting rules, the dialogue data is processed according to preset rules to generate candidate rewriting results in a preset format.
[0013] In one embodiment, the adopting a preset rewriting model to rewrite the conversation data into a semantically complete candidate rewriting result includes:
[0014] Performing semantic analysis on the dialogue data through a semantic parsing generation model to generate candidate rewriting results;
[0015] The conversation data is processed through a bidirectional encoder conversion model to obtain candidate rewriting results.
[0016] In one embodiment, the determining whether the conversation data needs to be rewritten includes:
[0017] Perform keyword analysis on the conversation data to determine whether there is semantics that needs to be supplemented or reconstructed by matching a preset keyword set;
[0018] Using contextual reference analysis technology, check whether the conversation data contains ambiguous references or pronouns, and determine whether rewriting is required based on the conversation history content;
[0019] Performing semantic integrity check on the conversation data through a semantic analysis model, and if incomplete semantics or ambiguous expressions are detected, determining that rewriting is required;
[0020] Based on historical conversation context analysis, it is determined whether the conversation data depends on the semantic information of previous rounds of conversations. If the degree of dependence is higher than a preset threshold and the conversation data does not have independent semantics, it is determined that rewriting is required.
[0021] In one embodiment, inputting the plurality of candidate rewriting results into a pre-trained rewriting scoring model to obtain the rewriting scores corresponding to the plurality of candidate rewriting results respectively includes:
[0022] Evaluating the grammatical completeness of the plurality of candidate rewriting results to obtain a grammatical score;
[0023] Analyzing the semantic clarity of the multiple candidate rewriting results to obtain semantic scores;
[0024] Verifying the correctness of the use of professional terms in the plurality of candidate rewriting results to obtain terminology scores;
[0025] A rewriting score of each of the plurality of candidate rewriting results is obtained according to the grammatical score, the semantic score and the terminology score.
[0026] In one embodiment, the preset rewriting model and the target training data set of the pre-trained rewriting scoring model are obtained by:
[0027] Acquire multiple rounds of historical conversation data from a historical question-and-answer database, and annotate user intent, contextual relationships, and coreference resolution content in the multiple rounds of historical conversation data to form a first training data set;
[0028] According to the scene classification of the preset question-and-answer scene, question-and-answer scene data and corresponding rewritten data for the scene classification are generated to form a second training data set;
[0029] Obtaining an information graph of a preset field, and simulating and generating question-answer data and corresponding rewritten data for the preset field to form a third training data set;
[0030] The training data set is obtained according to the first training data set, the second training data set and the third training data set.
[0031] In a second aspect, the present application also provides an input rewriting device for an intelligent question-answering system, comprising:
[0032] An input judgment module is used to obtain the dialogue data input by the user to the intelligent question-answering system and judge whether the dialogue data needs to be rewritten;
[0033] A candidate generation module, for generating a plurality of candidate rewriting results by using a preset rewriting model, a predefined rewriting template and a preset rewriting rule when it is determined that the dialog data needs to be rewritten by type;
[0034] A rewriting scoring module, configured to input the plurality of candidate rewriting results into a pre-trained rewriting scoring model to obtain a rewriting score corresponding to each of the plurality of candidate rewriting results;
[0035] A rewriting determination module is used to determine a target rewriting result from the multiple candidate rewriting results according to the rewriting score, and input the target rewriting result into the intelligent question answering system.
[0036] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0037] Obtaining the dialogue data input by the user to the intelligent question-answering system, and determining whether the dialogue data needs to be rewritten;
[0038] In the case where it is determined that the dialog data needs to be rewritten, a preset rewriting model, a predefined rewriting template and a preset rewriting rule are used to generate a plurality of candidate rewriting results;
[0039] Inputting the plurality of candidate rewriting results into a pre-trained rewriting scoring model to obtain rewriting scores corresponding to the plurality of candidate rewriting results;
[0040] According to the rewriting score, a target rewriting result is determined from the multiple candidate rewriting results, and the target rewriting result is input into the intelligent question answering system.
[0041] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0042] Obtaining the dialogue data input by the user to the intelligent question-answering system, and determining whether the dialogue data needs to be rewritten;
[0043] In the case where it is determined that the dialog data needs to be rewritten, a preset rewriting model, a predefined rewriting template and a preset rewriting rule are used to generate a plurality of candidate rewriting results;
[0044] Inputting the plurality of candidate rewriting results into a pre-trained rewriting scoring model to obtain rewriting scores corresponding to the plurality of candidate rewriting results;
[0045] According to the rewriting score, a target rewriting result is determined from the multiple candidate rewriting results, and the target rewriting result is input into the intelligent question answering system.
[0046] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0047] Obtaining the dialogue data input by the user to the intelligent question-answering system, and determining whether the dialogue data needs to be rewritten;
[0048] In the case where it is determined that the dialog data needs to be rewritten, a preset rewriting model, a predefined rewriting template and a preset rewriting rule are used to generate a plurality of candidate rewriting results;
[0049] Inputting the plurality of candidate rewriting results into a pre-trained rewriting scoring model to obtain rewriting scores corresponding to the plurality of candidate rewriting results;
[0050] According to the rewriting score, a target rewriting result is determined from the multiple candidate rewriting results, and the target rewriting result is input into the intelligent question answering system.
[0051] The input rewriting method, device, computer equipment, computer-readable storage medium and computer program product of the intelligent question-answering system described above first obtain the dialogue data input by the user to the intelligent question-answering system, and determine whether the dialogue data needs to be rewritten. By analyzing the dialogue data input by the user and combining the context information, it is accurately determined whether there are problems such as semantic ambiguity, incomplete expression or unclear reference, thereby avoiding unnecessary rewriting operations and improving the efficiency and pertinence of the system; then, when it is determined that the dialogue data needs to be rewritten by type, a preset rewriting model, a predefined rewriting template and a preset rewriting rule are used to generate multiple candidate rewriting results. Combining multiple rewriting generation methods (model generation, template matching, rule rewriting) can generate a variety of candidate rewriting results, which not only ensures It is flexible and can adapt to the needs of different dialogue scenarios, laying the foundation for subsequent screening and optimization; then, multiple candidate rewriting results are input into the pre-trained rewriting scoring model to obtain the rewriting scores corresponding to the multiple candidate rewriting results. Through the rewriting scoring model, the semantic accuracy, contextual coherence and grammatical completeness of the candidate rewriting results are comprehensively considered to ensure that the quality assessment of each candidate result is scientific and reasonable, providing a basis for screening out the best result; finally, according to the rewriting score, the target rewriting result is determined from multiple candidate rewriting results, and the target rewriting result is input into the intelligent question and answer system. Through the intelligent sorting and screening mechanism, the target rewriting result with the most accurate semantics and the most coherent context is finally determined to ensure that the content input into the question and answer system can better reflect the user's true intention and improve the accuracy and reliability of the answer. In the above method, by obtaining user input, judging rewriting requirements, generating candidate rewriting results, scoring and screening target rewriting results and other steps, semantic completion and fuzzy information processing of user input are achieved, which significantly improves the performance of the intelligent question-answering system in terms of semantic accuracy and contextual coherence; it not only solves the understanding problems caused by abbreviations, incomplete expressions and pronoun references, but also ensures that the final rewriting results can fully reflect user needs through a variety of rewriting generation methods and scoring optimization mechanisms, thereby improving the system's response quality and user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0053] Figure 1 A schematic diagram of a flow chart of an input rewriting method of an intelligent question answering system in one embodiment;
[0054] Figure 2 A schematic diagram of a flow chart of a step of generating a candidate rewriting result in one embodiment;
[0055] Figure 3 A schematic diagram of an input rewriting system of an intelligent question answering system in one embodiment;
[0056] Figure 4 is a structural block diagram of an input rewriting device of an intelligent question-answering system in one embodiment;
[0057] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0059] In one embodiment, Figure 1 As shown, an input rewriting method for an intelligent question-answering system is provided. This embodiment uses the method applied to a terminal as an example for illustration. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be, but is not limited to, various personal computers, laptops, smart phones, and tablet computers. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. In this embodiment, the method includes the following steps:
[0060] Step S101, obtaining the dialogue data input by the user to the intelligent question-answering system, and determining whether the dialogue data needs to be rewritten.
[0061] Among them, dialogue data refers to the natural language text or voice information that users input into the intelligent question-answering system through terminals (such as mobile phones, tablets or computers), which may include complete statements, abbreviated expressions, pronoun references, etc.
[0062] Exemplarily, the terminal obtains the dialogue data submitted by the user through the user input interface. If the input is in voice form, it is converted into text form using the voice recognition module. Then, the terminal passes the text data to the preprocessing module for data cleaning, including removing noise characters, normalizing punctuation marks, and lexical segmentation operations. After completing the preprocessing, the terminal uses the embedded semantic analysis module to extract keywords, identify intent, and analyze context dependencies on the dialogue data. Combined with historical dialogue records, it determines whether the data has semantic ambiguity, incomplete expression, or pronoun reference. If the judgment result is "need to be rewritten", the dialogue data is marked as requiring further rewriting and passed to the subsequent steps. If the judgment result is "no need to be rewritten", the dialogue data is directly sent to the question-and-answer system to generate an answer.
[0063] Step S102: when it is determined that the dialog data needs to be rewritten, a preset rewriting model, a predefined rewriting template and a preset rewriting rule are used to generate a plurality of candidate rewriting results.
[0064] The candidate rewriting results refer to multiple rewriting texts generated based on user input after the rewriting process that may meet the requirements of semantic completion and context coherence. These texts will be screened in subsequent steps.
[0065] Exemplarily, after the terminal receives the data to be rewritten, it generates candidate rewriting results by calling the rewriting processing module. The specific process is as follows: Preset rewriting model: The terminal calls the preset model based on deep learning to generate a set of rewriting candidates based on the input data and contextual semantic information to ensure its semantic integrity and expression diversity. Predefined rewriting template: Using the rewriting template stored in the terminal or server, the input is pattern matched with the template, and the rewriting candidate is generated by filling in the missing semantic parts according to the template. Preset rewriting rules: Rewrite the input in combination with domain-specific grammatical rules or business logic, such as explicit processing of pronoun references or expansion of abbreviations, thereby generating rule-based candidate rewriting. The multiple candidate rewriting results generated will be stored in the candidate pool with their respective source labels (models, templates or rules) to provide input for subsequent scoring and screening steps.
[0066] Step S103 , inputting the plurality of candidate rewriting results into a pre-trained rewriting scoring model to obtain rewriting scores corresponding to the plurality of candidate rewriting results.
[0067] Among them, the rewriting scoring model refers to a pre-trained deep learning model or machine learning model, whose function is to comprehensively score the semantic accuracy, contextual coherence and grammatical completeness of candidate rewriting results, providing a basis for subsequent screening of the best rewriting results.
[0068] Exemplarily, the terminal inputs multiple candidate rewriting results into the scoring module of the rewriting scoring model, which can be specifically: the rewriting scoring model semantically embeds the candidate rewriting results, and extracts semantic features through context matching, keyword weight analysis and other methods. The model evaluates the candidate rewriting results according to a multi-dimensional scoring mechanism, including: semantic accuracy: evaluating whether the rewriting result accurately expresses the intention of the user's original input; contextual coherence: analyzing whether the rewriting result is logically consistent with the conversation history; grammatical completeness: detecting whether the grammar of the rewriting result is standardized and free of grammatical errors. Based on the above dimensions, the model generates a comprehensive score for each candidate rewriting result, and attaches the score to the candidate rewriting results as a basis for sorting.
[0069] Step S104, determining a target rewriting result from a plurality of candidate rewriting results according to the rewriting scores, and inputting the target rewriting result into the intelligent question answering system.
[0070] Among them, the target rewriting result refers to the rewritten text with the highest score and the most consistent with the user's input intention selected from multiple candidate rewriting results. The text has semantic accuracy, contextual coherence and grammatical completeness, and can be used as the final input of the intelligent question-answering system.
[0071] Exemplarily, the terminal screens and determines the candidate rewriting results according to the scoring results output by the rewriting scoring module. The terminal sorts all candidates according to the comprehensive score of each candidate rewriting result in the scoring pool, and selects the rewritten text with the highest score from the sorting results as the target rewriting result. Finally, the target rewriting result is verified to see if it complies with the business logic and domain rules, such as checking whether the use of professional terms is standardized. After the verification is passed, the terminal sends the target rewriting result to the intelligent question-answering system, replacing the user's original input as the direct driving data of the question-answering process.
[0072] In the input rewriting method of the intelligent question-answering system, first, the dialogue data input by the user to the intelligent question-answering system is obtained, and it is determined whether the dialogue data needs to be rewritten. By analyzing the dialogue data input by the user and combining the context information, it is accurately determined whether there are problems such as semantic ambiguity, incomplete expression or unclear reference, thereby avoiding unnecessary rewriting operations and improving the efficiency and pertinence of the system; then, when it is determined that the dialogue data needs to be rewritten, a preset rewriting model, a predefined rewriting template and a preset rewriting rule are used to generate multiple candidate rewriting results. Combining multiple rewriting generation methods (model generation, template matching, rule rewriting), a variety of candidate rewriting results can be generated, which not only ensures flexibility but also can adapt to different dialogue scenarios. The needs of the scene are considered, laying the foundation for subsequent screening and optimization; then, multiple candidate rewriting results are input into the pre-trained rewriting scoring model to obtain the rewriting scores corresponding to the multiple candidate rewriting results. Through the rewriting scoring model, the semantic accuracy, contextual coherence and grammatical completeness of the candidate rewriting results are comprehensively considered to ensure that the quality assessment of each candidate result is scientific and reasonable, providing a basis for screening out the best result; finally, according to the rewriting score, the target rewriting result is determined from multiple candidate rewriting results, and the target rewriting result is input into the intelligent question and answer system. Through the intelligent sorting and screening mechanism, the target rewriting result with the most accurate semantics and the most coherent context is finally determined to ensure that the content input into the question and answer system can better reflect the user's true intention and improve the accuracy and reliability of the answer. In the above method, by obtaining user input, judging rewriting requirements, generating candidate rewriting results, scoring and screening target rewriting results and other steps, semantic completion and fuzzy information processing of user input are achieved, which significantly improves the performance of the intelligent question-answering system in terms of semantic accuracy and contextual coherence; it not only solves the understanding problems caused by abbreviations, incomplete expressions and pronoun references, but also ensures that the final rewriting results can fully reflect user needs through a variety of rewriting generation methods and scoring optimization mechanisms, thereby improving the system's response quality and user satisfaction.
[0073] In an exemplary embodiment, Figure 2 As shown, the above step S102 uses a preset rewriting model, a predefined rewriting template and a preset rewriting rule to generate multiple candidate rewriting results, which can also be achieved by the following steps:
[0074] Step S201, using a preset rewriting model to rewrite the conversation data into a semantically complete candidate rewriting result;
[0075] Step S202, matching the semantics of the dialogue data according to a predefined rewriting template, and generating a candidate rewriting result that conforms to the rewriting template;
[0076] Step S203: Based on the preset rewriting rules, the dialogue data is processed according to preset rules to generate candidate rewriting results in a preset format.
[0077] Among them, the preset rewriting model is a natural language processing model based on deep learning technology. It uses context information to semantically complete ambiguous expressions and incomplete sentences in the input dialogue data to generate semantically complete rewriting candidates; the predefined rewriting template is a structured sentence pattern designed according to domain-specific business needs, which contains a fixed semantic framework and placeholders, which is used to match the semantics of input data and generate rewriting; the preset rewriting rules are a set of clear logical judgments and operation rules that handle common abbreviations, pronoun references and grammatical structure problems to generate candidate rewriting results that meet expectations.
[0078] Exemplarily, after receiving the dialogue data to be rewritten, the terminal first calls the preset rewriting model. The model encodes the input dialogue data and converts it into a context vector to capture the user's intention and semantic information; then, the decoder generates semantically complete rewriting candidates, such as completing the input sentence "What is its coverage?" to "What is the coverage of this xx insurance?". Then, the terminal processes the input data using a predefined rewriting template. The rewriting template pre-designs the sentence framework of common questions, such as "Does [product name] include [insurance item]?" or "What is the [parameter name] of [product name]?". The terminal matches the input data with these templates and fills in the placeholder variables according to semantic extraction. For example, after inputting "Is there a discount for auto insurance?", the matching template generates a rewriting candidate "Does the auto insurance product enjoy a discount?". Finally, the terminal performs regular processing on the dialogue data based on the preset rewriting rules. The rules include making pronouns more specific (such as rewriting "it" to "the policy"), expanding abbreviations to full names (such as rewriting "compulsory traffic insurance" to "compulsory motor vehicle traffic accident liability insurance"), and adjusting sentence structures to make them grammatically standardized. For example, the input "How much compensation?" can be rewritten into "How much compensation can I get?" through the rules. Through the above three methods, the terminal generates a variety of candidate rewriting results, covering different semantic processing angles and expressions.
[0079] In this embodiment, by combining the preset rewriting model, rewriting template and regular processing, the rewriting effect of the dialogue data is significantly improved. On the one hand, the generated candidate rewriting results can cover the diversity of different semantics and expressions, thereby improving the ability to handle ambiguous expressions of user input; on the other hand, through context completion and regular rewriting, the problems of semantic ambiguity, incomplete expression and unclear reference are effectively solved, ensuring the semantic accuracy and expression standardization of the rewriting results. The input processing capability of the question-answering system is greatly enhanced, providing a strong guarantee for the quality of the final output answers and user satisfaction.
[0080] In an exemplary embodiment, the above step S201 uses a preset rewriting model to rewrite the dialogue data into semantically complete candidate rewriting results, and also includes: performing semantic analysis on the dialogue data through a semantic parsing generation model to generate candidate rewriting results; processing the dialogue data through a bidirectional encoder conversion model to obtain candidate rewriting results.
[0081] Among them, the semantic parsing generation model can be a seq2seq model, which is a generative model based on the encoder-decoder architecture, and uses input dialogue data to generate semantically complete rewriting candidate results; the bidirectional encoder transformation model can be a BERT (Bidirectional Encoder Representations from Transformer) model, which is a language representation model based on bidirectional encoder representation.
[0082] Exemplarily, the terminal first calls the seq2seq model to process the dialogue data. The model is based on the Transformer architecture and adopts an encoder-decoder design. The encoder part consists of multiple layers of encoding modules, each layer of which contains a multi-head self-attention mechanism and a feedforward neural network to capture long-distance dependencies and key semantic information in sentences. The decoder part consists of multiple layers of decoding modules, adding an encoder-decoder attention mechanism to generate rewritten text in combination with context information. For example, for the input "How much is the claim?" the encoder maps it to a context vector to capture the association information between "claim" and the historical context; the decoder uses the context to generate rewrite candidates "What is the specific amount of the claim?" or "What is the claim amount for this policy?".
[0083] Next, the terminal calls the BERT model to perform contextual semantic representation on the conversation data. The BERT model embeds each word into a high-dimensional semantic space through a bidirectional self-attention mechanism, and generates candidate rewrites based on contextual relationships. The model's multi-layer Transformer encoding structure is able to learn deep semantic associations between words. For example, for the input "What else?" the BERT model combines the context of previous rounds of conversations to generate candidate rewrites such as "Does this policy have any additional terms?" or "Does this insurance include additional coverage?"; for the input "When is the policy effective?" it generates candidate rewrites such as "When does my car insurance policy take effect?"
[0084] Through the collaborative work of the seq2seq model and the BERT model, the terminal generated a variety of candidate rewrite results. The seq2seq model is good at generating semantically complete and clearly structured rewrites, solving the problem of semantic ambiguity or information missing in the input sentence; the BERT model relies on context embedding and language relevance analysis to generate logically coherent and highly relevant candidate rewrites to historical conversations.
[0085] In this embodiment, the combination of the Transformer model and the BERT model significantly improves the rewriting quality of the dialogue data. On the one hand, the semantic parsing generation model generates semantically complete rewriting candidate results by capturing key semantics and long-distance dependencies, effectively solving the problem of semantic ambiguity or incompleteness in the input; on the other hand, the semantic embedding model generates contextually coherent candidate rewriting results through a deep understanding of the context, thereby enhancing the accuracy and logical consistency of the rewriting results.
[0086] In an exemplary embodiment, the above-mentioned step S101 determines whether the conversation data needs to be rewritten, and also includes: performing keyword analysis on the conversation data, and determining whether there is semantics that need to be supplemented or reconstructed by matching a preset keyword set; using contextual reference resolution technology to check whether the conversation data contains ambiguous references or pronouns, and determining whether rewriting is required in combination with the conversation history content; performing semantic integrity detection on the conversation data through a semantic analysis model, and if incomplete semantics or ambiguous expressions are detected, it is determined that rewriting is required; based on historical conversation context analysis, determining whether the conversation data depends on semantic information of previous rounds of conversations, and if the degree of dependence is higher than a preset threshold and the conversation data does not have independent semantics, it is determined that rewriting is required.
[0087] Among them, keyword analysis is to match the core words or phrases in the input dialogue data with the system's predefined keyword set to determine whether it involves specific scenarios that need to be rewritten, such as supplementary questions, unfinished questions or ambiguous expressions; contextual reference resolution technology uses natural language processing technology to parse pronouns or demonstrative pronouns, and clearly refer to objects by tracing back the semantics of historical dialogues; semantic integrity detection uses a semantic analysis model to detect the logic and information structure of the input data to determine whether it is fully expressed or has semantic omissions; historical context analysis uses the semantic information in the dialogue history to make associations and determine the independence and dependency of the current input.
[0088] Exemplarily, the terminal first performs keyword analysis on the conversation data input by the user and matches the preset keyword set. Keyword analysis is implemented through a rule-based keyword matching algorithm, and the input is scanned using a predefined keyword set. The keyword set can be a common vocabulary list built by domain experts according to scenario requirements, or it can be automatically extracted by analyzing large-scale conversation data. During the analysis process, a fast matching algorithm based on a hash table is used to improve efficiency, or the weights of keywords are sorted in combination with the TF-IDF (term frequency-inverse document frequency) model. After matching high-weight keywords, further combine the rule base to determine whether rewriting is required. For example, when the system detects that the input contains "payment" or "process", it may determine that the semantics needs to be supplemented with details. If the input is "How to make a claim?" The system detects the keyword "claim", and combined with the keyword rule, it determines that the input may involve a process description and needs to be further rewritten as "What is the claim process?" so that the system can better handle it.
[0089] Next, the terminal calls the contextual reference resolution technology to analyze whether the input contains ambiguous references or pronouns. Contextual reference resolution is achieved through the reference resolution technology in natural language processing, which usually relies on deep learning models (such as the reference resolution model based on BERT). The model first captures the semantic features of the pronouns in the sentence through a bidirectional self-attention mechanism, and then establishes a mapping relationship between the pronouns and the referents in combination with the entity information in the conversation history. In addition, entity recognition tools in specific fields are used to annotate and match entities in the conversation content (such as "insurance policy" and "auto insurance") to ensure that the reference resolution results are accurate. The results of reference resolution will be used to supplement the specific meaning of the pronouns to determine whether they need to be rewritten. For example, for the input "What is its coverage?", the system combines the previous round of dialogue "Auto insurance policy includes theft and robbery insurance" to resolve that "it" refers to "auto insurance policy", and thus determines that the sentence needs to be rewritten as "What is the coverage of the auto insurance policy?".
[0090] Then, the terminal uses the semantic analysis model to check the integrity of the conversation data. Semantic integrity detection relies on the semantic analysis model, which can be a Transformer-based deep learning model or a semantic verification system based on logical rules. The deep learning model uses semantic embedding technology to map the input conversation to a high-dimensional semantic space and detect whether it meets the predefined semantic integrity standards. For example, by analyzing the subject-predicate-object structure in the input sentence, it is determined whether it expresses complete semantic logic. If necessary information (such as subject, predicate, or object) is missing, the input will be marked as semantically incomplete and a rewrite operation will be triggered.
[0091] Finally, the terminal analyzes the degree of dependency between the current input and the conversation history based on the historical context. Context analysis is based on the semantic modeling of the conversation history, and uses a context dependency model (such as a conversation model based on RNN or Transformer) to calculate the semantic relevance between the current input and the historical content. The model dynamically weighs the relationship between the current input and the previous rounds of conversations through the attention mechanism to generate a context relevance score. If the relevance score is higher than the preset threshold and the current input is not independent enough, the system will determine that the input needs to be rewritten. In addition, context analysis also combines the contextual graph to record the flow of entities and intentions in the conversation, providing auxiliary support for dependency judgment. For example, for the input "What else?" combined with the previous rounds of conversations "What items are included in the accident insurance policy" and "What is the coverage", the system determines that the input has a high degree of context dependency and needs to be rewritten as "Does the accident insurance policy have other coverage items?".
[0092] In this embodiment, through multi-level judgments such as keyword analysis, reference resolution, semantic integrity detection, and context analysis, the need to rewrite the input dialogue data can be accurately identified, which not only improves the clarity and expression integrity of the input semantics, but also enhances the system's ability to handle complex dialogue scenarios, thereby laying the foundation for the subsequent generation of better-quality answers.
[0093] In an exemplary embodiment, the above step S103 inputs multiple candidate rewriting results into a pre-trained rewriting scoring model to obtain rewriting scores corresponding to each of the multiple candidate rewriting results, and also includes: evaluating the grammatical completeness of the multiple candidate rewriting results to obtain a grammatical score; analyzing the semantic clarity of the multiple candidate rewriting results to obtain a semantic score; verifying the correctness of the use of professional terms in the multiple candidate rewriting results to obtain a terminology score; and obtaining a rewriting score for each of the multiple candidate rewriting results based on the grammatical score, the semantic score and the terminology score.
[0094] Among them, the grammatical integrity assessment is based on natural language processing technology and grammatical analysis tools to check the grammatical structure of the candidate rewriting results to ensure that the sentences are standardized and the syntactic structure is complete and error-free; the semantic clarity analysis is to analyze the content of the candidate rewriting results through a semantic analysis model to determine whether its semantic expression is clear and unambiguous, and whether it can accurately convey the intention of the original input; the verification of the correctness of the use of professional terminology is to match and verify the professional terminology in the candidate rewriting results in combination with the domain knowledge base to ensure that it conforms to the professional expression standards of the specific field.
[0095] Exemplarily, the terminal first evaluates the grammatical integrity of the candidate rewriting results, and uses a rule-based grammar parser or a machine learning-based grammar correction model to analyze the grammatical structure of the candidate rewriting results sentence by sentence. The grammar parser decomposes the sentence into a syntactic tree structure to check whether the sentence components are complete and whether the arrangement conforms to the grammatical rules. For the machine learning-based grammar correction model, it detects and marks grammatical errors in sentences by learning from large-scale grammar data sets, and provides correction suggestions for the wrong parts.
[0096] Subsequently, semantic clarity analysis is completed through a semantic embedding model. Semantic embedding technology uses deep learning models (such as BERT or GPT) to map the content of candidate rewriting results into a high-dimensional semantic space and calculate the semantic similarity and consistency between the rewriting results and the original input. The model compares the contextual semantic information of the input and the rewriting results to identify potential ambiguous expressions or semantic deviations. At the same time, the model combines the conversation context to ensure that the semantic expression of the candidate rewriting results can cover the core intent of the input.
[0097] The verification of the correct use of professional terms combines the domain knowledge base and the word embedding model. The domain knowledge base contains professional terms and related expressions for a specific industry (such as insurance). By matching the keywords in the candidate rewriting results, it is verified whether the terms conform to the knowledge base definition. The word embedding model further verifies whether the terms are compliant by calculating the semantic similarity between the terms and the domain standard expression. When the term is found to be incorrect, it can make suggestions for revisions and reduce the score.
[0098] Finally, the scoring results are comprehensively evaluated using a weighted scoring mechanism to calculate the total score of the candidate rewriting results based on the weight of each score. The grammar score usually has a lower weight because the rewriting generation module is usually grammatically stable; semantic clarity and terminology correctness have a higher weight to ensure that the rewriting results are semantically accurate and meet domain standards.
[0099] In this embodiment, through the combination of grammatical completeness assessment, semantic clarity analysis and professional terminology correctness verification, the scoring model can comprehensively and accurately evaluate the quality of candidate rewriting results. By using rule-based and deep learning technical means, multi-dimensional and automated scoring processing of candidate rewriting results is achieved, which provides strong support for the subsequent screening of the best rewriting results and significantly improves the reliability and user experience of the question-answering system.
[0100] In an exemplary embodiment, the target training data set of the above-mentioned preset rewriting model and pre-trained rewriting scoring model can be obtained in the following manner: obtaining multiple rounds of historical conversation data from a historical question and answer database, and marking user intentions, contextual relationships, and reference resolution content in the multiple rounds of historical conversation data to form a first training data set; generating question and answer scene data and corresponding rewriting data for the scene classification according to the scene classification of the preset question and answer scene to form a second training data set; obtaining an information map of a preset field, simulating the generation of question and answer data and corresponding rewriting data for the preset field to form a third training data set; obtaining a training data set based on the first training data set, the second training data set, and the third training data set.
[0101] Exemplarily, the terminal extracts multi-round dialogue data from the historical question-and-answer database, and uses natural language processing technology to segment the multi-round dialogue, dividing the dialogue into independent question-and-answer rounds. Next, the terminal uses an intent classification model (such as a BERT-based intent classifier) to annotate the user's dialogue intent and extract key behaviors, such as "asking about the coverage" and "consulting about the claims process." Subsequently, the terminal uses reference resolution technology to parse pronouns or ambiguous expressions, for example, "it" in "its coverage" is parsed as "auto insurance policy." After manual verification, these data form the first training data set with complete annotations.
[0102] The terminal designs scenario classifications based on business needs, such as "coverage consultation" and "claim amount calculation" in the insurance field. For each scenario, the terminal uses the scenario generation tool to generate standard question and answer data, and generates a variety of rewritten forms through rewriting generation technology (such as template matching or deep learning generation model). For example, in the "coverage consultation" scenario, the system generates a rewritten version of the question "What items are included in the insurance policy?", such as "What does this insurance cover?" or "What are the specific coverage contents?" Finally, a second training data set covering different forms of expression is formed.
[0103] The terminal uses the knowledge graph reasoning tool to extract nodes (such as insurance products, coverage) and their relationships (such as "car insurance policy->includes->theft insurance"). Combined with these graph relationships, the terminal simulates the generation of question and answer data, and generates corresponding rewrites through deep learning generation models (such as large language models), forming a third training data set covering diverse domain knowledge. For example, the system generates a rewrite of the question "Does the car insurance policy include theft insurance?" based on the graph as "Does this policy cover theft insurance?".
[0104] Finally, the terminal integrates the first training data set, the second training data set, and the third training data set into the target training data set. The integration process uses data deduplication technology to remove duplicate data, the balancing algorithm adjusts the weight of a small number of samples, and the data enhancement technology introduces noise or adjusts the sentence structure to improve the model's robustness to irregular inputs.
[0105] In this embodiment, the training data set is generated through three technical means: historical data annotation, scene classification generation, and knowledge graph reasoning, which greatly enriches the diversity and quality of training samples. The optimized rewriting model and scoring model have stronger context understanding and semantic generation capabilities, significantly improving the accuracy of the question-answering system's answers and user satisfaction in complex scenarios.
[0106] In an exemplary embodiment, Figure 3 As shown, the present application provides an input rewriting system for an intelligent question-answering system, which is applied in the insurance field, and includes: a rewriting judgment module 301, a candidate rewriting result generation module 302 and a rewriting result sorting module 303.
[0107] Among them, the rewriting judgment module 301 is used to identify the rewriting needs in the multi-round dialogue system. Specifically, a multi-level rewriting judgment is adopted: 1. Insurance product question judgment: Identify whether the user is asking about the details of a specific insurance product. 2. Insurance reference check: Check whether there are demonstrative pronouns (such as "it" and "this") in the user input that need to be reference resolved. 3. Keyword matching: Use keyword matching technology to identify whether rewriting is required. 4. Semantic analysis: Use semantic analysis technology to determine whether the intention of the user input is clear. 5. Historical dialogue context: Combine historical dialogue context information to determine whether rewriting is required.
[0108] The candidate rewriting result generation module 302 is used to adopt multiple methods to generate candidate rewriting results. Specifically, multiple strategies are combined to support the rewriting requirements of various scenarios: 1. seq2seq model: Transformer is used as the seq2seq base model to generate rewriting candidates. 2. BERT extraction model: The BERT model is used to extract rewriting candidates. 3. Template matching: Rewriting candidates are generated through predefined templates. 4. Rule rewriting: Rewriting candidates are generated based on rule methods. 5. Machine learning model: Rewriting candidates are generated using machine learning models.
[0109] Among them, the seq2seq model: the model structure adopts the Transformer model, which includes an encoder composed of multiple encoding layers, each encoding layer includes a multi-head self-attention mechanism and a feed-forward neural network; and a decoder composed of multiple decoding layers, each decoding layer includes a multi-head self-attention mechanism, an encoder-decoder attention mechanism, and a feed-forward neural network. Among them, the multi-head self-attention mechanism calculates attention in parallel through multiple attention heads to capture the dependencies of different subspaces, and the feed-forward neural network consists of two fully connected layers to increase the nonlinear expression ability of the model.
[0110] BERT Extractive Model: Use the BERT model for context embedding and extract rewriting candidates.
[0111] Furthermore, the data set required for model training can be obtained in the following ways:
[0112] ① Rewrite the data set from historical question-and-answer data mining: 1. Data source: Collect historical question-and-answer data from the insurance company’s customer service system, including user questions and customer service answers. 2. Data cleaning: Preprocess the collected data, such as removing noise, word segmentation, and deduplication. 3. Data annotation: Annotate the historical question-and-answer data, including user intent, contextual relationship between question and answer pairs, and reference resolution.
[0113] ② Supplementary construction of multiple rounds of rewriting data based on 400 insurance intent classification systems: Intent classification system: According to the business needs of the insurance field, 400 insurance intent classification systems are constructed, including insurance product consultation, claim process query, policy query, etc. Data collection: For each intent classification, manually construct multiple rounds of rewriting scenario data of related question and answer data to ensure that each classification has sufficient data volume.
[0114] ③ Construct a data set based on the attribute relationship of the insurance product graph: 1. Insurance product graph: Collect and use the company's insurance product graph, including the attributes, terms and other information of insurance products. 2. Multi-round rewriting data construction: Based on the insurance product graph, artificially simulate the multi-round rewriting dialogue scenarios of entity inheritance, intention inheritance and other scenarios to construct a data set to ensure that the data covers all attributes and relationships of insurance products.
[0115] The rewriting result sorting module 303 is used to select the best rewriting result for output. Specifically, the following methods may be used: 1. Scoring function: Scoring the rewriting candidates using the scoring function. 2. Machine learning sorting model: Sorting the rewriting candidates using the machine learning sorting model. 3. User feedback data: Optimizing the sorting results by combining user feedback data.
[0116] The specific process is as follows:
[0117] Step 1: User inputs the question: The user inputs the question through a terminal (such as a mobile phone or computer), and the data first enters the preprocessing module for basic data cleaning (such as noise removal, word segmentation, etc.).
[0118] Step 2: Identification of rewriting needs: The data enters the rewriting judgment module and uses multi-level rewriting judgment (insurance product questioning judgment, insurance reference check, keyword matching, semantic analysis and historical conversation context) to identify whether rewriting is needed.
[0119] Step 3: Candidate rewriting generation: If rewriting is required, call the candidate rewriting result generation module to generate multiple rewriting candidates using the seq2seq model, BERT extractive model, template matching, rule rewriting, and machine learning model.
[0120] Step 4: Rewriting result sorting: The generated rewriting candidates enter the rewriting result sorting module, which uses the scoring function, machine learning sorting model and user feedback data to intelligently sort the rewriting candidates and select the best rewriting result.
[0121] Step 5, final output: The best rewritten result is requested to the question-answering system, which generates the final response and returns it to the user.
[0122] In this embodiment, multi-level rewriting judgment, multiple rewriting generation methods (such as seq2seq model, BERT extractive model, template matching, rule rewriting and machine learning model) and intelligent sorting mechanism are combined to optimize the specific needs in the insurance scenario, significantly improving the semantic understanding ability and dialogue quality of the multi-round dialogue system. The system accurately understands the user input and its context through insurance graph information and 400 insurance intent classification systems, and combines the reference resolution technology to generate rewriting results that better meet user needs. Context-aware technology ensures the coherence of the rewritten content, and the intelligent sorting mechanism selects the optimal rewriting result based on the scoring function and user feedback. In addition, through a variety of rewriting generation methods, the system can handle complex scenarios such as clause interpretation and claims settlement process, greatly improving the naturalness and professionalism of the dialogue. Thanks to this, the answer rate of complex dialogue scenarios is improved, the user experience and satisfaction are effectively improved, and the professionalism and reliability of the question-answering system in the insurance field are enhanced.
[0123] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0124] Based on the same inventive concept, the embodiment of the present application also provides an input rewriting device for an intelligent question and answer system for implementing the input rewriting method for the intelligent question and answer system involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the input rewriting device for one or more intelligent question and answer systems provided below can refer to the limitations of the input rewriting method for the intelligent question and answer system above, and will not be repeated here.
[0125] In an exemplary embodiment, Figure 4 As shown, an input rewriting device of an intelligent question-answering system is provided, comprising: an input judgment module 401, a candidate generation module 402, a rewriting scoring module 403 and a rewriting determination module 404, wherein:
[0126] The input judgment module 401 is used to obtain the dialogue data input by the user to the intelligent question-answering system and judge whether the dialogue data needs to be rewritten;
[0127] A candidate generation module 402 is used to generate a plurality of candidate rewriting results by using a preset rewriting model, a predefined rewriting template and a preset rewriting rule when it is determined that the dialog data needs to be rewritten.
[0128] A rewriting scoring module 403 is used to input multiple candidate rewriting results into a pre-trained rewriting scoring model to obtain rewriting scores corresponding to each of the multiple candidate rewriting results;
[0129] The rewriting determination module 404 is used to determine a target rewriting result from multiple candidate rewriting results according to the rewriting score, and input the target rewriting result into the intelligent question answering system.
[0130] In one of the embodiments, the candidate generation module 402 is further used to adopt a preset rewriting model to rewrite the conversation data into semantically complete candidate rewriting results; match the semantics of the conversation data according to a predefined rewriting template to generate candidate rewriting results that conform to the rewriting template; and perform preset regularized processing on the conversation data based on preset rewriting rules to generate candidate rewriting results in a preset format.
[0131] In one of the embodiments, the candidate generation module 402 is further used to perform semantic analysis on the dialogue data through a semantic parsing generation model to generate candidate rewriting results; and to perform contextual semantic embedding on the dialogue data through a bidirectional encoder conversion model to obtain candidate rewriting results.
[0132] In one of the embodiments, the input judgment module 401 is also used to perform keyword analysis on the conversation data, and to determine whether there are semantics that need to be supplemented or reconstructed by matching a preset keyword set; to use contextual reference resolution technology to check whether the conversation data contains ambiguous references or pronouns, and to determine whether rewriting is required in combination with the conversation history content; to perform semantic integrity detection on the conversation data through a semantic analysis model, and if incomplete semantics or ambiguous expressions are detected, it is determined that rewriting is required; based on historical conversation context analysis, it is determined whether the conversation data depends on the semantic information of previous rounds of conversations, and if the degree of dependence is higher than a preset threshold and the conversation data does not have independent semantics, it is determined that rewriting is required.
[0133] In one embodiment, the rewriting scoring module 403 is further used to evaluate the grammatical completeness of multiple candidate rewriting results to obtain a grammatical score; analyze the semantic clarity of multiple candidate rewriting results to obtain a semantic score; verify the correctness of the use of professional terms in multiple candidate rewriting results to obtain a terminology score; and obtain a rewriting score for each of the multiple candidate rewriting results based on the grammatical score, semantic score and terminology score.
[0134] In one of the embodiments, the input rewriting device of the above-mentioned intelligent question and answer system is also used to obtain multiple rounds of historical dialogue data from a historical question and answer database, and mark user intentions, contextual relationships, and reference resolution content in the multiple rounds of historical dialogue data to form a first training data set; according to the scene classification of the preset question and answer scene, generate question and answer scene data and corresponding rewriting data for the scene classification to form a second training data set; obtain an information map of a preset field, simulate and generate question and answer data and corresponding rewriting data for the preset field to form a third training data set; obtain a training data set based on the first training data set, the second training data set, and the third training data set.
[0135] Each module in the input rewriting device of the intelligent question-answering system can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0136] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, an input rewriting method of an intelligent question-answering system is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0137] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0138] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0139] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0140] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0141] 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, stored data, displayed data, 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 relevant data must comply with relevant regulations.
[0142] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0143] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.
[0144] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. An input rewriting method for an intelligent question answering system, characterized in that: The method comprises: Obtaining the dialogue data input by the user to the intelligent question-answering system, and determining whether the dialogue data needs to be rewritten; In the case where it is determined that the dialog data needs to be rewritten, a preset rewriting model, a predefined rewriting template and a preset rewriting rule are used to generate a plurality of candidate rewriting results; Inputting the plurality of candidate rewriting results into a pre-trained rewriting scoring model to obtain rewriting scores corresponding to the plurality of candidate rewriting results; According to the rewriting score, a target rewriting result is determined from the multiple candidate rewriting results, and the target rewriting result is input into the intelligent question answering system.
2. The method according to claim 1, characterized in that The method uses a preset rewriting model, a predefined rewriting template, and a preset rewriting rule to generate multiple candidate rewriting results, including: Using a preset rewriting model, rewriting the conversation data into a semantically complete candidate rewriting result; According to a predefined rewriting template, the semantics of the dialogue data are matched to generate a candidate rewriting result that conforms to the rewriting template; Based on the preset rewriting rules, the dialogue data is processed according to preset rules to generate candidate rewriting results in a preset format.
3. The method according to claim 2, characterized in that The adopting a preset rewriting model to rewrite the conversation data into a semantically complete candidate rewriting result includes: Performing semantic analysis on the dialogue data through a semantic parsing generation model to generate candidate rewriting results; The conversation data is processed through a bidirectional encoder conversion model to obtain candidate rewriting results.
4. The method according to claim 1, characterized in that: The determining whether the conversation data needs to be rewritten includes: Perform keyword analysis on the conversation data to determine whether there is semantics that needs to be supplemented or reconstructed by matching a preset keyword set; Using contextual reference analysis technology, check whether the conversation data contains ambiguous references or pronouns, and determine whether rewriting is required based on the conversation history content; Performing semantic integrity check on the conversation data through a semantic analysis model, and if incomplete semantics or ambiguous expressions are detected, determining that rewriting is required; Based on historical conversation context analysis, it is determined whether the conversation data depends on the semantic information of previous rounds of conversations. If the degree of dependence is higher than a preset threshold and the conversation data does not have independent semantics, it is determined that rewriting is required.
5. The method according to claim 1, characterized in that The step of inputting the plurality of candidate rewriting results into a pre-trained rewriting scoring model to obtain rewriting scores corresponding to the plurality of candidate rewriting results respectively includes: Evaluating the grammatical completeness of the plurality of candidate rewriting results to obtain a grammatical score; Analyzing the semantic clarity of the multiple candidate rewriting results to obtain semantic scores; Verifying the correctness of the use of professional terms in the plurality of candidate rewriting results to obtain terminology scores; A rewriting score of each of the plurality of candidate rewriting results is obtained according to the grammatical score, the semantic score and the terminology score.
6. The method according to any one of claims 1 to 5, characterized in that: The target training data set of the preset rewriting model and the pre-trained rewriting scoring model is obtained in the following manner: Acquire multiple rounds of historical conversation data from a historical question-and-answer database, and annotate user intent, contextual relationships, and coreference resolution content in the multiple rounds of historical conversation data to form a first training data set; According to the scene classification of the preset question-and-answer scene, generating question-and-answer scene data for the scene classification and corresponding rewritten data to form a second training data set; Obtaining an information graph of a preset field, and simulating and generating question-answer data and corresponding rewritten data for the preset field to form a third training data set; The training data set is obtained according to the first training data set, the second training data set and the third training data set.
7. An input rewriting device for an intelligent question-answering system, characterized in that: The device comprises: An input judgment module is used to obtain the dialogue data input by the user to the intelligent question-answering system and judge whether the dialogue data needs to be rewritten; A candidate generation module, for generating a plurality of candidate rewriting results by using a preset rewriting model, a predefined rewriting template and a preset rewriting rule when it is determined that the dialog data needs to be rewritten by type; A rewriting scoring module, configured to input the plurality of candidate rewriting results into a pre-trained rewriting scoring model to obtain a rewriting score corresponding to each of the plurality of candidate rewriting results; A rewriting determination module is used to determine a target rewriting result from the multiple candidate rewriting results according to the rewriting score, and input the target rewriting result into the intelligent question answering system.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Large and small model collaborative semantic rewriting system based on complexity induction
CN120633677A
Training method, system, equipment and product for multi-round dialogue query rewriting task
CN120724162A
Training method, system, device and product for multi-turn dialogue query rewriting task
CN120724162B
Medical dialogue search term rewriting method and device, equipment and storage medium
CN120994798A
Question and answer method, device and equipment based on intelligent agent and storage medium
CN122088712A