Question and answer processing method, method and device for training question and answer processing model
By combining the information extraction model and the answer generation model, the problem of the intelligent question-answering system being unable to accurately understand user demands is solved, and more accurate answers are generated, which is suitable for e-commerce customer service systems.
Patent Information
- Application Number
- CN202310468450.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-27
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2043-04-27
AI Technical Summary
The answer generation effect of existing intelligent question-answering systems still needs to be improved, and they are unable to accurately understand users' service demands and generate high-precision answers.
The information extraction model is used to extract the appeal text from the question text and context, and the appeal text is used to retrieve candidate knowledge in the knowledge base. A text sequence input answer generation model is constructed to generate the answer text.
Based on an accurate understanding of user service demands, it integrates various types of text knowledge to generate more accurate answers. This is especially suitable for e-commerce customer service systems, providing large-scale, high-quality answers for merchants and products.
Smart Images

Figure CN116662495B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a question-answering processing method, a method for training a question-answering processing model, and a device. Background Art
[0002] In the field of artificial intelligence, intelligent question answering (AI) is a very popular application. It requires AI question answering systems to automatically answer questions in natural language. AI question answering has been widely used in various scenarios, such as intelligent customer service and human-computer interaction. Compared to text retrieval, AI question answering reduces the need for users to perform secondary extraction and reasoning on the retrieved document content, significantly improving the user experience in acquiring knowledge. However, the answer generation performance of existing AI question answering systems still needs to be improved. Summary of the Invention
[0003] In view of this, the present application provides a question-answering processing method, a method and a device for training a question-answering processing model, so as to provide users with high-precision answers and improve the answer generation effect.
[0004] This application provides the following solutions:
[0005] In a first aspect, a question-answering processing method is provided, the method comprising:
[0006] Obtain the question text and the context of the question text in the conversation;
[0007] Inputting the question text and the context of the question text in the conversation into an information extraction model, obtaining a demand text output by the information extraction model, wherein the demand text describes the service demand of the target object targeted by the question text;
[0008] Using the appeal text to search in a knowledge base to obtain one or more candidate knowledge, the knowledge base contains multiple types of text knowledge;
[0009] constructing a second text sequence using the one or more candidate knowledge, the appeal text, and the context;
[0010] The second text sequence is input into an answer generation model to obtain an answer text generated by the answer generation model for the question text.
[0011] According to an implementable manner in an embodiment of the present application, the information extraction model includes a first encoding module and a first decoding module;
[0012] The first encoding module performs feature extraction on a first text sequence obtained by concatenating the question text and the context of the question text in the conversation, to obtain a feature representation of each element token in the first text sequence;
[0013] The first decoding module performs decoding processing using the feature representation of each token in the first text sequence, and uses the text sequence obtained by the decoding processing as the appeal text.
[0014] According to an achievable method in an embodiment of the present application, the knowledge base includes a question-answer knowledge base and an information knowledge base of the object type to which the target object belongs;
[0015] The question-answer knowledge base includes knowledge of question-answer pairs, which is indexed by questions in the question-answer pairs, and stores feature vectors of the indexes and object information related to the question-answer pairs accordingly;
[0016] The information knowledge base of the object type to which the target object belongs includes: at least one kind of knowledge among categories, attribute information, web page content, comment content and instructions corresponding to each object information of the object type.
[0017] According to an achievable method in an embodiment of the present application, searching the knowledge base using the appeal text includes:
[0018] Acquire information of the target object from the appeal text;
[0019] Performing a first search in the knowledge base using the information of the target object to obtain a plurality of text knowledge;
[0020] A second search is performed among the plurality of text knowledge using the feature vector of the appeal text to obtain the one or more candidate knowledge.
[0021] According to an achievable method in an embodiment of the present application, constructing a second text sequence using the one or more candidate knowledge, the appeal text, and the context includes:
[0022] Fill the one or more candidate knowledge, the appeal text and the context into a preset rewriting template to obtain the second text sequence, wherein the rewriting template includes content indicating the candidate knowledge, slots for the candidate knowledge, content indicating the appeal text, slots for the appeal text, content indicating the dialogue context and slots for the dialogue context.
[0023] In a second aspect, a question-answering processing method is provided, which is applied to an e-commerce intelligent customer service system. The method includes:
[0024] Obtaining a user's question text and the context of the question text in a conversation between the user and the e-commerce intelligent customer service system;
[0025] Inputting the question text and the context into an information extraction model to obtain a demand text output by the information extraction model, wherein the demand text describes the service demand of the target object targeted by the question text, and the target object includes merchants and / or products;
[0026] Using the appeal text to search in a knowledge base to obtain one or more candidate knowledge, the knowledge base contains multiple types of textual knowledge related to merchants and / or products;
[0027] constructing a second text sequence using the one or more candidate knowledge, the appeal text, and the context;
[0028] The second text sequence is input into an answer generation model to obtain an answer text generated by the answer generation model for the question text.
[0029] According to an achievable method in an embodiment of the present application, the knowledge base includes a merchant question and answer knowledge base and a product information knowledge base;
[0030] The merchant question-answer knowledge base includes knowledge of question-answer pairs, which is indexed by the questions in the question-answer pairs, and stores corresponding feature vectors of the indexes and product identifiers and / or merchant identifiers related to the question-answer pairs;
[0031] The product information knowledge base includes at least one of the categories, attribute information, details page, product title, review content and instructions corresponding to the product identification.
[0032] According to an achievable method in an embodiment of the present application, searching the knowledge base using the appeal text includes:
[0033] Obtaining a merchant ID and / or a product ID from the appeal text;
[0034] Perform a first search in the knowledge base using the merchant identifier and / or product identifier to obtain a plurality of text knowledge items;
[0035] A second search is performed among the plurality of text knowledge using the feature vector of the appeal text to obtain the one or more candidate knowledge.
[0036] In a third aspect, a question-answering processing method is provided, which is executed by a cloud server, and the method includes:
[0037] Obtain the question text or question voice sent by the user's terminal device, and obtain the context of the question text in the conversation;
[0038] Inputting the question text and the context of the question text in the conversation into an information extraction model, obtaining a demand text output by the information extraction model, wherein the demand text describes the service demand of the target object targeted by the question text;
[0039] Using the appeal text to search in a knowledge base to obtain one or more candidate knowledge, the knowledge base contains multiple types of text knowledge;
[0040] constructing a second text sequence using the one or more candidate knowledge, the appeal text, and the context;
[0041] Inputting the second text sequence into an answer generation model to obtain an answer text generated by the answer generation model for the question text;
[0042] The answer text or the speech synthesized using the answer text is returned to the terminal device.
[0043] In a fourth aspect, a method for training a question-answering processing model is provided, the method comprising:
[0044] Acquire training data comprising a plurality of training samples, wherein the training samples include a question sample, a context of the question sample in a conversation, and an answer sample corresponding to the question sample;
[0045] The training data is used to train a question-answering processing model, wherein the training includes: taking the question sample in the training sample and the context of the question sample in the conversation as the input of the question processing model, and the information extraction model in the question processing model using the input question sample and the context of the question sample in the conversation to generate a demand text, wherein the demand text describes the service demand of the target object targeted by the question sample; using the demand text to search in a knowledge base to obtain one or more candidate knowledge, and the knowledge base contains multiple types of text knowledge; using the one or more candidate knowledge, the demand text and the context to construct a second text sequence; inputting the second text sequence into the answer generation model in the question processing model to obtain the answer text generated by the answer generation model for the question sample; the goal of the training includes: minimizing the difference between the answer text generated by the answer generation model and the answer sample in the corresponding training sample.
[0046] In a fifth aspect, a question-answer processing device is provided, the device comprising:
[0047] a question acquisition unit configured to acquire a question text and a context of the question text in the conversation;
[0048] An information extraction unit is configured to input the question text and the context of the question text in the conversation into an information extraction model, and obtain a demand text output by the information extraction model, wherein the demand text describes the service demand of the target object targeted by the question text;
[0049] a knowledge retrieval unit configured to use the appeal text to search in a knowledge base to obtain one or more candidate knowledge, wherein the knowledge base contains multiple types of textual knowledge;
[0050] a text construction unit configured to construct a second text sequence using the one or more candidate knowledge, the appeal text, and the context;
[0051] The answer generation unit is configured to input the second text sequence into an answer generation model, and obtain an answer text generated by the answer generation model for the question text.
[0052] In a sixth aspect, a device for training a question-answering processing model is provided, the device comprising:
[0053] a sample acquisition unit configured to acquire training data comprising a plurality of training samples, wherein the training samples include a question sample, a context of the question sample in a conversation, and an answer sample corresponding to the question sample;
[0054] A model training unit is configured to train a question-answering processing model using the training data, wherein the training includes: taking the question sample in the training sample and the context of the question sample in the conversation as the input of the question processing model, and the information extraction model in the question processing model using the input question sample and the context of the question sample in the conversation to generate a demand text, wherein the demand text describes the service demand of the target object targeted by the question sample; using the demand text to search in the knowledge base to obtain one or more candidate knowledge, and the knowledge base contains multiple types of text knowledge; using the one or more candidate knowledge, the demand text and the context to construct a second text sequence; inputting the second text sequence into the answer generation model in the question processing model to obtain the answer text generated by the answer generation model for the question sample; the goal of the training includes: minimizing the difference between the answer text generated by the answer generation model and the answer sample in the corresponding training sample.
[0055] According to a seventh aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the steps of the method described in any one of the first to fourth aspects are implemented.
[0056] According to an eighth aspect, an electronic device is provided, comprising:
[0057] one or more processors; and
[0058] A memory associated with the one or more processors, the memory being used to store program instructions, wherein the program instructions, when read and executed by the one or more processors, execute the steps of the method described in any one of the first to fourth aspects above.
[0059] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0060] 1) This application uses an information extraction model to extract a request text that reflects the service demand for the target user from the question text and the context of the question text in the conversation. The request text is then used to retrieve one or more candidate knowledge from a knowledge base containing multiple types of textual knowledge. The candidate knowledge, request text, and context are used to construct a text sequence, which is then input into the answer generation model to obtain the answer text. This approach accurately understands the user's service demand and retrieves and integrates multiple types of textual knowledge, thereby generating more accurate answers and improving answer generation performance.
[0061] 2) This application integrates multiple types of knowledge, such as question-answer pairs, categories, attribute information, webpage content, reviews, and instructions, into a unified answer generation approach. This approach is more efficient and particularly suitable for e-commerce customer service systems, enabling large-scale, multi-source high-quality answer generation for tens of millions of merchants and hundreds of millions of products.
[0062] 3) This application uses an end-to-end approach to train the question-answer generation model. There is no need to additionally label training data for the information extraction model and the ranking model. Instead, a unified set of training data can be used for the question-answer generation model. Compared with the traditional intent-recognition-based question-answer generation method, which requires additional labeling of a large number of samples for the intent recognition model, this obviously greatly saves labor costs.
[0063] Of course, any product implementing the present application does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0065] Figure 1 is a system architecture diagram applicable to the embodiments of the present application;
[0066] Figure 2A flowchart of the question-and-answer processing method provided in an embodiment of the present application;
[0067] Figure 3 A schematic diagram illustrating the principle of the question-answering processing model provided in an embodiment of the present application;
[0068] Figure 4 A flowchart of a method for training a question-answering processing model provided in an embodiment of the present application;
[0069] Figure 5 The question-answering processing method provided in the embodiment of the present application is applied to the e-commerce intelligent customer service system;
[0070] Figure 6 A schematic block diagram of a question-and-answer processing device provided in an embodiment of the present application;
[0071] Figure 7 A schematic block diagram of a device for training a question-answering processing model provided in an embodiment of the present application;
[0072] Figure 8 A schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0073] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.
[0074] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The singular forms "a", "an", "the" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise.
[0075] It should be understood that the term "and / or" as used herein is merely a description of the relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.
[0076] The word "if," as used herein, may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to the determination" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)," depending on the context.
[0077] In order to facilitate the understanding of this application, the system architecture to which this application is applicable is first briefly described. Figure 1 An exemplary system architecture to which the embodiments of the present application can be applied is shown. Figure 1 As shown in , the system architecture may include a user device and a question-answering processing device and a model training device located on the server side.
[0078] The model training device is used to obtain training data in the offline stage and pre-train the answer generation model using the method provided in the embodiment of the present application. After the training is completed, the answer generation model is provided online to the question and answer processing device for online question and answer processing.
[0079] The user can input question text or voice containing the question through the user device, and the user device sends the question text or voice containing the question to the server.
[0080] User devices include, but are not limited to, smart mobile terminals, smart home devices, wearable devices, and personal computers (PCs). Smart mobile devices include mobile phones, tablets, laptops, PDAs (Personal Digital Assistants), and internet-connected cars. Smart home devices include smart TVs, smart speakers, and smart refrigerators. Wearable devices include smart watches, smart glasses, virtual reality devices, augmented reality devices, and mixed reality devices (i.e., devices that support both virtual reality and augmented reality).
[0081] The server side provides the received question text to the question-answering processing device, or the server side performs speech recognition on the received speech containing the question and provides the question text obtained by the speech recognition to the question-answering processing device.
[0082] The question and answer processing device can adopt the method provided in the embodiment of the present application, utilize various types of knowledge in the knowledge base, perform question and answer processing on the question text, and generate an answer text.
[0083] After obtaining the answer text generated by the question-answer processing device, the server can return the answer text to the user device via the network. It can also perform speech synthesis on the answer text to obtain a voice containing the answer and return the voice to the user device.
[0084] The model training device and the question-answering processing device can be set up as independent servers, or can be set up on the same server, or can be set up in a server group, or can be set up in a cloud server. A cloud server, also known as a cloud computing server or cloud host, is a host product in the cloud computing service system to solve the problems of difficult management and weak service scalability in traditional physical hosts and virtual private servers (VPS). Figure 1 In addition to the architecture shown, the model training device and the question-answering processing device can also be set on a computer terminal with strong computing power.
[0085] It should be understood that Figure 1 The number of user devices, model training devices, question-answering processing devices, question-answering processing models, and knowledge bases in the embodiment is merely illustrative. Any number of user devices, model training devices, question-answering processing devices, question-answering processing models, and knowledge bases may be provided as needed.
[0086] Figure 2 This is a flowchart of the question-answering processing method provided in the embodiment of the present application. The method can be Figure 1 The question-answer processing device in the system shown in FIG. Figure 2 As shown in , the method may include the following steps:
[0087] Step 202: Obtain the question text and the context of the question text in the conversation.
[0088] Step 204: Input the question text and the context of the question text in the conversation into the information extraction model to obtain the demand text output by the information extraction model. The demand text describes the service demand of the target object targeted by the question text.
[0089] Step 206: Use the appeal text to search in the knowledge base to obtain more than one candidate knowledge. The knowledge base contains multiple types of text knowledge.
[0090] Step 208: Construct a second text sequence using one or more candidate knowledge, the appeal text, and the above context.
[0091] Step 210: Input the second text sequence into the answer generation model to obtain the answer text generated by the answer generation model for the question text.
[0092] As can be seen from the above process, this application uses an information extraction model to extract a demand text that reflects the service demand for the target object from the question text and the context of the question text in the conversation. The demand text is then used to retrieve one or more candidate knowledge from a knowledge base containing multiple types of text knowledge. The candidate knowledge, demand text, and context are used to construct a text sequence, which is then input into the answer generation model to obtain the answer text. This method can retrieve and integrate multiple types of text knowledge based on an accurate understanding of the user's service demand, thereby generating more accurate answers and improving the answer generation effect.
[0093] It should be noted that the terms "first" and "second" in this disclosure do not restrict size, order, or quantity, but are merely used to distinguish between them in name. For example, "first encoding module" and "second encoding module" are used to distinguish between two encoding modules in name. Another example is "first decoding module" and "second decoding module" are used to distinguish between two decoding modules in name.
[0094] The following describes each step in the above process in detail. First, the above step 202, namely "obtaining the question text and the context of the question text in the conversation", is described in detail with reference to an embodiment.
[0095] The question text typically comes from the user. The source of the question text can vary in different application scenarios. For example, a user can enter the question text into a text box provided by the intelligent question-answering system through their device. Alternatively, the user can enter the question voice-activated on their device.
[0096] The question-answer processing device on the server side obtains the question text from the user device, or performs voice recognition on the question voice from the user device to obtain the question text.
[0097] When users enter questions in various scenarios, they typically ask a question at a certain point in the conversation. The question itself may not fully and completely express the user's needs. Therefore, in this embodiment, while obtaining the user's question text, the context of the question text in the conversation is also obtained. One possible implementation method is to use the content of the conversation N times prior to the question text as context, where N is a preset positive integer, for example, 3.
[0098] The above step 204, namely "inputting the question text and the context of the question text in the conversation into the information extraction model to obtain the appeal text output by the information extraction model", is described in detail below with reference to an embodiment.
[0099] In the embodiments of this application, Figure 3As shown in , the information extraction model is a submodel within the question-answering model. It extracts the requested text from the question text and its context within the conversation. The information extraction model can employ a seq2seq (sequence-to-sequence) generative model and specifically includes a first encoding module and a first decoding module.
[0100] The first encoding module is used to extract features from a first text sequence obtained by concatenating the question text and the context of the question text in the conversation, and obtain a feature representation of each token in the first text sequence.
[0101] Before encoding the input first text sequence, the first encoding module may first perform embedding processing on the input first text sequence. For example, word-based embedding, position-based embedding, etc. Among them, word embedding is to encode each token (element) into a word vector to obtain a word vector representation. Position embedding is to encode the position of each token in the input text to obtain a position representation. Among them, each token in the text sequence refers to an element that constitutes the text sequence. For a text sequence, the text sequence is divided into a character or word sequence, and the characters or words, as well as the start character and separator in the text sequence are all tokens.
[0102] The first encoding module can be trained based on a pre-trained language model. Pre-trained language models such as the T5 (Transfer Text-to-Text Transformer) model, BERT (Bidirectional Encoder Representation from Transformers), XLNet (an autoregressive model that implements bidirectional contextual information by arranging language models), and GPT (Generative Pre-Training) model are used as the initial encoding module, and further training is performed on this basis.
[0103] The first decoding module is used to perform decoding processing using the feature representation of each token in the first text sequence, and the obtained text sequence is used as the appeal text.
[0104] It should be noted here that, unlike the intent recognition used in some traditional question-answering processing methods, intent recognition maps the user's questions to fixed types of intent categories. That is to say, intent recognition obtains one of the multiple categories that have been pre-set. On the one hand, it is highly restrictive and is a forced expression. If the user's expression does not completely match the existing intent, it may cause inaccurate answers. On the other hand, in the process of training the intent recognition model, a large number of intent label samples need to be additionally labeled, which consumes a huge amount of manpower. As the number of intent types increases, the intent recognition model needs to be retrained and adjusted. The appeal text involved in the embodiment of the present application is a text sequence generated by a generative seq2seq model. It can be considered as a refined expression of the service appeal of the target object targeted by the question text. It does not need to be mapped to a specific category and is more freely and accurately expressed.
[0105] For example, suppose a user has the following conversation with an intelligent customer service representative:
[0106] User A: Hello!
[0107] Intelligent customer service: Hello.
[0108] User A: I ordered product XXX.
[0109] User A: But I don’t know what material it is, can you help me check it?
[0110] In this example, the user's question text is: "But I don't know what material it is, can you help me check it?". If the context in the conversation is taken from the content of the first three rounds of conversation, then after splicing the question text and the context, we can get the text sequence "Hello! Hello. I ordered product XXX. But I don't know what material it is, can you help me check it?". After inputting this text sequence into the information extraction model, we can get the demand text: "The user wants to inquire about the material of product XXX." It can be seen that the demand text concisely describes the user's service demand, and the service demand is for a specific object, namely "product XXX." It should be noted here that usually the user's service demand is for a specific object. This application refers to the specific object as the target object, and the target object in different application fields may be different. For example, in an e-commerce question-and-answer scenario, the target object can be a product, a merchant, etc. In a medical question-and-answer scenario, the target object can be a disease, an organ, a drug, etc.
[0111] The above step 206, namely "using the demand text to search in the knowledge base to obtain one or more candidate knowledge", is described in detail below with reference to an embodiment.
[0112] In the embodiment of the present application, a knowledge base containing various types of text knowledge can be pre-built. As one of the possible implementation methods, the above-mentioned knowledge base can be as follows Figure 3 As shown in , it includes a question-answer knowledge base and an information knowledge base of the object type to which the target object belongs.
[0113] The knowledge type in the question-and-answer knowledge base is question-and-answer pairs. Question-and-answer pairs can be pre-extracted from massive historical conversations or user comments, and the questions in the pairs can be indexed. The indexed feature vectors and object information related to the pairs can be stored accordingly. The object information can be represented by, for example, an object ID (Identity Document). For example, the following format is used for storage: [Object ID - Index - Index Vector - Knowledge]. The index can be the question in the pair, and the knowledge can be the answer.
[0114] The information knowledge base for the object type to which the target object belongs can include at least one type of knowledge from categories, attribute information, webpage content, reviews, and instructions corresponding to each object information. For example, it can be stored in the following format: [object ID - information source - knowledge]. In addition, feature vectors corresponding to the knowledge can be pre-stored.
[0115] This step can be implemented by the retrieval model in the question-answering processing model.
[0116] As one possible implementation method, the feature vector of the appeal text obtained in step 204 is obtained, and the feature vector of the appeal text is used to search the knowledge base to obtain one or more candidate knowledge. The search is essentially to calculate the similarity between the feature vector of the appeal text and the feature vectors of each knowledge in the knowledge base, for example, calculating the similarity between the appeal text and the feature vectors of the index in the question-and-answer knowledge base, and calculating the similarity between the appeal text and the feature vectors of the knowledge in the information knowledge base. Then, the knowledge with a similarity greater than or equal to a preset similarity threshold is selected as the candidate knowledge, or the knowledge with the top K similarities is selected as the candidate knowledge, where K is a preset positive integer, and so on.
[0117] Since users' questions are usually directed to specific objects, both the question-answer knowledge base and the information knowledge base usually store the corresponding relationship with the object information. Therefore, as another more preferred implementation method, the information of the target object can be first obtained from the appeal text. For example, the target object obtained from the appeal text "The user wants to inquire about the material of product XXX" is "product XXX". Furthermore, the information of the target object can also be obtained from other aspects, such as obtaining the store ID to which the intelligent customer service belongs. Then, the information of the target object is used to perform a first search in the knowledge base to obtain multiple text knowledge; and then the feature vector of the appeal text is used to perform a second search in the multiple text knowledge to obtain more than one candidate knowledge.
[0118] When the first search is performed in the knowledge base using the information of the target object, knowledge corresponding to the information of the target object may be retrieved, such as knowledge corresponding to the target product ID or knowledge corresponding to the target store ID.
[0119] When performing a second search using the feature vector of the appeal text within the plurality of textual knowledge, the similarity between the feature vector of the appeal text and the feature vectors of each piece of knowledge in the knowledge base can be calculated. For example, the similarity between the feature vector of the appeal text and an index in the question-and-answer knowledge base can be calculated, or the similarity between the feature vector of the appeal text and the knowledge in the information knowledge base can be calculated. Then, knowledge with a similarity greater than or equal to a preset similarity threshold can be selected as candidate knowledge, or knowledge ranked in the top K in similarity can be selected as candidate knowledge, where K is a preset positive integer, and so on.
[0120] The above step 208, namely "using one or more candidate knowledge, the appeal text and the above context to construct a second text sequence", is described in detail below with reference to an embodiment.
[0121] As one of the feasible ways, the one or more candidate knowledge, the appeal text and the context can be directly spliced together in a preset order to obtain a text sequence.
[0122] In addition to the above-mentioned achievable methods, in order to allow the answer generation model to better understand the user's demands and the semantic relationship between the user's demands and the candidate knowledge, one or more of the above-mentioned candidate knowledge, the demand text, and the context can be filled into a preset rewriting template to obtain a text sequence. The rewriting template may include content indicating the candidate knowledge, slots for the candidate knowledge, content indicating the demand text, slots for the demand text, content indicating the conversation context, and slots for the conversation context. For example, the rewriting template may take the following form:
[0123] "Based on or with reference to the information provided below: [Candidate knowledge 1], [Candidate knowledge 2], ..., [Candidate knowledge K]. Combined with the user's conversation context: [Context], please answer the user's current question: [Request text]."
[0124] The brackets [] represent slots.
[0125] In addition to the above content, the rewriting template can also include the content of the words to be used if the answer cannot be found. For example, the rewriting template may also include "if the answer cannot be found, output 'no answer'".
[0126] The above step 210, namely "inputting the second text sequence into the answer generation model to obtain the answer text generated by the answer generation model for the question text", is described in detail below with reference to an embodiment.
[0127] In the embodiments of this application, Figure 3 As shown in , the answer generation model is also a sub-model in the question-answering processing model, which is used to generate answer text using the input text sequence. The answer generation model can adopt a seq2seq (sequence-to-sequence) model and can specifically include: a second encoding module and a second decoding module.
[0128] The second encoding module is used to extract features from the input second text sequence to obtain feature representations of each token in the second text sequence.
[0129] Before encoding the input second text sequence, the second encoding module may first perform embedding processing on the input second text sequence. For example, word-based embedding, position-based embedding, etc. Among them, word embedding is to encode each token into a word vector to obtain a word vector representation. Position embedding is to encode the position of each token in the input text to obtain a position representation. Among them, each token in the text sequence refers to an element that constitutes the text sequence. For a text sequence, the text sequence is divided into a character or word sequence, and the characters or words, as well as the start character and separator in the text sequence are all tokens.
[0130] The second encoding module can be trained based on a pre-trained language model. Pre-trained language models such as the T5 model, BERT, XLNet, and GPT model are used as the initial encoding module, and further training is performed on this basis.
[0131] The second decoding module is used to use the feature representation of each token in the second text sequence to perform decoding processing, and the obtained text sequence is used as the answer text.
[0132] Figure 4This is a flow chart of a method for training a question-answering processing model provided in an embodiment of the present application. The method can be performed by Figure 1 The model training device in the system shown is executed. Figure 4 As shown in , the method includes:
[0133] Step 402: Acquire training data including a plurality of training samples, where the training samples include question samples, contexts of the question samples in a conversation, and answer samples corresponding to the question samples.
[0134] Training samples can be constructed manually or obtained through other means. For example, the user's question text and the preceding N rounds of conversation with the question text can be obtained from the customer service's historical Q&A logs as the question sample and the context of the question pseudo-text in the conversation, respectively. The answer text provided by the customer service representative to the question text can be used as the answer sample. Another example is that the user's question text and the preceding N rounds of conversation with the question text can be obtained from the customer service's historical Q&A logs as the question sample and the context of the question pseudo-text in the conversation, respectively. The high-quality answer text provided by the user can be used as the answer sample. And so on.
[0135] In addition, when constructing training samples, in addition to providing the answers that users want, some special sample construction can be performed to be able to return appropriate answer texts to users in different situations of user questions. This includes but is not limited to:
[0136] We can construct some ambiguous questions and their context within the conversation, and then construct the corresponding answers as rhetorical questions to further clarify the user's request. This way, during the actual question-answering process, if the user's input question and its context within the conversation don't clearly define the user's request, we can generate a rhetorical question to the user.
[0137] We can construct questions that ask for product information and their context within the conversation, and construct answers that recommend related products. This way, during the actual question-and-answer process, if the user's question and its context within the conversation reflect a desire to inquire about product information, we can generate a recommendation for related products.
[0138] Step 404: Using the training data to train the question-answering processing model, wherein the training includes: using the question sample in the training sample and the context of the question sample in the conversation as the input of the question processing model, and the information extraction model in the question processing model using the input question sample and the context of the question sample in the conversation to generate a demand text, wherein the demand text describes the service demand of the target object targeted by the question sample; the retrieval model in the question processing model uses the demand text to search in the knowledge base to obtain one or more candidate knowledge, and the knowledge base contains multiple types of text knowledge; using the one or more candidate knowledge, the demand text and the context to construct a second text sequence; inputting the second text sequence into the answer generation model in the question processing model to obtain the answer text generated by the answer generation model for the question sample; the training objectives include: minimizing the difference between the answer text generated by the answer generation model and the answer sample in the corresponding training sample.
[0139] In the embodiments of this application, the question-answering processing model is trained in an end-to-end manner, that is, the information extraction model, retrieval model, and answer generation model are trained as a whole. For the specific implementation principles of the information extraction model, retrieval model, and answer generation model, please refer to the relevant description in the embodiment of the question-answering processing method, which will not be repeated here.
[0140] In an embodiment of the present application, a loss function can be constructed based on the aforementioned training objective. In each iteration, the value of the loss function is used to update the parameters of the information extraction model, the retrieval model, and the answer generation model using methods such as gradient descent until a preset training termination condition is met. The training termination condition may include, for example, the value of the loss function being less than or equal to a preset loss function threshold, or the number of iterations reaching a preset threshold.
[0141] The above method provided in the embodiments of this application can be applied to a variety of application scenarios, such as the intelligent customer service system of e-commerce, the question-answering system in smart speakers, the question-answering system in the field of education, etc. Here, the method provided in this application is described by taking the application in the intelligent customer service system of e-commerce as an example.
[0142] Figure 5 The question-answering processing method provided in the embodiment of this application is applied to the e-commerce intelligent customer service system, such as Figure 5 As shown in , the method may include the following steps:
[0143] Step 502: Obtain the user's question text and the context of the question text in the conversation between the user and the e-commerce intelligent customer service system.
[0144] In this embodiment of the present application, the question text entered by the user during the conversation with the intelligent customer service is obtained, and the context of the question text in the conversation is also obtained. As one possible implementation method, the content of the conversation N rounds before the question text can be used as the context, where N is a preset positive integer, for example, N is 3.
[0145] Step 504: Input the question text and context into the information extraction model to obtain the demand text output by the information extraction model. The demand text describes the service demand of the target object targeted by the question text, and the target object includes merchants and / or products.
[0146] The structure and principle of the information extraction model are described in the previous embodiments and will not be elaborated here. For example, suppose a user has the following conversation with the intelligent customer service:
[0147] User A: Hello!
[0148] Intelligent customer service: Hello.
[0149] User A: I ordered product XXX.
[0150] User A: But I don’t know what material it is, can you help me check it?
[0151] In this example, the user's question text is: "I don't know what material it is made of. Can you help me check?" If the context in the conversation is taken from the first three rounds of dialogue, then the question text and context are concatenated to produce the text sequence "Hello! Hello. I ordered item XXX. But I don't know what material it is made of. Can you help me check?" When this text sequence is input into the information extraction model, the request text is obtained: "The user wants to inquire about the material of item XXX." Clearly, the request text concisely describes the user's service needs.
[0152] Step 506: Use the appeal text to search in the knowledge base to obtain one or more candidate knowledge. The knowledge base contains multiple types of text knowledge related to merchants and / or products.
[0153] The knowledge base involved in this embodiment may include a merchant question and answer knowledge base and a product information knowledge base, etc.
[0154] The merchant Q&A knowledge base can include knowledge about question-and-answer pairs, which can be pre-extracted from resources such as massive historical conversations or user reviews of products. This knowledge can be indexed by the question in the question-and-answer pair, and the corresponding feature vector of the index and the product ID and / or merchant ID associated with the question-and-answer pair can be stored. For example, the following storage format can be used: [merchant ID - product ID - index - index vector - knowledge]. The index can be the question in the question-and-answer pair, and the knowledge can be the answer to the question-and-answer pair.
[0155] The product information knowledge base includes at least one of the following: categories, attribute information, details page, product title, reviews, and instructions corresponding to the product identifier. For example, it can be stored in the following format: [merchant ID - product ID - information source - knowledge]. In addition, feature vectors corresponding to the knowledge can be pre-stored.
[0156] This step can be implemented by the retrieval model in the question-answering processing model. As one of the more preferred implementations, the merchant ID and / or product ID can be first obtained from the request text. In addition to obtaining them from the request text, other methods can also be used, such as obtaining the merchant ID from the merchant to which the intelligent customer service belongs.
[0157] Then, the merchant ID and / or product ID are used to perform a first search in the knowledge base to obtain a plurality of textual knowledge items. For example, the merchant ID and product ID are used to first determine a plurality of textual knowledge items having the merchant ID and product ID.
[0158] Then, the feature vector of the appeal text is used to perform a second search in multiple text knowledge to obtain more than one candidate knowledge.
[0159] Continuing with the previous example, the product ID of "product XXX" can be obtained from the request text: "The user wants to inquire about the material of product XXX." This product ID is then matched with the knowledge in the form of [merchant ID-product ID-index-index vector-knowledge] in the merchant Q&A knowledge base, and with the knowledge in the product information knowledge base in the form of [merchant ID-product ID-information source-knowledge] (i.e., the first search), resulting in multiple textual knowledge items. The feature vector of the request text is then used to calculate similarity with the feature vectors of the multiple textual knowledge items obtained (i.e., the second search). Knowledge items with a similarity greater than or equal to a preset threshold, or those ranked in the top K in similarity, are selected as candidate knowledge items.
[0160] This step integrates multiple types of knowledge, including question-and-answer pairs, reviews, product categories, attribute information, detail pages, product titles, review content, and instructions, for unified answer generation. This approach is also more efficient, enabling large-scale, multi-sourced, high-quality answer generation for tens of millions of merchants and hundreds of millions of products.
[0161] Step 508: Construct a second text sequence using one or more candidate knowledge, the appeal text, and the context.
[0162] In this embodiment, the above-mentioned one or more candidate knowledge, appeal text and context can be filled into the preset rewriting template to obtain a second text sequence. The following second text sequence can be generated:
[0163] "Based on or with reference to the information provided below: [Product title], [Product category], [Product details page], [Product attributes], [Product attributes], [Question and answer knowledge]. Combined with the user's conversation context: [Context], please answer the user's current question: [Request text]. If no answer is available, output 'No answer found'."
[0164] Step 510: Input the second text sequence into the answer generation model to obtain the answer text generated by the answer generation model for the question text.
[0165] Regarding the structure and principle of the answer generation model, please refer to the relevant records in the previous embodiments and will not be repeated here.
[0166] Continuing with the previous example, for the request text "The user wants to inquire about the material of product XXX," after inputting the corresponding second text sequence constructed in step 508 into the answer generation model, the answer generation model may generate the answer text "The material of product XXX is cotton and linen." If there is no candidate knowledge, the answer generation model may generate the answer text "No answer found."
[0167] Through the above process, a unified and effective multi-source knowledge e-commerce intelligent customer service system can be formed to improve the service capabilities and service quality of intelligent customer service, solve user problems more efficiently and comprehensively, and improve user experience and satisfaction.
[0168] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0169] According to another embodiment, a question and answer processing device is provided. Figure 6 FIG. 1 shows a schematic block diagram of a question-answering processing apparatus according to an embodiment. Figure 6 As shown, the apparatus 600 includes: a question acquisition unit 601, an information extraction unit 602, a knowledge retrieval unit 603, a text construction unit 604, and an answer generation unit 605. The main functions of each component unit are as follows:
[0170] The question acquisition unit 601 is configured to acquire the question text and the context of the question text in the conversation.
[0171] The information extraction unit 602 is configured to input the question text and the context of the question text in the conversation into the information extraction model, and obtain the demand text output by the information extraction model, which describes the service demand of the target object targeted by the question text.
[0172] The knowledge retrieval unit 603 is configured to use the appeal text to search in the knowledge base to obtain one or more candidate knowledge. The knowledge base contains multiple types of text knowledge.
[0173] The text construction unit 604 is configured to construct a second text sequence using one or more candidate knowledge, the appeal text, and the context.
[0174] The answer generation unit 605 is configured to input the second text sequence into the answer generation model, and obtain an answer text for the question text generated by the answer generation model.
[0175] As one possible implementation method, the information extraction model includes a first encoding module and a first decoding module.
[0176] The first encoding module extracts features from a first text sequence obtained by concatenating the question text and the context of the question text in the conversation, and obtains a feature representation of each element Token in the first text sequence.
[0177] The first decoding module uses the feature representation of each token in the first text sequence to perform decoding processing, and uses the text sequence obtained by the decoding processing as the appeal text.
[0178] As one possible implementation method, the knowledge base includes a question-answer knowledge base and an information knowledge base of the object type to which the target object belongs.
[0179] The question-answer knowledge base includes knowledge of question-answer pairs. The knowledge of question-answer pairs is indexed by the questions in the question-answer pairs, and stores the feature vectors of the index and the object information related to the question-answer pairs accordingly.
[0180] The information knowledge base of the object type to which the target object belongs includes: categories, attribute information, web page content, comment content, and at least one kind of knowledge in the description corresponding to each object information of the object type.
[0181] As one of the feasible ways, the knowledge retrieval unit 603 can be specifically configured to obtain information of the target object from the appeal text; perform a first search in the knowledge base using the information of the target object to obtain multiple text knowledge; and perform a second search in multiple text knowledge using the feature vector of the appeal text to obtain one or more candidate knowledge.
[0182] As one of the possible implementation methods, the text construction unit 604 can be specifically configured to: fill one or more candidate knowledge, appeal text and context into a preset rewriting template to obtain a second text sequence, wherein the rewriting template includes content indicating the candidate knowledge, a slot for the candidate knowledge, content indicating the appeal text, a slot for the appeal text, content indicating the dialogue context and a slot for the dialogue context.
[0183] According to yet another embodiment, a device for training a question-answering processing model is provided. Figure 7 A schematic block diagram of a device for training a question-answering processing model according to an embodiment is shown. Figure 1 The model training device in the system architecture shown in FIG. Figure 7 As shown, the device 700 includes: a sample acquisition unit 701 and a model training unit 702. The main functions of each component unit are as follows:
[0184] The sample acquisition unit 701 is configured to acquire training data including a plurality of training samples, where the training samples include question samples, contexts of the question samples in a conversation, and answer samples corresponding to the question samples.
[0185] The model training unit 702 is configured to train the question-answering processing model using the training data, wherein the training includes: taking the question sample in the training sample and the context of the question sample in the conversation as the input of the question processing model, and the information extraction model in the question processing model using the input question sample and the context of the question sample in the conversation to generate a demand text, wherein the demand text describes the service demand of the target object targeted by the question sample; using the demand text to search in the knowledge base to obtain one or more candidate knowledge, and the knowledge base contains multiple types of text knowledge; using the one or more candidate knowledge, the demand text and the context to construct a second text sequence; inputting the second text sequence into the answer generation model in the question processing model to obtain the answer text generated by the answer generation model for the question sample; the training objectives include: minimizing the difference between the answer text generated by the answer generation model and the answer sample in the corresponding training sample.
[0186] In the embodiments of this application, the question-answering processing model is trained in an end-to-end manner, that is, the information extraction model, retrieval model, and answer generation model are trained as a whole. For the specific implementation principles of the information extraction model, retrieval model, and answer generation model, please refer to the relevant description in the embodiment of the question-answering processing method, which will not be repeated here.
[0187] In an embodiment of the present application, a loss function can be constructed based on the above-mentioned training objectives. In each iteration, the model training unit 702 uses the value of the loss function to update the parameters of the information extraction model, the retrieval model, and the answer generation model using a method such as gradient descent until a preset training termination condition is met. The training termination condition may include, for example, the value of the loss function being less than or equal to a preset loss function threshold, the number of iterations reaching a preset number threshold, etc.
[0188] Each embodiment in this specification is described in a progressive manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For the relevant parts, refer to the partial description of the method embodiment. The device embodiment described above is merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without expending creative work.
[0189] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0190] In addition, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of any one of the methods in the aforementioned method embodiments are implemented.
[0191] And an electronic device comprising:
[0192] one or more processors; and
[0193] A memory associated with the one or more processors, the memory being used to store program instructions, wherein the program instructions, when read and executed by the one or more processors, execute the steps of the method described in any one of the aforementioned method embodiments.
[0194] The present application also provides a computer program product, comprising a computer program, which implements the steps of any one of the methods described in the aforementioned method embodiments when executed by a processor.
[0195] in, Figure 8 The electronic device architecture is shown as an example, and may include a processor 810, a video display adapter 811, a disk drive 812, an input / output interface 813, a network interface 814, and a memory 820. The processor 810, the video display adapter 811, the disk drive 812, the input / output interface 813, the network interface 814, and the memory 820 may be communicatively connected via a communication bus 830.
[0196] Among them, the processor 810 can be implemented by a general-purpose CPU, a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., to execute relevant programs to implement the technical solutions provided in this application.
[0197] The memory 820 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 820 can store an operating system 821 for controlling the operation of the electronic device 800, and a basic input and output system (BIOS) 822 for controlling the low-level operations of the electronic device 800. In addition, a web browser 823, a data storage management system 824, and a question and answer processing device / model training device 825, etc. can also be stored. The above-mentioned question and answer processing device / model training device 825 can be an application program that specifically implements the operations of the aforementioned steps in the embodiment of the present application. In short, when the technical solution provided in this application is implemented by software or firmware, the relevant program code is stored in the memory 820 and is called and executed by the processor 810.
[0198] The input / output interface 813 is used to connect input / output modules to implement information input and output. The input / output modules can be configured as components in the device (not shown in the figure) or can be externally connected to the device to provide corresponding functions. Input devices may include a keyboard, mouse, touch screen, microphone, various sensors, etc., and output devices may include a display, speaker, vibrator, indicator light, etc.
[0199] The network interface 814 is used to connect to a communication module (not shown) to enable communication between the device and other devices. The communication module can communicate via a wired method (such as USB, network cable, etc.) or a wireless method (such as mobile network, WiFi, Bluetooth, etc.).
[0200] The bus 830 comprises a pathway for transmitting information between the various components of the device (eg, the processor 810 , the video display adapter 811 , the disk drive 812 , the input / output interface 813 , the network interface 814 , and the memory 820 ).
[0201] It should be noted that although the above device only shows the processor 810, video display adapter 811, disk drive 812, input / output interface 813, network interface 814, memory 820, bus 830, etc., in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it will be understood by those skilled in the art that the above device may also include only the components necessary to implement the solution of the present application, and does not necessarily include all the components shown in the figure.
[0202] Through the description of the above embodiments, it can be seen that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer program product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present application or certain parts of the embodiments.
[0203] The above is a detailed introduction to the technical solutions provided by this application. Specific examples are used herein to illustrate the principles and implementation methods of this application. The description of the above embodiments is only intended to help understand the method and core concept of this application. At the same time, for those skilled in the art, based on the concept of this application, there may be changes in the specific implementation methods and application scope. In summary, the contents of this specification should not be understood as limiting this application.
Claims
1. A question-answering processing method, characterized in that: The method comprises: Obtain the question text and the context of the question text in the conversation; Inputting the question text and the context of the question text in the conversation into an information extraction model, obtaining a demand text output by the information extraction model, wherein the demand text describes the service demand of the target object targeted by the question text; Using the appeal text to search in a knowledge base to obtain one or more candidate knowledge, the knowledge base contains multiple types of text knowledge; constructing a second text sequence using the one or more candidate knowledge, the appeal text, and the context; The second text sequence is input into an answer generation model to obtain an answer text generated by the answer generation model for the question text.
2. The method according to claim 1, characterized in that The information extraction model includes a first encoding module and a first decoding module; The first encoding module performs feature extraction on a first text sequence obtained by concatenating the question text and the context of the question text in the conversation, to obtain a feature representation of each element token in the first text sequence; The first decoding module performs decoding processing using the feature representation of each token in the first text sequence, and uses the text sequence obtained by the decoding processing as the appeal text.
3. The method according to claim 1, characterized in that The knowledge base includes a question-answer knowledge base and an information knowledge base of the object type to which the target object belongs; The question-answer knowledge base includes knowledge of question-answer pairs, which is indexed by questions in the question-answer pairs, and stores feature vectors of the indexes and object information related to the question-answer pairs accordingly; The information knowledge base of the object type to which the target object belongs includes: at least one kind of knowledge among categories, attribute information, web page content, comment content and instructions corresponding to each object information of the object type.
4. The method according to claim 1 or 3, characterized in that Searching the knowledge base using the appeal text includes: Acquire information of the target object from the appeal text; Performing a first search in the knowledge base using the information of the target object to obtain a plurality of text knowledge; A second search is performed among the plurality of text knowledge using the feature vector of the appeal text to obtain the one or more candidate knowledge.
5. The method according to claim 1, wherein Constructing a second text sequence using the one or more candidate knowledge, the appeal text, and the context includes: Fill the one or more candidate knowledge, the appeal text and the context into a preset rewriting template to obtain the second text sequence, wherein the rewriting template includes content indicating the candidate knowledge, slots for the candidate knowledge, content indicating the appeal text, slots for the appeal text, content indicating the dialogue context and slots for the dialogue context.
6. A question-answering processing method, applied to an e-commerce intelligent customer service system, characterized in that: The method comprises: Obtaining a user's question text and the context of the question text in a conversation between the user and the e-commerce intelligent customer service system; Inputting the question text and the context into an information extraction model to obtain a demand text output by the information extraction model, wherein the demand text describes the service demand of the target object targeted by the question text, and the target object includes merchants and / or products; Using the appeal text to search in a knowledge base to obtain one or more candidate knowledge, the knowledge base contains multiple types of textual knowledge related to merchants and / or products; constructing a second text sequence using the one or more candidate knowledge, the appeal text, and the context; The second text sequence is input into an answer generation model to obtain an answer text generated by the answer generation model for the question text.
7. The method according to claim 6, characterized in that The knowledge base includes a merchant question and answer knowledge base and a product information knowledge base; The merchant question-answer knowledge base includes knowledge of question-answer pairs, which is indexed by the questions in the question-answer pairs, and stores corresponding feature vectors of the indexes and product identifiers and / or merchant identifiers related to the question-answer pairs; The product information knowledge base includes at least one of the categories, attribute information, details page, product title, review content and instructions corresponding to the product identification.
8. The method according to claim 6 or 7, characterized in that Searching the knowledge base using the appeal text includes: Obtaining a merchant ID and / or a product ID from the appeal text; Perform a first search in the knowledge base using the merchant identifier and / or product identifier to obtain a plurality of text knowledge items; A second search is performed among the plurality of text knowledge using the feature vector of the appeal text to obtain the one or more candidate knowledge.
9. A question-answering processing method, executed by a cloud server, characterized in that: The method comprises: Obtain the question text or question voice sent by the user's terminal device, and obtain the context of the question text in the conversation; Inputting the question text and the context of the question text in the conversation into an information extraction model, obtaining a demand text output by the information extraction model, wherein the demand text describes the service demand of the target object targeted by the question text; Using the appeal text to search in a knowledge base to obtain one or more candidate knowledge, the knowledge base contains multiple types of text knowledge; constructing a second text sequence using the one or more candidate knowledge, the appeal text, and the context; Inputting the second text sequence into an answer generation model to obtain an answer text generated by the answer generation model for the question text; The answer text or the speech synthesized using the answer text is returned to the terminal device.
10. A method for training a question-answering processing model, characterized in that: The method comprises: Acquire training data comprising a plurality of training samples, wherein the training samples include a question sample, a context of the question sample in a conversation, and an answer sample corresponding to the question sample; The training data is used to train a question-answering processing model, wherein the training includes: taking the question sample in the training sample and the context of the question sample in the conversation as the input of the question processing model, and the information extraction model in the question-answering processing model using the input question sample and the context of the question sample in the conversation to generate a demand text, wherein the demand text describes the service demand of the target object targeted by the question sample; using the demand text to search in a knowledge base to obtain one or more candidate knowledge, and the knowledge base contains multiple types of text knowledge; using the one or more candidate knowledge, the demand text and the context to construct a second text sequence; inputting the second text sequence into the answer generation model in the question processing model to obtain the answer text generated by the answer generation model for the question sample; the goal of the training includes: minimizing the difference between the answer text generated by the answer generation model and the answer sample in the corresponding training sample.
11. A question-answering processing device, characterized in that: The device comprises: a question acquisition unit configured to acquire a question text and a context of the question text in the conversation; An information extraction unit is configured to input the question text and the context of the question text in the conversation into an information extraction model, and obtain a demand text output by the information extraction model, wherein the demand text describes the service demand of the target object targeted by the question text; a knowledge retrieval unit configured to use the appeal text to search in a knowledge base to obtain one or more candidate knowledge, wherein the knowledge base contains multiple types of textual knowledge; a text construction unit configured to construct a second text sequence using the one or more candidate knowledge, the appeal text, and the context; The answer generation unit is configured to input the second text sequence into an answer generation model, and obtain an answer text generated by the answer generation model for the question text.
12. A device for training a question-answering processing model, characterized in that: The device comprises: a sample acquisition unit configured to acquire training data comprising a plurality of training samples, wherein the training samples include a question sample, a context of the question sample in a conversation, and an answer sample corresponding to the question sample; A model training unit is configured to train a question-answering processing model using the training data, wherein the training includes: taking the question sample in the training sample and the context of the question sample in the conversation as the input of the question processing model, and the information extraction model in the question processing model using the input question sample and the context of the question sample in the conversation to generate a demand text, wherein the demand text describes the service demand of the target object targeted by the question sample; using the demand text to search in the knowledge base to obtain one or more candidate knowledge, and the knowledge base contains multiple types of text knowledge; using the one or more candidate knowledge, the demand text and the context to construct a second text sequence; inputting the second text sequence into the answer generation model in the question processing model to obtain the answer text generated by the answer generation model for the question sample; the goal of the training includes: minimizing the difference between the answer text generated by the answer generation model and the answer sample in the corresponding training sample.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
14. An electronic device, characterized in that: include: one or more processors; as well as A memory associated with the one or more processors, the memory being used to store program instructions, wherein the program instructions, when read and executed by the one or more processors, perform the steps of the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Speech recommendation method and device in multi-round dialogue scene
CN110008322A
Problem identification method and device for multiple rounds of conversations
CN111400479A