Question and answer processing method and apparatus, electronic device, and storage medium

By combining lightweight and general natural language processing models, the question-and-answer process is optimized, solving the problems of high resource consumption and cost in human-computer dialogue, and improving dialogue efficiency and response speed.

CN118820422BActive Publication Date: 2026-06-23SHENZHEN ZHUIYI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN ZHUIYI TECH CO LTD
Filing Date
2024-06-27
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing technologies in human-computer dialogue suffer from high resource consumption, slow reasoning speed, and high cost due to frequent calls to large natural language processing models and knowledge bases.

Method used

By combining a lightweight language processing model with a general natural language processing model, the processing method is determined through the recognition model, semantic enhancement and scoring are performed, the question-answering process is optimized, and hardware development costs and inference time are reduced.

Benefits of technology

It improves the reasoning efficiency of human-computer dialogue, reduces hardware development costs and reasoning time, and increases response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118820422B_ABST
    Figure CN118820422B_ABST
Patent Text Reader

Abstract

The application provides a question and answer processing method and device, electronic equipment and storage medium. The method comprises: acquiring a user inputted to-be-recognized sentence, recognizing the to-be-recognized sentence, and determining a processing mode of processing the to-be-recognized sentence; if the processing mode is a model combination processing mode, calling a general natural language processing model to perform semantic enhancement processing on the to-be-recognized sentence to obtain an enhanced sentence, and performing scoring processing through a lightweight language processing model to obtain confidence and intent information of the to-be-recognized sentence; if the processing mode is a single model processing mode, calling the lightweight language processing model to perform scoring processing to obtain the confidence and the intent information of the to-be-recognized sentence; and determining a reply sentence of the to-be-recognized sentence based on the general natural language processing model and the lightweight language processing model. Through the cooperation between the general natural language model and the lightweight language processing model, the inference efficiency is improved, and the cost and inference time are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a question-and-answer processing method, apparatus, electronic device, and storage medium. Background Technology

[0002] Currently, in the field of human-computer dialogue, to provide a more intelligent and fluent communication experience, a large language model focused on generating natural language text is widely adopted. In professional domain human-computer dialogue, to compensate for the shortcomings of large dialogue models in specific professional knowledge, a common strategy is to establish a professional domain knowledge base, which is used to store and retrieve relevant professional knowledge.

[0003] In existing technologies, dialogue requires multiple calls to general natural language processing models and knowledge base retrieval, which can easily lead to high resource consumption, slow reasoning speed, and high costs. Summary of the Invention

[0004] The purpose of this application is to address the shortcomings of the prior art by providing a question-and-answer processing method, apparatus, electronic device, and storage medium to improve the accuracy of question-and-answer processing.

[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:

[0006] In a first aspect, embodiments of this application provide a question-and-answer processing method, the method comprising:

[0007] The system obtains the user-inputted statement to be recognized, identifies the statement to be recognized using a recognition model, and determines the processing method for the statement to be recognized.

[0008] If the processing method is a model-based processing method, then a general natural language processing model is called to perform semantic enhancement processing on the statement to be identified to obtain an enhanced statement, and a lightweight language processing model is used to score the enhanced statement to obtain the confidence level and intent information of the statement to be identified. The knowledge base of the general natural language processing model is larger than the knowledge base of the lightweight language processing model.

[0009] If the processing method is a single-model processing method, then the lightweight language processing model is called to score the statement to be identified, and the confidence and intent information of the statement to be identified are obtained.

[0010] Based on the confidence level and intent information of the statement to be identified, the response statement is determined using the general natural language processing model and the lightweight language processing model.

[0011] Optionally, determining the response statement for the statement to be identified based on the confidence level of the statement to be identified, using the general natural language processing model and the lightweight language processing model, includes:

[0012] Based on the confidence level of the statement to be identified and a preset first threshold, determine whether to invoke a lightweight language processing model to determine the response statement of the statement to be identified;

[0013] If so, the lightweight language processing model searches its knowledge base for a target statement that matches the intent information based on the intent information, and uses the answer corresponding to the target statement as the response statement.

[0014] If not, then based on the confidence level of the statement to be identified and the preset second threshold, it is determined whether to call the general natural language processing model to determine the response statement of the statement to be identified;

[0015] If yes, the general natural language processing model outputs a preset rejection response statement and uses it as the response statement to the statement to be identified; if no, the general natural language processing model performs semantic enhancement on the statement to be identified based on the intent information of the statement to be identified to obtain a new enhanced statement, and the lightweight language processing model re-scores the enhanced statement to obtain a new confidence level and new intent information, and then determines the response statement to the statement to be identified based on the new confidence level and new intent information.

[0016] Optionally, determining whether to invoke a lightweight language processing model to determine the response statement of the statement to be identified based on the confidence level of the statement to be identified and a preset first threshold includes:

[0017] If the confidence level is greater than or equal to the first threshold, then it is determined that a lightweight language processing model will be invoked to determine the response statement of the statement to be identified.

[0018] If the confidence level is less than the first threshold, then based on the confidence level of the statement to be identified and the preset second threshold, it is determined whether to call the general natural language processing model to determine the response statement of the statement to be identified.

[0019] Optionally, determining whether to invoke the general natural language processing model to determine the response statement of the statement to be identified based on the confidence level of the statement to be identified and a preset second threshold includes:

[0020] If the confidence level is greater than the second threshold, the general natural language processing model performs semantic enhancement on the statement to be identified again based on the intent information of the statement to be identified, and obtains a new enhanced statement. The lightweight language processing model then scores the enhanced statement again to obtain a new confidence level and new intent information. Finally, the response statement for the statement to be identified is determined based on the new confidence level and new intent information.

[0021] If the confidence level is less than or equal to the second threshold, then the general natural language processing model is invoked to determine the response statement for the statement to be identified.

[0022] Optionally, the step of identifying the statement to be identified through a recognition model and determining the processing method for the statement to be identified includes:

[0023] The sentiment analysis module in the general natural language processing model performs contextual recognition on the statement to be identified to determine user emotion information, which is used to indicate whether the context of the statement to be identified contains user emotion.

[0024] The user profile is identified by the profile recognition module in the general natural language processing model, and the user profile information is determined. The user profile information is used to indicate whether the user belongs to a specific customer group.

[0025] Based on the user's emotion information, the user profile information, and the current service quota information, the processing method for the statement to be identified is determined.

[0026] Optionally, determining the processing method for the statement to be identified based on the user emotion information, the user profile information, and the current service quota information includes:

[0027] If the user emotion information indicates that the context of the statement to be identified contains user emotions and the current service quota information meets the preset conditions, or if the user profile information indicates that the user belongs to a specific customer group and the current service quota information meets the preset conditions, then the processing method is determined to be the model combination processing method; otherwise, the processing method is determined to be the single model processing method.

[0028] Optionally, the step of calling the lightweight language processing model to score the statement to be identified, and obtaining the confidence level and intent information of the statement to be identified, includes:

[0029] The lightweight language processing model performs intent recognition and slot collection on the sentence to be recognized to obtain intent information of the sentence to be recognized.

[0030] The lightweight language processing model scores the statement to be identified based on the intent information of the statement to be identified, thereby obtaining the confidence level of the statement to be identified.

[0031] Secondly, embodiments of this application also provide a question-and-answer processing device, the device comprising:

[0032] The determination module is used to acquire the statement to be recognized input by the user, recognize the statement to be recognized through the recognition model, and determine the processing method for the statement to be recognized.

[0033] An enhancement processing module is used to, if the processing method is a model-based processing method, call a general natural language processing model to perform semantic enhancement processing on the statement to be identified to obtain an enhanced statement, and then use the lightweight language processing model to score the enhanced statement to obtain the confidence level and intent information of the statement to be identified. The knowledge base of the general natural language processing model is larger than the knowledge base of the lightweight language processing model.

[0034] The scoring module is used to call the lightweight language processing model to score the sentence to be identified if the processing method is a single-model processing method, so as to obtain the confidence and intent information of the sentence to be identified.

[0035] The determination module is used to determine the response statement of the statement to be identified based on the confidence level and intent information of the statement to be identified, using the general natural language processing model and the lightweight language processing model.

[0036] Optionally, the determining module is specifically used for:

[0037] Based on the confidence level of the statement to be identified and a preset first threshold, determine whether to invoke a lightweight language processing model to determine the response statement of the statement to be identified;

[0038] If so, the lightweight language processing model searches its knowledge base for a target statement that matches the intent information based on the intent information, and uses the answer corresponding to the target statement as the response statement.

[0039] If not, then based on the confidence level of the statement to be identified and the preset second threshold, it is determined whether to call the general natural language processing model to determine the response statement of the statement to be identified;

[0040] If yes, the general natural language processing model outputs a preset rejection response statement and uses it as the response statement to the statement to be identified; if no, the general natural language processing model performs semantic enhancement on the statement to be identified based on the intent information of the statement to be identified to obtain a new enhanced statement, and the lightweight language processing model re-scores the enhanced statement to obtain a new confidence level and new intent information, and then determines the response statement to the statement to be identified based on the new confidence level and new intent information.

[0041] Optionally, the determining module is specifically used for:

[0042] If the confidence level is greater than or equal to the first threshold, then it is determined that a lightweight language processing model will be invoked to determine the response statement of the statement to be identified.

[0043] If the confidence level is less than the first threshold, then based on the confidence level of the statement to be identified and the preset second threshold, it is determined whether to call the general natural language processing model to determine the response statement of the statement to be identified.

[0044] Optionally, the determining module is specifically used for:

[0045] If the confidence level is greater than the second threshold, the general natural language processing model performs semantic enhancement on the statement to be identified again based on the intent information of the statement to be identified, and obtains a new enhanced statement. The lightweight language processing model then scores the enhanced statement again to obtain a new confidence level and new intent information. Finally, the response statement for the statement to be identified is determined based on the new confidence level and new intent information.

[0046] If the confidence level is less than or equal to the second threshold, then the general natural language processing model is invoked to determine the response statement for the statement to be identified.

[0047] Optionally, the determining module is specifically used for:

[0048] The sentiment analysis module in the general natural language processing model performs contextual recognition on the statement to be identified to determine user emotion information, which is used to indicate whether the context of the statement to be identified contains user emotion.

[0049] The user profile is identified by the profile recognition module in the general natural language processing model, and the user profile information is determined. The user profile information is used to indicate whether the user belongs to a specific customer group.

[0050] Based on the user's emotion information, the user profile information, and the current service quota information, the processing method for the statement to be identified is determined.

[0051] Optionally, the determining module is specifically used for:

[0052] If the user emotion information indicates that the context of the statement to be identified contains user emotions and the current service quota information meets the preset conditions, or if the user profile information indicates that the user belongs to a specific customer group and the current service quota information meets the preset conditions, then the processing method is determined to be the model combination processing method; otherwise, the processing method is determined to be the single model processing method.

[0053] Optionally, the scoring module is specifically used for:

[0054] The lightweight language processing model performs intent recognition and slot collection on the sentence to be recognized to obtain intent information of the sentence to be recognized.

[0055] The lightweight language processing model scores the statement to be identified based on the intent information of the statement to be identified, thereby obtaining the confidence level of the statement to be identified.

[0056] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores program instructions executable by the processor, and when the application runs, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the question-and-answer processing method described in the first aspect above.

[0057] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which is read and executes the steps of the question-and-answer processing method described in the first aspect.

[0058] The beneficial effects of this application are:

[0059] This application provides a question-answering processing method, apparatus, electronic device, and storage medium. After recognizing the statement to be recognized using a recognition model, the processing method for the statement to be recognized can be determined based on the recognition result. If the processing method is a model-integrated processing method, a general natural language model is called for semantic enhancement processing to obtain an enhanced statement, and a lightweight language processing model is used to score the enhanced statement to obtain the confidence and intent information of the statement to be recognized. If the processing method is a single-model processing method, a lightweight language processing model is called to score the statement to be recognized to obtain the confidence and intent information of the statement to be recognized. In the process of determining the confidence and intent information of the statement to be recognized, the general natural language processing model and the lightweight language processing model are mutually integrated. Then, based on the general natural language model and the lightweight language model, the response statement is determined according to the confidence and intent information of the statement to be recognized. In the entire dialogue process, through the collaborative extended semantic understanding between the general natural language model and the lightweight language processing model, the reasoning efficiency is greatly improved, the hardware development cost and reasoning time are reduced, and the response speed of human-computer dialogue is effectively improved. Attached Figure Description

[0060] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments 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.

[0061] Figure 1 A flowchart illustrating a question-and-answer processing method provided in an embodiment of this application;

[0062] Figure 2 A flowchart illustrating another question-and-answer processing method provided in an embodiment of this application;

[0063] Figure 3 A flowchart illustrating another question-and-answer processing method provided in an embodiment of this application;

[0064] Figure 4 A complete flowchart of a question-and-answer processing method provided in this application embodiment;

[0065] Figure 5 A schematic diagram of an apparatus for a question-and-answer processing method provided in an embodiment of this application;

[0066] Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0067] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0068] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0069] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.

[0070] In existing technologies, when using large models for dialogue, semantic enhancement of questions is achieved by incorporating context. Therefore, the large model and knowledge base retrieval are called multiple times throughout the dialogue process. However, while improving dialogue quality, this also presents challenges in terms of computational space and performance costs. Specific issues are as follows:

[0071] First, the resource consumption is enormous: large models have numerous parameters, requiring a large amount of computing resources and storage space during use, which not only increases hardware costs but also increases energy consumption.

[0072] The second reasoning speed is slow: When large models perform reasoning, the computation process is complex, which may lead to slow reasoning speed even on high-performance hardware, making it impossible to achieve real-time feedback.

[0073] Third, the computational cost is high: the inference and prediction process of large-scale language models requires complex calculations such as matrix operations of a large number of parameters and activation functions. This kind of calculation requires extremely high floating-point arithmetic capabilities and places high demands on the parallel computing capabilities of hardware such as central processing units / graphics processors.

[0074] Fourth, the hardware investment and operating costs are huge: In order to support the inference work of large models, a large number of dedicated hardware devices such as graphics processors are often required. This not only leads to extremely high initial hardware investment costs, but also consumes a lot of energy during operation, which greatly increases the overall operation and maintenance costs.

[0075] Optionally, the question-and-answer processing method provided in this application embodiment can be applied to an electronic device, such as a mobile phone, tablet computer, laptop computer, PDA, desktop computer, or other terminal device with computing power and display function, or it can be a server. Specifically, it can be applied to applications in terminal devices, such as mobile phone apps (APPs) and computer application systems.

[0076] The following is a detailed explanation of the specific implementation process of the question-and-answer processing demonstration provided in the embodiments of this application.

[0077] Figure 1 This is a flowchart illustrating a question-and-answer processing method provided in an embodiment of this application. The execution subject of this method is as described above: electronic device. Figure 1 As shown, the method includes:

[0078] S101. Obtain the user-inputted statement to be recognized, and use the recognition model to recognize the statement to be recognized, and determine the processing method for the statement to be recognized.

[0079] The statement to be recognized can be a question input by the user into the electronic device. For example, the user can input "I want to inquire about the points application process," "I want to inquire about the card refund process," or "How can I quickly cancel my account?" Specifically, the user can manually input or select the question on the electronic device's display screen, or input the question via voice, or input the statement to be recognized through other methods.

[0080] Optionally, after a user inputs a sentence to be recognized, a recognition model identifies the input sentence. This recognition model can be a general natural language processing (NLP) model. The NLP model performs an initial recognition of the input sentence, and the processing method for the sentence is determined based on the recognition result. This processing method can include a model combination processing method and a single-model processing method. The model combination method refers to analyzing and processing the sentence using a combination of a general natural language model and a lightweight language processing model. The single-model processing method refers to analyzing and processing the sentence using only a lightweight language processing model.

[0081] Optionally, if the processing method for the statement to be identified is determined to be a model-combined processing method based on the processing result of the recognition model, then S102 is executed below; if the processing method for the statement to be identified is determined to be a single-model processing method based on the processing result of the recognition model, then S103 is executed below.

[0082] S102. Call the natural language processing model to perform semantic enhancement processing on the sentence to be identified, obtain the enhanced sentence, and score the enhanced sentence through a lightweight language processing model to obtain the confidence score and intent information of the sentence to be identified.

[0083] The general-purpose natural language processing (NLP) model has a larger knowledge base than the lightweight language processing (JLP) model. Furthermore, the general-purpose NLP model has a significantly larger number of parameters than the lightweight JLP model; the general-purpose NLP model runs slower than the lightweight JLP model; and the general-purpose NLP model can handle more complex tasks, while the lightweight JLP model can handle simpler tasks.

[0084] Optionally, when it is determined that the processing method for the statement to be identified is the model combination processing method, the general natural language processing model is first called to perform semantic enhancement processing on the statement to be identified to obtain the enhanced statement corresponding to the statement to be identified. Then, the enhanced statement is input into the lightweight language processing model, and the lightweight language processing model scores the enhanced statement to obtain the confidence and intent information of the statement to be identified.

[0085] S103. Call the lightweight language processing model to score the sentence to be recognized, and obtain the confidence level and intent information of the sentence to be recognized.

[0086] Optionally, when it is determined that the processing method for the statement to be recognized is the single-model processing method, the lightweight language model is directly called, and the lightweight language processing model scores the statement to be recognized to obtain the confidence level and intent information of the statement to be recognized.

[0087] Optionally, during the scoring process of the sentence to be identified, the lightweight language processing model will first identify the sentence to be identified to obtain the intent information and confidence level of the sentence. The higher the confidence level of the sentence to be identified, the higher the reliability of the sentence to be identified; the lower the confidence level of the sentence to be identified, the lower the reliability of the sentence to be identified.

[0088] S104. Based on the confidence level and intent information of the statement to be identified, determine the response statement of the statement to be identified using a general natural language processing model and a lightweight language processing model.

[0089] Optionally, after determining the confidence level and intent information of the statement to be identified, the response statement can be determined based on a general natural language processing model and a lightweight language processing model. For example, the response statement can be obtained by combining a general natural language processing model and a lightweight language processing model, or the response statement can be obtained directly through a lightweight language processing model.

[0090] In this embodiment, after the statement to be identified is identified by the recognition model, the processing method for the statement to be identified can be determined based on the recognition result. If the processing method is a model-combined processing method, a general natural language model is called to perform semantic enhancement processing to obtain an enhanced statement, and a lightweight language processing model is used to score the enhanced statement to obtain the confidence and intent information of the statement to be identified. If the processing method is a single-model processing method, a lightweight language processing model is called to score the statement to be identified to obtain the confidence and intent information of the statement to be identified. In the process of determining the confidence and intent information of the statement to be identified, the general natural language processing model and the lightweight language processing model are fused together. Then, based on the confidence and intent information of the statement to be identified, the response statement is determined according to the general natural language model and the lightweight language processing model. In the entire dialogue process, the collaborative extended semantic understanding between the general natural language model and the lightweight language processing model greatly improves the reasoning efficiency, reduces hardware development costs and reasoning time, and effectively improves the response speed of human-computer dialogue.

[0091] Figure 2 This is a flowchart illustrating another question-answering processing method provided in an embodiment of this application. In step S104 above, determining the response statement for the statement to be identified based on the confidence level and intent information of the statement to be identified, using a general natural language processing model and a lightweight language processing model, may include:

[0092] S201. Based on the confidence level of the statement to be identified and the preset first threshold, determine whether to call the lightweight language processing model to determine the response statement of the statement to be identified.

[0093] Optionally, if yes, that is, if it is determined that the lightweight language processing model is invoked, then S202 is executed below; if no, that is, if it is determined that the lightweight language processing model is not invoked, then S203 is executed below.

[0094] The first threshold is greater than the second threshold described below.

[0095] S202. The lightweight language processing model searches for the target statement that matches the intent information of the statement to be identified from the knowledge base of the lightweight language processing model, and takes the answer corresponding to the target statement as the response statement.

[0096] For example, if the statement to be identified is "I want to inquire about the points application process", the intent information of the statement to be identified is "inquire about the points application process", and it can be determined that a lightweight language processing model needs to be called based on the confidence level of the statement to be identified and the first threshold, then the lightweight language processing model searches the knowledge base for a target statement that matches the intent information, such as "points application process". The answer corresponding to the target statement "points application process" can be used as the response statement to the statement to be identified.

[0097] S203. Based on the confidence level of the statement to be identified and the preset second threshold, determine whether to call the general natural language processing model to determine the response statement of the statement to be identified.

[0098] Optionally, if yes, that is, if it is determined that the general natural language processing model is invoked to determine the response statement of the statement to be identified, then S204 is executed below; if no, that is, if the general natural language processing model is not invoked to determine the response statement of the statement to be identified, then S205 is executed below.

[0099] S204. The general natural language processing model outputs a preset rejection response statement and uses the rejection response statement as the response statement to the statement to be identified.

[0100] Specifically, when it is determined, based on the confidence level of the statement to be identified and the preset second threshold, that a general natural language processing model needs to be called to determine the response statement for the statement to be identified, the general natural language processing model outputs a preset rejection response statement, such as "Sorry, please re-enter". This means that the statement to be identified cannot be identified and no response statement corresponding to the statement to be identified can be found. Therefore, the rejection response statement can be used as the response statement for the statement to be identified.

[0101] S205. The general natural language processing model performs semantic enhancement on the sentence to be identified based on the intent information of the sentence to be identified, resulting in a new enhanced sentence. The lightweight language processing model then scores the enhanced sentence again to obtain a new confidence level and new intent information. Finally, the response sentence to be identified is determined based on the new confidence level and new intent information.

[0102] In this embodiment, the sentences to be identified are intelligently diverted to different language processing models to process the corresponding tasks by using different thresholds. Intelligent allocation can balance the performance and effect of sentence processing, improve the dialogue effect and make the cost controllable.

[0103] Optionally, the step S201 above, which determines whether to invoke the lightweight language processing model to determine the response statement based on the confidence level of the statement to be identified and a preset first threshold, may include:

[0104] Optionally, if the confidence level is greater than or equal to the first threshold, then a lightweight language processing model is invoked to determine the response statement for the statement to be identified. That is, when the confidence level of the statement to be identified is greater than or equal to the first threshold, the statement to be identified meets the conditions for a direct response. In this case, there is no need for the intervention of a general natural language processing model; the lightweight language processing model directly determines the response statement for the statement to be identified based on the intent information of the statement to be identified.

[0105] Optionally, if the confidence level is less than the first threshold, then a decision is made based on the confidence level of the statement to be identified and a preset second threshold to determine whether to invoke a general natural language processing model to determine the response statement. Specifically, if the confidence level of the statement to be identified is less than the first threshold, then the difference between the confidence level of the statement to be identified and the second threshold is further assessed to determine whether to invoke a general natural language processing model to determine the response statement.

[0106] Optionally, the step S203 above, which determines whether to invoke a general natural language processing model to determine the response statement of the statement to be identified based on the confidence level of the statement to be identified and a preset second threshold, may include:

[0107] Optionally, if the confidence score is greater than the second threshold, it indicates that the confidence score of the statement to be identified meets the indirect response threshold. In this case, the general natural language processing model is invoked to further enhance the semantic information of the statement to be identified, thereby increasing the original intent score. Specifically, the general natural language processing model performs semantic enhancement on the statement to be identified based on its intent information, resulting in a new enhanced statement. The lightweight language processing model then re-scores the enhanced statement to obtain a new confidence score and new intent information. Finally, the response statement for the statement to be identified is determined based on the new confidence score and new intent information.

[0108] Optionally, if the confidence level is less than or equal to the second threshold, a general natural language processing model is invoked to determine the response statement for the statement to be identified. When the confidence level is less than or equal to the second threshold, it indicates that the confidence level of the statement to be identified meets the low recall rejection threshold, and the general natural language processing model is invoked to output the preset rejection response statement.

[0109] In this embodiment, by setting a first threshold and a second threshold, and determining whether to directly output the response statement of the statement to be identified through a lightweight language processing model based on the confidence level of the statement to be identified and the first threshold; if not, then determining whether to directly output the rejection response statement of the statement to be identified through a general natural language processing model based on the confidence level and the second threshold. In the whole process, large model resources are effectively saved and question-answering efficiency is improved.

[0110] Figure 3 A flowchart illustrating another question-and-answer processing method provided in this application embodiment is shown below. Figure 3 As shown, the process of obtaining the user-inputted statement to be recognized in S101 above, recognizing the statement to be recognized through a recognition model, and determining the processing method for the statement to be recognized may include:

[0111] S301. The sentiment analysis module in the general natural language processing model performs contextual analysis on the sentence to be identified to determine the user's emotional information.

[0112] In this context, user emotion information refers to whether the context of the statement to be identified contains user emotions, such as negative emotions, specifically emotions like "Could you hurry up?" The sentiment analysis module can identify the user's consultation context in the user conversation, perform sentiment analysis, and perceive user emotions, such as whether the user has negative emotions when consulting the statement to be identified.

[0113] S302. The user profile is identified by the profile recognition module in the general natural language processing model, and the user profile information is determined.

[0114] This profile information can refer to whether a user belongs to a specific customer group, such as senior citizens, VIPs, VVIPs, or pregnant women.

[0115] Specifically, user profile information can be determined by tag matching or identification of channels, business, user tag rules, etc.

[0116] S303. Based on user emotion information, user profile information, and current service quota information, determine the processing method for the statement to be identified.

[0117] Optionally, the current service quota information refers to the processor service quota information of the general natural language model. Specifically, the processing method for the sentence to be recognized can be determined using a preset method based on user sentiment information, user profile information, and the current service quota information.

[0118] Optionally, the processing method for the statement to be identified in S303 above, based on user emotion information, user profile information, and current service quota information, may include:

[0119] Optionally, if the user emotion information refers to the context of the statement to be identified containing user emotions and the current service quota information meets preset conditions, or if the user profile information refers to the user belonging to a specific customer group and the current service quota information meets preset conditions, then the processing method for the statement to be identified is determined to be a model-based processing method; otherwise, the processing method for the statement to be identified is determined to be a single-model processing method. Here, the preset conditions may refer to the processor's current service quota information being sufficient to process the statement to be identified.

[0120] In this embodiment, the system adjusts whether to call a general natural language processing model to perform contextual semantic enhancement service in the corresponding scenario based on whether the statement to be identified contains user emotions, whether the user belongs to a specific customer group, and whether the current service quota information meets preset conditions, and determines the specific processing method for the statement to be identified.

[0121] Optionally, the step S103 above, which calls a lightweight language processing model to score the statement to be recognized and obtain the confidence level and intent information of the statement to be recognized, may include:

[0122] Optionally, a lightweight language processing model can perform intent recognition and slot collection on the statement to be recognized to obtain intent information of the statement to be recognized. Then, the lightweight language processing model can score the statement to be recognized based on the intent information of the statement to be recognized to obtain the confidence level of the statement to be recognized.

[0123] Optionally, the scoring process of the lightweight language processing model for enhanced sentences is similar to that for sentences to be recognized, and will not be elaborated here.

[0124] Figure 4 A complete flowchart of a question-and-answer processing method provided in this application embodiment is shown below. Figure 4 As shown, when a user inputs a statement to be recognized, the recognition model first performs contextual and profiling analysis on the statement. If the contextual analysis indicates that the statement contains user emotions and the current service quota information meets preset conditions, or if the profiling analysis indicates that the user belongs to a specific customer group and the current service quota information meets preset conditions, then the general natural language processing model is invoked to perform semantic enhancement on the statement. The enhanced statement is then input into a lightweight language processing model, which scores the enhanced statement to obtain the intent information and confidence level of the statement. If the statement does not contain user emotions, the user does not belong to a specific customer group, and the current service quota information does not meet preset conditions, then the lightweight language processing model directly scores the statement to obtain the confidence level and intent information of the statement.

[0125] Optionally, after determining the intent information and confidence level of the statement to be identified, the response statement can be determined according to a threshold strategy. Specifically, if the confidence level is greater than or equal to a first threshold, a lightweight language processing model is invoked to determine the response statement. If the confidence level is less than the first threshold but greater than a second threshold, a general natural language processing model is used to semantically enhance the statement to be identified based on its intent information, resulting in a new enhanced statement. The lightweight language processing model then re-scores the enhanced statement to obtain a new confidence level and new intent information, and the response statement is re-determined based on the new confidence level and new intent information. If the confidence level is less than or equal to the second threshold, a general natural language processing model is invoked to determine the response statement.

[0126] Figure 5 A schematic diagram of an apparatus for a question-and-answer processing method provided in an embodiment of this application is shown below. Figure 5 As shown, the device includes:

[0127] The determination module 401 is used to acquire the statement to be recognized input by the user, recognize the statement to be recognized through the recognition model, and determine the processing method for the statement to be recognized.

[0128] The enhancement processing module 402 is used to, if the processing method is a model combination processing method, call a general natural language processing model to perform semantic enhancement processing on the statement to be identified to obtain an enhanced statement, and score the enhanced statement through the lightweight language processing model to obtain the confidence and intent information of the statement to be identified. The knowledge base of the general natural language processing model is larger than the knowledge base of the lightweight language processing model.

[0129] The scoring module 403 is used to call the lightweight language processing model to score the statement to be identified if the processing method is a single-model processing method, so as to obtain the confidence and intent information of the statement to be identified.

[0130] The determination module 401 is used to determine the response statement of the statement to be identified based on the confidence level and intent information of the statement to be identified, and based on the general natural language processing model and the lightweight language processing model.

[0131] Optionally, the determination module 401 is specifically used for:

[0132] Based on the confidence level of the statement to be identified and a preset first threshold, determine whether to invoke a lightweight language processing model to determine the response statement of the statement to be identified;

[0133] If so, the lightweight language processing model searches its knowledge base for a target statement that matches the intent information based on the intent information, and uses the answer corresponding to the target statement as the response statement.

[0134] If not, then based on the confidence level of the statement to be identified and the preset second threshold, it is determined whether to call the general natural language processing model to determine the response statement of the statement to be identified;

[0135] If yes, the general natural language processing model outputs a preset rejection response statement and uses it as the response statement to the statement to be identified; if no, the general natural language processing model performs semantic enhancement on the statement to be identified based on the intent information of the statement to be identified to obtain a new enhanced statement, and the lightweight language processing model re-scores the enhanced statement to obtain a new confidence level and new intent information, and then determines the response statement to the statement to be identified based on the new confidence level and new intent information.

[0136] Optionally, the determination module 401 is specifically used for:

[0137] If the confidence level is greater than or equal to the first threshold, then it is determined that a lightweight language processing model will be invoked to determine the response statement of the statement to be identified.

[0138] If the confidence level is less than the first threshold, then based on the confidence level of the statement to be identified and the preset second threshold, it is determined whether to call the general natural language processing model to determine the response statement of the statement to be identified.

[0139] Optionally, the determining module 401 is specifically used for:

[0140] If the confidence level is greater than the second threshold, the general natural language processing model performs semantic enhancement on the statement to be identified again based on the intent information of the statement to be identified, and obtains a new enhanced statement. The lightweight language processing model then scores the enhanced statement again to obtain a new confidence level and new intent information. Finally, the response statement for the statement to be identified is determined based on the new confidence level and new intent information.

[0141] If the confidence level is less than or equal to the second threshold, then the general natural language processing model is invoked to determine the response statement for the statement to be identified.

[0142] Optionally, the determining module 401 is specifically used for:

[0143] The sentiment analysis module in the general natural language processing model performs contextual recognition on the statement to be identified to determine user emotion information, which is used to indicate whether the context of the statement to be identified contains user emotion.

[0144] The user profile is identified by the profile recognition module in the general natural language processing model, and the user profile information is determined. The user profile information is used to indicate whether the user belongs to a specific customer group.

[0145] Based on the user's emotion information, the user profile information, and the current service quota information, the processing method for the statement to be identified is determined.

[0146] Optionally, the determining module 401 is specifically used for:

[0147] If the user emotion information indicates that the context of the statement to be identified contains user emotions and the current service quota information meets the preset conditions, or if the user profile information indicates that the user belongs to a specific customer group and the current service quota information meets the preset conditions, then the processing method is determined to be the model combination processing method; otherwise, the processing method is determined to be the single model processing method.

[0148] Optionally, the scoring module 403 is specifically used for:

[0149] The lightweight language processing model performs intent recognition and slot collection on the sentence to be recognized to obtain intent information of the sentence to be recognized.

[0150] The lightweight language processing model scores the statement to be identified based on the intent information of the statement to be identified, thereby obtaining the confidence level of the statement to be identified.

[0151] Figure 6 This is a structural block diagram of an electronic device 500 provided in an embodiment of this application. For example... Figure 6 As shown, the electronic device may include: a processor 501 and a memory 502.

[0152] Optionally, a bus 503 may also be included, wherein the memory 502 is used to store machine-readable instructions executable by the processor 501. When the electronic device 500 is running, the processor 501 and the memory 502 communicate via the bus 503. When the machine-readable instructions are executed by the processor 501, the method steps in the above method embodiments are performed.

[0153] This application also provides a computer-readable storage medium storing a computer program, which, when run by a processor, executes the method steps described in the question-and-answer processing method embodiments.

[0154] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.

[0155] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.

[0156] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A question-and-answer processing method, characterized in that, The method includes: The system obtains the user-inputted statement to be recognized, identifies the statement to be recognized using a recognition model, and determines the processing method for the statement to be recognized. If the processing method is a model-based processing method, then a general natural language processing model is called to perform semantic enhancement processing on the statement to be identified to obtain an enhanced statement, and a lightweight language processing model is used to score the enhanced statement to obtain the confidence level and intent information of the statement to be identified. The knowledge base of the general natural language processing model is larger than the knowledge base of the lightweight language processing model. If the processing method is a single-model processing method, then the lightweight language processing model is called to score the statement to be identified, and the confidence and intent information of the statement to be identified are obtained. Based on the confidence level and intent information of the statement to be identified, the response statement is determined using the general natural language processing model and the lightweight language processing model, including: Based on the confidence level of the statement to be identified and a preset first threshold, determine whether to invoke a lightweight language processing model to determine the response statement of the statement to be identified; If so, the lightweight language processing model searches its knowledge base for a target statement that matches the intent information based on the intent information, and uses the answer corresponding to the target statement as the response statement. If not, then based on the confidence level of the statement to be identified and the preset second threshold, it is determined whether to call the general natural language processing model to determine the response statement of the statement to be identified; If yes, the general natural language processing model outputs a preset rejection response statement and uses it as the response statement to the statement to be identified; if no, the general natural language processing model performs semantic enhancement on the statement to be identified based on the intent information of the statement to be identified to obtain a new enhanced statement, and the lightweight language processing model re-scores the enhanced statement to obtain a new confidence level and new intent information, and then determines the response statement to the statement to be identified based on the new confidence level and new intent information.

2. The question-and-answer processing method according to claim 1, characterized in that, The step of determining whether to invoke a lightweight language processing model to determine the response statement of the statement to be identified based on the confidence level of the statement to be identified and a preset first threshold includes: If the confidence level is greater than or equal to the first threshold, then it is determined that a lightweight language processing model will be invoked to determine the response statement of the statement to be identified. If the confidence level is less than the first threshold, then based on the confidence level of the statement to be identified and the preset second threshold, it is determined whether to call the general natural language processing model to determine the response statement of the statement to be identified.

3. The question-and-answer processing method according to claim 1, characterized in that, The step of determining whether to invoke the general natural language processing model to determine the response statement of the statement to be identified based on the confidence level of the statement to be identified and a preset second threshold includes: If the confidence level is greater than the second threshold, the general natural language processing model performs semantic enhancement on the statement to be identified again based on the intent information of the statement to be identified, and obtains a new enhanced statement. The lightweight language processing model then scores the enhanced statement again to obtain a new confidence level and new intent information. Finally, the response statement for the statement to be identified is determined based on the new confidence level and new intent information. If the confidence level is less than or equal to the second threshold, then the general natural language processing model is invoked to determine the response statement for the statement to be identified.

4. The question-and-answer processing method according to claim 1, characterized in that, The step of identifying the statement to be identified using a recognition model and determining the processing method for the statement to be identified includes: The sentiment analysis module in the general natural language processing model performs contextual recognition on the statement to be identified to determine user emotion information, which is used to indicate whether the context of the statement to be identified contains user emotion. The user profile is identified by the profile recognition module in the general natural language processing model, and the user profile information is determined. The user profile information is used to indicate whether the user belongs to a specific customer group. Based on the user's emotion information, the user profile information, and the current service quota information, the processing method for the statement to be identified is determined.

5. The question-and-answer processing method according to claim 4, characterized in that, The step of determining the processing method for the statement to be identified based on the user emotion information, the user profile information, and the current service quota information includes: If the user emotion information indicates that the context of the statement to be identified contains user emotions and the current service quota information meets the preset conditions, or if the user profile information indicates that the user belongs to a specific customer group and the current service quota information meets the preset conditions, then the processing method is determined to be the model combination processing method; otherwise, the processing method is determined to be the single model processing method.

6. The question-and-answer processing method according to claim 1, characterized in that, The step of calling the lightweight language processing model to score the statement to be identified, and obtaining the confidence score and intent information of the statement to be identified, includes: The lightweight language processing model performs intent recognition and slot collection on the sentence to be recognized to obtain intent information of the sentence to be recognized. The lightweight language processing model scores the statement to be identified based on the intent information of the statement to be identified, thereby obtaining the confidence level of the statement to be identified.

7. A question-and-answer processing device, characterized in that, include: The determination module is used to acquire the statement to be recognized input by the user, recognize the statement to be recognized through the recognition model, and determine the processing method for the statement to be recognized. An enhancement processing module is used to, if the processing method is a model-based processing method, call a general natural language processing model to perform semantic enhancement processing on the statement to be identified to obtain an enhanced statement, and then use a lightweight language processing model to score the enhanced statement to obtain the confidence level and intent information of the statement to be identified. The knowledge base of the general natural language processing model is larger than the knowledge base of the lightweight language processing model. The scoring module is used to call the lightweight language processing model to score the sentence to be identified if the processing method is a single-model processing method, so as to obtain the confidence and intent information of the sentence to be identified. The determination module is used to determine the response statement of the statement to be identified based on the confidence level and intent information of the statement to be identified, and based on the general natural language processing model and the lightweight language processing model. The determining module is specifically used for: Based on the confidence level of the statement to be identified and a preset first threshold, determine whether to invoke a lightweight language processing model to determine the response statement of the statement to be identified; If so, the lightweight language processing model searches its knowledge base for a target statement that matches the intent information based on the intent information, and uses the answer corresponding to the target statement as the response statement. If not, then based on the confidence level of the statement to be identified and the preset second threshold, it is determined whether to call the general natural language processing model to determine the response statement of the statement to be identified; If yes, the general natural language processing model outputs a preset rejection response statement and uses it as the response statement to the statement to be identified; if no, the general natural language processing model performs semantic enhancement on the statement to be identified based on the intent information of the statement to be identified to obtain a new enhanced statement, and the lightweight language processing model re-scores the enhanced statement to obtain a new confidence level and new intent information, and then determines the response statement to the statement to be identified based on the new confidence level and new intent information.

8. An electronic device, characterized in that, The method includes a memory and a processor, wherein the memory stores a computer program executable by the processor, and the processor executes the computer program to implement the steps of the question-and-answer processing method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the question-and-answer processing method as described in any one of claims 1-6.