Question query method and device, equipment, storage medium and computer program product
By integrating multiple tasks in one model and using the multi-objective fusion model to realize user query words analysis and intelligent search, the problem of multi-module splitting in the existing technology is solved, reducing costs and improving results.
Patent Information
- Application Number
- CN202510200294.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-06-13
AI Technical Summary
In the prior art, query word analysis requires multiple independent modules to be trained separately, resulting in model splitting and unable to share information, limiting the overall performance optimization space, and high maintenance costs and high resource consumption.
A multi-objective fusion model is adopted to integrate tasks such as intent recognition and slot recognition into one model. Through training based on goal learning, user query word analysis and intelligent search for multiple tasks are realized.
It realizes query word analysis and intelligent search for multiple tasks that can be completed through only one model, optimizes resource usage costs and model maintenance costs, and improves the results.
Smart Images

Figure CN120144704A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent search technology, and particularly to a question query method, device, equipment, storage medium, and computer program product. Background Art
[0002] In modern search systems, the analysis of user query words (queries) is a core link in the retrieval process and plays a crucial role in the search experience and the relevance of search results. In the prior art, query analysis usually needs to be completed through multiple independent modules, including but not limited to: intent recognition, word segmentation, slot recognition, word weight calculation, etc. In the above modules, each part is implemented through an independent model or algorithm. Although this "multi-module" design has a clear structure, the models are fragmented and cannot share information: each module is trained separately, resulting in their inability to effectively share context information, and this fragmentation limits the optimization space of the overall performance.
[0003] The above content is only used to assist in understanding the technical solution of this application, and does not represent an admission that the above content is prior art. Summary of the Invention
[0004] The main purpose of this application is to provide a question query method, device, equipment, storage medium, and computer program product, aiming to solve the technical problem that the current query word analysis model needs to be trained and used separately, with high cost and poor effect.
[0005] To achieve the above purpose, this application proposes a question query method, and the method includes:
[0006] In response to the received question query instruction, obtain the user query word;
[0007] Input the user query word into a multi-objective fusion model to obtain an intent recognition target output and a slot recognition target output, where the multi-objective fusion model is a model trained based on target learning;
[0008] Perform a search query according to the intent recognition target output and the slot recognition target output.
[0009] Optionally, the step of inputting the user query word into a multi-objective fusion model to obtain an intent recognition target output and a slot recognition target output includes:
[0010] Concatenate the user query words to obtain a query text;
[0011] Input the query text into a multi-objective fusion model to obtain an intent recognition target output and a slot recognition target output.
[0012] Optionally, the step of concatenating the user query terms to obtain a query text includes:
[0013] Obtain special concatenation bytes;
[0014] Concatenate the special concatenation bytes with the user query terms to obtain a query text.
[0015] Optionally, the step of concatenating the special concatenation bytes with the user query terms to obtain a query text includes:
[0016] Convert the special concatenation bytes into concatenation feature vectors;
[0017] Concatenate according to the concatenation feature vectors and the user query terms to obtain a query text.
[0018] Optionally, before the step of inputting the user query terms into a multi-object fusion model to obtain an intent recognition target output and a slot recognition target output, it further includes:
[0019] Obtain an initial text understanding model and shared training parameters;
[0020] Train the initial text understanding model according to the shared training parameters to obtain a multi-object fusion model.
[0021] Optionally, the step of training the initial text understanding model according to the shared training parameters to obtain a multi-object fusion model includes:
[0022] Obtain a training sample set;
[0023] Train the initial text understanding model for multiple task objectives according to the training sample set and the shared training parameters to obtain a multi-object fusion model.
[0024] Optionally, after the step of training the initial text understanding model for multiple task objectives according to the training sample set and the shared training parameters to obtain a multi-object fusion model, it further includes:
[0025] Determine a classification target loss function and a sequence target loss function according to the multi-object fusion model;
[0026] Update the multi-object fusion model according to the classification target loss function and the sequence target loss function.
[0027] Optionally, the step of updating the multi-object fusion model according to the classification target loss function and the sequence target loss function includes:
[0028] Perform weighted accumulation according to the classification target loss function and the sequence target loss function to construct a total loss function;
[0029] Update the multi-objective fusion model according to the total loss function.
[0030] Optionally, after the step of training the initial text understanding model for multiple task objectives according to the training sample set and the shared training parameters to obtain a multi-objective fusion model, the following steps are further included:
[0031] Obtain multiple alternative activation functions and intent classification requirements;
[0032] Configure the intent classification activation function of the multi-objective fusion model according to the alternative activation function and the intent classification requirements.
[0033] Optionally, the step of performing a search query according to the intent recognition target output and the slot recognition target output includes:
[0034] Generate a model output query formula according to the intent recognition target output and the slot recognition target output;
[0035] Import the model output query formula into the model for search and query to obtain a search query result
[0036] In addition, to achieve the above object, the present application also proposes a question query device, and the question query device includes:
[0037] An instruction recognition module, configured to obtain a user query word in response to a received question query instruction;
[0038] A model processing module, configured to input the user query word into a multi-objective fusion model to obtain an intent recognition target output and a slot recognition target output, where the multi-objective fusion model is a model trained based on target learning;
[0039] A search query module, configured to perform a search query according to the intent recognition target output and the slot recognition target output.
[0040] Optionally, the model processing module is further configured to splice the user query words to obtain a query text; input the query text into the multi-objective fusion model to obtain an intent recognition target output and a slot recognition target output.
[0041] Optionally, the model processing module is further configured to obtain special splicing bytes; splice the special splicing bytes with the user query word to obtain a query text.
[0042] Optionally, the model processing module is further configured to convert the special splicing bytes into a splicing feature vector; splice the splicing feature vector with the user query term to obtain a query text.
[0043] Optionally, the model processing module is further configured to obtain an initial text understanding model and shared training parameters; train the initial text understanding model according to the shared training parameters to obtain a multi-objective fusion model.
[0044] Optionally, the model processing module is further configured to obtain a training sample set; train the initial text understanding model for multiple task objectives according to the training sample set and the shared training parameters to obtain a multi-objective fusion model.
[0045] Optionally, the model processing module is further configured to determine a classification objective loss function and a sequence objective loss function according to the multi-objective fusion model; update the multi-objective fusion model according to the classification objective loss function and the sequence objective loss function.
[0046] In addition, to achieve the above object, the present application further provides a question query device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the question query method as described above.
[0047] In addition, to achieve the above object, the present application further provides a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium, and when the computer program is executed by a processor, it implements the steps of the question query method as described above.
[0048] In addition, to achieve the above object, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the question query method as described above.
[0049] One or more technical solutions proposed by the present application have at least the following technical effects:
[0050] In response to a received question query instruction, the present application obtains a user query term; inputs the user query term into a multi-objective fusion model to obtain an intention recognition target output and a slot recognition target output, where the multi-objective fusion model is a model trained based on target learning; performs a search query according to the intention recognition target output and the slot recognition target output. In this way, it is realized that only one model is used to implement the analysis of user query terms for multiple tasks and intelligent search, without separate training of multiple modules or cooperation of multiple models, greatly optimizing the resource usage cost and model maintenance cost, and at the same time obtaining an improvement in effect. Brief Description of the Drawings
[0051] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0052] To more clearly illustrate the technical solutions in the embodiments of the present application or in the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other accompanying drawings can be obtained based on these drawings without creative efforts.
[0053] Figure 1 It is a schematic flowchart provided for the first embodiment of the problem query method of the present application;
[0054] Figure 2 It is a schematic flowchart provided for the second embodiment of the problem query method of the present application;
[0055] Figure 3 It is a schematic diagram of the model architecture provided in an embodiment of the problem query method of the present application;
[0056] Figure 4 It is a schematic diagram of the module structure of the problem query device in the embodiment of the present application;
[0057] Figure 5 It is a schematic diagram of the device structure of the hardware operating environment involved in the problem query method in the embodiment of the present application.
[0058] The realization of the purpose, functional features and advantages of the present application will be further described in conjunction with the embodiments with reference to the accompanying drawings. Detailed Embodiments
[0059] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0060] To better understand the technical solutions of the present application, the following will be described in detail in conjunction with the accompanying drawings of the specification and the specific embodiments.
[0061] The main solution of the embodiment of the present application is: by responding to the received problem query instruction, obtaining the user query term; inputting the user query term into the multi-target fusion model to obtain the intent recognition target output and the slot recognition target output, where the multi-target fusion model is a model trained based on target learning; performing a search query according to the intent recognition target output and the slot recognition target output.
[0062] In this embodiment, for the convenience of description, the following will be described with an identification computer as the execution subject.
[0063] In the prior art, in modern search systems, the analysis of user query terms (queries) is a core part of the retrieval process and plays a crucial role in the search experience and the relevance of search results. In the prior art, query analysis usually needs to be completed through multiple independent modules, including but not limited to: intent recognition, word segmentation, slot recognition, word weight calculation, etc. In the above modules, each part is implemented through an independent model or algorithm. Although this "multi-module" design has a clear structure, the models are fragmented and cannot share information: each module is trained separately, resulting in their inability to effectively share context information, and this fragmentation limits the optimization space of the overall performance.
[0064] This application provides a solution. In this way, it realizes the analysis of user query terms and intelligent search of multiple tasks through only one model, without the need for multiple modules to be trained separately or multiple models to cooperate, greatly optimizing the resource usage cost and model maintenance cost, and at the same time achieving an improvement in the effect.
[0065] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication, and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, a server, etc. that can implement the above functions. Hereinafter, the computer is taken as an example to illustrate this embodiment and the following embodiments.
[0066] Based on this, the embodiment of this application provides a problem query method, referring to Figure 1 , Figure 1 which is the flowchart of the first embodiment of the problem query method of this application.
[0067] In this embodiment, the problem query method includes steps S10 to S30:
[0068] Step S10, in response to the received problem query instruction, obtain the user query term;
[0069] It should be noted that in modern search systems, the analysis of user queries is a core part of the retrieval process and plays a crucial role in the search experience and the relevance of search results. In the prior art, query analysis usually needs to be completed through multiple independent modules, including but not limited to: Intent recognition: used to determine the functional category of the query, such as question answering, addressing, document, exchange rate query, weather, product search, etc., and decide which type of resources to recall. Word segmentation: segment the query into word fragments. Especially in Chinese search scenarios, the accuracy of word segmentation has a significant impact on subsequent tasks. The search needs to use the results of word segmentation to perform intersection retrieval in the index library, and correct word segmentation results are conducive to recalling correct results. For example, "ranking of Tsinghua University" needs to be segmented into "Tsinghua University" and "ranking", rather than "Tsinghua" and "university ranking". Slot recognition: used to identify word fragments with specific meanings in the query and their categories. For many refined requirements, accurate slot categories need to be identified for refined queries. For example, in "how much is 3500 US dollars in Chinese yuan", "3500" is the query amount, "US dollars" is the starting currency, and "Chinese yuan" is the target currency. Word weight calculation: calculate and evaluate the importance of each word in the query, highlighting the influence of keywords. It is used to judge which hits are more important and which are relatively unimportant or can be ignored during recall.
[0070] In the above modules, each part is implemented through an independent model or algorithm. Although this "multi-module" design has a clear structure, there are also significant problems: 1. Model fragmentation and inability to share information: Each module is trained independently, resulting in their inability to effectively share context information. This fragmentation limits the optimization space of the overall performance. 2. High maintenance cost and complex coordination: The training, optimization, and deployment of multiple modules need to be managed independently. Each module requires separate training data and resources. Updating one module may have a chain effect on other modules, and complex debugging and testing are required. 3. High resource consumption: Each module maintains a separate model architecture, which not only increases the resource consumption of storage and computing during daily iteration but also requires higher server capacity during actual deployment.
[0071] To solve the above problems, the present invention proposes a new multi-objective training technical solution, which can integrate important query analysis modules such as query classification and slot recognition into one model. This solution has the following characteristics: 1. Convenient and cost-saving: Multiple tasks can be trained and predicted at one time, which is more friendly to the industrial community. If n models are used to predict n tasks, the computational cost, storage cost, maintenance cost, and training cost of each model will be much greater than using 1 model. 2. Improve the generalization ability of the model: Because of the multi-objective training framework, some parameters of the model are shared, which can play a role in mutual assistance between tasks, alleviate model overfitting, and improve the generalization ability of the model.
[0072] It should be understood that the core idea of the present invention is to use a deep learning multi-objective learning framework to perform multi-objective learning on important tasks in query analysis, so that the system can obtain the inference results of multiple tasks by loading one model. Query analysis is the entry point of the entire search system. Its time consumption ratio in the entire search system should not be too long. Generally, the total time consumption is controlled within 20-30 milliseconds. Therefore, the model used should not be too complex. However, query analysis also determines the recall direction of the entire search. The analysis results of requirement recognition, slot recognition, term weight, word segmentation, etc. directly determine what resources the search system needs to recall. Therefore, we need to find a balance between time consumption and performance, and achieve good online results even when the time consumption is not too high.
[0073] In a specific implementation, first, in response to the received question query instruction, the user query term can be extracted. The user query term can be a combination of multiple words or a sentence. The question query instruction can be an instruction triggered by the user through the search window, or an instruction input by the user's voice or image. This embodiment does not limit this.
[0074] Step S20, input the user query term into the multi-objective fusion model to obtain an intention recognition target output and a slot recognition target output. The multi-objective fusion model is a model trained based on objective learning.
[0075] It should be noted that after obtaining the user query term, after inputting the user query term into the multi-objective fusion model that has been trained, the intention recognition result and slot recognition result processed and output by the multi-objective fusion model can be directly obtained. The present invention uses the BERT model as the core architecture, utilizes its powerful text understanding ability, and simultaneously completes multiple tasks such as Query classification and slot recognition by sharing the parameters of the same deep neural network. Among them, the multi-objective fusion model in this application can be a model trained with a local data set, or a large model updated with real-time updated big data as training samples or other types of large models. This embodiment does not limit this.
[0076] In a feasible implementation, in order to accurately obtain the intent recognition target output and the slot recognition target output, step S20 includes: concatenating the user query words to obtain a query text; inputting the query text into a multi-target fusion model to obtain the intent recognition target output and the slot recognition target output.
[0077] It should be understood that first, the user query words need to be concatenated to obtain a query text, and then the query text is input into the multi-target fusion model for output processing. Among them, the input of the model is the special token "[CLS]" concatenated with the user query query to be analyzed.
[0078] In a feasible implementation, in order to perform more accurate processing on the query word concatenation, the step of concatenating the user query words to obtain a query text includes: obtaining a special concatenation byte; concatenating the special concatenation byte with the user query words to obtain a query text.
[0079] In a specific implementation, [CLS] is a special token added in front of the entire query, and in training, CLS is used to represent the semantics of the entire query. c_1, c_2...c_n represent each word in the query. E_CLS, E_1...E_n represent the embedding representations converted by each token.
[0080] In a feasible implementation, in order to perform concatenation after vectorized expression, the step of concatenating the special concatenation byte with the user query words to obtain a query text includes: converting the special concatenation byte into a concatenation feature vector; concatenating according to the concatenation feature vector and the user query words to obtain a query text.
[0081] It should be noted that the input of the model is the special token "[CLS]" concatenated with the user query query to be analyzed. The input text is vectorized and embedded in units of words, and then the features are extracted through multiple layers of the transformer layer. The output embedding for each token can complete various tasks of query analysis through a multi-target training method.
[0082] Step S30, perform a search query according to the intent recognition target output and the slot recognition target output.
[0083] It should be understood that after obtaining the intent recognition target output and the slot recognition target output, the intent recognition target output and the slot recognition target output need to be integrated to directly obtain the model output query formula, and then perform a search query.
[0084] In a feasible implementation, in order to accurately generate a model output query formula, step S30 includes: generating a model output query formula according to the target output of intent recognition and the target output of slot recognition; importing the model output query formula into the model for searching and querying to obtain a search query result.
[0085] In a specific implementation, the model output query formula is a complete expression, which contains the words and phrases of the query words input by the user. For example, the input of the multi-target fusion model is as follows. When the query is "Query the weather forecast for 15 days in Lingshui in July", the model output is:
[0086] query_ner: "{"nType": "WEATHER", "Lingshui": "LOC", "July": "TIME"}"
[0087] Among them, nType is the target output of intent recognition of the query. In this example, it represents that this query is to search for weather. The rest are the outputs of the target recognition of slots. In this example, it represents that Lingshui is the location to search for weather, and the search time is July.
[0088] This embodiment provides a question query method. By responding to the received question query instruction, the user query word is obtained; the user query word is input into the multi-target fusion model to obtain the target output of intent recognition and the target output of slot recognition. The multi-target fusion model is a model trained based on target learning; search and query are performed according to the target output of intent recognition and the target output of slot recognition. In this way, the analysis of the user query word and intelligent search of multiple tasks are realized only through one model, without the need for separate training of multiple modules or cooperation of multiple models, greatly optimizing the resource usage cost and model maintenance cost, and at the same time obtaining an improvement in effect.
[0089] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar content as that in the above-mentioned embodiment 1 can be referred to the above introduction and will not be repeated hereinafter. On this basis, please refer to Figure 2 , before step S20, the question query method further includes steps S201 to S202:
[0090] Step S201, obtain an initial text understanding model and shared training parameters;
[0091] It should be noted that first, an initial text understanding model is obtained. The initial text understanding model uses the BERT model as the core architecture. Utilizing its powerful text understanding ability, by sharing the parameters of the same deep neural network, multiple tasks such as Query classification and slot recognition are completed simultaneously.
[0092] It should be understood that the shared training parameters refer to a set of pre-set deep neural network parameters that can be applied to the training and learning of multiple tasks such as classification and slot recognition.
[0093] Step S202: Train the initial text understanding model according to the shared training parameters to obtain a multi-objective fusion model.
[0094] In a specific implementation, a multi-objective fusion model that fuses multiple task modules is finally trained. Among them, for the classification objective: using the [CLS] label vector of the BERT output layer, the intention category to which the Query belongs is predicted through a fully connected layer. For the sequence objective: for each character, a fully connected neural network is established using each token vector of the bert output layer, and sequence objectives such as the slot type to which each target belongs and the score of the term weigh can be predicted.
[0095] In a feasible implementation manner, in order to accurately obtain the multi-objective fusion model, before step S202, it further includes: obtaining a training sample set; training the initial text understanding model for multiple task objectives according to the training sample set and the shared training parameters to obtain a multi-objective fusion model.
[0096] It should be noted that first, a pre-set training sample set is obtained. The training sample set can include search terms and search term processing results in multiple domains or with different intents and slots as a control group, so as to simultaneously train multiple task objectives and finally obtain multi-objective fusion training.
[0097] It should be understood that as Figure 3 shown is the schematic architecture diagram of the model of the present invention. [CLS] is a special token added in front of the entire query, and CLS is used to represent the semantics of the entire query during training. c_1, c_2...c_n represent each word in the query. E_CLS, E_1...E_n represent the embedding representations converted by each token. In addition to token embedding, other feature vectors such as position embedding can be superimposed in the embedding, which is not elaborated here in detail. After embedding, the feature extraction is performed through the encoder layer of N layers of transformers, and different processes are performed on the transformer outputs for each token.
[0098] In a feasible implementation, in order to further optimize the trained multi-objective fusion model, after the step of training the initial text understanding model for multiple task objectives according to the training sample set and the shared training parameters to obtain the multi-objective fusion model, the following steps are further included: determining a classification objective loss function and a sequence objective loss function according to the multi-objective fusion model; updating the multi-objective fusion model according to the classification objective loss function and the sequence objective loss function.
[0099] In a specific implementation, first, a classification objective loss function and a sequence objective loss function are determined. Specifically, the loss function calculations for two tasks and the weight calculations for the classification objective loss function and the sequence objective loss function are performed, so as to facilitate the subsequent calculation of the total loss function.
[0100] In a feasible implementation, in order to calculate the total loss function, the step of updating the multi-objective fusion model according to the classification objective loss function and the sequence objective loss function includes: performing weighted accumulation according to the classification objective loss function and the sequence objective loss function to construct a total loss function; updating the multi-objective fusion model according to the total loss function.
[0101] It should be noted that the expression of the total loss function is: L 总 = αL 分类 + βL 序列 ,
[0102] where L 总 represents the total loss of the current model, and α and β respectively represent the weight parameters of the loss, which are used to balance multiple objectives. L 分类 represents the intention classification objective of the entire query predicted by using the CLS token, and L 序列 represents the sequence prediction loss predicted by using each word token in the query.
[0103] In a feasible implementation, in order to select a more appropriate activation function through the multi-objective fusion model in the intention classification requirement, after the step of training the initial text understanding model for multiple task objectives according to the training sample set and the shared training parameters to obtain the multi-objective fusion model, the following steps are further included: obtaining multiple alternative activation functions and the intention classification requirement; configuring the intention classification activation function of the multi-objective fusion model according to the alternative activation functions and the intention classification requirement.
[0104] It should be understood that the CLS token contains the information of the entire query. Therefore, for the output of the CLS token, after using a fully connected layer for feature extraction and dimensionality reduction, the classification and recognition of the query intent can be performed. If it is a multi-label intent classification requirement, the sigmoid function can be used as the final activation function. If it is a multi-classification, the softmax function can be directly used.
[0105] In specific implementation, the output of each other word token can be used for the prediction of sequence tasks. Taking the slot recognition task as an example, the prediction target of each token is whether the current token belongs to the start, middle, or end of a certain type of slot. Finally, they can be concatenated when used. Further, for the sequence prediction part, multiple tasks can also be predicted together. Hard parameter sharing or soft parameter sharing can be used after the output layer of each token for multi-target prediction.
[0106] It should be noted that the model architecture proposed in this embodiment is only one implementation method. The transformer layer therein can be replaced with various network structures such as a fully connected neural network, LSTM, RNN, etc., which is universal and can be flexibly selected according to the actual business situation.
[0107] In this embodiment, an initial text understanding model and shared training parameters are obtained; the initial text understanding model is trained according to the shared training parameters to obtain a multi-target fusion model. In this way, by sharing the parameters of the same deep neural network, multiple tasks such as Query classification and slot recognition are completed simultaneously, reducing the training cost of the model and enabling different modules to share context information.
[0108] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the problem query method of this application. Based on this technical concept, more forms of simple transformations are within the protection scope of this application.
[0109] This application also provides a problem query device. Please refer to Figure 4 , the problem query device includes:
[0110] An instruction recognition module 10, configured to obtain a user query word in response to a received problem query instruction.
[0111] A model processing module 20, configured to input the user query word into the multi-target fusion model to obtain an intent recognition target output and a slot recognition target output, where the multi-target fusion model is a model trained based on target learning.
[0112] A search query module 30 is configured to perform a search query based on the intent recognition target output and the slot recognition target output.
[0113] In this embodiment, by responding to a received question query instruction, a user query term is obtained; the user query term is input into a multi-target fusion model to obtain an intent recognition target output and a slot recognition target output, and the multi-target fusion model is a model trained based on target learning; a search query is performed according to the intent recognition target output and the slot recognition target output. In this way, it is realized that only one model is used to implement the analysis of user query terms for multiple tasks and intelligent search, without the need for separate training of multiple modules or cooperation of multiple models, greatly optimizing the resource usage cost and model maintenance cost, and at the same time achieving an improvement in effect.
[0114] In one embodiment, the model processing module 20 is further configured to splice the user query terms to obtain a query text; the query text is input into the multi-target fusion model to obtain an intent recognition target output and a slot recognition target output.
[0115] In one embodiment, the model processing module 20 is further configured to obtain a special splicing byte; the special splicing byte is spliced with the user query term to obtain a query text.
[0116] In one embodiment, the model processing module 20 is further configured to convert the special splicing byte into a splicing feature vector; the splicing feature vector is spliced with the user query term to obtain a query text.
[0117] In one embodiment, the model processing module 20 is further configured to obtain an initial text understanding model and shared training parameters; the initial text understanding model is trained according to the shared training parameters to obtain a multi-target fusion model.
[0118] In one embodiment, the model processing module 20 is further configured to obtain a training sample set; the initial text understanding model is trained for multiple task objectives according to the training sample set and the shared training parameters to obtain a multi-target fusion model.
[0119] In one embodiment, the model processing module 20 is further configured to determine a classification target loss function and a sequence target loss function according to the multi-target fusion model; the multi-target fusion model is updated according to the classification target loss function and the sequence target loss function.
[0120] In one embodiment, the model processing module 20 is further configured to perform weighted accumulation according to the classification target loss function and the sequence target loss function to construct a total loss function; the multi-target fusion model is updated according to the total loss function.
[0121] In one embodiment, the model processing module 20 is further configured to obtain a plurality of alternative activation functions and an intent classification requirement; and configure the intent classification activation function of the multi-objective fusion model according to the alternative activation functions and the intent classification requirement.
[0122] In one embodiment, the search query module 30 is further configured to generate a model output query formula according to the intent recognition target output and the slot recognition target output; and import the model output query formula into the model for searching and querying to obtain a search query result.
[0123] The problem query device provided by the present application adopts the problem query method in the above embodiment, and can solve the technical problem that the current model for query term analysis needs to be trained and used separately, with high cost and poor effect. Compared with the prior art, the beneficial effects of the problem query device provided by the present application are the same as those of the problem query method provided by the above embodiment, and other technical features in the problem query device are the same as the features disclosed in the method of the above embodiment, which will not be elaborated here.
[0124] The present application provides a problem query device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the problem query method in the first embodiment above.
[0125] Next, refer to Figure 5 , which shows a schematic structural diagram of a problem query device suitable for implementing the embodiments of the present application. The problem query device in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The problem query device shown is only an example, and should not impose any limitation on the functions and usage scope of the embodiments of the present application.
[0126] As Figure 5As shown, the problem query device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in the ROM (Read Only Memory) 1002 or a program loaded from the storage device 1003 into the RAM (Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of the problem query device are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. The input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the problem query device to communicate with other devices wirelessly or wiredly to exchange data. Although the figure shows a problem query device with various systems, it should be understood that it is not required to implement or have all the shown systems. More or fewer systems can be alternatively implemented or had.
[0127] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the methods of the embodiments disclosed in the present application are executed.
[0128] The problem query device provided by the present application adopts the problem query method in the above embodiment, and can solve the technical problem that the current query term analysis model needs to be trained and used separately, with high cost and poor effect. Compared with the prior art, the beneficial effects of the problem query device provided by the present application are the same as those of the problem query method provided by the above embodiment, and other technical features in the problem query device are the same as those disclosed in the method of the previous embodiment, and will not be elaborated here.
[0129] It should be understood that each part disclosed in this application can be implemented by hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in a suitable manner in any one or more embodiments or examples.
[0130] As described above, the above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed in this application can easily think of changes or substitutions, which should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
[0131] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the problem query method in the above embodiments.
[0132] The computer-readable storage medium provided by this application can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this embodiment, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or combined with an instruction execution system, device, or device. The program code contained on the computer-readable storage medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0133] The above computer-readable storage medium can be included in the problem query device; it can also exist separately without being assembled into the problem query device.
[0134] The above computer-readable storage medium carries one or more programs, which, when executed by the question query device, cause the question query device to: in response to a received question query instruction, obtain a user query term; input the user query term into a multi-target fusion model to obtain an intention recognition target output and a slot recognition target output, where the multi-target fusion model is a model trained based on target learning; and perform a search query according to the intention recognition target output and the slot recognition target output.
[0135] Computer program code for performing the operations of the present application may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).
[0136] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that, in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0137] The modules described in the embodiments of the present application may be implemented in software or in hardware. Wherein, the name of the module does not constitute a limitation to the unit itself in some cases.
[0138] The readable storage medium provided by this application is a computer-readable storage medium. The computer-readable storage medium stores computer-readable program instructions (i.e., computer programs) for executing the above problem query method, which can solve the technical problem that the current query term analysis model needs to be trained and used separately, with high cost and poor effect. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by this application are the same as those of the problem query method provided by the above embodiments, and will not be elaborated here.
[0139] This application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the steps of the problem query method as described above.
[0140] The computer program product provided by this application can solve the technical problem that the current query term analysis model needs to be trained and used separately, with high cost and poor effect. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as those of the problem query method provided by the above embodiments, and will not be elaborated here.
[0141] The above are only partial embodiments of this application, and do not limit the patent scope of this application accordingly. Any equivalent structural transformation made under the technical concept of this application by using the content of the specification and drawings of this application, or directly / indirectly applied in other related technical fields, is included in the patent protection scope of this application.
[0142] The present invention discloses A1. A problem query method, and the method includes:
[0143] In response to the received problem query instruction, obtain the user query term;
[0144] Input the user query term into a multi-objective fusion model to obtain an intention recognition target output and a slot recognition target output. The multi-objective fusion model is a model trained based on target learning;
[0145] Perform a search query according to the intention recognition target output and the slot recognition target output.
[0146] A2. The method as described in A1, and the step of inputting the user query term into the multi-objective fusion model to obtain an intention recognition target output and a slot recognition target output includes:
[0147] Concatenate the user query terms to obtain a query text;
[0148] Input the query text into the multi-objective fusion model to obtain an intention recognition target output and a slot recognition target output.
[0149] A3. The method as described in A2, the step of concatenating the user query terms to obtain a query text includes:
[0150] Obtain special concatenation bytes;
[0151] Concatenate the special concatenation bytes with the user query terms to obtain a query text.
[0152] A4. The method as described in A3, the step of concatenating the special concatenation bytes with the user query terms to obtain a query text includes:
[0153] Convert the special concatenation bytes into concatenation feature vectors;
[0154] Concatenate according to the concatenation feature vectors and the user query terms to obtain a query text.
[0155] A5. The method as described in A1, before the step of inputting the user query terms into a multi-object fusion model to obtain an intention recognition target output and a slot recognition target output, further includes:
[0156] Obtain an initial text understanding model and shared training parameters;
[0157] Train the initial text understanding model according to the shared training parameters to obtain a multi-object fusion model.
[0158] A6. The method as described in A5, the step of training the initial text understanding model according to the shared training parameters to obtain a multi-object fusion model includes:
[0159] Obtain a training sample set;
[0160] Train the initial text understanding model for multiple task objectives according to the training sample set and the shared training parameters to obtain a multi-object fusion model.
[0161] A7. The method as described in A6, after the step of training the initial text understanding model for multiple task objectives according to the training sample set and the shared training parameters to obtain a multi-object fusion model, further includes:
[0162] Determine a classification target loss function and a sequence target loss function according to the multi-object fusion model;
[0163] Update the multi-object fusion model according to the classification target loss function and the sequence target loss function.
[0164] A8. The method as described in A7, the step of updating the multi-object fusion model according to the classification target loss function and the sequence target loss function includes:
[0165] Perform weighted accumulation according to the classification target loss function and the sequence target loss function to construct a total loss function;
[0166] Update the multi-objective fusion model according to the total loss function.
[0167] A9. The method as described in A6, after the step of training the initial text understanding model for multiple task objectives according to the training sample set and the shared training parameters to obtain a multi-objective fusion model, further includes:
[0168] Obtain multiple alternative activation functions and intent classification requirements;
[0169] Configure the intent classification activation function of the multi-objective fusion model according to the alternative activation functions and the intent classification requirements.
[0170] A10. The method as described in any one of A1 - A9, the step of performing a search query according to the intent recognition target output and the slot recognition target output includes:
[0171] Generate a model output query formula according to the intent recognition target output and the slot recognition target output;
[0172] Import the model output query formula into the model for search and query to obtain a search query result.
[0173] The present invention also discloses B11. A problem query device, the device includes:
[0174] An instruction recognition module, configured to obtain a user query word in response to a received problem query instruction;
[0175] A model processing module, configured to input the user query word into a multi-objective fusion model to obtain an intent recognition target output and a slot recognition target output, where the multi-objective fusion model is a model trained based on target learning;
[0176] A search query module, configured to perform a search query according to the intent recognition target output and the slot recognition target output.
[0177] B12. The device as described in B11, the model processing module is further configured to splice the user query words to obtain a query text; input the query text into the multi-objective fusion model to obtain an intent recognition target output and a slot recognition target output.
[0178] B13. The device as described in B12, the model processing module is further configured to obtain special splicing bytes; splice the special splicing bytes with the user query words to obtain a query text.
[0179] B14. The device as described in B13, wherein the model processing module is further configured to convert the special splicing byte into a splicing feature vector; and splice the splicing feature vector with the user query word to obtain a query text.
[0180] B15. The device as described in B11, wherein the model processing module is further configured to obtain an initial text understanding model and shared training parameters; and train the initial text understanding model according to the shared training parameters to obtain a multi-objective fusion model.
[0181] B16. The device as described in B15, wherein the model processing module is further configured to obtain a training sample set; and train the initial text understanding model for multiple task objectives according to the training sample set and the shared training parameters to obtain a multi-objective fusion model.
[0182] B17. The device as described in B16, wherein the model processing module is further configured to determine a classification objective loss function and a sequence objective loss function according to the multi-objective fusion model; and update the multi-objective fusion model according to the classification objective loss function and the sequence objective loss function.
[0183] The present invention also discloses C18. A problem query device, the device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the problem query method as described above.
[0184] The present invention also discloses D19. A storage medium, the storage medium being a computer-readable storage medium, and a computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps of the problem query method as described above are implemented.
[0185] The present invention also discloses E20. A computer program product, the computer program product comprising a computer program, and when the computer program is executed by a processor, the steps of the problem query method as described above are implemented.
Claims
1. A question query method, characterized in that: The method includes: In response to the received question query instruction, obtaining a user query word; Input the user query word into a multi-objective fusion model to obtain an intent recognition target output and a slot recognition target output, wherein the multi-objective fusion model is a model obtained based on target learning training; A search query is performed based on the intent identification target output and the slot identification target output.
2. The method according to claim 1, characterized in that The step of inputting the user query word into the multi-target fusion model to obtain the intent recognition target output and the slot recognition target output comprises: Concatenate the user query words to obtain a query text; The query text is input into a multi-target fusion model to obtain an intent recognition target output and a slot recognition target output.
3. The method according to claim 2, characterized in that The step of concatenating the user query words to obtain the query text comprises: Get special splicing bytes; The special concatenated bytes are concatenated with the user query words to obtain a query text.
4. The method according to claim 3, characterized in that The step of concatenating the special concatenated bytes with the user query word to obtain the query text comprises: Converting the special splicing bytes into a splicing feature vector; The query text is obtained by concatenating the concatenated feature vector with the user query word.
5. The method according to claim 1, characterized in that Before the step of inputting the user query word into the multi-target fusion model to obtain the intent recognition target output and the slot recognition target output, the following step is further included: Get the initial text understanding model and share training parameters; The initial text understanding model is trained according to the shared training parameters to obtain a multi-objective fusion model.
6. The method according to claim 5, characterized in that The step of training the initial text understanding model according to the shared training parameters to obtain a multi-objective fusion model comprises: Obtain a training sample set; The initial text understanding model is trained for multiple task objectives according to the training sample set and the shared training parameters to obtain a multi-objective fusion model.
7. A question query device, characterized in that: The device comprises: An instruction recognition module, used to obtain a user query word in response to a received question query instruction; A model processing module, used for inputting the user query word into a multi-objective fusion model to obtain an intent recognition target output and a slot recognition target output, wherein the multi-objective fusion model is a model obtained based on target learning training; A search query module is used to perform a search query based on the intent identification target output and the slot identification target output.
8. A question query device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the question query method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the question query method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the question query method according to any one of claims 1 to 6 are implemented.