Question and answer processing method and device, equipment, medium and program product
By acquiring and analyzing user problems in multiple rounds of conversations, and using machine learning models to identify user needs, it solves the problem of difficulty in identifying user needs in multiple rounds of conversations, and improves the quality of response.
Patent Information
- Application Number
- CN202411350992.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-01-17
AI Technical Summary
In multi-wheel dialogue scenarios, it is difficult for digital assistants to accurately identify user needs, affecting response quality, especially in specific areas such as vehicle fields.
By obtaining target user questions in multiple conversation rounds and their previous historical user questions, determining reference information, using trained machine learning models to identify target user needs, and generating high-quality responses.
Improve the accuracy of user demand identification and the quality of response in multiple rounds of dialogue scenarios.
Smart Images

Figure CN119323256A_ABST
Abstract
Description
Technical Field
[0001] Example embodiments of the present disclosure generally relate to the field of computers, and more particularly, to methods, devices, apparatuses, computer-readable storage media, and computer program products for question-answering processing. Background Art
[0002] Digital assistants are provided to assist users with various task processing needs in different applications and scenarios. Digital assistants usually have intelligent dialogue and task processing capabilities. During the interaction with the digital assistant, the user inputs an interactive message, and the digital assistant provides a reply message in response to the user input. Generally, a digital assistant can support users to input questions in natural language, and perform tasks and provide replies based on the understanding of natural language input and logical reasoning ability. This kind of interaction method has become a tool that people love and rely on because of its flexible and convenient characteristics. Summary of the invention
[0003] In a first aspect of the present disclosure, a method for question-answering processing is provided. The method includes: in response to receiving a target user question of a target conversation round in multiple conversation rounds with a user, obtaining at least one historical user question of at least one historical conversation round before the target conversation round; determining reference information based on the target user question and at least one historical user question, the reference information including multiple reference user questions and reference user requirements of the multiple reference user questions, each reference user question matches the target user question and / or at least one historical user question; determining the target user requirement of the target user question using a trained machine learning model based on the target user question and the reference information; and generating a target user answer to the target user question based on the target user requirement.
[0004] In a second aspect of the present disclosure, a device for question-answering processing is provided. The device includes: an acquisition module, configured to, in response to receiving a target user question of a target conversation round in multiple conversation rounds with a user, acquire at least one historical user question of at least one historical conversation round before the target conversation round; a first determination module, configured to determine reference information based on the target user question and at least one historical user question, the reference information including multiple reference user questions and reference user requirements of the multiple reference user questions, each reference user question matches the target user question and / or at least one historical user question; a second determination module, configured to determine the target user requirement of the target user question based on the target user question and the reference information using a trained machine learning model; and a generation module, configured to generate a target user answer to the target user question based on the target user requirement.
[0005] In a third aspect of the present disclosure, an electronic device is provided. The device includes at least one processing unit; and at least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit. When the instructions are executed by the at least one processing unit, the electronic device executes the method of the first aspect.
[0006] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored on the medium, and when the computer program is executed by a processor, the method of the first aspect is implemented.
[0007] In a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the method according to the first aspect of the present disclosure is implemented.
[0008] It should be understood that the content described in this section is not intended to limit the key features or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0010] Figure 1 A schematic diagram showing an example environment in which embodiments of the present disclosure can be implemented;
[0011] Figure 2 A flowchart showing a process for question-answering processing according to some embodiments of the present disclosure is shown;
[0012] Figure 3 A schematic diagram showing an example of a conversation interface of a digital assistant according to some embodiments of the present disclosure;
[0013] Figure 4 A flowchart showing a process of building a reference data set according to some embodiments of the present disclosure is shown;
[0014] Figure 5 A flowchart showing a process of reference information determination according to some embodiments of the present disclosure;
[0015] Figure 6 A schematic structural block diagram of an apparatus for question-answering processing according to some embodiments of the present disclosure is shown; and
[0016] Figure 7 A block diagram of an electronic device in which one or more embodiments of the present disclosure may be implemented is shown. DETAILED DESCRIPTION
[0017] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain 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 construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0018] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below.
[0019] Herein, unless explicitly stated, executing a step “in response to A” does not mean executing the step immediately after “A” but may include one or more intermediate steps.
[0020] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition, use, storage or deletion of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0021] It is understandable that before using the technical solutions disclosed in the various embodiments of the present disclosure, the types, scopes of use, usage scenarios, etc. of the information involved in the present disclosure should be informed to relevant users and their authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. The relevant users may include any type of right holders, such as individuals, enterprises, and groups.
[0022] For example, in response to receiving an active request from a user, a prompt message is sent to the relevant user to clearly prompt the relevant user that the operation requested to be performed will require obtaining and using the information of the relevant user, so that the relevant user can independently choose whether to provide information to software or hardware such as an electronic device, application, server or storage medium that executes the operation of the technical solution of the present disclosure based on the prompt message.
[0023] As an optional but non-limiting implementation, in response to receiving an active request from a relevant user, a prompt message is sent to the relevant user, for example, in the form of a pop-up window, in which the prompt message may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to select "agree" or "disagree" to provide information to the electronic device.
[0024] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0025] As used herein, the term "model" can learn the association between the corresponding input and output from the training data, so that after the training is completed, the corresponding output can be generated for a given input. The generation of the model can be based on machine learning technology. Deep learning is a machine learning algorithm that processes inputs and provides corresponding outputs by using multi-layer processing units. A neural network model is an example of a model based on deep learning. In this article, "model" may also be referred to as "machine learning model", "learning model", "machine learning network" or "learning network", and these terms are used interchangeably in this article.
[0026] A "neural network" is a machine learning network based on deep learning. A neural network is capable of processing inputs and providing corresponding outputs, and typically includes an input layer and an output layer and one or more hidden layers between the input layer and the output layer. Neural networks used in deep learning applications typically include many hidden layers, thereby increasing the depth of the network. The layers of a neural network are connected in sequence so that the output of the previous layer is provided as input to the next layer, where the input layer receives the input of the neural network and the output of the output layer serves as the final output of the neural network. Each layer of a neural network includes one or more nodes (also called processing nodes or neurons), each of which processes input from the previous layer.
[0027] Generally, machine learning can be roughly divided into three stages, namely the training stage, the testing stage, and the application stage (also called the inference stage). In the training stage, a given model can be trained using a large amount of training data, and the parameter values are continuously updated iteratively until the model can obtain consistent inferences that meet the expected goals from the training data. Through training, the model can be considered to be able to learn the association from input to output (also called the mapping of input to output) from the training data. The parameter values of the trained model are determined. In the testing stage, the test input is applied to the trained model to test whether the model can provide the correct output, thereby determining the performance of the model. In the application stage, the model can be used to process the actual input based on the parameter values obtained from the training to determine the corresponding output.
[0028] Figure 1A schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented is shown. In the example environment 100, an application 120 is installed in a terminal device 110. A user 140 can interact with the application 120 via the terminal device 110 and / or an attached device of the terminal device 110. For example, the application 120 can collect the voice of the user 140 via a voice collection device (e.g., a microphone) of the terminal device 110.
[0029] In an embodiment of the present disclosure, application 120 may be any appropriate application with a human-computer dialogue function. For example, application 120 may provide a digital assistant for human-computer dialogue. The digital assistant supports text dialogue services, voice dialogue services, and content dialogues in other modes with user 140. In some embodiments, application 120 or the digital assistant therein may utilize a machine learning model 160 (which may include one or more machine learning models, such as machine learning model 160-1, machine learning model 160-2, ..., machine learning model 160-N, and so on, where N is a positive integer. For the convenience of description, one or more machine learning models are collectively referred to as machine learning models 160 herein) to support interaction with user 140. For example, application 120 or the digital assistant therein may utilize one or more machine learning models 160 to provide question-and-answer services to user 140.
[0030] In the environment 100, if the application 120 is active, the terminal device 110 can present the user interface 150 of the application 120. The user interface 150 may include various interfaces that the application 120 can provide, such as a conversation interface between the user and the digital assistant (in which the current conversation and historical conversation, including text conversation content, can be presented), etc. In some embodiments, the terminal device 110 can present text 152 and play voice in the user interface 150. The voice may include, for example, a voice from the user 140 or a voice in response to the voice.
[0031] The machine learning model 160 can be a model of different types. In some embodiments, one or more machine learning models 160 can be built based on a language model (LM). The machine learning model used is a content generation model that can generate corresponding outputs based on model inputs. In some embodiments, a machine learning model based on a language model can input a model in a textual mode (e.g., natural language and / or machine language) and / or a model in a non-textual mode (e.g., image, voice, video, etc.), and can generate the desired output based on the model input and the prompt word. The prompt word here is used to guide the machine learning model to generate user needs that can solve the model input. In an application scenario for supporting user dialogue, the input of the user 140 can be provided to the machine learning model 160 as at least a part of the model input (other parts may include prompt words). The user input is regarded as a question. Based on the model output, a corresponding response can be generated to provide to the user 140.
[0032] In some embodiments, one or more machine learning models 160 may be speech-related models, including an ASR model and a TTS model. The input of the ASR model is speech, and the output is text. The input of the TTS model is text, and the output is the corresponding speech.
[0033] In some embodiments, the terminal device 110 communicates with the server device 130 to provide services for the application 120. Figure 1 As shown, the server device 130 can call the machine learning model 160 to support the human-computer dialogue function between the application 120 and the user 140 based on the output of the machine learning model 160. The terminal device 110 can be any type of mobile terminal, fixed terminal or portable terminal, including a mobile phone, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a media computer, a multimedia tablet, a personal communication system (PCS) device, a personal navigation device, a personal digital assistant (PDA), an audio / video player, a digital camera / camcorder, a positioning device, a television receiver, a radio broadcast receiver, an e-book device, a gaming device or any combination of the foregoing, including accessories and peripherals of these devices or any combination thereof. In some embodiments, the terminal device 110 can also support any type of interface for the user (such as a "wearable" circuit, etc.). The server device 130 can be various types of computing systems / servers that can provide computing capabilities, including but not limited to mainframes, edge computing nodes, computing devices in cloud environments, and the like. The server device 130 can be implemented based on a cloud environment, for example.
[0034] It should be understood that the structure and function of the various elements in the environment 100 are described for exemplary purposes only and do not imply any limitation on the scope of the present disclosure.
[0035] As mentioned above, digital assistants are provided to assist users with various task processing needs in different applications and scenarios. Digital assistants usually have intelligent dialogue and task processing capabilities. During the interaction with the digital assistant, the user inputs an interactive message, and the digital assistant provides a reply message in response to the user input. Generally, a digital assistant can support users to input questions in natural language, and perform tasks and provide replies based on the understanding of natural language input and logical reasoning ability. This kind of interaction method has become a favorite and dependent tool because of its flexible and convenient characteristics.
[0036] Traditionally, digital assistants (such as digital assistants used in the automotive field) need to identify the user's needs in the multi-round dialogue in order to answer user questions, and provide targeted responses based on the user's needs (such as car series introduction, configuration questions and answers, car series comparison, etc.). However, the conventional technology has a relatively poor effect on identifying user needs in multi-round dialogues, especially for specific fields such as the automotive field, which affects the quality of digital assistants' responses.
[0037] In view of this, an embodiment of the present disclosure provides an improved solution for question-answering processing. In this solution, in response to receiving a target user question of a target conversation round in multiple conversation rounds with a user, at least one historical user question of at least one historical conversation round before the target conversation round is obtained. Based on the target user question and at least one historical user question, reference information is determined. The reference information includes multiple reference user questions and reference user requirements for multiple reference user questions, and each reference user question matches the target user question and / or at least one historical user question. Based on the target user question and the reference information, a target user requirement for the target user question is determined using a trained machine learning model. Thereafter, a target user answer to the target user question is generated based on the target user requirement.
[0038] In the embodiments of the present disclosure, multiple reference user questions and corresponding reference user needs are used to provide a reference for identifying user needs of user questions in a multi-round dialogue scenario, which is beneficial to improving the accuracy of user need identification and further beneficial to improving the quality of responses in a multi-round dialogue scenario.
[0039] Some example embodiments of the present disclosure will be described in detail below with reference to examples of the accompanying drawings.
[0040] Figure 2 A flowchart of a process 200 for question-answering processing according to some embodiments of the present disclosure is shown. The process 200 may be performed in Figure 1The terminal device 110 is implemented as follows: Figure 1 To describe Figure 2 Process 200 is shown.
[0041] In box 210 of process 200, in response to receiving a target user question of a target conversation round in multiple conversation rounds with the user, the terminal device 110 obtains at least one historical user question of at least one historical conversation round before the target conversation round. The target conversation round may include a current conversation round or a historical conversation round. There are many ways to divide the conversation round. For example, the terminal device 110 can regard a conversation round from receiving a user question input by the user to completing the response to the user question. For another example, each time the terminal device 110 receives a user question input by the user, it can be regarded as a conversation round. Of course, the above-mentioned way of dividing the conversation round is only exemplary. In actual application, any appropriate way of dividing the conversation round can be selected according to actual needs. The target user question can be a user question to be answered at present, or it can be a user question among multiple user questions to be answered.
[0042] The user may input a user question through the terminal device 110 or a device attached to the terminal device 110. The target user question may include a user question input by the user based on multiple modal data such as voice, text, image, video, etc. For example, Figure 3 As shown, Figure 3 A schematic diagram of an example 300 of a conversation interface of a digital assistant according to some embodiments of the present disclosure is shown. In example 300, the conversation interface includes a presentation area 301, a text input box 302, and a voice input control 303. The terminal device 110 can use the presentation area 301 to present content related to the conversation, such as user questions 304 and user responses 306. The terminal device 110 can receive text questions input by the user through the text input box 302, and the terminal device 110 can also receive voice questions input by the user through the voice input control 303. It should be understood that Figure 3 The interface shown in is only an example, and various interface designs may exist in practice. The various graphical elements in the interface may have different arrangements and different visual representations, one or more of which may be omitted or replaced, and one or more other elements may also exist. The embodiments of the present disclosure are not limited in this respect.
[0043] In some embodiments, the target user questions include vehicle-related questions input by the user. It should be understood that the vehicle-related questions here can be understood as questions related to the vehicle field, and can include various questions related to the service, sales, evaluation, inspection, maintenance, management, manufacturing, after-sales, etc. of the vehicle. The vehicle can be a "car", "vehicle" and "complete vehicle" or other similar terms including general motor vehicles, including sedans, SUVs, MPVs, buses, trucks and other cargo or passenger vehicles, including hybrid vehicles, electric vehicles, fuel vehicles, plug-in hybrid vehicles, fuel cell vehicles and other alternative fuel vehicles. Among them, a hybrid vehicle refers to a vehicle with two or more power sources, and an electric vehicle includes a pure electric vehicle, an extended-range electric vehicle, etc. The specific type of the vehicle is not limited here.
[0044] In actual application, the terminal device 110 can obtain one or more historical user questions from the historical dialogue rounds before the target round in one or more ways. In some embodiments, the terminal device 110 can obtain multiple historical user questions in multiple historical dialogue rounds in a predetermined round range before the target dialogue round. The predetermined round range can be a round range composed of any multiple historical dialogue rounds before the target round. Exemplarily, the target user question can be a user question to be answered in the current dialogue round, and the target user question can be recorded as D[i]. The terminal device can use, for example, a sliding window W to obtain k historical user questions of k historical dialogue rounds that are located before the target user question and adjacent to the target user question. The k historical user questions can be recorded as D[m](m∈(i-1,ik]).
[0045] In some embodiments, the terminal device 110 may obtain multiple historical user questions in multiple intervals of historical conversation rounds before the target conversation round. Exemplarily, the terminal device 110 may use a skip cascade method to obtain n mutually spaced historical user questions before D[i]. The n historical user questions may be recorded as D[j](j∈[i-1, is]), where s represents the number of skip cascade jumps. The terminal device 110 may skip a predetermined number of historical user questions each time, and the terminal device 110 may skip a random number of historical user questions each time. It is to be understood that the above-mentioned method of obtaining historical user questions is only exemplary. In actual application, any appropriate method may be selected to obtain historical user questions according to actual needs. The scope of the present disclosure is not limited in this respect.
[0046] In process 200, at block 220, terminal device 110 determines reference information based on the target user question and at least one historical user question. The reference information includes multiple reference user questions and reference user requirements of the multiple reference user questions, and each reference user question matches the target user question and / or at least one historical user question. Specifically, each reference user question may match the target user question, may match one or more historical user questions in the at least one historical user question, or may match the target user question and the historical user question at the same time.
[0047] The reference user demand is used to indicate the user demand of the corresponding reference user question. The reference user demand may have a variety of data formats. Exemplarily, the reference user question may include, for example, "What is the acceleration of XXX car per 100 kilometers", "Recommend several SUVs (i.e., sports utility vehicles) priced between 100,000 yuan and 200,000 yuan", "Should I go to a 4S store for repair and maintenance?", etc. Correspondingly, the reference user demand may indicate the user demand of the above reference user question through labels such as "parameters and answers", "car selection recommendations", "general knowledge" written in natural language.
[0048] In some embodiments, a reference data set may be pre-built, and the reference data set may include multiple reference user questions and reference user requirements of multiple reference user questions. The terminal device 110 may determine the reference user question and the reference user requirement that match the target user question and / or the at least one historical user question from the reference data set based on the target user question and the at least one historical user question, so as to obtain reference information.
[0049] In order to illustrate the construction process of the reference dataset, the following will combine Figure 4 The construction process of the reference dataset is illustrated in an exemplary manner. Figure 4 A flow chart of a process 400 of reference dataset construction according to some embodiments of the present disclosure is shown.
[0050] In box 410 of process 400, the terminal device 110 can obtain reference user questions and reference user needs of the reference user questions. Alternatively or additionally, the terminal device 110 can select appropriate historical user questions from the historical interaction data of the digital assistant as reference user questions, and obtain reference user needs for each reference user question. In one example, the terminal device 110 can select historical user questions of multiple single-round conversations of the digital assistant as reference user questions. In another example, the terminal device 110 can select multiple historical user questions in multiple rounds of conversations of the digital assistant as reference user questions. Regarding reference user needs, multiple predetermined user needs can be determined in advance. Then, a predetermined user need that matches the reference user problem is selected from the multiple predetermined user needs as the reference user need for the reference user problem. Of course, the reference user need can also be a user need that has been determined for the historical user problem during the historical interaction process.
[0051] In process 400, at block 420, terminal device 110 may perform data structuring processing on a reference question-requirement pair consisting of a reference user question and a reference user requirement to obtain structured data including the reference user question and the corresponding reference user requirement. The structured data here may include various data having a predetermined data structure, such as a table, an object, and the like.
[0052] For example, a reference user question may include "How fast can a XXX car accelerate to 100 kilometers per hour?", and a corresponding reference user requirement may include "matching questions and answers." The reference question and requirement pair consisting of the reference user question and the reference user requirement may be recorded as S = (How fast can a XXX car accelerate to 100 kilometers per hour?, matching questions and answers). The terminal device 110 performs data structuring processing on the reference question and requirement pair, and the obtained structured data may be recorded as S f , S f An example of is shown in the following table.
[0053] Table 1
[0054]
[0055] In the above table, the field value of the "label" field can be a reference to user requirements, the field value of the "query" field can be a reference to user questions, the field value of the "id" field can be the data identifier of the structured data, which is used to uniquely identify the structured data, and the field value of the "dsl" field can record the filtering conditions.
[0056] In process 400, at block 430, terminal device 110 may perform data vectorization processing on the text content in the structured data to generate a reference vector representation. For example, terminal device 110 may obtain text content T in the structured data, and terminal device 110 may use, for example, a model Reasoning is performed on the text content T based on the following formula to obtain the output Emb of the deep network layer c of the deep network M as the reference vector representation of the text content T.
[0057]
[0058] It is understandable that the terminal device 110 can use a variety of data vectorization methods to perform data vectorization processing on structured data, such as a sentence vectorization method based on a single / dual tower encoder architecture, a sentence vectorization method based on a model encoder / decoder, etc. The embodiments of the present disclosure are not limited in this respect.
[0059] In process 400, at box 440, the terminal device 110 may generate an index based on the reference vector representation. Afterwards, the terminal device 110 may construct a reference data set 450 based on the reference user question, the reference user demand and the index. It is understandable that the terminal device 110 may use various index construction methods to construct an index, such as an inverted index, a bag of words model, a term frequency-inverse document frequency (TF-IDF) vector, a tree-based method (such as a KD tree and an Annoy tree), a hash method (such as a local sensitive hash, i.e., LSH), a vector quantization method (such as a product quantization method or an optimized product quantization method, i.e., a PQ method or an OPQ method), a graph-based method (such as a hierarchical navigable hourly screenshot method, i.e., a HNSW method), and the like. In actual application, any appropriate index construction method may be selected to construct an index according to actual needs, and the index construction method is not limited here. It should also be noted that the construction method of the reference data set described above is only exemplary and should not be understood as being limited to the construction of a reference data set using the method shown above. An appropriate method may be selected to construct a reference data set according to actual needs.
[0060] In some embodiments, the terminal device 110 may determine a vector representation of a target user question and a vector representation of at least one historical user question. The terminal device 110 may then determine a plurality of matching reference user questions and reference user requirements of a plurality of reference user questions from a reference data set based on the vector representation of the target user question and the vector representation of at least one historical user question to obtain reference information. Exemplarily, the terminal device 110 may determine a similarity index between the vector representation of the target user question and each reference vector representation in an index of the reference data set, and a similarity index between the vector representation of the at least one historical user question and each reference vector representation in the index. The terminal device 110 may sort the similarity index. Afterwards, based on the sorting result, multiple reference user questions and corresponding reference user requirements with top similarity index rankings may be selected from the reference data set. It should be understood that the terminal device 110 may select various appropriate similarity calculation methods to determine the similarity index, such as cosine similarity, Euclidean distance, edit distance, and the like.
[0061] In some embodiments, the terminal device 110 may obtain multiple candidate sets based on the target user question and at least one historical user question. Each candidate set includes one or more reference user questions and corresponding reference user requirements. The terminal device 110 may determine a predetermined number of reference user questions and corresponding reference user requirements from the multiple candidate sets to obtain reference information.
[0062] For example, Figure 5 As shown, Figure 5 A flowchart of a process 500 of determining reference information according to some embodiments of the present disclosure is shown. In block 510, the terminal device 110 may perform multi-way recall. Specifically, the terminal device 110 may obtain multiple candidate sets in multiple ways based on the target user question and at least one historical user question.
[0063] In block 511 of process 500, terminal device 110 may recall reference user questions and reference user requirements based on the target user question to obtain a candidate set. Specifically, terminal device 110 may perform data vectorization processing on the text content in target user question D[i] to obtain a vectorized representation of target user question D[i]. Then, based on the vectorized representation of target user question D[i], multiple matching reference user questions and corresponding reference user requirements are retrieved from reference data set 450 to obtain candidate set R i .
[0064] In block 512 of process 500, terminal device 110 may recall reference user questions and reference user requirements based on a sliding window to obtain a candidate set. Specifically, terminal device 110 may also determine vector representations of k historical user questions in set D[m] (m∈[i-1,ik]). Then, based on the vector representations of the k historical user questions, k groups of reference user questions and reference user requirements are retrieved from reference data set 450. Here, each group of reference user questions and corresponding reference user requirements may include one or more reference user questions and corresponding reference user requirements. Each group of reference user questions and reference user requirements may be represented as R i-1 , R i-2 , ..., R i-k Afterwards, the terminal device 110 will i-1 , R i-2 , ..., R i-k Merge into candidate set R m .
[0065] In some embodiments, the terminal device 110 may also construct multiple first question pairs based on the target user question and multiple historical user questions, each first question pair including the target user question and one historical user question. Afterwards, the terminal device 110 may determine multiple reference user questions that match the multiple first question pairs respectively and reference user requirements of the multiple reference user questions.
[0066] For example, Figure 5 As shown, in block 513 of process 500, the terminal device 110 may recall reference user questions and reference user requirements based on the skip cascade method to obtain a candidate set. Specifically, the terminal device 110 may construct a first question pair with each historical user question in D[j] (j∈[i-1, is]), which may form a total of n first question pairs. The set D[i] may be obtained through the n first question pairs. ij , set D ij It can be expressed by the following formula.
[0067] D ij =D[i][SEP]D[j] (2)
[0068] [SEP] indicates a separator.
[0069] The terminal device 110 can ij The text content of each first question pair in the data vectorization process is performed to obtain the vector representation of each first question pair. Afterwards, the terminal device 110 can retrieve n groups of reference user questions and reference user requirements from the reference data set based on the vector representation of the n first question pairs, which can be represented as R i,j-1, R i,j-2 , ..., R i,j-n The terminal device 110 can i,j-1 , R i,j-2 , ..., R i,j-n Merge into candidate set R ij Afterwards, the terminal device 110 can select from the candidate set R i , R m , R ij Determine the reference user questions and corresponding reference user needs of the predetermined data to obtain reference information.
[0070] It should be noted that the combination of the first question pair is only exemplary and should not be construed as being limited to combining the target user question with the historical user question determined based on the skip cascade method to form the first question pair. In actual application, the target user question may also be combined with the historical user question determined based on other methods to form the first question pair.
[0071] In some embodiments, the terminal device 110 may determine a first score for each reference user question based on the number of occurrences of each reference user question in multiple candidate sets and the weight of each candidate set. Afterwards, the terminal device 110 may determine a predetermined number of reference user questions and corresponding reference user needs from multiple candidate sets based on the first score. Alternatively or additionally, there may be a positive correlation between the first score and the number of occurrences of the reference user question in multiple candidate sets. That is, the more times the reference user question appears in multiple candidate sets, the greater the value of the first score may be. In this way, the first score can indicate the relevance of the reference user question to multiple rounds of dialogue to a certain extent.
[0072] For example, Figure 5 As shown, the terminal device 110 can set the candidate set R i , R m , R ij Input to the screening module 520, and use the screening module 520 to select from the candidate set R i , R e , R ij Specifically, the candidate sets R can be determined in advance. i , R m , R ij The harmonic coefficients α, β, As the candidate set R i , R m , R ij For the vehicle field, the harmonic coefficients α, β, The sum may not be 1.
[0073] If the reference user question appears in the candidate set R i , then the reference user question is assigned the first sub-score score1. If the reference user question appears in the candidate set R m , then the reference user question is given the second sub-score score2. If the reference user question appears in the candidate set R ij , then the reference user question is assigned a third sub-score score3. If the reference user question does not appear in any of the candidate sets, the corresponding sub-score may be zero or assigned a lower score.
[0074] Alternatively or additionally, in constructing the candidate set R i , R m , R ij In the process of performing deduplication processing on the reference user questions, score 1, score 2, and score 3 can be set to fixed values. i , R m , R ij In the process, when deduplication processing is not performed on the reference user question, the scores of score 1, score 2 and score 3 can be determined based on the number of times the reference user question appears repeatedly in the corresponding candidate set.
[0075] The terminal device 110 may determine the first score of each reference user question using the following formula.
[0076]
[0077] Wherein, score represents the first score of each reference user question.
[0078] After determining the first score of each reference user question, the terminal device 110 may sort the reference user questions based on the first score, and select a predetermined number (e.g., Z, where Z is a positive integer) of reference user questions and corresponding reference user needs from the sort. The predetermined number of reference user questions may be a predetermined number of reference user questions after merging and deduplication. Alternatively or additionally, a score threshold Th may also be pre-set. The terminal device 110 may compare the first score of each reference user question with the score threshold Th, and select Z reference user questions and corresponding reference user needs from the reference user questions whose first scores exceed the score threshold Th. It should be understood that the above method of screening reference user questions and reference user needs is only exemplary, and any appropriate method may be selected according to actual needs to screen out a predetermined number of reference user questions and corresponding reference user needs from multiple candidate sets to obtain reference information.
[0079] In some embodiments, the terminal device 110 may also construct a plurality of second question pairs based on the target user question and a predetermined number of reference user questions, each second question pair including a target user question and a reference user question. Based on the second question pairs, a second score of the relevance between the target user question and each reference user question is determined. Then, based on the second score, the predetermined number of reference user questions and the corresponding reference user requirements are sorted to obtain reference information. For example, Figure 5 As shown, the terminal device 110 can input the target user question and a predetermined number of reference user questions into the trained sorting model 530. The sorting model 530 is used to score the relevance between the target user question and each reference user question to obtain a second score. Based on the second score, the reference user questions of the predetermined data and the corresponding reference user requirements are sorted. The sorted reference user questions form reference information 540. The reference information 540 can also be called a few-shot.
[0080] In box 230 of process 200, the terminal device 110 determines the target user needs of the target user problem based on the target user problem and reference information using the trained machine learning model 160. Specifically, the terminal device 110 can construct a model input based on the target user problem and reference information. The terminal device 110 can provide the model input to the trained machine learning model 160 to obtain the model output of the machine learning model 160. The target user needs of the target user problem are then determined based on the model output. Here, the terminal device 110 can call the machine learning model 160 local to the terminal device 110, or call the machine learning model 160 through the server device 130.
[0081] In order to illustrate the data structure and data content of the model input constructed based on the target user questions and reference information, the following table shows the data content included in the model input constructed for the target user questions related to the vehicle.
[0082] Table 2
[0083]
[0084] An example of a model input built based on Table 2 is shown below.
[0085] Table 3
[0086]
[0087] In some embodiments, the terminal device 110 can obtain the model output of the machine learning model 160 based on the target user question and reference information, and the model output includes at least one label for marking the predicted user demand. Afterwards, the predicted user demand corresponding to the label at the target position in the model output is determined as the target user demand. Exemplarily, multiple predetermined user demands can be predetermined, and the model output can include labels of multiple predetermined user demands, and the labels can include probability values of each predetermined user demand being a target user demand. In the model output, multiple labels can be sorted according to the probability value, and the predetermined user demand corresponding to the first label in the model output can be determined as the target user demand.
[0088] In some embodiments, the terminal device 110 may obtain a model output of a machine learning model based on the target user question and the reference information, wherein the model output includes a probability matrix. The probability matrix includes a first predicted probability of a plurality of predetermined characters. Based on the probability matrix, a first predicted probability of each character in a plurality of predetermined user requirements is determined. Based on the first predicted probability of each character in a plurality of predetermined user requirements, a second predicted probability of each of the plurality of predetermined user requirements is determined. Then, based on the second predicted probability of each of the plurality of predetermined user requirements, a target user requirement is determined.
[0089] Exemplarily, the model output may be configured to include a posterior probability matrix M, which includes first predicted probabilities of a plurality of predetermined characters, for example, the first predicted probability may include a logistic regression (Logit) value g. If the predicted user demand includes the characters "X1X2X3X4", the Logit values g1, g2, g3, and g4 corresponding to the characters "X1X2X3X4" in the posterior probability matrix M may be determined. Thereafter, the second predicted probability may be determined by the following formula.
[0090] Second prediction probability = Πgi (4)
[0091] Among them, gi represents the Logit value in the posterior probability matrix M, and Π is the multiplication symbol.
[0092] The terminal device 110 may perform normalization processing on the second predicted probabilities of the plurality of predetermined user needs, and select the predetermined user need corresponding to the largest second predicted probability after the normalization processing as the target user need. In this way, the prediction of the target user need may be prevented from being affected by the hallucinations generated by the machine learning model 160 to a certain extent, and the accuracy of determining the target user need may be improved.
[0093] In box 240 of process 200, the terminal device 110 generates a target user answer to the target user's question based on the target user's needs. In actual application, the target user answer can be generated in a variety of ways. In one example, after determining the target user's needs, the terminal device 110 can use the machine learning model 160 to generate a target user answer to the target user's question. In another example, after determining the target user's needs, the terminal device 110 can also determine the target user answer to the target user's question from the knowledge base. In another example, the terminal device 110 can also obtain prior knowledge matching the target user's needs from the knowledge base based on the target user's needs, provide the target user's question and the prior knowledge to the machine learning model 160, and use the machine learning model 160 to generate a target user answer to the target user's question. Of course, the above method of generating a target user answer is only exemplary. In actual application, any appropriate method can be selected according to actual needs to determine the target user answer based on the target user's needs.
[0094] In some embodiments, the terminal device 110 may also present the target user's response and may also play the response voice corresponding to the target user's response. Figure 3 As shown, the terminal device 110 can present reference information 305 and target user response 306 in the presentation area 301 .
[0095] The training process of the machine learning model will be introduced below. It should be understood that such a training process can be performed by appropriate training equipment, which may include but is not limited to terminal device 110.
[0096] In an embodiment of the present disclosure, the training device may obtain a plurality of training samples, each of which includes a sample user question, a sample user requirement of the sample user question, a reference user question matching the sample user question, and a reference user requirement of the reference user question.
[0097] Exemplarily, the training device can select multiple historical user questions of the digital assistant to form multiple sample user questions. The training device can also determine the sample user needs of the multiple sample user questions respectively. Afterwards, the training device can also determine the reference information of each sample user question. It should be noted that the process of determining the reference information of the sample user questions is similar to the process of determining the reference information of the target user questions. The process of determining the reference information of the target user questions has been explained in the foregoing content, and please refer to the foregoing explanations, which will not be repeated here.
[0098] In an embodiment of the present disclosure, a training device may train a machine learning model based on a plurality of training samples. In some embodiments, the training device may provide a plurality of training samples to the machine learning model to obtain predicted user needs for sample user questions. Thereafter, the training device may train the machine learning model using a loss function constructed based on a business factor, where the business factor is related to the vehicle.
[0099] Exemplarily, during the training process, the sample model input may be constructed based on the formats shown in Tables 2 and 3. The difference between using the machine learning model to determine the target user needs is that the first sample label indicating the sample user needs may be filled in the field value of the "label" field in Table 3. Afterwards, the sample model input is provided to the machine learning model to obtain the first predicted label indicating the predicted user needs of the sample user problem.
[0100] L1=-Σ(y θ *log(p θ ) μ ) (5)
[0101] Among them, L1 represents the loss function, y θ represents the first sample label indicating the sample user's needs, p θ represents the first prediction label for predicting user demand, and μ represents the business factor related to the vehicle.
[0102] In some embodiments, the training device may also use the training samples to train the ranking model 530. Specifically, the training device may also input the sample user questions and reference user questions in the training samples into the ranking model 530 to obtain the second predicted label output by the ranking model 530. The ranking model 530 may be trained using the loss function shown below.
[0103] L2=-[y*log(p) μ +(1-y)*log(1-p) μ ] (6)
[0104] Wherein, L represents the loss function; y represents the second sample label, which is used to mark the correlation between the sample user question and the reference user question; p is the second prediction label output by the sorting model, which is used to mark the correlation between the sample user question and the reference user question; μ represents the business factor related to the vehicle.
[0105] It should be noted that the above loss functions for machine learning models and ranking models are exemplary. In practical applications, loss functions that meet actual needs can be constructed according to actual training requirements and training objectives.
[0106] To summarize, according to the embodiments of the present disclosure, multiple reference user questions and corresponding reference user needs provide a reference for identifying user needs of user questions in a multi-round dialogue scenario, which is beneficial to improving the accuracy of user need identification, and further beneficial to improving the quality of responses in a multi-round dialogue scenario.
[0107] The embodiments of the present disclosure also provide corresponding devices for implementing the above methods or processes. Figure 6 A schematic structural block diagram of an apparatus 600 for question-answer processing according to some embodiments of the present disclosure is shown. The apparatus 600 may be implemented in or included in the terminal device 110, for example. Each module / component in the apparatus 600 may be implemented by hardware, software, firmware, or any combination thereof.
[0108] As shown in the figure, the device 600 may include an acquisition module 610, a first determination module 620, a second determination module 630 and a generation module 640. The acquisition module 610 is configured to, in response to receiving a target user question of a target dialogue round in multiple dialogue rounds with a user, acquire at least one historical user question of at least one historical dialogue round before the target dialogue round. The first determination module 620 is configured to determine reference information based on the target user question and at least one historical user question, the reference information including multiple reference user questions and reference user requirements of multiple reference user questions, each reference user question matches the target user question and / or at least one historical user question. The second determination module 630 is configured to determine the target user requirement of the target user question based on the target user question and the reference information using a trained machine learning model. The generation module 640 is configured to generate a target user answer to the target user question based on the target user requirement.
[0109] In some embodiments, the acquisition module 610 is further configured to: acquire multiple historical user questions from multiple historical conversation turns within a predetermined turn range before the target conversation turn; and / or acquire multiple historical user questions from multiple interval historical conversation turns before the target conversation turn.
[0110] In some embodiments, the first determination module 620 is further configured to: construct multiple first question pairs based on the target user question and multiple historical user questions, each first question pair including the target user question and a historical user question; and determine multiple reference user questions that match the multiple first question pairs respectively and reference user needs of the multiple reference user questions to obtain reference information.
[0111] In some embodiments, the first determination module 620 is further configured to: determine a vector representation of a target user question and a vector representation of at least one historical user question; and based on the vector representation of the target user question and the vector representation of at least one historical user question, determine a plurality of matching reference user questions and reference user requirements of the plurality of reference user questions from a reference data set to obtain reference information.
[0112] In some embodiments, the device 600 also includes: a construction module, configured to construct a reference data set by the following method: obtaining reference user questions and reference user requirements of reference user questions; determining structured data containing reference user questions and corresponding reference user requirements; generating a reference vector representation based on the structured data; and generating an index based on the reference vector representation to obtain a reference data set containing reference user questions, reference user requirements of reference user questions and an index.
[0113] In some embodiments, the first determination module 620 is further configured to: obtain multiple candidate sets based on the target user question and at least one historical user question, each candidate set including one or more reference user questions and corresponding reference user needs; and determine a predetermined number of reference user questions and corresponding reference user needs from the multiple candidate sets to obtain reference information.
[0114] In some embodiments, the first determination module 620 is further configured to: determine, for each reference user question, a first score for each reference user question based on the number of occurrences of each reference user question in multiple candidate sets and the weight of each candidate set; and determine a predetermined number of reference user questions and corresponding reference user needs from the multiple candidate sets based on the first score.
[0115] In some embodiments, the first determination module 620 is further configured to: construct a plurality of second question pairs based on the target user question and a predetermined number of reference user questions, each second question pair including a target user question and a reference user question; determine a second score of the correlation between the target user question and each reference user question based on the second question pairs; and sort a predetermined number of reference user questions and corresponding reference user needs based on the second score to obtain reference information.
[0116] In some embodiments, the second determination module 630 is further configured to: obtain a model output of a machine learning model based on the target user question and reference information, the model output including at least one label for annotating predicted user needs; and determine the predicted user needs corresponding to the label at the target position in the model output as the target user needs.
[0117] In some embodiments, the second determination module 630 is further configured to: obtain a model output of a machine learning model based on the target user question and reference information, the model output including a probability matrix, the probability matrix including first prediction probabilities of multiple predetermined characters; determine the first prediction probability of each character in multiple predetermined user needs based on the probability matrix; determine the second prediction probability of each of the multiple predetermined user needs based on the first prediction probability of each character in the multiple predetermined user needs; and determine the target user need based on the second prediction probability of each of the multiple predetermined user needs.
[0118] In some embodiments, the targeted user question comprises a vehicle-related question input by the user.
[0119] In some embodiments, the device 600 also includes: a training module, configured to obtain multiple training samples, each training sample includes a sample user question, a sample user demand of the sample user question, a reference user question matching the sample user question, and a reference user demand of the reference user question; and training a machine learning model based on the multiple training samples.
[0120] In some embodiments, the training module is further configured to: provide multiple training samples to the machine learning model to obtain predicted user needs of sample user questions; and train the machine learning model using a loss function constructed based on business factors, where the business factors are related to the vehicle.
[0121] The units and / or modules included in the device 600 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more units and / or modules can be implemented using software and / or firmware, such as machine executable instructions stored on a storage medium. In addition to or as an alternative to machine executable instructions, some or all of the units and / or modules in the device 600 can be implemented at least in part by one or more hardware logic components. As an example and not limitation, exemplary types of hardware logic components that can be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0122] Figure 7 1 shows a block diagram of an electronic device 700 in which one or more embodiments of the present disclosure may be implemented. It should be understood that Figure 7 The electronic device 700 shown is merely exemplary and should not constitute any limitation on the functionality and scope of the embodiments described herein. Figure 7 The electronic device 700 shown may include or be implemented as Figure 1 The terminal device 110, or Figure 6Device 600.
[0123] like Figure 7 As shown, the electronic device 700 is in the form of a general electronic device. The components of the electronic device 700 may include, but are not limited to, one or more processors or processing units 710, a memory 720, a storage device 730, one or more communication units 740, one or more input devices 750, and one or more output devices 760. The processing unit 710 may be an actual or virtual processor and is capable of performing various processes according to a program stored in the memory 720. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to improve the parallel processing capability of the electronic device 700.
[0124] The electronic device 700 typically includes a plurality of computer storage media. Such media may be any accessible media that is accessible to the electronic device 700, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 720 may be a volatile memory (e.g., registers, caches, random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The storage device 730 may be a removable or non-removable medium, and may include a machine-readable medium, such as a flash drive, a disk, or any other medium, which may be capable of being used to store information and / or data and may be accessed within the electronic device 700.
[0125] The electronic device 700 may further include additional removable / non-removable, volatile / non-volatile storage media. Figure 7 As shown in , a disk drive for reading or writing from a removable, non-volatile disk (e.g., a "floppy disk") and an optical drive for reading or writing from a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to the bus (not shown) by one or more data media interfaces. The memory 720 may include a computer program product 725 having one or more program modules that are configured to perform various methods or actions of various embodiments of the present disclosure.
[0126] The communication unit 740 implements communication with other electronic devices through a communication medium. Additionally, the functions of the components of the electronic device 700 can be implemented with a single computing cluster or multiple computing machines that can communicate through a communication connection. Therefore, the electronic device 700 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.
[0127] The input device 750 may be one or more input devices, such as a mouse, a keyboard, a tracking ball, etc. The output device 760 may be one or more output devices, such as a display, a speaker, a printer, etc. The electronic device 700 may also communicate with one or more external devices (not shown) through the communication unit 740 as needed, such as a storage device, a display device, etc., communicate with one or more devices that allow a user to interact with the electronic device 700, or communicate with any device that allows the electronic device 700 to communicate with one or more other electronic devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).
[0128] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which computer-executable instructions are stored, wherein the computer-executable instructions are executed by a processor to implement the method described above. According to an exemplary implementation of the present disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the method described above.
[0129] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices, equipment, and computer program products implemented according to the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0130] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0131] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, so that the instructions executed on the computer, other programmable data processing apparatus, or other device implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0132] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple implementations of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some implementations as replacements, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.
[0133] The above descriptions of various implementations of the present disclosure are exemplary, non-exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described implementations. The selection of terms used herein is intended to best explain the principles of the implementations, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the various implementations disclosed herein.
Claims
1. A method for question answering processing, comprising: In response to receiving a target user question of a target conversation turn among a plurality of conversation turns with a user, obtaining at least one historical user question of at least one historical conversation turn before the target conversation turn; Determine reference information based on the target user question and the at least one historical user question, the reference information comprising a plurality of reference user questions and reference user requirements of the plurality of reference user questions, each reference user question matching the target user question and / or the at least one historical user question; Based on the target user question and the reference information, using the trained machine learning model, determine the target user needs of the target user question; as well as Based on the target user needs, a target user answer to the target user question is generated.
2. The method according to claim 1, wherein obtaining the at least one historical user question comprises: Acquire a plurality of historical user questions in a plurality of historical dialogue turns within a predetermined turn range before the target dialogue turn; and / or A plurality of historical user questions in a plurality of historical dialogue turns at intervals before the target dialogue turn are obtained.
3. The method according to claim 1, wherein determining the reference information comprises: Based on the target user question and the multiple historical user questions, construct multiple first question pairs, each first question pair includes the target user question and a historical user question; as well as A plurality of reference user questions respectively matching the plurality of first question pairs and reference user requirements of the plurality of reference user questions are determined to obtain the reference information.
4. The method according to claim 1, wherein determining the reference information comprises: Determining a vector representation of the target user question and a vector representation of the at least one historical user question; as well as Based on the vector representation of the target user question and the vector representation of the at least one historical user question, a plurality of matching reference user questions and reference user requirements of the plurality of reference user questions are determined from a reference data set to obtain the reference information.
5. The method according to claim 4, wherein the reference data set is constructed by: Obtain reference user questions and reference user needs of reference user questions; Determining structured data including the reference user questions and corresponding reference user requirements; Based on the structured data, generating a reference vector representation; as well as An index is generated based on the reference vector representation to obtain a reference data set including the reference user question, the reference user requirement of the reference user question, and the index.
6. The method of claim 1, wherein determining the reference information comprises: Based on the target user question and the at least one historical user question, a plurality of candidate sets are obtained, each of the candidate sets comprising one or more reference user questions and corresponding reference user requirements; as well as A predetermined number of reference user questions and corresponding reference user requirements are determined from the multiple candidate sets to obtain the reference information.
7. The method according to claim 6, wherein determining a predetermined number of reference user questions and corresponding reference user requirements from the plurality of candidate sets to obtain the reference information comprises: For each reference user question, determine a first score for each reference user question based on the number of occurrences of each reference user question in the multiple candidate sets and the weight of each candidate set; as well as Based on the first score, a predetermined number of reference user questions and corresponding reference user requirements are determined from the multiple candidate sets.
8. The method according to claim 7, wherein determining a predetermined number of reference user questions and corresponding reference user requirements from the plurality of candidate sets to obtain the reference information further comprises: Based on the target user question and the predetermined number of reference user questions, construct a plurality of second question pairs, each second question pair including the target user question and one reference user question; Based on the second question pair, determining a second score of the relevance between the target user question and each reference user question; as well as Based on the second score, the predetermined number of reference user questions and corresponding reference user requirements are sorted to obtain the reference information.
9. The method according to claim 1, wherein determining the target user needs of the target user problem comprises: Based on the target user question and the reference information, obtaining a model output of the machine learning model, wherein the model output includes at least one label for annotating the predicted user demand; as well as The predicted user demand corresponding to the label at the target position in the model output is determined as the target user demand.
10. The method according to claim 1, wherein determining the target user needs of the target user problem comprises: Based on the target user question and the reference information, obtaining a model output of the machine learning model, wherein the model output includes a probability matrix, and the probability matrix includes first predicted probabilities of a plurality of predetermined characters; Based on the probability matrix, determining a first predicted probability of each character in a plurality of predetermined user requirements; Determining a second prediction probability of each of the plurality of predetermined user demands based on the first prediction probability of each character in the plurality of predetermined user demands; and The target user demand is determined based on the second predicted probabilities of each of the plurality of predetermined user demands. The method of claim 1 , wherein the target user question comprises a vehicle-related question input by a user.
12. The method according to claim 1, further comprising: Acquire multiple training samples, each training sample includes a sample user question, a sample user demand for the sample user question, a reference user question matching the sample user question, and a reference user demand for the reference user question; as well as Based on the multiple training samples, the machine learning model is trained.
13. The method according to claim 12, wherein based on the plurality of training samples, training the machine learning model comprises: Providing the plurality of training samples to the machine learning model to obtain predicted user needs for the sample user questions; as well as The machine learning model is trained using a loss function constructed based on business factors, where the business factors are related to the vehicle.
14. A device for question-answering processing, comprising: an acquisition module, configured to, in response to receiving a target user question of a target conversation turn among a plurality of conversation turns with a user, acquire at least one historical user question of at least one historical conversation turn before the target conversation turn; A first determination module is configured to determine reference information based on the target user question and the at least one historical user question, the reference information comprising a plurality of reference user questions and reference user requirements of the plurality of reference user questions, each reference user question matching the target user question and / or the at least one historical user question; A second determination module is configured to determine the target user needs of the target user problem based on the target user problem and the reference information using a trained machine learning model; as well as The generating module is configured to generate a target user answer to the target user question based on the target user demand.
15. An electronic device, comprising: at least one processing unit; as well as At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to any one of claims 1 to 13 when executed by the at least one processing unit.
16. A computer-readable storage medium having a computer program stored thereon, wherein the computer program can be executed by a processor to implement the method according to any one of claims 1 to 13.
17. A computer program product, comprising a computer program, wherein the computer program implements the method according to any one of claims 1 to 13 when executed by a processor.