Large model question and answer optimization system and method combining performance function and slot filling

Through a large-model Q&A optimization system combining functional functions and slot filling, the problem of insufficient answer accuracy and consistency of large language models in the Q&A system is solved, and more accurate user intention understanding and more professional answers are achieved, improving user experience and Q&A effects.

CN119557410AActive Publication Date: 2025-03-04DIGITAL HEALTH CHINA TECHNOLOGIES CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510122166.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-26
Publication Date
2025-03-04
Estimated Expiration
2045-01-26

AI Technical Summary

Technical Problem

The existing large language model has problems in the question-and-answer system with insufficient answer accuracy, consistency and complex problem processing capabilities, especially when the answers to professional questions and slot filling are inaccurate and the inefficient function call.

Method used

A large-scale Q&A optimization system combining functional functions and slot filling, through user intention analysis modules, intention matching judgment modules, slot filling processing modules, function function processing modules and Q&A display modules, identify and fill key information in the query, and call corresponding functional functions or execute specific logic to complete tasks.

Benefits of technology

It effectively solves the problems in the question of the large language model that is stubborn in the Q&A system and repeatedly answers incorrectly for the same question, so that the large model can more accurately understand the user's intentions, provide more professional and coherent answers, and improves the user experience and overall Q&A effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557410A_ABST
    Figure CN119557410A_ABST
Patent Text Reader

Abstract

The invention discloses a large model question and answer optimization system and method combining a performance function and slot filling, and the method comprises the steps: recognizing and filling key information (such as time, place, figure and the like) in a query through slot filling, and combining with a query intention to call a corresponding performance function or execute a specific logic to complete a task. The problem that the intention of the user cannot be understood due to the fact that the user insists on the own and repeatedly makes the same wrong answer for multiple questions of the same question in the application scene of the existing large language model is effectively solved, so that the intention of the user can be more accurately understood when the large model processes the questions of the user; according to the method and the device, the questions of the user can be answered by calling the performance function more professionally, continuity and consistency can be kept in multiple rounds of questions and answers, smoother user experience is provided, and the overall questions and answers effect is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of intelligent question answering systems, and specifically relates to a large-model question answering optimization system and method combining functional functions and slot filling. Background Art

[0002] Human-computer interaction is the science of studying the interactive relationship between systems and users. Systems can be various machines or computerized systems and software. Various artificial intelligence systems can be realized through human-computer interaction, such as intelligent customer service systems, voice control systems, large models, etc.; FAQ is a standard system for most products, which helps users find problems themselves to reduce the cost of manual customer service. The common FAQ system on the market is the question-and-answer FAQ system. In a chat dialog box, users directly ask questions, and the system provides an answer to a similar question based on keywords or the latest similarity algorithm. Among them, the Large Language Model (LLM, also known as the large model) has become one of the core technologies in the field of natural language processing. These models can capture rich language rules and knowledge information by training on large-scale text data, so they have powerful natural language understanding and generation capabilities and are widely used in various question-and-answer systems.

[0003] However, although large language models have achieved remarkable results in many natural language processing tasks, their performance in question-answering systems, especially in answering professional questions, still needs to be improved. This is because traditional question-answering systems usually rely on manually designed rules or specific knowledge bases to answer questions, while large language models try to automatically learn the ability to answer questions from massive amounts of text data. This difference leads to some challenges for large language models in question-answering systems, such as the accuracy and consistency of answers and the ability to handle complex questions. In addition, general large language models have not been trained for a certain field or usage scenario, so general large language models cannot generate answers that meet user requirements in segmented fields. In addition, in existing systems, when processing complex queries, they often face problems such as inaccurate slot filling and inefficient function calls, resulting in an unsmooth question-answering process and a poor user experience. Summary of the invention

[0004] In view of the above-mentioned deficiencies in the prior art, the present application provides a large-model question-answering optimization system and method that combines functional functions and slot filling.

[0005] In the first aspect, the present application proposes a large-model question-answering optimization system combining functional functions and slot filling, including a user intent analysis module, an intent matching judgment module, a slot filling processing module, a functional function processing module, and a question-answering display module:

[0006] The user intention analysis module is used to build an intention intelligent analysis model and obtain the question description information input by the user, input the question description information into the intention intelligent analysis model to perform user intention analysis and calculation, and obtain the intention intelligent judgment result;

[0007] The intention matching judgment module is used to compare the intention intelligent judgment result with the preset intention type in the intention library to determine whether it matches the preset intention type in the intention library. When the match is successful, it means that the preset intention is hit, and the processing flow of the slot filling processing module is executed. When the match fails, it means that the preset intention is not hit, and the processing flow of the function function processing module is executed;

[0008] The slot filling processing module is used to enable the slot pool and call the slot template that matches the preset intent type, fill the slot according to the content to be filled in the slot template, and generate a first type of optimized response statement adapted to the problem description information according to the filling result;

[0009] The function processing module is used to call the preset corresponding function according to the intention intelligent judgment result, parse the problem description information according to the function function, input the parsed information into the big model for keyword extraction, and generate a second type of optimized response statement suitable for the problem description information based on the keyword extraction result;

[0010] The question and answer display module is used to display the first type of optimized response statements and the second type of optimized response statements to the user.

[0011] In some optional implementations of some embodiments, the user intent analysis module includes an intent intelligent analysis model construction unit, which is used to construct the intent intelligent analysis model through an embedding layer, a self-att layer, a FeedForward layer and a Layernorm layer, expressed as:

[0012] y=hidden+MLP(LayerNorm(hidden))+Attention(LayerNorm(hidden))

[0013] Among them, the calculation of the embedding layer is:

[0014]

[0015] Among them, x is the id obtained by mapping each character into the vocabulary, A is the weight matrix of the embedding layer, b is the bias matrix of the embedding layer, hidden represents the result obtained after the current input data passes through the embedding layer, and then hidden passes through the self-att layer and FeedForward layer respectively. Attention() represents the calculation process of the self-att layer, MLP() represents the calculation process of the FeedForward layer, LayerNorm() represents the normalization of hidden, and y represents the result of intelligent judgment of intent.

[0016] In some optional implementations of some embodiments, the user intent analysis module further includes an intelligent analysis and judgment unit, which is used to input the problem description information into the intent intelligent analysis model to perform user intent analysis calculation, including the calculation process of the self-att layer:

[0017] The input hidden is first normalized by the layernorm layer:

[0018] The calculation of the layernorm layer is:

[0019]

[0020] in, Represents the mean of the current input data, Represents the variance of the input data hidden, is a hyperparameter to prevent the denominator from being 0, and its value is 0.0001. represents the weight matrix of the LN layer, and β represents the bias weight of the LN layer;

[0021] The output of the layernorm layer passes through three linear layers to obtain different vector representations: q, k, v:

[0022]

[0023] in, is the output result after the layernorm layer, , 2, 3 are the weight matrices of the query layer, key layer, and value layer, respectively; b1, b2, and b3 are the bias matrices of the query layer, key layer, and value layer, respectively;

[0024] Next, calculate the self-attention for q, k, and v:

[0025]

[0026] Where m and n represent the mth and nth characters respectively; d is a custom hyperparameter, exp is an exponential function with the natural constant e as the base, and N represents the character length of the current text. is the attention score between the mth character and the nth character, is the attention score matrix of the current mth character and all the characters in the current text, and the attention score matrix of all characters is saved as hidden;

[0027] It also includes the calculation process of the FeedForward layer:

[0028] The input hidden is first normalized by the layernorm layer:

[0029] The calculation of the layernorm layer is:

[0030]

[0031] Among them, hidden represents the current input data, Represents the mean of the current input data, Represents the variance of the input data hidden, is a hyperparameter to prevent the denominator from being 0, and its value is 0.0001. represents the weight matrix of the LN layer, and β represents the bias weight of the LN layer;

[0032] Next, the calculation of the FeedForward layer is performed:

[0033]

[0034] Among them, the calculation formula of the GeLU activation function is:

[0035]

[0036] Among them, tanh is the activation function, and the formula is:

[0037]

[0038] in, is the output result after the layernorm layer, , 2 are different weight matrices, b1 and b2 are different bias matrices, Calculate the final output for the multi-head matrix calculation layer, Represents the calculation output of the first layer network of the FeedForward layer, Represents the calculation output of the intermediate activation function layer of the FeedForward layer.

[0039] In some optional implementations of some embodiments, obtaining the intention intelligent judgment result by the intelligent analysis and judgment unit includes:

[0040] After the FeedForward layer is calculated, it is calculated by the softmax layer. The softmax layer represents the normalization layer and is calculated as:

[0041]

[0042] Represents the final output of the softmax layer. represent An exponential function with the natural constant e as the base, i and j represent the i-th and j-th inputs respectively, and ∑ represents accumulation;

[0043] The calculation result of the softmax layer is a matrix with the same dimension as the number of intent categories. The index with the largest value in the matrix is ​​selected, and the corresponding intent is found in the list of intent categories using the index to obtain the intent value predicted by the model, which corresponds to the intelligent judgment result of the intent.

[0044] In some optional implementations of some embodiments, the intention matching judgment module includes an intention library construction unit and an intention matching unit;

[0045] The intent library construction unit is used to preset multiple intent types according to business scenarios, save the preset intent types and name them as intent libraries, and complete the intent library construction;

[0046] The intention matching unit is used to match the intention intelligent judgment result with the information in the intention library through preset matching rules. If the match is successful, it means that the preset intention is hit; if the match fails, it means that the preset intention is not hit.

[0047] In some optional implementations of some embodiments, the slot filling processing module includes: a slot template calling unit, a slot preliminary filling unit, a filling completeness judgment unit, a first type of rhetorical question sentence construction unit, and a first type of reply sentence construction unit;

[0048] The slot template calling unit is used to enable the slot pool and call the slot template matching the preset intent type;

[0049] The slot preliminary filling unit is used to call the large model to extract keywords from the problem description information according to the content to be filled in the slot template by means of prompt word extraction, input the extracted keywords into the large model to extract key information, and supplement the slots in the slot template according to the key information extraction results to obtain a preliminary filling result;

[0050] The filling completeness judgment unit is used to judge whether the key information in the slot is missing according to the preliminary filling result, and if it is missing, execute the first type of rhetorical question input unit; if it is not missing, execute the first type of reply sentence input unit;

[0051] The first type of rhetorical question sentence construction unit is used to construct a question sentence for the missing information and ask the user a rhetorical question when it is determined that the key information in the slot is still missing after being supplemented;

[0052] The first type of reply statement construction unit is used to directly input the supplemented slot template information into the large model for direct reply when it is determined that the key information in the slot has been supplemented.

[0053] In some optional implementations of some embodiments, the function processing module includes a function encapsulation unit, a search and analysis unit, and a second type of optimized response statement construction unit:

[0054] The function encapsulation unit is used to encapsulate various query functions into functions called by API in advance and store them in the storage repository;

[0055] The search and analysis unit is used to call the big model and extract keywords from the problem description information by means of prompt word extraction, input the extracted keywords into the big model to extract key information, and parse the problem description information according to the key information extraction result to obtain the search and analysis result;

[0056] The second type of optimized response statement construction unit is used to select a corresponding function function from the repository to make an API call according to the search and analysis results, extract parsing information from the search and analysis results according to the called function function, convert the parsing information extraction results into natural language through the large model, and generate a second type of optimized response statement according to the converted natural language.

[0057] In some optional implementations of some embodiments, the functional function processing module further includes a request construction sending unit and a response receiving parsing unit;

[0058] The request construction and sending unit is used to construct a request that meets the requirements of the corresponding API according to the key information extracted from the search and analysis results, including setting the request header, request method, request body and URL parameters; and send the constructed request to the corresponding API server through the HTTP protocol;

[0059] The response receiving and parsing unit is used to process and return a response containing key information in the search and parsing result after the API server receives the request, return the result data in json format, parse the result data, and extract information corresponding to the search and parsing result.

[0060] In a second aspect, the present application proposes a large model question answering optimization method combining functional functions and slot filling, comprising the following steps:

[0061] Construct an intention intelligent analysis model and obtain the question description information input by the user, input the question description information into the intention intelligent analysis model to perform user intention analysis and calculation, and obtain the intention intelligent judgment result;

[0062] The intention intelligent judgment result is compared with the preset intention type in the intention library to determine whether it matches the preset intention type in the intention library. When the match is successful, it means that the preset intention is hit, and the slot filling process is executed. When the match fails, it means that the preset intention is not hit, and the function function process is executed;

[0063] Enable the slot pool and call the slot template that matches the preset intent type, fill the slot according to the content to be filled in the slot template, and generate a first type of optimized response statement that is suitable for the problem description information according to the filling result;

[0064] Calling a preset corresponding function according to the intention intelligent judgment result, parsing the problem description information according to the function function, inputting the parsed information into the big model for keyword extraction, and generating a second type of optimized response statement suitable for the problem description information based on the keyword extraction result;

[0065] The first type of optimized response statements and the second type of optimized response statements are displayed to the user.

[0066] In a third aspect, the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0067] Beneficial effects of the present invention:

[0068] The present invention identifies and fills in key information in the query (such as time, place, person, etc.) through slot filling, and calls corresponding function or executes specific logic to complete the task in combination with the query intent, effectively solving the problems often seen in existing large language model application scenarios, such as stubbornly insisting on one's own opinions, repeatedly giving the same wrong answers to multiple questions of the same question, and failing to understand the user's intent. The present invention enables the large model to more accurately understand the user's intent when processing user questions, and to more professionally call function functions to answer the user's questions, and to maintain coherence and consistency in multiple rounds of question and answer, thereby providing a smoother user experience and optimizing the overall question and answer effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 This is the system schematic diagram of this device.

[0070] Figure 2 It is the overall flow chart of the present invention. DETAILED DESCRIPTION

[0071] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein; on the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0072] In the first aspect, the present application proposes a large model question answering optimization system combining functional functions and slot filling, such as Figure 1 As shown, it includes a user intent analysis module, an intent matching judgment module, a slot filling processing module, a function processing module and a question and answer display module:

[0073] The user intention analysis module is used to build an intention intelligent analysis model and obtain the question description information input by the user, input the question description information into the intention intelligent analysis model to perform user intention analysis and calculation, and obtain the intention intelligent judgment result;

[0074] The intention matching judgment module is used to compare the intention intelligent judgment result with the preset intention type in the intention library to determine whether it matches the preset intention type in the intention library. When the match is successful, it means that the preset intention is hit, and the processing flow of the slot filling processing module is executed. When the match fails, it means that the preset intention is not hit, and the processing flow of the function function processing module is executed;

[0075] The slot filling processing module is used to enable the slot pool and call the slot template that matches the preset intent type, fill the slot according to the content to be filled in the slot template, and generate a first type of optimized response statement adapted to the problem description information according to the filling result;

[0076] The function processing module is used to call the preset corresponding function according to the intention intelligent judgment result, parse the problem description information according to the function function, input the parsed information into the big model for keyword extraction, and generate a second type of optimized response statement suitable for the problem description information based on the keyword extraction result;

[0077] The question and answer display module is used to display the first type of optimized response statements and the second type of optimized response statements to the user.

[0078] In some optional implementations of some embodiments, the user intent analysis module includes an intent intelligent analysis model construction unit, which is used to construct the intent intelligent analysis model through an embedding layer, a self-att layer, a FeedForward layer and a Layernorm layer, expressed as:

[0079] y=hidden+MLP(LayerNorm(hidden))+Attention(LayerNorm(hidden))

[0080] Among them, the calculation of the embedding layer is:

[0081]

[0082] Among them, x is the id obtained by mapping each character into the vocabulary, A is the weight matrix of the embedding layer, b is the bias matrix of the embedding layer, hidden represents the result obtained after the current input data passes through the embedding layer, and then hidden passes through the self-att layer and FeedForward layer respectively. Attention() represents the calculation process of the self-att layer, MLP() represents the calculation process of the FeedForward layer, LayerNorm() represents the normalization of hidden, and y represents the result of intelligent judgment of intent.

[0083] In some optional implementations of some embodiments, the user intent analysis module further includes an intelligent analysis and judgment unit, which is used to input the problem description information into the intent intelligent analysis model to perform user intent analysis calculation, including the calculation process of the self-att layer:

[0084] The input hidden is first normalized by the layernorm layer:

[0085] The calculation of the layernorm layer is:

[0086]

[0087] in, Represents the mean of the current input data, Represents the variance of the input data hidden, is a hyperparameter to prevent the denominator from being 0, and its value is 0.0001. represents the weight matrix of the LN layer, and β represents the bias weight of the LN layer;

[0088] The output of the layernorm layer passes through three linear layers to obtain different vector representations: q, k, v:

[0089]

[0090] in, is the output result after the layernorm layer, , 2, 3 are the weight matrices of the query layer, key layer, and value layer, respectively; b1, b2, and b3 are the bias matrices of the query layer, key layer, and value layer, respectively;

[0091] Next, calculate the self-attention for q, k, and v:

[0092]

[0093] Where m and n represent the mth and nth characters respectively; d is a custom hyperparameter, exp is an exponential function with the natural constant e as the base, and N represents the character length of the current text. is the attention score between the mth character and the nth character, is the attention score matrix of the current mth character and all the characters in the current text, and the attention score matrix of all characters is saved as hidden;

[0094] It also includes the calculation process of the FeedForward layer:

[0095] The input hidden is first normalized by the layernorm layer:

[0096] The calculation of the layernorm layer is:

[0097]

[0098] Among them, hidden represents the current input data, Represents the mean of the current input data, Represents the variance of the input data hidden, is a hyperparameter to prevent the denominator from being 0, and its value is 0.0001. represents the weight matrix of the LN layer, and β represents the bias weight of the LN layer;

[0099] Next, the calculation of the FeedForward layer is performed:

[0100]

[0101] Among them, the calculation formula of the GeLU activation function is:

[0102]

[0103] Among them, tanh is the activation function, and the formula is:

[0104]

[0105] in, is the output result after the layernorm layer, , 2 are different weight matrices, b1 and b2 are different bias matrices, Calculate the final output for the multi-head matrix calculation layer, Represents the calculation output of the first layer network of the FeedForward layer, Represents the calculation output of the intermediate activation function layer of the FeedForward layer.

[0106] In some optional implementations of some embodiments, obtaining the intention intelligent judgment result by the intelligent analysis and judgment unit includes:

[0107] After the FeedForward layer is calculated, it is calculated by the softmax layer. The softmax layer represents the normalization layer and is calculated as:

[0108]

[0109] Represents the final output of the softmax layer. represent An exponential function with the natural constant e as the base, i and j represent the i-th and j-th inputs respectively, and ∑ represents accumulation;

[0110] The calculation result of the softmax layer is a matrix with the same dimension as the number of intent categories. The index with the largest value in the matrix is ​​selected, and the corresponding intent is found in the list of intent categories using the index to obtain the intent value predicted by the model, which corresponds to the intelligent judgment result of the intent.

[0111] In some optional implementations of some embodiments, the intention matching judgment module includes an intention library construction unit and an intention matching unit;

[0112] The intent library construction unit is used to preset multiple intent types according to business scenarios, save the preset intent types and name them as intent libraries, and complete the intent library construction;

[0113] The intention matching unit is used to match the intention intelligent judgment result with the information in the intention library through preset matching rules. If the match is successful, it means that the preset intention is hit; if the match fails, it means that the preset intention is not hit.

[0114] The matching process between the intent recognition result and the intent library can be achieved in the following ways:

[0115] 1. Matching based on vector similarity: First, the intent intelligent judgment result and the intent in the intent library are expressed as vectors (for example, through word embedding models such as BERT or Word2Vec). Then the similarity between the intent intelligent judgment result vector and each intent vector in the intent library is calculated (such as cosine similarity, Mahalanobis distance, etc.). The match is determined based on the similarity score. If the similarity score is higher than the preset threshold, the intent intelligent judgment result is considered to hit an intent in the intent library; otherwise, it is considered to miss.

[0116] 2. Matching based on text matching: Directly match the intent intelligent judgment result with the text in the intent library. You can use a text matching model (such as TextCNN, Transformer, etc.) to calculate the similarity between the two. If the matching degree is higher than the set threshold, it is considered that the intent intelligent judgment result successfully matches an intent in the intent library; otherwise, it is not a hit. 3. Keyword matching: Extract keywords from the results of intelligent intent judgment and match them with the preset keywords in the intent library. If the keywords in the results of intelligent intent judgment are consistent with or highly relevant to the keywords in the intent library, the match is considered successful; otherwise, it is a miss.

[0117] In some optional implementations of some embodiments, the slot filling processing module includes: a slot template calling unit, a slot preliminary filling unit, a filling completeness judgment unit, a first type of rhetorical question sentence construction unit, and a first type of reply sentence construction unit;

[0118] The slot template calling unit is used to enable the slot pool and call the slot template matching the preset intent type;

[0119] The slot preliminary filling unit is used to call the large model to extract keywords from the problem description information according to the content to be filled in the slot template by means of prompt word extraction, input the extracted keywords into the large model to extract key information, and supplement the slots in the slot template according to the key information extraction results to obtain a preliminary filling result;

[0120] When a preset intent is hit: call the slot pool and select the slot template corresponding to the current hit intent. The example of the hit slot template is as follows:

[0121] "Book movie tickets": {

[0122] "Movie Name":__,

[0123] "Cinema Name":_,

[0124] "time":_

[0125] "quantity":_,

[0126] "Seating Location":_,

[0127] }

[0128] Next, the big model is called to extract keywords from the user's query (question description information) through prompts according to the content that needs to be filled in the slots. The constructed prompts for the input big model are:

[0129] "The query currently entered by the user is: Book a ticket for XX (movie name) for this afternoon's show. Please extract the following information from this query: "movie name", "cinema name", "time", "quantity", "seat location"".

[0130] Input the defined keyword extraction prompt into the large model to extract key information. Then, supplement the slots in the slot template according to the extraction results. Determine whether to ask the user a question based on the supplemented information.

[0131] The filling completeness judgment unit is used to judge whether the key information in the slot is missing according to the preliminary filling result, and if it is missing, execute the first type of rhetorical question input unit; if it is not missing, execute the first type of reply sentence input unit;

[0132] Among them, judging whether the key information in the slot is missing after being supplemented can be achieved through the following methods:

[0133] 1. Integrity check based on slot template:

[0134] Slot templates usually preset key information fields that need to be filled. After filling in the key information, you can check whether these fields are correctly filled to determine whether there are any missing fields. For example, if a slot template contains multiple fields (such as time, location, person, etc.), you need to check whether these fields are filled one by one.

[0135] 2. Confidence in model predictions:

[0136] During the slot filling process, the confidence of the model output can be used to determine whether the information is complete. For example, if the confidence of a slot is lower than the preset threshold, it is considered that the slot information may be incomplete. This method relies on the predictive ability of the model and is usually implemented in combination with deep learning models (such as BERT, CNN, etc.).

[0137] 3. Rule-based checking:

[0138] The slot information is judged to be complete by using preset rules. For example, if a field in the slot template is required but the model fails to extract relevant information, the field is considered missing. This method is simple and efficient, but it depends on the completeness of the rules.

[0139] The first type of rhetorical question sentence construction unit is used to construct a question sentence for the missing information and ask the user a rhetorical question when it is determined that the key information in the slot is still missing after being supplemented;

[0140] The first type of reply statement construction unit is used to directly input the supplemented slot template information into the large model for direct reply when it is determined that the key information in the slot has been supplemented.

[0141] In some optional implementations of some embodiments, the function processing module includes a function encapsulation unit, a search and analysis unit, and a second type of optimized response statement construction unit:

[0142] The function encapsulation unit is used to encapsulate various query functions into functions called by API in advance and store them in the storage repository;

[0143] The search and analysis unit is used to call the big model and extract keywords from the problem description information by means of prompt word extraction, input the extracted keywords into the big model to extract key information, and parse the problem description information according to the key information extraction result to obtain the search and analysis result;

[0144] The second type of optimized response statement construction unit is used to select a corresponding function function from the repository to make an API call according to the search and analysis results, extract parsing information from the search and analysis results according to the called function function, convert the parsing information extraction results into natural language through the large model, and generate a second type of optimized response statement according to the converted natural language.

[0145] When the preset intent is not hit: various functions such as querying air index, querying temperature, hot spot search, etc. are pre-packaged into functions that can be called through the API as preset function functions and stored in the repository. When the intent extracted by the large model does not hit the preset intent, we perform keyword matching to determine whether it hits the preset function function in the repository. Suppose the user input is: "How is the air index in Tianjin today?"

[0146] 1. When a function in the repository is hit, the input is parsed first. By building a prompt, the large model is used to obtain the keywords in the input query and extract key information from the text, that is, "Tianjin" as the location and "today" as the time. In addition, the previously identified intent: "Query the air index" is used as the output of the analysis;

[0147] 2. Determine the calling function or API

[0148] The large model selects the "Air Index Query" API interface in the repository according to the "Query Air Index" in the parsing result, and decides that an air index query API needs to be called to obtain data.

[0149] 3. Construct a request and call the API

[0150] ① Construction request

[0151] The big model constructs a request that meets the requirements of the Air Index API based on the extracted key information (location and time). This usually includes setting the request header (such as Content-Type), request method (such as GET or POST), request body (for POST requests), and URL parameters (such as location and time as query parameters).

[0152] For example, the constructed URL could be:

[0153] “https: / / api.weather.com / data / 2.5 / weather?q=tianjin&appid=YOUR_API_KEY&units=metric&lang=zh_cn”

[0154] ②Send request

[0155] The big model sends the constructed request to the server of the Air Index API through the HTTP protocol (GET or POST request).

[0156] 4. Handle API responses

[0157] ① Receive response

[0158] After receiving the request, the Air Index API server processes and returns a response containing the Air Index information. The result data is returned in JSON format.

[0159] ②Analysis response

[0160] The large model parses the response data and extracts the air index information that users are concerned about, such as temperature, humidity, wind direction, etc.

[0161] 5. Generate a response

[0162] The parsed air index information is used to construct a prompt word and input it into the big model. The big model converts the parsed air index information into natural language and generates an easy-to-understand second-class optimized response sentence, such as: "Today's weather in Tianjin is sunny, the temperature is 30°C, the humidity is 60%, and the southwest wind is level 2.

[0163] In some optional implementations of some embodiments, the functional function processing module further includes a request construction sending unit and a response receiving parsing unit;

[0164] The request construction and sending unit is used to construct a request that meets the requirements of the corresponding API according to the key information extracted from the search and analysis results, including setting the request header, request method, request body and URL parameters; and send the constructed request to the corresponding API server through the HTTP protocol;

[0165] The response receiving and parsing unit is used to process and return a response containing key information in the search and parsing result after the API server receives the request, and return the result data in JSON format;

[0166] The result data is parsed to extract information corresponding to the search and analysis result.

[0167] In the second aspect, the present application proposes a large model question answering optimization method combining functional functions and slot filling, such as Figure 2 As shown, the following steps are included;

[0168] S100: construct an intention intelligent analysis model and obtain question description information input by the user, input the question description information into the intention intelligent analysis model to perform user intention analysis and calculation, and obtain an intention intelligent judgment result;

[0169] S200: Compare the intention intelligent judgment result with the preset intention type in the intention library to determine whether it matches the preset intention type in the intention library. When the match is successful, it means that the preset intention is hit, and the slot filling process is executed. When the match fails, it means that the preset intention is not hit, and the function function process is executed;

[0170] S300: Activate a slot pool and call a slot template that matches a preset intent type, fill the slot according to the content to be filled in the slot template, and generate a first type of optimized response statement that is suitable for the problem description information according to the filling result;

[0171] S400: calling a preset corresponding function according to the intention intelligent judgment result, parsing the problem description information according to the function, inputting the parsed information into the big model for keyword extraction, and generating a second type of optimized response sentence suitable for the problem description information based on the keyword extraction result;

[0172] S500: Displaying the first-type optimized response statements and the second-type optimized response statements to the user.

[0173] In a third aspect, the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0174] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0175] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0176] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this disclosure.

[0177] In the embodiments provided in the present disclosure, it should be understood that the disclosed apparatus / computer equipment and methods can be implemented in other ways. For example, the apparatus / computer equipment embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. Multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection of the apparatus or unit, which may be electrical, mechanical or other forms.

[0178] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0179] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0180] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present disclosure implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.

[0181] The above are only preferred implementations of the present invention. It should be pointed out that a number of modifications and improved technical solutions made by those skilled in the art without departing from the technical solution should also be deemed to fall within the scope of protection required by the claims.

Claims

1. A large-model question-answering optimization system combining functional functions and slot filling, characterized by: It includes user intention analysis module, intention matching judgment module, slot filling processing module, function processing module and question and answer display module: The user intention analysis module is used to build an intention intelligent analysis model and obtain the question description information input by the user, input the question description information into the intention intelligent analysis model to perform user intention analysis and calculation, and obtain the intention intelligent judgment result; The intention matching judgment module is used to compare the intention intelligent judgment result with the preset intention type in the intention library to determine whether it matches the preset intention type in the intention library. When the match is successful, it means that the preset intention is hit, and the processing flow of the slot filling processing module is executed. When the match fails, it means that the preset intention is not hit, and the processing flow of the function function processing module is executed; The slot filling processing module is used to enable the slot pool and call the slot template that matches the preset intent type, fill the slot according to the content to be filled in the slot template, and generate a first type of optimized response statement adapted to the problem description information according to the filling result; The function processing module is used to call the preset corresponding function according to the intention intelligent judgment result, parse the problem description information according to the function function, input the parsed information into the big model for keyword extraction, and generate a second type of optimized response statement suitable for the problem description information based on the keyword extraction result; The question and answer display module is used to display the first type of optimized response statements and the second type of optimized response statements to the user.

2. The system according to claim 1, characterized in that: The user intention analysis module includes an intention intelligent analysis model construction unit, which is used to construct the intention intelligent analysis model through an embedding layer, a self-att layer, a FeedForward layer, and a Layernorm layer, which is expressed as: y=hidden+MLP(LayerNorm(hidden))+Attention(LayerNorm(hidden)) Among them, the calculation of the embedding layer is: Among them, x is the id obtained by mapping each character into the vocabulary, A is the weight matrix of the embedding layer, b is the bias matrix of the embedding layer, hidden represents the result obtained after the current input data passes through the embedding layer, and then hidden passes through the self-att layer and FeedForward layer respectively. Attention() represents the calculation process of the self-att layer, MLP() represents the calculation process of the FeedForward layer, LayerNorm() represents the normalization of hidden, and y represents the result of intelligent judgment of intent.

3. The system according to claim 2, characterized in that: The user intention analysis module also includes an intelligent analysis and judgment unit, which is used to input the problem description information into the intention intelligent analysis model to perform user intention analysis calculation, including the calculation process of the self-att layer: The input hidden is first normalized by the layernorm layer: The calculation of the layernorm layer is: in, Represents the mean of the current input data, Represents the variance of the input data hidden, is a hyperparameter to prevent the denominator from being 0, and its value is 0.0001. represents the weight matrix of the LN layer, and β represents the bias weight of the LN layer; The output of the layernorm layer passes through three linear layers to obtain different vector representations: q, k, v: in, is the output result after the layernorm layer, , 2, 3 are the weight matrices of the query layer, key layer, and value layer, respectively; b1, b2, and b3 are the bias matrices of the query layer, key layer, and value layer, respectively; Next, calculate the self-attention for q, k, and v: Where m and n represent the mth and nth characters respectively; d is a custom hyperparameter, exp is an exponential function with the natural constant e as the base, and N represents the character length of the current text. is the attention score between the mth character and the nth character, is the attention score matrix of the current mth character and all the characters in the current text, and the attention score matrix of all characters is saved as hidden; It also includes the calculation process of the FeedForward layer: The input hidden is first normalized by the layernorm layer: The calculation of the layernorm layer is: Among them, hidden represents the current input data, Represents the mean of the current input data, Represents the variance of the input data hidden, is a hyperparameter to prevent the denominator from being 0, and its value is 0.0001. represents the weight matrix of the LN layer, and β represents the bias weight of the LN layer; Next, the calculation of the FeedForward layer is performed: Among them, the calculation formula of the GeLU activation function is: Among them, tanh is the activation function, and the formula is: in, is the output result after the layernorm layer, , 2 are different weight matrices, b1 and b2 are different bias matrices, Calculate the final output for the multi-head matrix calculation layer, Represents the calculation output of the first layer network of the FeedForward layer, Represents the calculation output of the intermediate activation function layer of the FeedForward layer.

4. The system according to claim 3, characterized in that: The intelligent analysis and judgment unit obtains the intention intelligent judgment result, including: After the FeedForward layer is calculated, it is calculated by the softmax layer. The softmax layer represents the normalization layer and is calculated as: Represents the final output of the softmax layer. represent An exponential function with the natural constant e as the base, i and j represent the i-th and j-th inputs respectively, and ∑ represents accumulation; The calculation result of the softmax layer is a matrix with the same dimension as the number of intent categories. The index with the largest value in the matrix is ​​selected, and the corresponding intent is found in the list of intent categories using the index to obtain the intent value predicted by the model, which corresponds to the intelligent judgment result of the intent.

5. The system according to claim 4, characterized in that: The intention matching judgment module includes an intention library construction unit and an intention matching unit; The intent library construction unit is used to preset multiple intent types according to business scenarios, save the preset intent types and name them as intent libraries, and complete the intent library construction; The intention matching unit is used to match the intention intelligent judgment result with the information in the intention library through preset matching rules. If the match is successful, it means that the preset intention is hit; if the match fails, it means that the preset intention is not hit.

6. The system according to claim 5, characterized in that: The slot filling processing module includes: a slot template calling unit, a slot preliminary filling unit, a filling completeness judgment unit, a first type of rhetorical question sentence construction unit and a first type of reply sentence construction unit; The slot template calling unit is used to enable the slot pool and call the slot template matching the preset intent type; The slot preliminary filling unit is used to call the large model to extract keywords from the problem description information according to the content to be filled in the slot template by means of prompt word extraction, input the extracted keywords into the large model to extract key information, and supplement the slots in the slot template according to the key information extraction results to obtain a preliminary filling result; The filling completeness judgment unit is used to judge whether the key information in the slot is missing according to the preliminary filling result, and if it is missing, execute the first type of rhetorical question input unit; if it is not missing, execute the first type of reply sentence input unit; The first type of rhetorical question sentence construction unit is used to construct a question sentence for the missing information and ask the user a rhetorical question when it is determined that the key information in the slot is still missing after being supplemented; The first type of reply statement construction unit is used to directly input the supplemented slot template information into the large model for direct reply when it is determined that the key information in the slot has been supplemented.

7. The system according to claim 6, characterized in that: The function processing module includes a function encapsulation unit, a search and analysis unit, and a second type of optimized response statement construction unit: The function encapsulation unit is used to encapsulate various query functions into functions called by API in advance and store them in the storage repository; The search and analysis unit is used to call the big model and extract keywords from the problem description information by means of prompt word extraction, input the extracted keywords into the big model to extract key information, and parse the problem description information according to the key information extraction result to obtain the search and analysis result; The second type of optimized response statement construction unit is used to select a corresponding function function from the repository to make an API call according to the search and analysis results, extract parsing information from the search and analysis results according to the called function function, convert the parsing information extraction results into natural language through the large model, and generate a second type of optimized response statement according to the converted natural language.

8. The system according to claim 7, characterized in that: The functional function processing module also includes a request construction sending unit and a response receiving parsing unit; The request construction and sending unit is used to construct a request that meets the requirements of the corresponding API according to the key information extracted from the search and analysis results, including setting the request header, request method, request body and URL parameters; and send the constructed request to the corresponding API server through the HTTP protocol; The response receiving and parsing unit is used to process and return a response containing key information in the search and parsing result after the API server receives the request, return the result data in json format, parse the result data, and extract information corresponding to the search and parsing result.

9. A large-model question-answering optimization method combining functional functions and slot filling, characterized in that: The steps include: Obtain the problem description information input by the user, build an intention intelligent analysis model, use the problem description information as input to the intention intelligent analysis model to perform intention recognition calculation, and obtain an intention intelligent judgment result; Construct an intention intelligent analysis model and obtain the question description information input by the user, input the question description information into the intention intelligent analysis model to perform user intention analysis and calculation, and obtain the intention intelligent judgment result; The intention intelligent judgment result is compared with the preset intention type in the intention library to determine whether it matches the preset intention type in the intention library. When the match is successful, it means that the preset intention is hit, and the slot filling process is executed. When the match fails, it means that the preset intention is not hit, and the function function process is executed; Enable the slot pool and call the slot template that matches the preset intent type, fill the slot according to the content to be filled in the slot template, and generate a first type of optimized response statement that is suitable for the problem description information according to the filling result; Calling a preset corresponding function according to the intention intelligent judgment result, parsing the problem description information according to the function function, inputting the parsed information into the big model for keyword extraction, and generating a second type of optimized response statement suitable for the problem description information based on the keyword extraction result; The first type of optimized response statements and the second type of optimized response statements are displayed to the user.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to claim 9 are implemented.

Citation Information

Patent Citations

  • Artificial intelligence-based search intention recognition method, device, equipment and storage medium

    CN113707300A

  • Futures question and answer-oriented user intention identification method and system

    CN114218392A

  • Law question answering system based on intention recognition and knowledge graph

    CN117891923A

  • Implementation method of multi-dimensional question and answer of thyroid disease

    CN118352003A

  • Response method in human-computer dialogue, dialogue system, and storage medium

    US20230084583A1