Methods, apparatuses, devices, and media for responding
Patent Information
- Application Number
- CN202611340465.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-10-20
AI Technical Summary
[0004]本申请提供一种答复方法、装置、计算机设备及介质,旨在解决答复方法中答复准确性较低的问题
[0009]上述答复方法、装置、设备及介质所实现的方案中,通过响应于接收到用户的对话请求,根据对话请求中的目标实体信息确定候选维度维值,并从预设历史案例库中确定目标历史案例,再将对话请求、候选维度维值以及目标历史案例输入至目标模型中,由目标模型的维度识别子任务输出目标维度维值,最后根据目标维度维值确定真实数值信息并生成目标答复结果。由此,通过将历史案例作为上下文学习素材注入维度识别子任务,使目标模型能够参考历史问法模式和维度映射关系进行推理,有效解决了现有技术中大模型维度识别缺乏案例参考、面对业务俚语和歧义表达容易误判的问题,从而提高了对用户对话请求的答复准确性。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology and is applied to financial technology scenarios, particularly to a response method, apparatus, device, and medium. Background Technology
[0002] With the continuous maturation of natural language processing technology, human-computer interaction-based response methods have been widely applied in various information service scenarios. Especially in data-intensive fields such as insurance and finance, users often expect to obtain accurate answers directly through conversational questions.
[0003] However, existing response methods struggle to provide accurate answers to user conversations, resulting in low response accuracy. Summary of the Invention
[0004] This application provides a response method, apparatus, computer equipment, and medium, aiming to solve the problem of low response accuracy in response methods.
[0005] In a first aspect, a response method is provided, comprising: in response to receiving a user's dialogue request, determining a candidate dimension value corresponding to the target entity information based on the target entity information in the dialogue request, and determining a target historical case corresponding to the dialogue request from a preset historical case library; wherein the dimension value is used to convert the dialogue content in the dialogue request into standard dimension encoding, the preset historical case library includes multiple historical dialogue requests and historical cases corresponding to each historical dialogue request, and the historical case includes the dimension value corresponding to the dialogue request and a response result; The dialogue request, the candidate dimension value, and the target historical case are input into the target model, and the target dimension value is output by the dimension recognition subtask of the target model. Based on the target dimension value, determine the actual numerical information corresponding to the dialogue request; and based on the actual numerical information, generate the target response result for the dialogue request.
[0006] Secondly, a response device is provided, comprising: The determination module is configured to, in response to receiving a user's dialogue request, determine the candidate dimension value corresponding to the target entity information based on the target entity information in the dialogue request, and determine the target historical case corresponding to the dialogue request from a preset historical case library; wherein, the dimension value is used to convert the dialogue content in the dialogue request into standard dimension encoding, and the preset historical case library includes multiple historical dialogue requests and historical cases corresponding to each historical dialogue request, and the historical case includes the dimension value corresponding to the dialogue request and the response result; The output module is used to input the dialogue request, the candidate dimension value, and the target historical case into the target model, and output the target dimension value by the dimension recognition subtask of the target model. The generation module is used to determine the real numerical information corresponding to the dialogue request based on the target dimension value; and to generate the target response result of the dialogue request based on the real numerical information.
[0007] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described response method.
[0008] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the above-described response method.
[0009] In the solution implemented by the aforementioned response method, apparatus, device, and medium, in response to receiving a user's dialogue request, candidate dimension values are determined based on the target entity information in the dialogue request, and target historical cases are determined from a preset historical case library. The dialogue request, candidate dimension values, and target historical cases are then input into the target model. The dimension recognition subtask of the target model outputs the target dimension value, and finally, the actual numerical information is determined based on the target dimension value, generating the target response result. Thus, by injecting historical cases as contextual learning material into the dimension recognition subtask, the target model can refer to historical question patterns and dimension mapping relationships for reasoning. This effectively solves the problems of lack of case references in large-scale model dimension recognition and the ease of misjudgment when faced with business slang and ambiguous expressions in existing technologies, thereby improving the accuracy of responses to user dialogue requests. Attached Figure Description
[0010] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a schematic diagram of an application environment for a response method in one embodiment of this application; Figure 2 This is a flowchart illustrating a response method in one embodiment of this application; Figure 3 yes Figure 2 A schematic diagram of a specific implementation method for step S10; Figure 4This is a schematic diagram of the structure of a response device in one embodiment of this application; Figure 5 This is a schematic diagram of the structure of a computer device according to one embodiment of this application; Figure 6 This is another structural schematic diagram of a computer device in one embodiment of this application. Detailed Implementation
[0012] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0013] The response method provided in this application embodiment can be applied to, for example, Figure 1 In this application environment, the client communicates with the server via a network. The server can receive dialogue requests sent by the user through the client, determine the candidate dimension values corresponding to the target entity information in the dialogue request, and determine the target historical cases corresponding to the dialogue request from a preset historical case library. The dimension values are used to convert the dialogue content in the dialogue request into standard dimension codes. The preset historical case library includes multiple historical dialogue requests and corresponding historical cases, each including the dimension value and response result. The server inputs the dialogue request, candidate dimension values, and target historical cases into the target model, and the target dimension value is output by the dimension recognition subtask of the target model. Based on the target dimension value, the server determines the actual numerical information corresponding to the dialogue request, generates the target response result based on the actual numerical information, and feeds the target response result back to the client. This application addresses the problems of inaccurate information comprehension and low response generation efficiency in dialogue response scenarios. It utilizes a historical case database for reference and combines this with a target model to accurately identify dimensional values, transforming unstructured dialogue requests into standardized numerical information. This effectively leverages historical experience and model reasoning capabilities to quickly and accurately generate response results, significantly improving response accuracy. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. Specific embodiments of this application are described in detail below.
[0014] Before introducing the response method provided in the embodiments of this application, the system architecture on which the embodiments of this application are based is first described in general. The embodiments of this application can adopt a decoupled knowledge architecture with three separate databases: a preset dimension value database, a preset historical case database, and a preset real database. These three independent yet collaborative knowledge databases respectively undertake three core functions: standardized mapping, question pattern learning, and precise numerical querying. Specifically, the preset dimension value database has a built-in colloquial alias system responsible for accurately mapping business slang to standard codes; the preset historical case database accumulates high-quality question-and-answer pairs that have been manually reviewed, used for question pattern learning and recall; and the preset real database independently stores sensitive business indicators, implementing minimum access control through dimension coding. This decoupled design allows knowledge expansion, case accumulation, and data updates to evolve independently, ensuring the absolute security of business data and laying a solid foundation for rapid system iteration and cross-domain reuse.
[0015] It should be noted that the specific contents of the preset dimension value library, preset historical case library, and preset real database can all be set according to the actual situation, and no specific restrictions are made here.
[0016] In the offline construction phase, the construction of the three knowledge bases mentioned above and the multi-task joint fine-tuning training of the target model are completed. The target model includes three sub-tasks: initial response generation, dimension recognition, and target response generation. A progressive joint training strategy enables a single model to have end-to-end question-answering processing capabilities. In the online service phase, after receiving the user's dialogue request, the steps of candidate set generation, multi-source information fusion and dimension recognition, real data query and answer generation are executed sequentially, and finally, the target response result that conforms to the business context is output. The above two phases of offline construction and online service work together to support the efficient operation of the response method of this application embodiment.
[0017] Please see Figure 2 As shown, Figure 2 A flowchart illustrating the response method provided in this application embodiment includes the following steps: S10: In response to receiving a user's dialogue request, determine the candidate dimension value corresponding to the target entity information based on the target entity information in the dialogue request, and determine the target historical case corresponding to the dialogue request from a preset historical case library; wherein, the dimension value is used to convert the dialogue content in the dialogue request into standard dimension encoding, the preset historical case library includes multiple historical dialogue requests and historical cases corresponding to each historical dialogue request, and the historical case includes the dimension value corresponding to the dialogue request and the response result.
[0018] In this step, the dialogue request can be a natural language query request initiated by the user through a terminal application, web page, voice interaction device, or other smart terminal.
[0019] The dialogue request may include information such as user identifier, request text, and request time. The target entity information may be the business entity involved in the dialogue request, such as organization name, indicator name, and time range.
[0020] Candidate dimension values can be a set of candidates obtained from preliminary matching based on target entity information, used to convert the dialogue content in the dialogue request into standard dimension encoding.
[0021] The preset historical case library includes multiple historical dialogue requests and corresponding historical cases for each request. Each historical case includes the dimension value of the dialogue request and the response result. Target historical cases can be retrieved from the preset historical case library that have a high similarity to the current dialogue request, and are used to provide contextual learning material for the dimension recognition subtask of the target model.
[0022] Furthermore, dimension values are used to convert the dialogue content in a dialogue request into standard dimension codes. Specifically, this can be achieved using structured data that includes dimension identifier information and dimension value information. The dimension identifier information can be used to identify the category of the dimension, such as an organizational dimension, an indicator dimension, or a time dimension; the dimension value information can be used to represent the specific value under that dimension, such as a branch office under the organizational dimension or premium income under the indicator dimension.
[0023] By converting colloquial dialogue content into standard dimensional encoding, the recognition difficulties caused by differences in how different users ask questions can be eliminated, providing a unified data interface for subsequent real data queries and response generation.
[0024] Specifically, upon receiving a user's dialogue request, natural language understanding can be performed on the request, and target entity information can be extracted using named entity recognition technology. After extracting the target entity information, it is matched with dimension names in a pre-defined dimension value library to obtain candidate dimension values corresponding to the target entity information. Simultaneously, the dialogue request is searched in a pre-defined historical case library to obtain target historical cases corresponding to the dialogue request. The retrieval of target historical cases can employ a vector retrieval method, where the dialogue request and historical dialogue requests in the pre-defined historical case library are vectorized separately, and the target historical cases are retrieved by calculating vector similarity.
[0025] For example, in an insurance indicator Q&A service within a financial scenario, a user inputs a dialogue request via a mobile banking application: "What is the reinsurance premium for Company A's Insurance B?" Upon receiving this dialogue request, entity recognition is performed, extracting the target entity information, including the institutional entity Company A and the indicator entity, "Insurance reinsurance premium for Insurance B." The institutional entity Company A is matched against the institutional dimension names in a pre-defined dimension value library, determining the candidate dimension value as Company A corresponding to code 1000 under the institutional dimension. Similarly, the indicator entity "Insurance reinsurance premium for Insurance B" is matched against the indicator dimension names in the pre-defined dimension value library, determining the candidate dimension value as the reinsurance premium for Insurance B corresponding to code CIA_PREM under the indicator dimension. Simultaneously, the dialogue request is vector-based in a pre-defined historical case library, retrieving the target historical case, case number CASE_012. In this case, the user's question is "Insurance reinsurance premium for Company A's Insurance B," with dimensions of institutional 1000 and indicator CIA_PREM. The standard answer is: "Company A's reinsurance premium for Insurance B in 2024 is 35 million yuan."
[0026] S11: Input the dialogue request, the candidate dimension value, and the target historical case into the target model, and output the target dimension value by the dimension recognition subtask of the target model.
[0027] In this step, the target model can be a large language model trained through multi-task joint fine-tuning, including three subtasks: initial response generation, dimension recognition, and target response generation. The dimension recognition subtask identifies a structured set of dimension values from user dialogue requests, serving as a crucial bridge between natural language and real-world data queries. The target dimension values are the final set of dimension values output by the dimension recognition subtask and confirmed through model inference, used for subsequent real-world data queries and response generation. By simultaneously using the dialogue request, candidate dimension values, and target historical cases as input to the dimension recognition subtask, the model can reference the question patterns and dimension mapping relationships of historical cases during inference, thereby improving the accuracy and robustness of dimension recognition.
[0028] Furthermore, target historical cases are injected as contextual learning material into the dimension recognition subtask, enabling the target model to handle new metrics or new question formats without relying on parameter memorization or retraining. Specifically, the dialogue request text, the structured representation of candidate dimension values, and question-answer pairs from target historical cases can be concatenated into a model input sequence according to a preset prompt word template and input into the dimension recognition subtask of the target model. The dimension recognition subtask outputs a structured result, including the dimension value recognition result based on the user question text (i.e., the target dimension value). In other implementations, in addition to outputting the dimension value recognition result, the dimension recognition subtask can also output a reasoning explanation, i.e., explanatory text on how these dimension values were identified from the user question text. By demonstrating the model's reasoning basis to business personnel through the reasoning explanation, the interpretability of the dimension recognition process is improved.
[0029] Specifically, the prompt word template can include three parts: task description, few-shot examples, and input data. The task description informs the model of the dimension recognition task to be performed and its output format requirements; the few-shot examples, i.e., target historical cases, guide the model to learn the mapping relationship between question patterns and dimension values; the input data includes the dialogue request text and candidate dimension values, serving as input for model inference. Through this prompt word engineering, the target model can complete dimension recognition of new dialogue requests without updating parameters, using the guidance of historical cases, achieving hourly iteration of knowledge.
[0030] For example, in an insurance indicator question-and-answer business within a financial scenario, the dialogue request "What is the reinsurance premium of Company A's Insurance B?", the candidate dimension values (Institution 1000: Company A, Indicator CIA_PREM: Reinsurance Premium of Insurance B), and the target historical case CASE_012 are concatenated according to the prompt word template and input into the dimension recognition subtask of the target model. The model references the mapping relationship between Company A and Institution 1000 in the target historical case, outputting the target dimension values as the institution dimension code DIM_ORG (value 1000) and the indicator dimension code DIM_IND (value CIA_PREM), along with an inference explanation. This inference explanation allows business personnel to trace the basis for model recognition, facilitating case correction and knowledge updates when recognition errors occur.
[0031] S12: Determine the actual numerical information corresponding to the dialogue request based on the target dimension value; and generate the target response result of the dialogue request based on the actual numerical information.
[0032] In this step, the actual numerical information can be the actual business indicator data retrieved from a pre-set real database based on the target dimension values. The pre-set real database independently stores sensitive business indicators, and uses dimension encoding to implement least privilege access control, ensuring that sensitive data is stored separately from knowledge rules and reducing the risk of data leakage.
[0033] The target response can be a natural language answer generated based on real numerical information and consistent with the business context, including accurate numerical values and business interpretation. By using the target dimension value as a query condition to perform a precise query in a pre-set real database, the real numerical information corresponding to the dialogue request can be obtained. Then, the target response generation subtask of the target model generates a natural language answer based on the real numerical information, realizing an end-to-end question-and-answer process from natural language to structured query and then to natural language answer.
[0034] For example, in an insurance indicator Q&A session within a financial scenario, a query is performed in a pre-defined real database based on the target dimension (1000 institutions, indicator CIA_PREM) to obtain the actual numerical information: Company A's reinsurance premium for Insurance B in 2024 was 35 million yuan, representing a year-on-year increase of 12%. The dialogue request regarding Company A's reinsurance premium for Insurance B, the target dimension, and the actual numerical information are input into the target model's target response generation subtask. The model outputs the target response result: Company A's reinsurance premium for Insurance B in 2024 was 35 million yuan, representing a year-on-year increase of 12%. This response directly references the actual numerical value obtained from the query, ensuring absolute accuracy, while also including a business interpretation of the year-on-year growth, consistent with the style of insurance business reports.
[0035] In this embodiment, in response to a received user dialogue request, candidate dimension values are determined based on the target entity information in the dialogue request, and target historical cases are determined from a preset historical case library. The dialogue request, candidate dimension values, and target historical cases are then input into the target model. The dimension recognition subtask of the target model outputs the target dimension value. Finally, the actual numerical information is determined based on the target dimension value, and the target response result is generated. Thus, by injecting historical cases as contextual learning material into the dimension recognition subtask, the target model can refer to historical question patterns and dimension mapping relationships for reasoning. This effectively solves the problems of lack of case references and easy misjudgment when faced with business slang and ambiguous expressions in existing technologies, thereby improving the accuracy of responses to user dialogue requests.
[0036] In some implementations, such as Figure 3 As shown, step S10 may include the following steps: S20: Based on the dialogue request, search the dialogue requests in the preset historical case database to obtain the first candidate historical case; S21: Input the dialogue request into the target model, and the initial response generation subtask of the target model outputs the initial response result corresponding to the dialogue request; S22: Based on the initial response result, search the response results in the preset historical case database to obtain a second candidate historical case; S23: Determine the target historical case based on the first candidate historical case and the second candidate historical case.
[0037] In this embodiment, the first candidate historical cases can be a set of historical cases obtained by vector retrieval of the dialogue request field in a preset historical case library based on the dialogue request text. Specifically, a pre-trained vector encoding model can be used to encode the dialogue request to obtain a vector representation of the dialogue request. Simultaneously, each historical dialogue request is pre-encoded and a vector index is established in the preset historical case library. By calculating the similarity between the dialogue request vector and the historical dialogue request vectors, the several historical cases with the highest similarity are retrieved as the first candidate historical cases. This retrieval path excels at handling explicitly mentioned standardized dimensions and can accurately match historical cases similar to the dialogue request text.
[0038] Furthermore, the vector coding model can employ a bilingual vector coding model trained on a business domain corpus. After fine-tuning with a domain-specific corpus, such as insurance corpus, the vector coding model can better capture the semantic features of domain terminology and business slang. Vector similarity can be calculated using methods such as cosine similarity and inner product similarity; no specific limitations are imposed here. The number of search results can be set according to actual needs; for example, the top ten historical cases with the highest similarity can be used as the first candidate historical cases.
[0039] For example, in a financial scenario, the dialogue request might be "How is Branch C's car insurance performance this year?" This request is encoded into a vector representation. A search of the dialogue request field index in a pre-defined historical case library yields first-line candidate historical cases, including queries about Branch C's car insurance business and Branch C's accident insurance performance. The dialogue request text of these historical cases is semantically highly similar to the current dialogue request, providing accurate questioning patterns for subsequent dimensional identification.
[0040] The initial response generation subtask can be a subtask within the target model used to generate a draft hypothetical answer containing speculative dimensions and pseudo-numerical values. The initial response result can be the output text of the hypothetical answer draft from the initial response generation subtask. This draft transforms colloquial user questions into canonical expressions containing standard dimensional terms and captures the computational type features of the question by generating pseudo-numerical values. The initial response result serves both to enhance semantic retrieval and to provide normalized input for the dimensionality recognition subtask. The core value of this subtask lies in transforming colloquial user questions into canonical expressions containing standard dimensional terms, providing text rich in dimensional information for subsequent vector retrieval, and improving the recall rate of vector retrieval.
[0041] Furthermore, the training samples for the initial response generation subtask can be constructed based on historical real-world problems. This can be achieved by replacing dimension values with other dimensions of the same type, generating initial drafts using an untuned base model followed by manual review and correction, and adding computational logic descriptions for complex computational problems. Through training with these samples, the initial response generation subtask can generate standardized drafts containing standard dimensional terms and pseudo-numerical values, providing structured query expansion for subsequent semantic vector retrieval.
[0042] For example, in a financial scenario, the dialogue request "How is Branch C's car accident insurance performance this year?" is input into the target model's initial response generation subtask. The model outputs the initial response as follows: According to the query, Branch C (institution code 1000) has car insurance premium income (indicator code PREM_AUTO) of xx million yuan, accident insurance premium income (indicator code PREM_ACC) of xx million yuan, and total car accident insurance premium income of xx million yuan, representing a year-on-year growth of xx%. This initial response contains standard dimensional terms and pseudo-numerical values, providing text rich in dimensional information for subsequent semantic retrieval.
[0043] The second candidate historical cases can be a set of historical cases obtained by vector retrieval of the response result field in a pre-set historical case database based on the initial response result. Specifically, a pre-trained vector encoding model is used to encode the initial response result to obtain a vector representation of the initial response result. At the same time, the standard answer of each historical case is pre-encoded and a vector index is established in the pre-set historical case database. By calculating the similarity between the initial response result vector and the standard answer vector of the historical case, the several historical cases with the highest similarity are retrieved as the second candidate historical cases. This retrieval path is good at capturing implicit dimensions and complex question patterns, and can make up for the lack of recall in the first candidate historical case retrieval path.
[0044] Furthermore, since the initial response results contain standard dimensional terms and pseudo-numerical values, their semantic features are closer to the semantic features of standard answers in the preset historical case library. Therefore, retrieval based on the initial response results can recall more historical cases that are dissimilar in dialogue request text but similar in response patterns, thereby improving the recall rate and coverage of the retrieval. The first candidate historical case and the second candidate historical case complement each other, taking into account both accurate identification and high coverage recall, providing more comprehensive reference materials for subsequent dimensional identification. It should be noted that in this embodiment, the execution order of steps S20 and S21 is not limited. Steps S20 and S21 can be performed simultaneously or sequentially depending on computing resources or actual conditions.
[0045] For example, in a financial scenario, based on the initial response result, a search is performed in the response result field index of a pre-defined historical case database to obtain second candidate historical cases, including historical cases such as the C branch's auto insurance premium income of 120 million yuan and the C branch's accident insurance premium income of 80 million yuan. The standard answers of these historical cases are highly similar to the initial response result in terms of dimensional terminology and response patterns, which can provide a reference for implicit dimensions for subsequent dimension identification.
[0046] The target historical cases can be the final set of historical cases obtained by fusing the first and second candidate historical cases. Specifically, the first and second candidate historical cases can be deduplicated. For historical cases that appear in both candidate sets, a dynamic weighting mechanism can be used to weight and fuse their comprehensive similarity scores; for historical cases that appear in only one candidate set, their similarity scores can be used directly. Finally, the historical cases are ranked according to their comprehensive similarity scores, and the highest-scoring historical cases are selected as the target historical cases.
[0047] Furthermore, the dynamic weighting mechanism can adaptively adjust the weights of the first and second candidate historical cases based on the characteristics of the dialogue request. For example, when the dialogue request contains more explicit dimensional terms, the weight of the first candidate historical case can be increased; when the dialogue request is colloquial or contains implicit dimensions, the weight of the second candidate historical case can be increased. By fusing the two retrieval results through conflict resolution and the dynamic weighting mechanism, both high-precision identification and high-coverage recall can be achieved, providing more comprehensive and accurate contextual learning materials for the dimensionality identification subtask.
[0048] For example, in a financial scenario, the first candidate historical case contains 10 historical cases, and the second candidate historical case contains 10 historical cases, with 3 historical cases appearing in both candidate sets. For these three historical cases that appear simultaneously, a dynamic weighting mechanism is used to weight and fuse their comprehensive similarity scores to obtain a higher comprehensive similarity score; for historical cases that appear in only one candidate set, their similarity score is used directly. Finally, based on the comprehensive similarity scores, the top five historical cases with the highest scores are selected as target historical cases and input into the dimension recognition subtask of the target model as context learning material.
[0049] In this embodiment, through a dual-path complementary mechanism of entity recognition retrieval and semantic retrieval, the entity recognition path excels at handling explicitly mentioned standardized dimensions, while the semantic retrieval path excels at capturing implicit dimensions and complex question patterns. The results from the two paths are fused through conflict resolution and dynamic weighting mechanisms, achieving both high-precision recognition and high-coverage recall, effectively resolving ambiguous expressions, thereby improving the accuracy and coverage of target historical case retrieval, and providing more comprehensive and accurate contextual learning materials for subsequent dimension recognition subtasks.
[0050] In some implementations, step S10 may include the following steps: S30: Match the target entity information with the dimension names in the preset dimension value library to obtain a matching result; wherein, the preset dimension value library includes multiple dimension names and dimension values corresponding to each dimension name, and the dimension value includes dimension identification information and dimension value information; S31: In response to the matching result indicating a matching failure, the dimension value corresponding to the dimension name with the highest similarity to the entity information in the preset dimension value library is determined as the candidate dimension value.
[0051] In this embodiment, the preset dimension and dimension value library can be a knowledge base that stores standard dimension definitions and dimension value information for the business domain. It includes multiple dimension names and the dimension values corresponding to each dimension name. The dimension and dimension values contain dimension identification information and dimension value information. The dimension identification information identifies the category of the dimension, and the dimension value information represents the specific value taken under that dimension.
[0052] The matching results can be used to indicate whether the target entity information matches the dimension name in the preset dimension value library. By accurately matching the target entity information with the dimension name in the preset dimension value library, the standard dimension value corresponding to the target entity information can be quickly located, providing a candidate set for subsequent dimension identification.
[0053] In some implementations, the pre-defined dimension value library can also include a built-in colloquial alias system, where commonly used colloquial expressions by business personnel are used as aliases for each dimension value. For example, for the organization dimension, code 1000 corresponds to branch office C, colloquial aliases could include C East, C Branch, Provincial Company, etc. During the matching process, not only is the target entity information matched with the dimension name, but also with the colloquial aliases of each dimension value, thus accurately mapping business slang to standard codes. Matching methods can include exact matching, edit distance matching, or alias mapping table lookup, etc., and are not specifically limited here.
[0054] When the target entity information fails to match any dimension name or colloquial alias in the preset dimension value library (i.e., the matching result indicates a failure), a similarity backoff mechanism can be used to determine candidate dimension values. Specifically, the semantic similarity between the target entity information and each dimension name in the preset dimension value library can be calculated, and the dimension value corresponding to the dimension name with the highest similarity can be determined as the candidate dimension value. Semantic similarity can be calculated using vector encoding and cosine similarity methods based on pre-trained language models, or string similarity methods based on edit distance; no specific limitation is made here. The similarity backoff mechanism can handle new entities or new question formats not included in the preset dimension value library, improving the coverage and robustness of candidate dimension value determination.
[0055] Furthermore, the similarity fallback mechanism can set a similarity threshold. When the maximum similarity is greater than or equal to the threshold, the corresponding dimension value is determined as a candidate dimension value. When the maximum similarity is less than the threshold, the target entity information can be marked as an unknown entity, triggering a manual review process where business personnel confirm whether a new dimension value needs to be added. By controlling the similarity threshold, mismatches caused by excessively low similarity can be avoided, while the manual review process enables continuous updates and expansion of the knowledge base. The similarity threshold can be set according to actual circumstances and is not specifically limited here.
[0056] In this embodiment, a matching result is obtained by matching the target entity information with the dimension names in a preset dimension value library. In response to a matching failure, the dimension value corresponding to the dimension name with the highest similarity to the entity information in the preset dimension value library is determined as a candidate dimension value. Thus, through a two-layer matching mechanism combining precise matching and similarity backoff, the standard dimension values of already included entities can be quickly located, while also handling new entities or new question formats not yet included. This effectively resolves the recognition difficulties caused by ambiguous expressions and business slang, thereby improving the accuracy and coverage of candidate dimension value determination and providing a more comprehensive and accurate candidate set for subsequent dimension recognition subtasks.
[0057] In some implementations, step S12 may include the following steps: S40: The real numerical information in the preset real database that matches the target dimension value is determined as the real numerical information corresponding to the dialogue request; wherein, the real database includes multiple dimension values and the real numerical information corresponding to each dimension value.
[0058] In this embodiment, the preset real database can be an independent database storing sensitive business indicator data, including multiple dimension values and the corresponding actual numerical information for each dimension value. The preset real database implements least privilege access control through dimension encoding, ensuring that sensitive data and knowledge rules are stored separately, thereby reducing the risk of data leakage.
[0059] Authentic numerical information can be actual business metric data obtained by precisely querying a pre-defined real database based on the target dimension value. By using the target dimension value as a query condition to perform a precise query in the pre-defined real database, authentic numerical information corresponding to the dialogue request can be obtained, providing an accurate data foundation for generating subsequent response results.
[0060] Furthermore, the preset real database can be implemented using a relational database or a columnar storage database, supporting precise queries based on dimension combinations. During the query process, the dimension identifiers and value information of each dimension in the target dimension are used as query conditions to match the corresponding real numerical information in the preset real database. For example, when the target dimension includes an organization dimension value of 1000 and an indicator dimension value of CIA_PREM, the query conditions are organization code equal to 1000 and indicator code equal to CIA_PREM, and the query result is the premium value of B insurance for branch office C. The least privilege access control implemented through dimension coding ensures that only authorized query requests can access the corresponding sensitive business data.
[0061] In some implementations, data in the preset real database can be periodically synchronized and updated from the business system to ensure that the retrieved numerical information is the latest business metric data. Data synchronization can be performed using incremental or full synchronization methods. Incremental synchronization only synchronizes data that has changed, while full synchronization synchronizes all data. The synchronization frequency can be set according to business needs, such as once a day or once an hour; no specific limitation is made here. Through regular data synchronization, the timeliness and accuracy of the data in the preset real database can be guaranteed.
[0062] In this embodiment, the real numerical information matching the target dimension value in the preset real database is determined as the real numerical information corresponding to the dialogue request. Therefore, by using the target dimension value as a query condition to perform a precise query in the preset real database, the real numerical information corresponding to the dialogue request can be obtained, providing an accurate data foundation for the subsequent generation of response results. Simultaneously, the preset real database independently stores sensitive business indicators, and implements least-privilege access control through dimension encoding, ensuring that sensitive data and knowledge rules are stored separately. This effectively solves the problem in existing technologies where sensitive business data and knowledge rules are stored together, making fine-grained permission control difficult and posing a risk of data leakage. This improves the data security and fine-grained permission control capabilities of the response method.
[0063] In some implementations, step S12 may include the following steps: S50: Input the dialogue request, the target dimension value, and the real numerical information into the target model, and output the target response result by the target response generation subtask of the target model.
[0064] In this embodiment, the target response generation subtask can be a subtask in the target model used to generate a natural language answer that conforms to the business context based on the accurately identified dimension values and the real numerical values obtained from the query.
[0065] The target response can be a natural language answer output by the target response generation subtask, containing accurate numerical values and business interpretation. By simultaneously using the dialogue request, target dimension values, and real numerical information as input to the target response generation subtask, the model can reference the original expression of the user's question, the identified dimension values, and the real numerical values obtained from the query when generating the response, thereby generating a natural language answer that is both accurate and consistent with the business context.
[0066] Furthermore, the dialogue request text, the structured representation of the target dimension's value, and the actual numerical information can be concatenated into a model input sequence according to a preset prompt word template, and then input into the target model's target response generation subtask. The prompt word template can explicitly require the model to directly reference the numerical values from the actual numerical information and not to generate or modify any numerical values, thereby ensuring the accuracy of the numerical values.
[0067] Specifically, the training samples for the target response generation subtask can be constructed based on historical real question-and-answer pairs, with numerical accuracy ensured through manual review; alternatively, they can be generated based on templates, with diverse expression templates designed for different types of indicators (such as achievement rate, growth rate, percentage, and absolute value); and numerical perturbation samples can be used, performing unit conversions (e.g., converting yuan to ten thousand yuan) and format adjustments (e.g., converting 0.152 to 15.2%) based on real numerical values to enhance the model's robustness to numerical formats. Through training with the above training samples, the target response generation subtask can generate natural language responses that conform to the business context, are numerically accurate, and are expressed in a standardized manner.
[0068] In this embodiment, by inputting the dialogue request, target dimension value, and actual numerical information into the target model, the target model's target response generation subtask outputs the target response result. Thus, by simultaneously using the dialogue request, target dimension value, and actual numerical information as input to the target response generation subtask, the model can reference the original expression of the user's dialogue, the identified dimension value, and the retrieved actual numerical value when generating the response result, thereby generating a natural language response that is both accurate and consistent with the business context.
[0069] In some implementations, the target model is a multi-task model, which includes an initial response generation subtask, a dimension recognition subtask, and a target response generation subtask; the target model can be obtained through the following steps: S60: Obtain a first training sample for training the initial response generation subtask, a second training sample for training the dimension recognition subtask, and a third training sample for training the target response generation subtask. S61: Train the dimension recognition subtask of the initial model separately based on the second training sample to obtain an intermediate model; the first loss function during separate training is determined based on the output of the dimension recognition subtask. S62: Based on the first training sample, the second training sample, and the third training sample, jointly train the initial response generation subtask, the dimension recognition subtask, and the target response generation subtask of the intermediate model to obtain the target model.
[0070] In this embodiment, the first training sample can be sample data used to train the initial response generation subtask. Its input is the user question text, and its output is the hypothetical answer draft text. The first training sample can be constructed based on historical real questions, and can be generated by replacing dimension values with other dimensions of the same type, generating an initial draft using an untuned base model and having it manually reviewed and corrected, and adding computational logic descriptions for complex computational problems.
[0071] The second training sample can be sample data used to train the dimension recognition subtask. Its input includes user question text, a set of candidate dimension values, and a set of candidate historical cases. The output is structured data containing dimension value recognition results and reasoning explanations. The second training sample can include historical manually annotated cases, template-generated variant questions, and adversarial samples, etc.
[0072] The third training sample can be sample data used to train the target response generation subtask. Its input includes user question text, dimension value recognition results, and real numerical data, and the output is a natural language response. The third training sample can be constructed based on historical real question-answer pairs, template-based generation, and numerically perturbed samples, etc.
[0073] Furthermore, the second training sample, serving as the training sample for the core task, has the largest sample size and can include historical manually annotated cases, template-generated variant questions, and adversarial samples. The template-generated variant questions are generated through synonym replacement, dimension reorganization, and word order adjustment, enhancing the model's generalization ability to different question patterns. Adversarial samples contain ambiguous expressions (e.g., a branch office might refer to a provincial or municipal office), missing dimensions (e.g., omitting time), and unconventional question formats (e.g., performance needs to be mapped to specific metrics), enhancing the model's robustness to complex and ambiguous scenarios. Through this rich training sample, the dimension recognition subtask can learn a more comprehensive understanding of question patterns and dimensional mapping relationships.
[0074] The initial model can be a base model without multi-task joint fine-tuning. The intermediate model can be a model obtained by training only on the dimension recognition subtask. The first loss function during separate training is determined based on the output of the dimension recognition subtask; that is, the first loss function measures the difference between the output of the dimension recognition subtask and the labels of the second training samples. By first training the dimension recognition subtask separately, the model can master the core dimension recognition capability before introducing auxiliary tasks, avoiding interference from auxiliary tasks in the early stages of training, thereby improving the training effect and stability of the dimension recognition subtask.
[0075] Furthermore, standalone training can employ Low-Rank Adaptation (LoRA) technology for efficient parameter fine-tuning. By adding a low-rank adaptation matrix to the pre-trained model, only the parameters of the low-rank adaptation matrix are trained, while the original model parameters are frozen. This significantly reduces the number of training parameters while maintaining model performance. LoRA technology reduces training costs and memory usage, making fine-tuning of large language models possible with limited computing resources. The number of training epochs for standalone training can be set according to the actual situation, such as training for one epoch; no specific limit is imposed here.
[0076] Joint training can be a process of simultaneously training three subtasks—initial response generation, dimensionality recognition, and target response generation—on top of an intermediate model. Through joint training, the three subtasks can share parameters and knowledge, enabling a single model to have end-to-end question-answering capabilities. Furthermore, parameter sharing between tasks improves generalization performance. Joint training employs a progressive training strategy, first training the core dimensionality recognition subtask, then gradually introducing auxiliary tasks. LoRA low-rank adaptation enables efficient parameter fine-tuning and knowledge transfer, giving the single model end-to-end question-answering capabilities, significantly reducing error propagation, and improving inference efficiency.
[0077] In some implementations, model training can employ a progressive training strategy, dividing model training into multiple stages. In the first stage, only the dimensional recognition subtask is trained, enabling the model to master the core dimensional recognition capability. In the second stage, initial response generation and target response generation subtasks are introduced, allowing the model to begin learning the ability to perform auxiliary tasks. In the third stage, the three subtasks are jointly fine-tuned, with dynamic task weights ensuring task synergy, allowing the three subtasks to mutually promote and improve each other. This progressive training strategy avoids auxiliary tasks interfering with the learning of the core task in the early stages of training, while enabling the three subtasks to achieve collaborative optimization in the later stages of training.
[0078] Furthermore, the joint loss function during joint training is a weighted sum of the first, second, and third loss functions. The first loss function is determined based on the output of the dimension recognition subtask, the second loss function on the output of the initial response generation subtask, and the third loss function on the output of the target response generation subtask. The weight coefficients of each loss function can be set according to the importance of the task; dimension recognition, as the core task, has the highest weight coefficient. Through reasonable weight settings, it can be ensured that the core task is fully optimized during joint training, while the auxiliary tasks can also contribute to the overall performance improvement. It should be noted that the weights of each loss function can be set according to the actual situation and are not specifically limited here.
[0079] For example, the base model can be an open-source large language model, and its parameters can be efficiently fine-tuned using LoRA low-rank adaptation technology. The loss function is: L=λ1L hyde + λ2L extract +λ3L generate ; In the formula, λ1, λ2, and λ3 are task weight coefficients, which control the contribution of the three subtasks: the initial response generation subtask, the dimension recognition subtask, and the target response generation subtask, respectively. L hyde Generate subtasks for the initial response, L extrac For the dimension recognition subtask, Lgenerate Subtasks are generated to provide the target response. Among them, λ1=0.3, λ2=0.5, λ3=0.2, and dimensional identification is the core task with the highest weight.
[0080] In this embodiment, a first training sample for training the initial response generation subtask, a second training sample for training the dimension recognition subtask, and a third training sample for training the target response generation subtask are obtained. An intermediate model is obtained by training the dimension recognition subtask of the initial model separately using the second training sample. Then, the target model is obtained by jointly training the three subtasks of the intermediate model using the first, second, and third training samples. Thus, through a progressive multi-task joint fine-tuning strategy, the core dimension recognition subtask is trained first, and then auxiliary tasks are gradually introduced. LoRA low-rank adaptation enables efficient parameter fine-tuning and knowledge transfer, giving a single model end-to-end question-answering capabilities. This effectively solves the problems of coarse multi-task training strategies, insufficient task collaboration, and low inference efficiency in existing technologies. It significantly reduces error propagation and improves inference efficiency, thereby improving the accuracy and response speed of the response method to user dialogue requests.
[0081] In some implementations, the first loss function during individual training is determined based on the output of the dimension-identifying subtask; the joint loss function during joint training is a weighted sum of the first loss function, the second loss function, and the third loss function, whereby the second loss function is determined based on the output of the subtask generated from the initial response, and the third loss function is determined based on the output of the subtask generated from the target response.
[0082] The second loss function can be used to measure the difference between the output of the initial response generation subtask and the labels of the first training samples. The output of the initial response generation subtask is the draft text of the hypothetical answer. The second loss function can be the autoregressive cross-entropy loss function commonly used in language models to measure the difference between the draft text generated by the model and the labeled text. By optimizing the second loss function, the initial response generation subtask can generate more standardized hypothetical answer drafts that are richer in dimensional information.
[0083] The third loss function can be used to measure the difference between the output of the target response generation subtask and the labels of the third training sample. The output of the target response generation subtask is a natural language answer, and the third loss function can also use the autoregressive cross-entropy loss function to measure the difference between the model-generated answer and the labeled answer. Optimizing the third loss function enables the target response generation subtask to generate more accurate and business-context-appropriate natural language answers.
[0084] Specifically, the joint loss function is a weighted sum of the first, second, and third loss functions. It can be expressed as the joint loss function equal to the product of the first weight coefficient and the first loss function, plus the product of the second weight coefficient and the second loss function, and finally the product of the third weight coefficient and the third loss function. The first, second, and third weight coefficients control the contribution of the dimension recognition subtask, the initial response generation subtask, and the target response generation subtask to the joint training, respectively. Since dimension recognition is the core task, the first weight coefficient is set to its highest value, for example, 0.5 for the first weight coefficient, 0.3 for the second weight coefficient, and 0.2 for the third weight coefficient. By setting appropriate weights, it is ensured that the core task is fully optimized during joint training, while the auxiliary tasks also contribute to the overall performance improvement, avoiding interference from the core task's learning.
[0085] In this embodiment, the first loss function during individual training is determined based on the output of the dimension recognition subtask. The joint loss function during joint training is set as a weighted sum of the first, second, and third loss functions. The second loss function is determined based on the output of the subtask generated from the initial response, and the third loss function is determined based on the output of the subtask generated from the target response. Therefore, through reasonable loss function design and weight coefficient settings, it is ensured that the core dimension recognition subtask is fully optimized during training, while the auxiliary tasks also contribute to the overall performance improvement. This avoids the auxiliary tasks interfering with the learning of the core task, effectively solving the problems of simple multi-task joint training in existing technologies that do not consider task dependencies and importance differences, and where auxiliary tasks easily interfere with the learning of the core task. This improves the training effect and response accuracy of the target model.
[0086] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0087] For ease of understanding, a specific embodiment will be used as an example: The response method provided in this application, taking insurance business as an example, can adopt a two-stage architecture of "offline construction - online service": the offline stage completes the knowledge base construction and large model multi-task fine-tuning, and the online stage realizes end-to-end real-time question-answering reasoning. Specifically: I. Offline Build Phase (1) Construction of knowledge base 1. Construction of a Pre-defined Dimension and Value Knowledge Base. Specifically, standard dimension codes, dimension names, and dimension value lists are defined, and commonly used colloquial aliases and example questions for each dimension are collected. For example, the dimension code is "DIM_ORG", the dimension name is "Institution", and the dimension value list includes "1000-Branch Company in a Certain Location", "1100-Central Branch in a Certain Location", etc.; the dimension value alias mapping is: {"1000": ["Location", "Branch in a Certain Location", "Provincial Company"], "1100": ["Location", "Central Branch in a Certain Location"]}; and example questions are collected, such as "What is the premium in a certain location?", "How is the performance of a certain branch this year?", "What is the situation of the provincial company's auto insurance business", etc., and stored as a pre-defined dimension and value knowledge base.
[0088] 2. A pre-built historical case database is constructed by collecting historical query records from insurance business personnel. After manual review, the records are labeled with structured information. Each data entry includes a case ID, user question, dimension values, standard answer, and question type. For example: Case ID is “CASE_001”, user question is “What is the premium income in location A and location B?”, dimension values are {“DIM_ORG”: [“1100-Center branch in location A”, “2100-Center branch in location B”], “DIM_IND”: [“PREM_INC-Premium income”]}, standard answer is “The premium income of the center branch in location A is 120 million yuan, the premium income of the center branch in location B is 90 million yuan, totaling 210 million yuan”, and the question type is “Multi-institution comparison query”. A neural network embedding model trained on an insurance corpus is used to vectorize the user question, dimension value JSON string, standard answer, and question type, generating four embedding vectors. Vector indexes are then created for each vector, forming the pre-built historical case database.
[0089] 3. A pre-built real data knowledge base can store actual indicator data of the insurance business system and support precise queries based on dimension combinations.
[0090] (2) Multi-task fine-tuning of large model training: In this embodiment, a three-task joint fine-tuning framework is used to train the base large language model, which specifically includes the following sub-tasks: 1. Hypothetical answer generation subtask (initial response generation) This subtask takes user question text as input and outputs a draft hypothetical answer containing speculative dimensions and pseudo-numerical values. The training sample size is 15,000 entries, constructed using methods including: replacing dimensions with other dimensions of the same type based on historical real questions; generating initial drafts using an untuned base model and then manually reviewing and correcting them; and adding computational logic descriptions for complex calculation-based questions (such as year-on-year comparisons, month-on-month comparisons, and achievement rates). This subtask aims to transform colloquial questions into standardized expressions containing standard dimensional terminology and provide dimensionally rich extended query text for subsequent vector retrieval.
[0091] 2. Dimension Recognition Subtask This subtask takes user question text, a candidate set of dimensions and values, and a candidate set of historical cases as input, and outputs dimension recognition results in JSON format. The JSON format includes two parts: "Dimension Recognition Results" and "Inference Explanation." The training sample size is 25,000 samples, constructed using the following methods: 8,500 historical manually annotated cases; 10,000 template-generated variant questions (achieved through synonym replacement, dimension reorganization, and word order adjustment); and 6,500 adversarial samples (including ambiguous expressions, missing dimensions, and unconventional question formats). This subtask is the core task of the joint training.
[0092] 3. Target response generation subtask This subtask takes user question text, JSON-formatted dimension recognition results from the dimension recognition subtask, and real numerical data as input, and outputs a natural language answer containing accurate numerical values and business interpretation. The training sample size is 12,000 entries, constructed as follows: 5,000 historical real question-and-answer pairs (human-reviewed to ensure numerical accuracy); 4,000 template-generated entries (with diverse expression templates designed for different types of indicators such as achievement rate, growth rate, percentage, and absolute value); and 3,000 numerical perturbation samples (unit conversion and format adjustment to enhance model robustness). This subtask prohibits the model from generating or modifying numerical values to ensure absolute accuracy.
[0093] This application embodiment can use LoRA low-rank adaptation technology to efficiently fine-tune the parameters of the base large language model. The joint loss function is: The base model can be an open-source large language model, and LoRA low-rank adaptation technology can be used to efficiently fine-tune its parameters. The loss function is: L=λ1L hyde + λ2L extract +λ3L generate ; In the formula, λ1, λ2, and λ3 are task weight coefficients, which control the contribution of the three subtasks: the initial response generation subtask, the dimension recognition subtask, and the target response generation subtask, respectively. L hyde Generate subtasks for the initial response, L extrac For the dimension recognition subtask, L generate Subtasks are generated to provide the target response. Among them, λ1=0.3, λ2=0.5, λ3=0.2, and dimensional identification is the core task with the highest weight.
[0094] The training adopts a progressive strategy: the first training round trains only the dimension recognition subtask; the second training round adds the hypothetical answer generation subtask and the target response generation subtask; the third training round fine-tunes the three subtasks together.
[0095] II. Online Q&A Phase (1) Accept user questions, receive natural language questions input by users, such as: "What is the reinsurance premium of Insurance A in a certain place?"
[0096] (2) Parallel candidate set generation 1. Entity Recognition Candidate Set Generation A neural network model trained with insurance knowledge is used to identify entities in user questions and output entity mentions. Based on the edit distance and alias mapping table, entity mentions are linked to standard dimensions and dimensions in a preset dimension value library, and the first candidate set, i.e., the dimension value candidate set, is output.
[0097] 2. HyDE-enhanced semantic retrieval candidate set generation The user question is input into the finely tuned large model (i.e., the model corresponding to the hypothetical answer generation subtask), generating a draft hypothetical answer. For example: "According to the query, the CIA reinsurance premium (indicator code CIA_PREM) of a branch office (organization code 1000) is XXXX million yuan." Then, the BGE-M3 model is used to encode the user question to obtain vector Vq, and the hypothetical answer draft is encoded to obtain vector Vh. Using Vq, the top-K similar cases are retrieved from the question field index of the preset historical case library to obtain the first candidate historical case. Using Vh, the top-K similar cases are retrieved from the answer field index of the preset historical case library to obtain the second candidate historical case. The two search results are combined to output the second candidate set, i.e., the target historical case set. Each record contains similar user questions, labeled dimension values, standard answers, and comprehensive similarity scores.
[0098] (3) Multi-source information fusion and dimensional identification The preset prompt word template, the user question text, the first candidate set, and the second candidate set are concatenated as context. The fine-tuned large model (i.e., the model corresponding to the dimension recognition subtask) is input, and the dimension recognition result in JSON format is output, including the dimension value recognition result based on the user question text and the corresponding reasoning explanation.
[0099] (4) Real data query and answer generation Based on the dimension values identified in (3), the corresponding indicator values are queried in the preset real data knowledge base; the user question, the dimension values, and the real values obtained from the query are concatenated and input into the finely tuned large model (i.e., the model corresponding to the target answer generation subtask) to generate a natural language answer that conforms to the context of insurance business. For example, for the user question "What is the reinsurance premium of Insurance A in a certain place?", the generated answer is "The reinsurance premium of Insurance A in a certain branch in 2024 was RMB 35 million, an increase of 12% year-on-year". The value in this answer comes directly from the real data query results, ensuring accuracy.
[0100] Through the two-stage processing of offline construction and online question answering described above, the embodiments of this application can achieve end-to-end automation of insurance indicator question answering, effectively improving the accuracy and robustness of natural language question answering in complex business scenarios.
[0101] In one embodiment, a response device is provided, which corresponds one-to-one with the response methods described in the above embodiments. For example... Figure 4 As shown, the response device includes a determining module 101, an output module 102, and a generating module 103. Detailed descriptions of each module are as follows: The determining module 101 is configured to, in response to receiving a user's dialogue request, determine the candidate dimension value corresponding to the target entity information based on the target entity information in the dialogue request, and determine the target historical case corresponding to the dialogue request from a preset historical case library; wherein, the dimension value is used to convert the dialogue content in the dialogue request into standard dimension encoding, the preset historical case library includes multiple historical dialogue requests and historical cases corresponding to each historical dialogue request, and the historical case includes the dimension value corresponding to the dialogue request and the response result; Output module 102 is used to input the dialogue request, the candidate dimension value and the target historical case into the target model, and output the target dimension value by the dimension recognition subtask of the target model; The generation module 103 is used to determine the real numerical information corresponding to the dialogue request based on the target dimension value; and to generate the target response result of the dialogue request based on the real numerical information.
[0102] This application provides a response device that, in response to a user's dialogue request, determines candidate dimension values based on the target entity information in the dialogue request, identifies target historical cases from a pre-set historical case library, inputs the dialogue request, candidate dimension values, and target historical cases into a target model, and the target model's dimension recognition subtask outputs the target dimension value. Finally, the device determines the actual numerical information based on the target dimension value and generates the target response result. Thus, by injecting historical cases as contextual learning material into the dimension recognition subtask, the target model can reason by referring to historical question patterns and dimension mapping relationships. This effectively solves the problems of lack of case references in large-scale model dimension recognition and the susceptibility to misjudgment when faced with business slang and ambiguous expressions in existing technologies, thereby improving the accuracy of response methods to user dialogue requests.
[0103] For specific limitations regarding the response device, please refer to the limitations on the response method above, which will not be repeated here. Each subtask in the aforementioned response device can be implemented entirely or partially through software, hardware, or a combination thereof. Each subtask can be embedded in hardware or independent of the processor in the computer device, or stored in software in the memory of the computer device, so that the processor can invoke and execute the operations corresponding to each subtask.
[0104] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements a response method, server-side function, or step.
[0105] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements a response method, client-side functions, or steps.
[0106] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: In response to receiving a user's dialogue request, the system determines the candidate dimension value corresponding to the target entity information based on the target entity information in the dialogue request, and determines the target historical case corresponding to the dialogue request from a preset historical case library; wherein, the dimension value is used to convert the dialogue content in the dialogue request into standard dimension encoding, and the preset historical case library includes multiple historical dialogue requests and historical cases corresponding to each historical dialogue request, and the historical case includes the dimension value corresponding to the dialogue request and the response result; The dialogue request, the candidate dimension value, and the target historical case are input into the target model, and the target dimension value is output by the dimension recognition subtask of the target model. Based on the target dimension value, determine the actual numerical information corresponding to the dialogue request; and based on the actual numerical information, generate the target response result for the dialogue request.
[0107] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor: In response to receiving a user's dialogue request, the system determines the candidate dimension value corresponding to the target entity information based on the target entity information in the dialogue request, and determines the target historical case corresponding to the dialogue request from a preset historical case library; wherein, the dimension value is used to convert the dialogue content in the dialogue request into standard dimension encoding, and the preset historical case library includes multiple historical dialogue requests and historical cases corresponding to each historical dialogue request, and the historical case includes the dimension value corresponding to the dialogue request and the response result; The dialogue request, the candidate dimension value, and the target historical case are input into the target model, and the target dimension value is output by the dimension recognition subtask of the target model. Based on the target dimension value, determine the actual numerical information corresponding to the dialogue request; and based on the actual numerical information, generate the target response result for the dialogue request.
[0108] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0109] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0110] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and sub-tasks is used as an example. In practical applications, the above functions can be assigned to different functional units or sub-tasks as needed, that is, the internal structure of the device can be divided into different functional units or sub-tasks to complete all or part of the functions described above.
[0111] It should be noted that any AI models, software tools, or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with the knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.
[0112] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended 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 of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A response method, characterized in that, include: In response to receiving a user's dialogue request, the system determines the candidate dimension value corresponding to the target entity information based on the target entity information in the dialogue request, and determines the target historical case corresponding to the dialogue request from a preset historical case library; wherein, the dimension value is used to convert the dialogue content in the dialogue request into standard dimension encoding, and the preset historical case library includes multiple historical dialogue requests and historical cases corresponding to each historical dialogue request, and the historical case includes the dimension value corresponding to the dialogue request and the response result; The dialogue request, the candidate dimension value, and the target historical case are input into the target model, and the target dimension value is output by the dimension recognition subtask of the target model. Based on the target dimension value, determine the actual numerical information corresponding to the dialogue request; and based on the actual numerical information, generate the target response result for the dialogue request.
2. The method according to claim 1, characterized in that, The step of determining the target historical case corresponding to the dialogue request from a preset historical case database includes: Based on the dialogue request, a search is conducted in the dialogue requests of the preset historical case database to obtain the first candidate historical case; The dialogue request is input into the target model, and the initial response generation subtask of the target model outputs the initial response result corresponding to the dialogue request; Based on the initial response result, a search is performed in the response results of the preset historical case database to obtain a second candidate historical case; The target historical case is determined based on the first candidate historical case and the second candidate historical case.
3. The method according to claim 1, characterized in that, The step of determining the candidate dimension value corresponding to the target entity information based on the target entity information in the dialogue request includes: The target entity information is matched with the dimension names in the preset dimension value library to obtain the matching result; wherein, the preset dimension value library includes multiple dimension names and dimension values corresponding to each dimension name, and the dimension value includes dimension identification information and dimension value information; In response to the matching result indicating a matching failure, the dimension value corresponding to the dimension name with the highest similarity to the entity information in the preset dimension value library is determined as the candidate dimension value.
4. The method according to claim 1, characterized in that, The step of determining the actual numerical information corresponding to the dialogue request based on the target dimension value includes: The real numerical information that matches the target dimension value in the preset real database is determined as the real numerical information corresponding to the dialogue request; wherein, the real database includes multiple dimension values and the real numerical information corresponding to each dimension value.
5. The method according to claim 1, characterized in that, The step of generating the target response result for the dialogue request based on the actual numerical information includes: The dialogue request, the target dimension value, and the actual numerical information are input into the target model, and the target response generation subtask of the target model outputs the target response result.
6. The method according to claim 1, characterized in that, The target model is a multi-task model, which includes an initial response generation subtask, a dimension recognition subtask, and a target response generation subtask. The target model is obtained through the following steps: Obtain a first training sample for training the initial response generation subtask, a second training sample for training the dimension recognition subtask, and a third training sample for training the target response generation subtask. The initial model is trained separately for the dimension recognition subtask based on the second training sample to obtain an intermediate model; the first loss function during separate training is determined based on the output of the dimension recognition subtask. Based on the first training sample, the second training sample, and the third training sample, the initial response generation subtask, the dimension recognition subtask, and the target response generation subtask of the intermediate model are jointly trained to obtain the target model.
7. The method according to claim 6, characterized in that, The first loss function during individual training is determined based on the output of the dimension-identifying subtask; the joint loss function during joint training is a weighted sum of the first loss function, the second loss function, and the third loss function, wherein the second loss function is determined based on the output of the subtask generated from the initial response, and the third loss function is determined based on the output of the subtask generated from the target response.
8. A response device, characterized in that, include: The determination module is configured to, in response to receiving a user's dialogue request, determine the candidate dimension value corresponding to the target entity information based on the target entity information in the dialogue request, and determine the target historical case corresponding to the dialogue request from a preset historical case library; wherein, the dimension value is used to convert the dialogue content in the dialogue request into standard dimension encoding, and the preset historical case library includes multiple historical dialogue requests and historical cases corresponding to each historical dialogue request, and the historical case includes the dimension value corresponding to the dialogue request and the response result; The output module is used to input the dialogue request, the candidate dimension value, and the target historical case into the target model, and output the target dimension value by the dimension recognition subtask of the target model. The generation module is used to determine the actual numerical information corresponding to the dialogue request based on the target dimension value; and to generate the target response result of the dialogue request based on the actual numerical information.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the response method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the response method as described in any one of claims 1 to 7.