Answer generation method and apparatus, electronic device, medium, and product

By generating structured question representations and retrieving evidence from multiple data sources, the problem of insufficient coverage by a single knowledge base is solved, thereby improving the accuracy and reliability of responses and ensuring that each conclusion is supported by evidence.

CN123138380APending Publication Date: 2026-11-20SHANGHAI SHIZHUANG INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611331179.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

In existing technologies, a single knowledge base is insufficient to cover the data needs across systems, resulting in low accuracy and reliability of responses and incomplete chains of evidence.

Method used

By acquiring user questions, session states, user identity information, channel information, and business scenario identifiers, a structured question representation is generated, and evidence is retrieved from multiple data sources. The large language model is then called for processing to ultimately generate an accurate response.

Benefits of technology

It improves the accuracy and reliability of responses, reduces the probability of unfounded replies and false promises, ensures that every conclusion is supported by evidence, and supports user complaints and compliance reviews.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123138380A_ABST
    Figure CN123138380A_ABST
Patent Text Reader

Abstract

The application discloses a reply generation method and device, electronic equipment, medium and product. The method comprises: obtaining a user question, a session state, a session context, user identity information, channel information and a business scenario identifier; analyzing the user question according to the session context, the business scenario identifier and the channel information to generate a structured question representation; performing multi-data source evidence retrieval according to the structured question representation and the user identity information to obtain a multi-source evidence retrieval result; and calling a large language model to process the user question, the session state, the channel information and the multi-source evidence retrieval result to obtain a final reply. The method can significantly reduce the illusion phenomenon in the large model reply in the customer service scenario, ensure that each reply conclusion is supported by reliable evidence, effectively improve the accuracy, explainability and compliance of the customer service reply, and further provide reliable basis for subsequent quality inspection auditing and dispute tracing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, specifically to a response generation method, apparatus, electronic device, readable storage medium, and computer program product. Background Technology

[0002] With the widespread application of large language models in intelligent customer service, online consultation, and human-computer interaction, how to accurately and reliably respond to user questions using artificial intelligence technology has become a key focus of the industry. In a typical customer service Q&A scenario, users submit questions through instant messaging windows, web forms, or voice interaction channels. The system needs to understand the user's intent and retrieve relevant information from a knowledge base to generate a response. In existing technologies, systems typically retrieve knowledge entries that match the keywords or vector similarity of the current user's question from a single knowledge base, and then concatenate the retrieval results with the user's question before inputting them into a large language model to generate a response. However, a single knowledge base is insufficient to cover the data needs across systems, and relying solely on keyword matching or vector similarity calculation cannot adapt to the query characteristics of different data sources. This results in a large amount of business evidence related to the user's question not being recalled, leading to an incomplete evidence chain on which the response is based, thus reducing the accuracy and reliability of the response. Summary of the Invention

[0003] In view of the above problems, this application provides a response generation method, apparatus, electronic device, readable storage medium, and computer program product, which can solve the problems that the prior art is unable to cover cross-system data needs and that incomplete evidence chains lead to low response accuracy.

[0004] Firstly, this application provides a method for generating a response, including: Obtain user questions, session status, session context, user identity information, channel information, and business scenario identifiers; The user question is parsed based on the session context, the business scenario identifier, and the channel information to generate a structured question representation; Based on the structured problem representation and the user identity information, evidence retrieval from multiple data sources is performed to obtain multi-source evidence retrieval results; Based on the user's question, the session state, the channel information, and the multi-source evidence retrieval results, a large language model is invoked for processing to obtain the final response.

[0005] In the above technical solution, the method first obtains information to provide a complete multi-dimensional input foundation for response generation, enabling targeted processing based on conversation progress, user attributes, and business scenarios. Then, through question parsing, the natural language question is transformed into a structured question representation, eliminating ambiguity caused by missing context, thus providing accurate and actionable evidence retrieval. Next, through multi-source evidence retrieval, it covers multiple data sources such as knowledge bases and business systems, matching evidence within the user's permission scope, thereby improving the comprehensiveness and effectiveness of evidence acquisition. Finally, through response generation, the final response is built upon the retrieved evidence, achieving improved accuracy and relevance.

[0006] In some implementations, parsing the user question based on the session context, the business scenario identifier, and the channel information to generate a structured question representation includes: Based on the session context and the business scenario identifier, the user's intent is determined by intent recognition of the user question. Based on the session context and the user intent, entity data is obtained by extracting entities from the user question. Based on the entity data, slots are filled to obtain the target slot filling result; Risk label identification is performed on the target slot filling results to obtain risk label identification results; Obtain business object and time information based on the target slot filling result; A structured question representation is generated based on the user intent, the entity data, the business object, the time information, the channel information, and the risk tag identification result.

[0007] In the above technical solution, the method can decompose user questions into structured elements, enabling the system to accurately grasp user demands and question context, thereby providing accurate basis for subsequent retrieval.

[0008] In some implementations, the step of filling the slots based on the entity data to obtain the target slot filling result includes: Obtain the slot template corresponding to the user intent; The original entity values ​​in the entity data are filled into the corresponding slots in the slot template to obtain the initial slot filling result; Based on the session context and the user identity information, the slots that are not filled in the initial slot filling result are filled to obtain the target slot filling result.

[0009] In the above technical solution, the method can fill in entity values ​​in the slot template and complete the missing slots by combining the session context and user identity, thereby ensuring the integrity of the information in the structured problem representation and avoiding the impact of missing information on subsequent processing.

[0010] In some implementations, the step of invoking a large language model to process the user question, the session state, the channel information, and the multi-source evidence retrieval results to obtain a final response includes: A set of natural language evidence fragments is generated based on the multi-source evidence retrieval results; The multi-source evidence retrieval results are segmented to obtain multiple initial evidence fragments; Obtain the target response format based on the channel information; The user question, the session state, the set of natural language evidence fragments, and the target response format are taken as input, and a large language model is invoked for processing to obtain candidate responses; wherein, the candidate responses include multiple conclusion units, and each conclusion unit is bound to a corresponding candidate evidence number; From the plurality of initial evidence fragments, obtain a plurality of candidate evidence fragments that correspond one-to-one with the plurality of candidate evidence numbers; Calculate multiple alignment scores in the candidate responses that correspond one-to-one with the multiple conclusion units based on the multiple candidate evidence fragments; The candidate responses are optimized based on the multiple alignment scores to obtain the final response.

[0011] In the above technical solution, the method enables the large model to first generate candidate responses based on evidence, then align and score each conclusion unit in the response with the evidence, and optimize the response according to the score, so that each conclusion of the final response is supported by evidence.

[0012] In some implementations, generating a set of natural language evidence fragments based on the multi-source evidence retrieval results includes: The structured business data in the multi-source evidence retrieval results are converted into natural language expressions to obtain multiple natural language evidence fragments; The multiple natural language evidence fragments are labeled to obtain multiple labeling information corresponding one-to-one with the multiple natural language evidence fragments; wherein, the labeling information includes source system, document number, version number, effective time, expiration time, permission level, business type and credibility; The set of natural language evidence fragments includes the multiple natural language evidence fragments and the multiple annotation information.

[0013] In the above technical solution, the method can convert structured business data into natural language expression and label each piece of evidence with information such as source, version, permission, and credibility, so that large models can understand business data and the evidence is traceable and verifiable.

[0014] In some implementations, calculating multiple alignment scores in the candidate responses that correspond one-to-one with the multiple conclusion units based on the multiple candidate evidence fragments includes: Based on the multiple conclusion units and the multiple candidate evidence fragments, multiple multidimensional scores corresponding one-to-one with the multiple conclusion units are calculated; wherein, the multidimensional scores include semantic implication score, keyword coverage score, entity consistency score, time consistency score, and business rule consistency score; The multiple multidimensional scores are weighted and fused to obtain multiple aligned scores that correspond one-to-one with the multiple conclusion units.

[0015] In the above technical solution, the method can measure the degree of matching between the conclusion and the evidence from five dimensions: semantics, keywords, entities, time, and business rules, and then weight and integrate them into a total score, thereby making the judgment of the strength of evidence support more comprehensive and reliable.

[0016] In some implementations, optimizing the candidate responses based on the plurality of alignment scores to obtain the final response includes: Based on multiple annotation information, the multiple candidate evidence fragments are subjected to evidence invalidity checks to obtain invalidity check results; Based on the multiple alignment scores and the invalidity check results, the multiple conclusion units are marked as having no evidence to obtain no evidence conclusion marking results. The candidate responses are optimized based on the no-evidence conclusion marking results to obtain the final response.

[0017] In the above technical solution, the method can first check whether the evidence is valid, then mark the conclusions that are not supported by valid evidence and optimize the response accordingly, thereby intercepting conclusions without evidence and preventing unfounded content from appearing in the response.

[0018] In some implementations, calculating multiple multidimensional scores corresponding one-to-one with the plurality of conclusion units and the plurality of candidate evidence fragments includes: Semantic vector extraction is performed on the multiple conclusion units to obtain multiple first semantic vectors that correspond one-to-one with the multiple conclusion units, and semantic vector extraction is performed on the multiple candidate evidence fragments to obtain multiple second semantic vectors that correspond one-to-one with the multiple candidate evidence fragments. Based on the plurality of first semantic vectors and the plurality of second semantic vectors, vector similarity is calculated to obtain a plurality of semantic implication scores that correspond one-to-one with the plurality of conclusion units; Keyword extraction is performed on each of the multiple conclusion units to obtain multiple first keyword sets that correspond one-to-one with each of the multiple conclusion units; and keyword extraction is performed on each of the multiple candidate evidence fragments to obtain multiple second keyword sets that correspond one-to-one with each of the multiple candidate evidence fragments. Based on the multiple first keyword sets and the multiple second keyword sets, the percentage of keyword overlap is calculated to obtain multiple keyword coverage scores that correspond one-to-one with the multiple conclusion units; Business entity identification is performed on the multiple conclusion units respectively to obtain multiple first business entity identifiers that correspond one-to-one with the multiple conclusion units, and business entity identification is performed on the multiple candidate evidence fragments respectively to obtain multiple second business entity identifiers that correspond one-to-one with the multiple candidate evidence fragments. Based on the multiple first business entity identifiers and the multiple second business entity identifiers, a matching degree calculation is performed to obtain multiple entity consistency scores that correspond one-to-one with the multiple conclusion units; Time extraction is performed on the multiple conclusion units to obtain multiple first conclusion time information corresponding to each of the multiple conclusion units, and time extraction is performed on the multiple candidate evidence fragments to obtain multiple second conclusion time information corresponding to each of the multiple candidate evidence fragments. Based on the time information of the multiple first conclusions and the time information of the multiple second conclusions, a matching degree is calculated to obtain multiple time consistency scores that correspond one-to-one with the multiple conclusion units; Obtain multiple business types that correspond one-to-one with the multiple candidate evidence fragments; Call multiple business rule bases that correspond one-to-one with the multiple business types; Based on the multiple conclusion units and the multiple business rule bases, rule matching is performed to obtain multiple hit rules that correspond one-to-one with the multiple conclusion units; Based on the total number of rules in the multiple business rule bases and the number of hits of the multiple hit rules, calculate the consistency score of multiple business rules that correspond one-to-one with the multiple conclusion units.

[0019] In the above technical solution, the method can compare the conclusions and evidence item by item through five computable methods: semantic vector, keywords, entities, time, and business rules, so as to obtain the matching score of each dimension, so that the alignment score has a specific calculation basis and is objective and reproducible.

[0020] In some implementations, the weighted fusion calculation of the plurality of multidimensional scores to obtain a plurality of aligned scores corresponding one-to-one with the plurality of conclusion units includes: Obtain multiple weight sets corresponding one-to-one with the multiple conclusion units, as well as multiple preset static weights; wherein, the weight sets include source system weights, document type weights, and timeliness weights; The multiple weight sets are fused and calculated to obtain multiple dynamic confidence weights that correspond one-to-one with the multiple conclusion units; Based on the multiple preset static weights and the multiple dynamic confidence weights, the multiple multidimensional scores are weighted and fused to obtain multiple aligned scores that correspond one-to-one with the multiple conclusion units.

[0021] In the above technical solution, the method can dynamically adjust the confidence weight according to the source of the evidence, document type and timeliness, and then combine it with the preset static weight to generate an aligned score, so that the proportion of evidence with different levels of credibility in the score is more reasonable.

[0022] Secondly, this application provides a response generation apparatus, comprising: The acquisition unit is used to acquire user questions, session status, session context, user identity information, channel information, and business scenario identifiers; The parsing unit is used to parse the user question based on the session context, the business scenario identifier, and the channel information, and generate a structured question representation; The evidence retrieval unit is used to perform evidence retrieval from multiple data sources based on the structured question representation and the user identity information, and obtain multi-source evidence retrieval results; The processing unit is used to call a large language model to process the user's question, the session state, the channel information, and the multi-source evidence retrieval results to obtain a final response.

[0023] In the above technical solution, the device first provides a complete multi-dimensional input foundation for response generation through data access, enabling targeted processing based on conversation progress, user attributes, and business scenarios. Then, through question parsing, it transforms natural language questions into structured question representations, eliminating ambiguity caused by missing context, thus providing accurate and actionable evidence retrieval. Next, through multi-source evidence retrieval, it covers multiple data sources such as knowledge bases and business systems, matching evidence within the user's permission scope, thereby improving the comprehensiveness and effectiveness of evidence acquisition. Finally, through response generation, the final response is built upon the retrieved evidence, achieving improved accuracy and relevance of the response.

[0024] Thirdly, this application provides an electronic device including a memory and a processor, the memory storing a computer program, and the processor running the computer program to cause the electronic device to perform the response generation method described in any one of the first aspects.

[0025] Fourthly, this application provides a readable storage medium storing a computer program, which, when executed by a processor, performs the response generation method described in any one of the first aspects.

[0026] Fifthly, this application provides a computer program product comprising a computer program that, when executed by a processor, performs the response generation method described in any one of the first aspects.

[0027] The beneficial effects of this application are as follows: This method can refine the granularity of evidence verification from the entire response to the conclusion unit, thereby significantly reducing the probability of unfounded responses and false promises; at the same time, each key conclusion is bound to a corresponding evidence number and associated with the evidence version information and alignment score, so that the basis for the response can be quickly reviewed when users complain, compliance reviews and knowledge base updates occur; in addition, through the evidence-free conclusion interception mechanism, conclusions with insufficient evidence can also be intercepted and optimized, thereby effectively reducing the business risks caused by the illusion of a large model. Attached Figure Description

[0028] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 This is a flowchart illustrating the response generation method in some embodiments of this application; Figure 2 This is a schematic diagram of the structure of the response generation device in some embodiments of this application; Figure 3 This is a schematic diagram of the structure of an electronic device in some embodiments of this application. Detailed Implementation

[0030] The embodiments of the technical solution of this application will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of this application and are therefore merely examples, and should not be used to limit the scope of protection of this application.

[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0032] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more (including two), similarly, "multiple sets" refers to two or more sets (including two sets), and "multiple pieces" refers to two or more pieces (including two pieces), unless otherwise explicitly specified.

[0033] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0034] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0035] Existing large-scale customer service models typically employ a "user question - knowledge retrieval - large-scale model generates response" process, using retrieved knowledge fragments as context input to generate a response. However, the responses generated by the large-scale model only utilize the retrieval results at the overall response level. This results in a significant lack of linking and verification with evidence during the generation process, potentially leading to issues such as unfounded answers and citing outdated knowledge, creating the illusion of knowledge. Furthermore, it is difficult to trace the basis of each response afterward.

[0036] To address the aforementioned technical issues, this application provides a response generation method. This method aims to: break down candidate responses into conclusion units and calculate the alignment score between each conclusion unit and verifiable evidence fragment; intercept and downgrade conclusions that are unsupported by evidence or whose evidence is invalid; thereby achieving the binding and traceability of each key conclusion and evidence in the response, thereby weakening illusions and improving the credibility and auditability of the response.

[0037] like Figure 1 As shown, some embodiments of this application provide a response generation method, which includes: S100: Obtain user questions, session status, session context, user identity information, channel information, and business scenario identifiers.

[0038] In this embodiment, a user question refers to the unanswered request submitted by the user to the customer service system.

[0039] In this embodiment, the session state refers to the current state of the session, including information such as the number of dialogue rounds and whether the dialogue has ended.

[0040] In this embodiment, the session context refers to the context information of the current session, including historical dialogue content, etc.

[0041] In this embodiment, user identity information refers to information used to identify a user's identity, including user accounts, etc.

[0042] In this embodiment, channel information refers to the information of the channel used by the user to initiate the session. Channels include web pages, apps, telephones, etc.

[0043] In this embodiment, the business scenario identifier refers to the information used to identify the current business scenario, which includes pre-sales consultation, after-sales service, etc.

[0044] S200: Parse the user's question based on the session context, business scenario identifier, and channel information to generate a structured question representation.

[0045] In this embodiment, structured question representation refers to the structured data representation obtained after parsing user questions, including user intent, entity data, business objects, time, channel, and risk tags.

[0046] In this embodiment, the method can generate a structured question representation by performing intent recognition, entity extraction, slot completion, and risk label recognition on the user question.

[0047] In this embodiment, intent recognition refers to determining the user intent corresponding to the user question by combining the session context and the business scenario identifier.

[0048] In this embodiment, entity extraction refers to extracting entity data from user questions.

[0049] In this embodiment, slot filling refers to filling in the slots that are not filled in the slot filling result.

[0050] In this embodiment, risk label recognition refers to identifying whether a user's question has risk characteristics and generating a corresponding risk label.

[0051] S300. Based on the structured question representation and user identity information, perform evidence retrieval from multiple data sources to obtain multi-source evidence retrieval results.

[0052] In this embodiment, evidence refers to factual material retrieved from multiple data sources to support the response.

[0053] In this embodiment, multiple data sources refer to multiple data sources used for evidence retrieval, including enterprise knowledge base, FAQ (Frequently Asked Questions) database, policy and system database, business systems such as order / logistics / payment / account, historical work order database, and user authorization data.

[0054] In this embodiment, the retrieval methods include keyword retrieval, vector retrieval, rule filtering, and structured query.

[0055] In this embodiment, keyword retrieval refers to a retrieval method based on keyword matching.

[0056] In this embodiment, vector retrieval refers to a retrieval method based on semantic vector similarity.

[0057] In this embodiment, rule filtering refers to the method of filtering search results based on preset rules.

[0058] In this embodiment, structured query refers to the method of performing queries on structured data.

[0059] S400: Based on the user's question, session status, channel information, and multi-source evidence retrieval results, the large language model is invoked for processing to obtain the final response.

[0060] In this embodiment, the Large Language Model (LLM) refers to a deep learning model with a large number of parameters and natural language processing capabilities.

[0061] In this embodiment, the final response refers to the response content that is finally output to the user.

[0062] In the above embodiments, the method first obtains information to provide a complete multi-dimensional input foundation for response generation, enabling targeted processing based on conversation progress, user attributes, and business scenarios. Then, through question parsing, the natural language question is transformed into a structured question representation, eliminating ambiguity caused by missing context, thus providing accurate and actionable evidence retrieval. Next, through multi-source evidence retrieval, it covers multiple data sources such as knowledge bases and business systems, matching evidence within the user's permission scope, thereby improving the comprehensiveness and effectiveness of evidence acquisition. Finally, through response generation, the final response is built upon the retrieved evidence, achieving the effect of improving the accuracy and relevance of the response.

[0063] In some embodiments, step S200 may include: S210. Based on the session context and business scenario identifier, perform intent recognition on the user's question to obtain the user's intent.

[0064] In this embodiment, user intent refers to the task that the user hopes to accomplish as expressed in the user question.

[0065] S220. Extract entity data from user questions based on session context and user intent.

[0066] In this embodiment, entity data refers to entity information extracted from user questions.

[0067] S230. Fill the slots according to the entity data to obtain the target slot filling result.

[0068] In this embodiment, a slot refers to the location in the slot template used to fill in entity values.

[0069] To ensure the integrity of the information represented by the structured problem, step S230 may include: S231. Obtain the slot template corresponding to the user intent.

[0070] In this embodiment, the slot template refers to a template structure containing multiple slots that corresponds to the user's intent.

[0071] S232. Fill the original entity values ​​in the entity data into the corresponding slots in the slot template to obtain the initial slot filling result.

[0072] In this embodiment, the initial slot filling result refers to the filling result obtained after filling the original entity value into the slot template.

[0073] S233. Based on the session context and user identity information, fill in the unfilled slots in the initial slot filling result to obtain the target slot filling result.

[0074] In this embodiment, the target slot filling result refers to the slot filling result obtained after completing the slot filling.

[0075] S240. Perform risk label identification on the target slot filling results to obtain the risk label identification results.

[0076] In this embodiment, the risk label identification result refers to the result obtained after identifying the risk label of the target slot filling result.

[0077] S250. Obtain business object and time information based on the target slot filling result.

[0078] In this embodiment, the business object refers to an object related to the user's business, such as an order.

[0079] In this embodiment, time information refers to time information related to the business, such as order time.

[0080] S260. Generate a structured question representation based on user intent, entity data, business object, time information, channel information, and risk label identification results.

[0081] In the above embodiments, the method can decompose user questions into structured elements, enabling the system to accurately grasp user demands and question context, and provide accurate basis for subsequent retrieval.

[0082] In some embodiments, step S400 may include: S410. Generate a set of natural language evidence fragments based on the multi-source evidence retrieval results.

[0083] In this embodiment, the set of natural language evidence fragments refers to a set consisting of multiple natural language evidence fragments and multiple annotation information.

[0084] In order for large models to understand business data and for evidence to be traceable and verifiable, step S410 may include: S411. Convert the structured business data in the multi-source evidence retrieval results into natural language expressions to obtain multiple natural language evidence fragments.

[0085] In this embodiment, structured business data refers to business data stored in a structured form.

[0086] In this embodiment, natural language evidence fragments refer to evidence fragments in natural language form obtained after converting structured business data.

[0087] For example, structured business data can generate natural language evidence fragments, such as "Order A was signed for on June 1, 2026".

[0088] S412. Annotate multiple natural language evidence fragments to obtain multiple annotation information corresponding to each natural language evidence fragment; wherein, the annotation information includes source system, document number, version number, effective time, expiration time, permission level, business type and credibility.

[0089] In this embodiment, the annotation information refers to the metadata information annotated for natural language evidence fragments.

[0090] S420. The multi-source evidence retrieval results are segmented to obtain multiple initial evidence fragments.

[0091] In this embodiment, the initial evidence fragment obtained by segmentation is denoted as E_i.

[0092] In this embodiment, the initial evidence fragment refers to the evidence fragment obtained after segmenting the multi-source evidence retrieval results.

[0093] S430. Obtain the target response format based on channel information.

[0094] In this embodiment, the target response format refers to the response format requirements corresponding to the channel information.

[0095] S440. Taking the user question, session state, set of natural language evidence fragments and target response format as input, the large language model is called for processing to obtain candidate responses; among them, the candidate responses include multiple conclusion units, and each conclusion unit is bound to the corresponding candidate evidence number.

[0096] In this embodiment, the generated candidate response is denoted as R; the candidate response is required to be organized according to the conclusion unit when it is generated.

[0097] In this embodiment, the candidate responses are segmented and semantically analyzed to extract the conclusion unit C_j.

[0098] In this embodiment, the conclusion unit refers to the smallest unit in the candidate response that expresses a complete conclusion.

[0099] In this embodiment, the candidate evidence number refers to the number that is bound to the conclusion unit and used to identify its corresponding candidate evidence.

[0100] S450. Obtain multiple candidate evidence fragments from multiple initial evidence fragments, each corresponding to a different candidate evidence number.

[0101] In this embodiment, the candidate evidence fragment refers to the initial evidence fragment corresponding to the candidate evidence number.

[0102] S460. Calculate multiple alignment scores in the candidate responses that correspond one-to-one with multiple conclusion units based on multiple candidate evidence fragments.

[0103] In this embodiment, the method can transform customer service sessions, business data, knowledge evidence, permission status, and risk labels into computable features through a conclusion-evidence bidirectional alignment scoring model, and form a controllable output through weighted fusion, threshold judgment, and downgrade processing.

[0104] In this embodiment, the alignment score refers to the score of the degree of matching between the conclusion unit and the evidence fragment.

[0105] To make the assessment of the strength of evidence more comprehensive and reliable, step S460 may include: S461. Based on multiple conclusion units and multiple candidate evidence fragments, calculate multiple multidimensional scores that correspond one-to-one with the multiple conclusion units; among which, the multidimensional scores include semantic implication score, keyword coverage score, entity consistency score, time consistency score, and business rule consistency score.

[0106] In this embodiment, the multidimensional score refers to the scores of multiple dimensions used to measure the degree of matching between the conclusion unit and the evidence fragment.

[0107] In this embodiment, the semantic implication score refers to the score calculated based on semantic implication relationships, which measures whether a piece of evidence contains the meaning of a conclusion unit.

[0108] In this embodiment, the keyword coverage score refers to a score calculated based on keyword coverage, which measures the degree of keyword overlap between the conclusion unit and the evidence fragment.

[0109] In this embodiment, the entity consistency score refers to a score calculated based on the matching of business entities, which measures the degree of consistency between the conclusion unit and the business entities in the evidence fragment.

[0110] In this embodiment, the time consistency score refers to a score calculated based on the time information matching situation, which measures the degree of consistency between the time information in the conclusion unit and the evidence segment.

[0111] In this embodiment, the business rule consistency score refers to the score calculated based on the business rule matching situation, which measures the degree of consistency between the conclusion unit and the business rule.

[0112] As an optional implementation, step S461 may include: Semantic vectors are extracted from multiple conclusion units to obtain multiple first semantic vectors that correspond one-to-one with the multiple conclusion units. Semantic vectors are also extracted from multiple candidate evidence fragments to obtain multiple second semantic vectors that correspond one-to-one with the multiple candidate evidence fragments. Based on multiple first semantic vectors and multiple second semantic vectors, vector similarity is calculated to obtain multiple semantic implication scores that correspond one-to-one with multiple conclusion units; Keyword extraction is performed on multiple conclusion units to obtain multiple sets of first keywords that correspond one-to-one with the multiple conclusion units. Keyword extraction is also performed on multiple candidate evidence fragments to obtain multiple sets of second keywords that correspond one-to-one with the multiple candidate evidence fragments. Based on the calculation of the percentage of keyword overlap between multiple sets of first keywords and multiple sets of second keywords, multiple keyword coverage scores corresponding to multiple conclusion units are obtained. Business entity identification is performed on multiple conclusion units to obtain multiple first business entity identifiers that correspond one-to-one with the multiple conclusion units. Business entity identification is also performed on multiple candidate evidence fragments to obtain multiple second business entity identifiers that correspond one-to-one with the multiple candidate evidence fragments. The matching degree is calculated based on multiple first business entity identifiers and multiple second business entity identifiers to obtain multiple entity consistency scores that correspond one-to-one with multiple conclusion units; Time extraction is performed on multiple conclusion units to obtain multiple first conclusion time information corresponding to each conclusion unit. Time extraction is also performed on multiple candidate evidence fragments to obtain multiple second conclusion time information corresponding to each candidate evidence fragment. The matching degree is calculated based on the time information of multiple first conclusions and multiple time information of multiple second conclusions to obtain multiple time consistency scores that correspond one-to-one with multiple conclusion units; Obtain multiple business types that correspond one-to-one with multiple candidate evidence fragments; Call multiple business rule libraries that correspond one-to-one with multiple business types; Based on multiple conclusion units and multiple business rule bases, rule matching is performed to obtain multiple hit rules that correspond one-to-one with the multiple conclusion units; Based on the total number of rules in multiple business rule bases and the number of hits of multiple hit rules, calculate the consistency score of multiple business rules that correspond one-to-one with multiple conclusion units.

[0113] By implementing this method, multiple multidimensional scores can be calculated based on specific criteria and are objectively reproducible.

[0114] S462. Perform weighted fusion calculations on multiple multidimensional scores to obtain multiple aligned scores that correspond one-to-one with multiple conclusion units.

[0115] As an optional implementation, step S462 may include: Obtain multiple weight sets corresponding one-to-one with multiple conclusion units, as well as multiple preset static weights; wherein, the weight sets include source system weights, document type weights, and timeliness weights; Multiple weight sets are fused and calculated separately to obtain multiple dynamic confidence weights that correspond one-to-one with multiple conclusion units; Based on multiple preset static weights and multiple dynamic confidence weights, multiple multidimensional scores are weighted and fused to obtain multiple aligned scores that correspond one-to-one with multiple conclusion units.

[0116] For example, the formula for calculating the alignment score A(C_j,E_i) can be: A(C_j,E_i)=w1*S_sem+w2*S_ent+w3*S_time+w4*S_rule+w5*S_trust; Where A(C_j,E_i) is the alignment score, specifically the comprehensive matching score between the conclusion unit C_j and the evidence fragment E_i; C_j is the j-th conclusion unit, which is specifically each independent conclusion extracted from the candidate responses generated by the large model according to sentence segmentation and semantic parsing. E_i represents the i-th evidence fragment, specifically each piece of evidence retrieved and segmented from multiple sources such as knowledge bases and business systems; S_sem is the semantic implication score, specifically referring to whether the semantics of C_j are implied / supported by E_i; S_ent is the entity consistency score, specifically referring to whether the business entities (such as order number and user ID) in C_j and E_i are consistent; S_time is the time consistency score, specifically referring to whether the time information in C_j and E_i matches; S_rule is the consistency score for business rules, specifically whether C_j conforms to the rule base of the corresponding business type of E_i; S_trust is the trust score, specifically referring to trust metadata such as the source system and document level of E_i; w1~w5 are weight parameters, specifically the weighting coefficients for the scores of each dimension, which can be trained or pre-configured according to the business risk level.

[0117] In this embodiment, the weight parameters can be determined through training using historical customer service data, manually labeled data, agent feedback data, or post-launch performance data, or can be pre-configured based on the business risk level.

[0118] In this embodiment, during the training phase, the method can construct training samples based on historical conversations, knowledge hit records, manual quality inspection results, complaint results, agent revision results, and final business processing results.

[0119] In this embodiment, during the inference phase, the method can perform feature extraction, model scoring, and threshold determination on real-time sessions, and write intermediate model results into the audit log.

[0120] In this embodiment, the weight set refers to the set of weight information including source system weight, document type weight, and timeliness weight.

[0121] In this embodiment, the dynamic confidence weight refers to the confidence weight obtained after fusion calculation of the weight set.

[0122] In this embodiment, the preset static weight refers to the static weight that is set in advance.

[0123] S470. Optimize the candidate responses based on multiple alignment scores to obtain the final response.

[0124] To intercept conclusions without evidence, step S470 may include: S471. Based on multiple annotation information, perform evidence invalidity checks on multiple candidate evidence fragments to obtain invalidity check results.

[0125] In this embodiment, the evidence invalidity check includes checking whether the evidence fragment has expired, whether the permissions are insufficient, and whether it conflicts with other evidence.

[0126] In this embodiment, the invalidity check result refers to the result obtained after performing an invalidity check on the candidate evidence fragment.

[0127] S472. Based on multiple alignment scores and invalidity check results, perform no-evidence conclusion labeling on multiple conclusion units to obtain no-evidence conclusion labeling results.

[0128] In this embodiment, if max_i A(C_j,E_i) < threshold T_e, then C_j is determined to be a conclusion without evidence.

[0129] Where max_i A(C_j,E_i) refers to the highest score among the conclusion unit C_j and all evidence fragments E_i after calculating the aligned scores one by one (i.e. the score of the evidence that most supports it). T_e is a preset threshold for determining a conclusion of no evidence (e.g., 0.7). A score below this is considered "insufficient evidence". C_j refers to the conclusion unit that is determined to be a conclusion without evidence.

[0130] It should be understood that this process involves comparing a conclusion with all the evidence. If the conclusion does not even reach the passing score with the most similar piece of evidence, then the conclusion is deemed to be "unsupported by evidence".

[0131] In this embodiment, a conclusion without evidence refers to a conclusion unit that is not supported by valid evidence.

[0132] In this embodiment, the no-evidence conclusion labeling result refers to the result obtained after labeling the conclusion unit with no-evidence conclusions.

[0133] S473. Based on the no-evidence conclusion marking results, optimize the candidate responses to obtain the final response.

[0134] In this embodiment, the method can optimize conclusions without evidence by deleting them, rewriting them into uncertain expressions, generating clarification questions, transferring them to manual review, or triggering compliance review.

[0135] In this embodiment, the final response is output with evidence number and the question, retrieved evidence, candidate responses, alignment scores, interception records, final response, knowledge version, and operation log are saved for quality inspection and dispute review.

[0136] In the above embodiments, the method enables the large model to first generate candidate responses based on evidence, then align and score each conclusion unit in the response with the evidence, and optimize the response according to the score, so that each conclusion in the final response is supported by evidence.

[0137] like Figure 2 As shown, some embodiments of this application provide a schematic diagram of a response generation apparatus. It should be understood that this apparatus is related to... Figure 1 The method executed in the middle corresponds to the steps involved in the aforementioned method. The specific functions and effects of the device can be found in the description above. To avoid repetition, detailed descriptions are omitted here.

[0138] The response generation device includes: The acquisition unit 510 is used to acquire user questions, session status, session context, user identity information, channel information, and business scenario identifiers; Parsing unit 520 is used to parse user questions based on session context, business scenario identifier and channel information, and generate a structured question representation; The evidence retrieval unit 530 is used to perform evidence retrieval from multiple data sources based on the structured question representation and user identity information, and obtain multi-source evidence retrieval results. The processing unit 540 is used to call the large language model to process the user's question, session status, channel information and multi-source evidence retrieval results to obtain the final answer.

[0139] like Figure 3 As shown, this application provides an electronic device 600, which includes a processor 601 and a memory 602. The processor 601 and the memory 602 are interconnected and communicate with each other through a communication bus 603 and / or other forms of connection mechanism (not shown). The memory 602 stores a computer program that can be executed by the processor 601. When the computer program is run, the processor 601 executes the computer program to perform the method in any of the aforementioned optional implementations.

[0140] This application provides a readable storage medium storing a computer program, which, when executed by a processor, performs the method in any of the aforementioned optional implementations.

[0141] The readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0142] This application provides a computer program product, which includes a computer program that, when run by a processor, executes the method in any of the aforementioned optional implementations.

[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and they should all be covered within the scope of the claims and specification of this application. In particular, as long as there is no conflict, the various technical features mentioned in the embodiments can be combined in any way. This application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.

Claims

1. A response generation method, characterized in that, include: Obtain user questions, session status, session context, user identity information, channel information, and business scenario identifiers; The user question is parsed based on the session context, the business scenario identifier, and the channel information to generate a structured question representation; Based on the structured problem representation and the user identity information, evidence retrieval from multiple data sources is performed to obtain multi-source evidence retrieval results; Based on the user's question, the session state, the channel information, and the multi-source evidence retrieval results, a large language model is invoked for processing to obtain the final response.

2. The response generation method according to claim 1, characterized in that, The step of parsing the user question based on the session context, the business scenario identifier, and the channel information to generate a structured question representation includes: Based on the session context and the business scenario identifier, the user's intent is determined by intent recognition of the user question. Based on the session context and the user intent, entity data is obtained by extracting entities from the user question. Based on the entity data, slots are filled to obtain the target slot filling result; Risk label identification is performed on the target slot filling results to obtain risk label identification results; Obtain business object and time information based on the target slot filling result; A structured question representation is generated based on the user intent, the entity data, the business object, the time information, the channel information, and the risk tag identification result.

3. The response generation method according to claim 2, characterized in that, The step of filling slots based on the entity data to obtain the target slot filling result includes: Obtain the slot template corresponding to the user intent; The original entity values ​​in the entity data are filled into the corresponding slots in the slot template to obtain the initial slot filling result; Based on the session context and the user identity information, the slots that are not filled in the initial slot filling result are filled to obtain the target slot filling result.

4. The response generation method according to claim 1, characterized in that, The step of processing the user question, the session state, the channel information, and the multi-source evidence retrieval results using a large language model to obtain the final response includes: A set of natural language evidence fragments is generated based on the multi-source evidence retrieval results; The multi-source evidence retrieval results are segmented to obtain multiple initial evidence fragments; Obtain the target response format based on the channel information; The user question, the session state, the set of natural language evidence fragments, and the target response format are taken as input, and a large language model is invoked for processing to obtain candidate responses; wherein, the candidate responses include multiple conclusion units, and each conclusion unit is bound to a corresponding candidate evidence number; From the plurality of initial evidence fragments, obtain a plurality of candidate evidence fragments that correspond one-to-one with the plurality of candidate evidence numbers; Calculate multiple alignment scores in the candidate responses that correspond one-to-one with the multiple conclusion units based on the multiple candidate evidence fragments; The candidate responses are optimized based on the multiple alignment scores to obtain the final response.

5. The response generation method according to claim 4, characterized in that, The step of generating a set of natural language evidence fragments based on the multi-source evidence retrieval results includes: The structured business data in the multi-source evidence retrieval results are converted into natural language expressions to obtain multiple natural language evidence fragments; The multiple natural language evidence fragments are labeled to obtain multiple labeling information corresponding one-to-one with the multiple natural language evidence fragments; wherein, the labeling information includes source system, document number, version number, effective time, expiration time, permission level, business type and credibility; The set of natural language evidence fragments includes the multiple natural language evidence fragments and the multiple annotation information.

6. The response generation method according to claim 4, characterized in that, The step of calculating multiple alignment scores in the candidate responses that correspond one-to-one with the multiple conclusion units based on the multiple candidate evidence fragments includes: Based on the multiple conclusion units and the multiple candidate evidence fragments, multiple multidimensional scores corresponding one-to-one with the multiple conclusion units are calculated; wherein, the multidimensional scores include semantic implication score, keyword coverage score, entity consistency score, time consistency score, and business rule consistency score; The multiple multidimensional scores are weighted and fused to obtain multiple aligned scores that correspond one-to-one with the multiple conclusion units.

7. The response generation method according to claim 5, characterized in that, The step of optimizing the candidate responses based on the multiple alignment scores to obtain the final response includes: Based on multiple annotation information, the multiple candidate evidence fragments are subjected to evidence invalidity checks to obtain invalidity check results; Based on the multiple alignment scores and the invalidity check results, the multiple conclusion units are marked as having no evidence to obtain no evidence conclusion marking results. The candidate responses are optimized based on the no-evidence conclusion marking results to obtain the final response.

8. The response generation method according to claim 6, characterized in that, The step of calculating multiple multidimensional scores corresponding one-to-one with the multiple conclusion units and the multiple candidate evidence fragments includes: Semantic vector extraction is performed on the multiple conclusion units to obtain multiple first semantic vectors that correspond one-to-one with the multiple conclusion units, and semantic vector extraction is performed on the multiple candidate evidence fragments to obtain multiple second semantic vectors that correspond one-to-one with the multiple candidate evidence fragments. Based on the plurality of first semantic vectors and the plurality of second semantic vectors, vector similarity is calculated to obtain a plurality of semantic implication scores that correspond one-to-one with the plurality of conclusion units; Keyword extraction is performed on each of the multiple conclusion units to obtain multiple first keyword sets that correspond one-to-one with each of the multiple conclusion units; and keyword extraction is performed on each of the multiple candidate evidence fragments to obtain multiple second keyword sets that correspond one-to-one with each of the multiple candidate evidence fragments. Based on the multiple first keyword sets and the multiple second keyword sets, the percentage of keyword overlap is calculated to obtain multiple keyword coverage scores that correspond one-to-one with the multiple conclusion units; Business entity identification is performed on the multiple conclusion units respectively to obtain multiple first business entity identifiers that correspond one-to-one with the multiple conclusion units, and business entity identification is performed on the multiple candidate evidence fragments respectively to obtain multiple second business entity identifiers that correspond one-to-one with the multiple candidate evidence fragments. Based on the multiple first business entity identifiers and the multiple second business entity identifiers, a matching degree calculation is performed to obtain multiple entity consistency scores that correspond one-to-one with the multiple conclusion units; Time extraction is performed on the multiple conclusion units to obtain multiple first conclusion time information corresponding to each of the multiple conclusion units, and time extraction is performed on the multiple candidate evidence fragments to obtain multiple second conclusion time information corresponding to each of the multiple candidate evidence fragments. Based on the time information of the multiple first conclusions and the time information of the multiple second conclusions, a matching degree is calculated to obtain multiple time consistency scores that correspond one-to-one with the multiple conclusion units; Obtain multiple business types that correspond one-to-one with the multiple candidate evidence fragments; Call multiple business rule bases that correspond one-to-one with the multiple business types; Based on the multiple conclusion units and the multiple business rule bases, rule matching is performed to obtain multiple hit rules that correspond one-to-one with the multiple conclusion units; Based on the total number of rules in the multiple business rule bases and the number of hits of the multiple hit rules, calculate the consistency score of multiple business rules that correspond one-to-one with the multiple conclusion units.

9. The response generation method according to claim 6, characterized in that, The weighted fusion calculation of the multiple multidimensional scores yields multiple aligned scores that correspond one-to-one with the multiple conclusion units, including: Obtain multiple weight sets corresponding one-to-one with the multiple conclusion units, as well as multiple preset static weights; wherein, the weight sets include source system weights, document type weights, and timeliness weights; The multiple weight sets are fused and calculated to obtain multiple dynamic confidence weights that correspond one-to-one with the multiple conclusion units; Based on the multiple preset static weights and the multiple dynamic confidence weights, the multiple multidimensional scores are weighted and fused to obtain multiple aligned scores that correspond one-to-one with the multiple conclusion units.

10. A response generation apparatus, characterized in that, The response generation device includes: The acquisition unit is used to acquire user questions, session status, session context, user identity information, channel information, and business scenario identifiers; The parsing unit is used to parse the user question based on the session context, the business scenario identifier, and the channel information, and generate a structured question representation; The evidence retrieval unit is used to perform evidence retrieval from multiple data sources based on the structured question representation and the user identity information, and obtain multi-source evidence retrieval results. The processing unit is used to call a large language model to process the user's question, the session state, the channel information, and the multi-source evidence retrieval results to obtain a final response.

11. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor running the computer program to cause the electronic device to perform the response generation method according to any one of claims 1 to 9.

12. A readable storage medium, characterized in that, The readable storage medium stores a computer program, which, when executed by a processor, performs the response generation method according to any one of claims 1 to 9.

13. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, performs the response generation method according to any one of claims 1 to 9.