Question and answer method, and question and answer model training method
By training the pre-trained question and answer model based on image-text matching results, the problem of scarcity of multi-modal dialogue data is solved, the training effect and application effect of the question and answer model of intelligent customer service are improved, and the model can generate accurate reply information.
Patent Information
- Application Number
- PCT/SG2024/050201
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-11
- Filing Date
- 2024-03-29
- Publication Date
- 2024-10-17
AI Technical Summary
Multimodal dialogue data is difficult to collect, resulting in less training data for dialogue generation models and poor application effects. Especially in intelligent customer service, it is difficult for the model to determine the reply modality and generate smooth and natural replies.
The pre-trained question and answer model is used to train based on the image and text matching results. The question and answer model is trained through a small amount of dialogue text and images, and the pre-training samples and question samples are used for model training to achieve image and text matching and text generation.
The training effect and application effect of the question and answer model are improved, so that the model can better learn the semantic knowledge in the dialogue text and generate accurate reply information without the need for a large amount of dialogue text as training data.
Smart Images

Figure SG2024050201_17102024_PF_FP_ABST
Abstract
Description
[0001] Cross-reference to a Question-Answering Method and Question-Answering Model Training Method. This disclosure claims priority to a Chinese patent application filed with the Chinese Patent Office on April 11, 2023, application number 202310412430.3, entitled "Question-Answering Method and Question-Answering Model Training Method," the entire contents of which are incorporated herein by reference. Technical Field: Embodiments of the present disclosure relate to the field of computer technology, and more particularly, to a question-answering method. Background: With the abundance of multimedia data, task-based dialogue systems have gained widespread attention. For example, in intelligent customer service in the e-commerce field, task-based dialogue systems can help users obtain self-service answers to their questions. As users' requirements for task-based dialogue systems continue to increase, dialogue systems must first determine the modality of the response to the user, namely, whether to respond with an image or text, and then complete the response. However, due to the difficulty in collecting multimodal dialogue data, training data is limited, making it difficult to train a dialogue generation model, resulting in poor application effectiveness of the dialogue generation model. SUMMARY: In view of this, embodiments of the present disclosure provide a question-answering method. One or more embodiments of the present disclosure also relate to another question-answering method, a question-answering model training method, a text question-answering method, a question-answering apparatus, a computing device, a computer-readable storage medium, and a computer program to solve the technical defects existing in the prior art. According to a first aspect of an embodiment of the present disclosure, a question-answering method is provided, comprising: obtaining question information to be answered; inputting the question information into a question-answering model to obtain answer information corresponding to the question information; wherein, the question-answering model is trained based on predicted answer information, and the predicted answer information is obtained by predicting answer information corresponding to a question sample using a pre-trained question-answering model; the pre-trained question-answering model is trained based on predicted image-text matching results, and the predicted image-text matching results are obtained by matching a training image with target semantic information using the pre-trained question-answering model; and the target semantic information is generated based on an image description text corresponding to the training image and a dialogue text associated with the training image.According to a second aspect of an embodiment of the present disclosure, another question-answering method is provided, which is applied to a cloud-side device, and includes: receiving a question-answering request sent by a terminal side, wherein the question-answering request carries question information; inputting the question information into a question-answering model to obtain reply information corresponding to the question information; wherein the question-answering model is trained based on predicted reply information, and the predicted reply information is obtained by predicting reply information corresponding to a question sample using a pre-trained question-answering model, and the pre-trained question-answering model is trained based on predicted image-text matching results, and the predicted image-text matching results are obtained by matching an image to be trained with target semantic information using the pre-trained question-answering model, and the target semantic information is generated based on an image description text corresponding to the image to be trained and a dialogue text associated with the image to be trained; and sending the reply information to the terminal side device. According to a third aspect of an embodiment of the present disclosure, a question-answering model training method is provided, which is applied to a cloud-side device, and includes: obtaining a pre-training sample, wherein the pre-training sample includes an image to be trained, an image description text corresponding to the image to be trained, and a dialogue text associated with the image to be trained; training the pre-trained question-answering model based on a predicted image-text matching result corresponding to the pre-training sample, wherein the predicted image-text matching result is obtained by matching the image to be trained with target semantic information using the pre-trained question-answering model, and the target semantic information is generated based on the image description text and the dialogue text; obtaining a question sample, wherein the question sample includes an image to be trained and a dialogue text associated with the image to be trained; inputting the question sample into the pre-trained question-answering model, obtaining predicted reply information output by the pre-trained question-answering model, and training the pre-trained question-answering model based on the predicted reply information to obtain a question-answering model; and sending model parameters of the question-answering model to an end-side device. According to a fourth aspect of an embodiment of the present disclosure, a text question and answer method is provided, which is applied to a terminal-side device and includes: receiving text question information; inputting the text question information into a question and answer model to obtain text reply information corresponding to the text question information, wherein the question and answer model is obtained according to the above-mentioned question and answer model training method; and displaying the text reply information.According to a fifth aspect of an embodiment of the present disclosure, a question-and-answer apparatus is provided, comprising: a question acquisition module configured to acquire question information to be answered; and an answer acquisition module configured to input the question information into a question-and-answer model to obtain answer information corresponding to the question information; wherein the question-and-answer model is trained based on predicted answer information, the predicted answer information being predicted by a pre-trained question-and-answer model for answer information corresponding to a question sample; the pre-trained question-and-answer model is trained based on predicted image-text matching results, the predicted image-text matching results being matched by the pre-trained question-and-answer model between a training image and target semantic information, the target semantic information being generated based on image description text corresponding to the training image and conversation text associated with the training image. According to a sixth aspect of an embodiment of the present disclosure, a computing device is provided, comprising: a memory and a processor; the memory being configured to store computer-executable instructions, and the processor being configured to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the aforementioned method. According to a seventh aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, storing computer-executable instructions that, when executed by a processor, implement the steps of the aforementioned method. According to an eighth aspect of an embodiment of the present disclosure, a computer program is provided, wherein, when executed on a computer, the computer is caused to execute the steps of the aforementioned method. A question-answering method provided in one embodiment of the present disclosure includes obtaining question information to be answered; inputting the question information into a question-answering model to obtain answer information corresponding to the question information; wherein the question-answering model is trained based on predicted answer information, the predicted answer information being predicted by using a pre-trained question-answering model for question samples; the pre-trained question-answering model is trained based on predicted image-text matching results, the predicted image-text matching results being obtained by using the pre-trained question-answering model to match a training image with target semantic information, the target semantic information being generated based on image description text corresponding to the training image and conversation text associated with the training image.In an embodiment of the present disclosure, question information to be answered is input into a question-answering model to obtain answer information output by the question-answering model. The question-answering model can be implemented by training a pre-trained question-answering model. Answer information corresponding to a question sample is predicted based on the pre-trained question-answering model, and the question-answering model is trained based on the predicted answer information. The pre-trained question-answering model is trained based on a predicted image-text matching result. The predicted image-text matching result is obtained by matching the training image with target semantic information based on the pre-trained question-answering model. In addition, the target semantic information is generated based on the image description text corresponding to the training image and the conversation text associated with the training image. This approach enables the question-answering model to be trained to better learn the target semantic text using a small amount of conversation text and the training image, and further trains the question-answering model to output conversation content based on the conversation text. This approach does not require a large amount of conversation text as training data, and enables the question-answering model to better learn the semantic knowledge in the conversation text, thereby achieving more accurate answer information from the trained question-answering model and improving the application effect of the model. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 is a schematic diagram of an application scenario of a question-answering method provided by an embodiment of the present disclosure; Figure 2 is a flow chart of a question-answering method provided by an embodiment of the present disclosure; Figure 3a is a schematic diagram of the first stage training of a question-answering model in a question-answering method provided by an embodiment of the present disclosure; Figure 3b is a schematic diagram of the second stage training of a question-answering model in a question-answering method provided by an embodiment of the present disclosure;.
[0002] Figure 3c is a schematic diagram of the third stage of training a question-answering model in a question-answering method provided by an embodiment of the present disclosure; Figure 4 is a flowchart of another question-answering method provided by an embodiment of the present disclosure; Figure 5 is a flowchart of a question-answering model training method provided by an embodiment of the present disclosure; Figure 6 is a flowchart of a text question-answering method provided by an embodiment of the present disclosure; Figure 7 is a schematic diagram of the structure of a question-answering apparatus provided by an embodiment of the present disclosure; and Figure 8 is a block diagram of the structure of a computing device provided by an embodiment of the present disclosure. The following description sets forth numerous specific details to facilitate a thorough understanding of the present disclosure. However, the present disclosure can be implemented in many other ways than those described herein, and those skilled in the art may make similar generalizations without departing from the scope of the present disclosure. Therefore, the present disclosure is not limited to the specific implementations disclosed below. The terminology used in one or more embodiments of the present disclosure is for the purpose of describing specific embodiments and is not intended to limit the present disclosure. As used in one or more embodiments of the present disclosure and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present disclosure refers to and encompasses any and all possible combinations of one or more associated listed items. It should be understood that while the terms "first," "second," and so on may be used to describe various information in one or more embodiments of the present disclosure, such information should not be limited to these terms. These terms are used to distinguish information of the same type from one another. For example, "first" could also be referred to as "second," and similarly, "second" could also be referred to as "first," without departing from the scope of one or more embodiments of the present disclosure. Depending on the context, the term "if" as used herein could be interpreted as "at the time of," "when," or "in response to a determination." Furthermore, 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, and displayed data, etc.) involved in one or more embodiments of the present disclosure are all authorized by the user or fully authorized by all parties. The collection, use, and processing of such data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding entry points are provided for users to choose to authorize or deny. First, the terminology used in one or more embodiments of the present disclosure is explained. Multimodality: In the field of artificial intelligence, it often refers to perceptual information, such as images, text, and speech. With the abundance of multimedia data, conversational communication on the internet is no longer limited to pure text.Therefore, the introduction of multimodal conversations will become an unstoppable trend in future intelligent customer service. Multimodal conversations require models to first determine the modality of the response to the user, namely, whether to respond with an image or text. Secondly, they must be able to retrieve contextually appropriate responses, including image and text retrieval. Furthermore, they must be able to track user status to track user needs. Finally, they must be able to generate text to produce fluent and natural responses. However, in today's data-driven world, multimodal conversational data is difficult to collect due to privacy concerns, resulting in a relatively small amount and difficulty in model training. Multimodal non-conversational data, on the other hand, is available in large quantities. Therefore, the disclosed embodiments propose an incremental combined expert multimodal conversational pre-training model. This model leverages the recognition and matching capabilities of text and image experts in multimodal non-conversational data. By inheriting these expert capabilities, multimodal conversational data is introduced to model conversational experts, achieving a step-by-step improvement in model capabilities. This disclosure provides a question-and-answer method. It also relates to another question-and-answer method, a question-and-answer model training method, a text question-and-answer method, a question-and-answer apparatus, a computing device, and a computer-readable storage medium, each of which is described in detail in the following embodiments. Referring to FIG1 , FIG1 illustrates a schematic diagram of an application scenario of a question-and-answer method provided according to one embodiment of this disclosure. It should be noted that the question-and-answer method provided in this embodiment can be applied to scenarios such as question-and-answer response for intelligent customer service. The specific application scenario can be adapted to different project requirements and is not limited in this embodiment. For ease of understanding, this embodiment uses the application scenario of a user using intelligent customer service as an example. In actual applications, users send questions requiring responses to intelligent customer service. Questions can be understood as information in different application scenarios, including but not limited to text and image information. Since the intelligent customer service uses the question-answering model in the question-answering method provided in this embodiment, after receiving the question sent by the user, the question-answering model can output response information corresponding to the question. Response information can be understood as the content of the response to the question, including but not limited to text and image information. Furthermore, the user can receive the response content fed back by the intelligent customer service. It should be noted that the question-answering model needs to be pre-trained before it is put into use. Specifically, to improve the training effect of the question-answering model, this embodiment can adopt a staged model training method. By combining different expert networks, multimodal dialogue data is introduced to model the question-answering model, achieving step-by-step model capability improvement.Referring to Figure 2, Figure 2 shows a flowchart of a question-and-answer method provided according to an embodiment of the present disclosure, specifically comprising the following steps. Step 202: Obtaining question information to be answered. In practical applications, the executing entity may obtain question information to be answered, where question information can be understood as the content of questions for which a user is awaiting an answer, including but not limited to text content, image content, or both. Step 204: Inputting the question information into a question-and-answer model to obtain answer information corresponding to the question information. The question-and-answer model is trained based on predicted answer information, which is obtained by predicting answer information corresponding to question samples using a pre-trained question-and-answer model. The pre-trained question-and-answer model is trained based on predicted image-text matching results, which are obtained by matching a training image with target semantic information using the pre-trained question-and-answer model. The target semantic information is generated based on the image description text corresponding to the training image and the conversation text associated with the training image. In practical applications, the execution entity can input question information into the question-answering model to obtain the corresponding response information. The response information can be understood as the corresponding response content determined for the question information, including text content and / or image content. It should be noted that the question-answering model provided in this embodiment can be implemented by training a pre-trained question-answering model, and is trained based on the predicted response information output by the pre-trained question-answering model based on question samples. Furthermore, the pre-trained question-answering model can also be trained based on the training image and target semantic information. The target semantic information can be understood as the image description text corresponding to the training image and the dialogue text associated with the training image.To facilitate understanding, the following embodiment introduces the training process of a question-answering model. The training process of the question-answering model may include three stages of training: first, an initial question-answering model is trained using images and image annotated text; second, a pre-trained question-answering model is trained using images, image annotated text, and dialogue text; and finally, a third, a question-answering model is trained based on images and dialogue text. It should be noted that the initial question-answering model, the pre-trained question-answering model, and the question-answering model all refer to the same question-answering model. It can be understood that the model output capabilities and effects of the question-answering model vary at different training stages. The training process provided in this embodiment is to first train the pre-trained question-answering module and then train the question-answering model, namely, the training process of the second and third stages. Specifically, before inputting the question information into the question-answering model and obtaining the answer information corresponding to the question information, the process further includes: obtaining pre-training samples, where the pre-training samples include the image to be trained, the image description text corresponding to the image to be trained, and the dialogue text associated with the image to be trained; The pre-trained question-answering model is trained based on a predicted image-text matching result corresponding to the pre-trained sample, wherein the predicted image-text matching result is obtained by matching the image to be trained with target semantic information using the pre-trained question-answering model, and the target semantic information is generated based on the image description text and the dialogue text; and a question sample is obtained, wherein the question sample includes the image to be trained and information associated with the image to be trained. Schematic diagram. In practical applications, the two-stage pre-training process in Figure 3b takes as input the image, image annotated text, and conversation text. These are first input into the LF layer, where the matching between the image annotated text and the conversation text is completed. After obtaining the target semantic text, the text is then input into the F layer of the model for matching with the image, completing the image-text alignment training process. Figure 3c shows a schematic diagram of the third-stage training of a question-answering model in a question-answering method provided by one embodiment of the present disclosure. In practical applications, the three-stage pre-training process in Figure 3c takes as input the conversation text and image. Since the question-answering model already possesses the ability to match conversations and images in the first two stages of training, the three-stage pre-training utilizes the conversation context and image networks in the LF layer to understand the matching between the conversation and image. Finally, in the F layer of the model, the text generation network is trained to train the question-answering model's ability to generate response information. It should be noted that when applied to multimodal conversational tasks, question-answering models can include multiple tasks: 1. Multimodal intent recognition, specifically predicting whether image sharing is necessary in the current round; 2. Multimodal retrieval, retrieving appropriate images and text responses based on conversation history; 3. Multimodal conversation tracking, tracking key user conversational needs; and 4. Multimodal text generation, generating appropriate responses based on conversation history. Based on this, the question-answering model training process provided in this embodiment divides each layer of the model into multiple expert networks. When completing specific tasks, these different expert networks are combined to achieve task processing. This modular division makes model training more controllable and enhances its interpretability. Furthermore, expert network parameters not used in a specific task are not activated, significantly accelerating model inference and improving parameter utilization. Furthermore, by assigning different semantic knowledge to each expert network, the flow of each modality and data type within the model can be traced, enhancing the model's robustness and generalization capabilities. Referring to Figure 4, a flowchart of another question-and-answer method provided according to an embodiment of the present disclosure is shown, specifically including the following steps. It should be noted that the question-and-answer method provided in this embodiment is applied to a cloud-side device. That is, after receiving question information from a client-side device, the cloud-side device can respond to the question information based on a question-and-answer model. Step 402: Receive a question-and-answer request sent by the client-side device, wherein the question-and-answer request carries the question information.In actual applications, the cloud-side device may receive a question-and-answer request sent by the client-side device and obtain the question information carried in the question-and-answer request. It should be noted that the specific content and form of the question information are not limited in this embodiment. Step 404: Input the question information into the question-and-answer model to obtain answer information corresponding to the question information. The question-and-answer model is trained based on predicted answer information. The predicted answer information is obtained by predicting answer information corresponding to question samples using a pre-trained question-and-answer model. The pre-trained question-and-answer model is trained based on predicted image-text matching results. The predicted image-text matching results are obtained by matching the training image with target semantic information using the pre-trained question-and-answer model. The target semantic information is generated based on the image description text corresponding to the training image and the conversation text associated with the training image. In actual applications, the cloud-side device may input the question information into the question-and-answer model and obtain answer information output by the question-and-answer model. The training process of the question-and-answer model in the cloud-side device can refer to the training process described in the above embodiment, i.e., the three-stage question-and-answer model training, and will not be further elaborated here. Step 406: Send the reply information to the end-side device. Furthermore, after receiving the reply information, the cloud-side device may feed the reply information back to the end-side device. Based on this, this embodiment provides a question-answering method applied to a cloud-side device, enabling responses to question information sent by the end-side device. Furthermore, the question-answering model is trained on the cloud-side device, saving computing resources and storage space on the end-side device and providing better user experience. Referring to Figure 5, a flowchart of a question-answering model training method provided according to an embodiment of the present disclosure is shown, specifically including the following steps. It should be noted that the question-answering model training method provided in this embodiment can be applied to both end-side devices and cloud-side devices, and this embodiment is not limited thereto. Step 502: Obtain pre-training samples, where the pre-training samples include an image to be trained, image description text corresponding to the image to be trained, and conversation text associated with the image to be trained. Step 504: Train the pre-trained question-answering model based on the predicted image-text matching results corresponding to the pre-training samples, wherein the predicted image-text matching results are obtained by matching the training image with target semantic information using the pre-trained question-answering model, and the target semantic information is generated based on the image description text and the conversation text. Step 506: Obtain question samples, wherein the question samples include the training image and the conversation text associated with the training image.Step 508: Input the question sample into the pre-trained question-answering model to obtain predicted answer information output by the pre-trained question-answering model. The pre-trained question-answering model is then trained based on the predicted answer information to obtain a question-answering model. Step 510: Send the model parameters of the question-answering model to the end-side device. Pre-training samples can be understood as sample data for training the pre-trained question-answering model, including training images, image description text corresponding to the training images, and conversation text associated with the training images. Training images can be understood as any type of training image, without any restrictions on image category. Image description text corresponding to the training images can be understood as textual information describing the image content in the training images, such as describing the content and state of objects in the images. Conversation text associated with the training images can be understood as conversation information discussing the training images. This conversation information can be understood as conversation data between different subjects, although this embodiment does not impose any restrictions on the form of the conversation content or the subjects of the conversation. In practical applications, a pre-trained question-answering model can be trained based on the predicted image-text matching results corresponding to the pre-training samples. The predicted image-text matching results can be obtained by matching the training image with the target semantic information based on the information matching layer (FFN) in the pre-trained question-answering model. It should be noted that the target semantic information can be understood as vector matching between the image description text and the conversation text, that is, based on the image description text, so that the pre-trained question-answering model can better understand the semantic information in the conversation text. Furthermore, after the pre-trained question-answering model is trained, question samples can be obtained. These question samples can be understood as training samples for the question-answering model and include the image to be trained and the conversation text associated with the image to be trained. The question samples are then input into the pre-trained question-answering model to obtain the predicted response information output by the information generation layer (FFN) in the pre-trained question-answering model. The pre-trained question-answering model is then trained based on the predicted response information, ultimately yielding a well-trained question-answering model. The model parameters in the question-answering model are then sent to the device-side device, allowing the device to construct a well-performing question-answering model based on the model parameters, thereby improving the performance of the question-answering model on the device-side device. Based on this, the pre-trained question-answering model is trained to match conversation text with images. Furthermore, the pre-trained question-answering model can be trained to achieve image-text alignment between conversation text and images, thereby generating and responding to responses. This question-answering model utilizes multimodal data to train its dialogue generation capabilities, thereby improving its response performance. 6 , which shows a flowchart of a text question-answering method provided according to an embodiment of the present disclosure, specifically including the following steps.It should be noted that, for ease of understanding, the text question-and-answer method provided in this embodiment can be applied to the application scenario of intelligent customer service, providing text responses to text questions raised by users. The automatic responses provided by the intelligent customer service are responses output by a question-and-answer model. Step 602: Receive text question information. The text question information can be understood as a text question raised by a user to the intelligent customer service. The text question is associated with a project on the platform where the intelligent customer service is currently located, but this embodiment does not limit this. Step 604: Input the text question information into the question-and-answer model to obtain text response information corresponding to the text question information. In actual applications, after the text question information is input into the question-and-answer model, the question-and-answer model can output text response information corresponding to the text question information, which can be understood as the intelligent customer service providing a text response to the text question raised by the user. It should be noted that the question-and-answer model provided in this embodiment can be obtained by referring to the training method described in the above embodiments, and will not be described in detail here. This includes question-and-answer models trained using cloud-side devices. In addition, this embodiment also provides for training the question-answering model on a device and applying it on the device. Specifically, before inputting the text question information into the question-answering model and obtaining the text answer information corresponding to the text question information, the process includes: obtaining model parameters of the question-answering model on the cloud device; obtaining text question samples; constructing a question-answering model to be trained based on the model parameters; and training the question-answering model to be trained based on the text question samples to obtain the question-answering model. In actual applications, the device can obtain the model parameters of the question-answering model on the cloud device. The process for obtaining the model parameters can be referenced to the process for training the question-answering model on the cloud device described above and will not be further described here. Furthermore, the device can also obtain text question samples and use the model parameters of the question-answering model obtained from the cloud device to construct the question-answering model to be trained. The question-answering model to be trained is then trained based on the text question samples on the device to obtain the question-answering model. The question-answering model trained on the device can then be applied locally. It should be noted that the process of training the model parameters of the question-answering model by the cloud-side device can be referred to the description of question-answering model training in the above embodiment, namely, the process of training the question-answering model in three stages, which is not described in detail here. Step 606: Display the textual response information. In actual applications, after the terminal-side device uses the question-answering model to respond to the textual question information, the textual response information can be displayed on the terminal-side device's display interface.In summary, the text question-answering method provided in this embodiment automatically responds to text question information by utilizing a question-answering model. This question-answering model can be trained using either a cloud-side device or a device-side device. Both models can provide rapid and appropriate responses to text question information, improving user experience with text responses. Corresponding to the above method embodiments, the present disclosure also provides embodiments of a question-answering device. Figure 7 shows a schematic structural diagram of a question-answering device provided in one embodiment of the present disclosure. As shown in Figure 7, the device includes: a question acquisition module 702, configured to obtain question information to be answered; an answer acquisition module 704, configured to input the question information into a question-answering model to obtain answer information corresponding to the question information; wherein, the question-answering model is trained based on predicted answer information, the predicted answer information is obtained by predicting the answer information corresponding to the question sample using a pre-trained question-answering model, the pre-trained question-answering model is trained based on predicted image-text matching results, the predicted image-text matching results are obtained by matching the image to be trained and target semantic information using the pre-trained question-answering model, and the target semantic information is generated based on the image description text corresponding to the image to be trained and the dialogue text associated with the image to be trained. Optionally, the apparatus further includes: a question-answering model training module configured to obtain pre-training samples, wherein the pre-training samples include a to-be-trained image, an image description text corresponding to the to-be-trained image, and a conversation text associated with the to-be-trained image; train the pre-trained question-answering model based on a predicted image-text matching result corresponding to the pre-training samples, wherein the predicted image-text matching result is obtained by matching the to-be-trained image with target semantic information using the pre-trained question-answering model, wherein the target semantic information is generated based on the image description text and the conversation text; obtain a question sample, wherein the question sample includes the to-be-trained image and the conversation text associated with the to-be-trained image; input the question sample into the pre-trained question-answering model, obtain predicted answer information output by the pre-trained question-answering model, and train the pre-trained question-answering model based on the predicted answer information to obtain a question-answering model. Optionally, the question-answering model training module is further configured to: calculate an autoregressive loss value based on the predicted answer information; and train the pre-trained question-answering model based on the autoregressive loss value to obtain the question-answering model.Optionally, the question-answering model training module is further configured to: perform image processing on a to-be-trained image in the pre-training samples using the pre-trained question-answering model to obtain an image vector; perform text processing on a conversation text associated with the to-be-trained image in the pre-training samples using the pre-trained question-answering model to obtain a conversation vector; generate a predicted image-text matching result based on the image vector and the conversation vector; determine an image-text alignment loss value based on the predicted image-text matching result, and train the pre-trained question-answering model based on the image-text alignment loss value. Optionally, the question-answering model training module is further configured to: calculate a conversation annotation alignment loss value based on the image vector, calculate an image conversation loss value based on the conversation vector; and train the pre-trained question-answering model based on the conversation annotation alignment loss value, the image conversation loss value, and the image-text alignment loss value. Optionally, the question-answering model training module is further configured to: obtain initial training samples, wherein the initial training samples include a to-be-trained image and image annotation text corresponding to the to-be-trained image; perform image processing on the to-be-trained image using the initial question-answering model to obtain an image vector; perform text processing on the image annotation text corresponding to the to-be-trained image using the initial question-answering model to obtain a text annotation vector; determine a predicted image description text based on the image vector and the text annotation vector; and train the initial question-answering model based on the predicted image description text. Optionally, the question-answering model training module is further configured to: calculate an image-text annotation loss value based on the image vector and the text annotation vector; calculate an image-text alignment loss value based on the predicted image description text; and train the initial question-answering model based on the image-text annotation loss value and the image-text alignment loss value. Optionally, the device further includes: a model adjustment module, configured to send the reply information to the user; receive feedback results from the user regarding the reply information; and adjust model parameters in the question-answering model based on the feedback results.In summary, the question-answering device provided in the embodiments of the present disclosure obtains answer information output by the question-answering model by inputting question information to be answered into a question-answering model. The question-answering model can be implemented by training a pretrained question-answering model. The pretrained question-answering model predicts answer information corresponding to question samples, and the question-answering model is trained based on the predicted answer information. The pretrained question-answering model is trained based on predicted image-text matching results, which are obtained by matching the training image with target semantic information based on the pretrained question-answering model. Furthermore, the target semantic information is generated based on the image description text corresponding to the training image and the conversation text associated with the training image. This approach enables the question-answering model to better learn the target semantic text using a small amount of conversation text and the training image, and further trains the question-answering model to output conversation content based on the conversation text. This approach eliminates the need for a large amount of conversation text as training data, enables the question-answering model to better learn the semantic knowledge in the conversation text, and achieves more accurate answers from the trained question-answering model, improving the model's application effectiveness. The above is a schematic scheme of a question-answering device in this embodiment. It should be noted that the technical solution of the question-and-answer device and the technical solution of the aforementioned question-and-answer method share the same concept. For details not described in detail in the technical solution of the question-and-answer device, please refer to the description of the technical solution of the aforementioned question-and-answer method. Figure 8 shows a block diagram of a computing device 800 provided according to one embodiment of the present disclosure. The components of computing device 800 include, but are not limited to, a memory 810 and a processor 820. Processor 820 is connected to memory 810 via a bus 830, and a database 850 is configured to store data. Computing device 800 also includes an access device 840 that enables computing device 800 to communicate via one or more networks 860. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet.Access device 840 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, or a Near Field Communication (NFC) interface. In one embodiment of the present disclosure, the aforementioned components of computing device 800 and other components not shown in FIG. 8 may also be connected to each other, for example, via a bus. It should be understood that the computing device structure block diagram shown in FIG. 8 is for illustrative purposes only and does not limit the scope of the present disclosure. Those skilled in the art may add or replace other components as needed. The computing device 800 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, personal digital assistant, laptop computer, notebook computer, netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or personal computer (PC). The computing device 800 can also be a mobile or stationary server. The processor 820 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the aforementioned question-answering method, question-answering model training method, and text question-answering method. The above is a schematic diagram of a computing device of this embodiment. It should be noted that the technical solutions of this computing device and the technical solutions of the aforementioned question-answering method, question-answering model training method, and text question-answering method are based on the same concept. Details not described in detail in the technical solution of the computing device can be found in the description of the technical solutions of the aforementioned question-answering method, question-answering model training method, and text question-answering method. One embodiment of the present disclosure further provides a computer-readable storage medium storing computer-executable instructions. When executed by a processor, these computer-executable instructions implement the steps of the aforementioned question-answering method, question-answering model training method, and text-based question-answering method. The above is an illustrative embodiment of a computer-readable storage medium according to this embodiment.It should be noted that the technical solution of this storage medium is based on the same concept as the technical solutions of the aforementioned question-answering method, question-answering model training method, and text question-answering method. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solutions of the aforementioned question-answering method, question-answering model training method, and text question-answering method. One embodiment of the present disclosure also provides a computer program. When executed on a computer, the computer executes the steps of the aforementioned question-answering method, question-answering model training method, and text question-answering method. The above is an illustrative embodiment of a computer program of this embodiment. It should be noted that the technical solution of this computer program is based on the same concept as the technical solutions of the aforementioned question-answering method, question-answering model training method, and text question-answering method. For details not described in detail in the technical solution of the computer program, please refer to the description of the technical solutions of the aforementioned question-answering method, question-answering model training method, and text question-answering method. The above describes specific embodiments of the present disclosure. 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 in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous. The computer instructions include computer program code, which may be in source code form, object code form, executable files, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signals, telecommunication signals, and software distribution media. It should be noted that the content of the computer-readable medium may be appropriately increased or decreased based on the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media does not include electric carrier signals and telecommunication signals. It should be noted that, for ease of description, the aforementioned method embodiments are described as a series of actions. However, those skilled in the art should understand that the embodiments of the present disclosure are not limited by the order of the actions described, as certain steps may be performed in a different order or simultaneously, depending on the embodiments of the present disclosure. Furthermore, those skilled in the art should also understand that the embodiments described herein are preferred embodiments, and that the actions and modules involved are not necessarily required for the embodiments of the present disclosure.In the above embodiments, the description of each embodiment has its own emphasis. For portions not described in detail in a particular embodiment, reference should be made to the relevant descriptions of other embodiments. The preferred embodiments disclosed above are merely intended to illustrate the present disclosure. The alternative embodiments do not describe all details in detail, nor do they limit the invention to the specific implementations described. Obviously, many modifications and variations are possible based on the content of the embodiments disclosed. These embodiments are selected and described in detail in this disclosure to better explain the principles and practical applications of the embodiments of the present disclosure, thereby enabling those skilled in the art to better understand and utilize the present disclosure. The present disclosure is subject to the claims and their full scope and equivalents. Industrial Applicability: The method for training a text generation model, the method for text generation, and the apparatus provided in the embodiments of the present disclosure are applied to training text generation scenarios. Question information to be answered is input into a question-answering model to obtain answer information output by the question-answering model. The question-answering model can be implemented by training a pretrained question-answering model. Answer information corresponding to a question sample is predicted based on the pretrained question-answering model, and the question-answering model is trained based on the predicted answer information. The pretrained question-answering model is trained based on predicted image-text matching results. The predicted image-text matching results are obtained by matching the training image with target semantic information based on the pretrained question-answering model. Furthermore, the target semantic information is generated based on the image description text corresponding to the training image and the conversation text associated with the training image. This approach enables the question-answering model to better learn the target semantic text using a small amount of conversation text and the training image, and further trains the question-answering model to output conversation content based on the conversation text. This approach eliminates the need for a large amount of conversation text as training data and enables the question-answering model to better learn the semantic knowledge in the conversation text, thereby achieving more accurate answers from the trained question-answering model and improving the application effectiveness of the model.
Claims
Claims 1. A question-answering method, include: Get information about questions to be answered; The question information is input into a question-answering model to obtain answer information corresponding to the question information; wherein the question-answering model is trained based on predicted answer information, the predicted answer information is obtained by predicting answer information corresponding to a question sample using a pre-trained question-answering model, the pre-trained question-answering model is trained based on predicted image-text matching results, the predicted image-text matching results are obtained by matching a training image with target semantic information using the pre-trained question-answering model, and the target semantic information is generated based on an image description text corresponding to the training image and a dialogue text associated with the training image.
2. The method according to claim 1, before inputting the question information into the question-answering model and obtaining the answer information corresponding to the question information, further comprising: include: Acquire a pre-training sample, wherein the pre-training sample includes an image to be trained, an image description text corresponding to the image to be trained, and a dialogue text associated with the image to be trained; train the pre-trained question-answering model based on a predicted image-text matching result corresponding to the pre-training sample, wherein the predicted image-text matching result is obtained by the pre-trained question-answering model matching the image to be trained with target semantic information, and the target semantic information is generated based on the image description text and the dialogue text; acquire a question sample, wherein the question sample includes an image to be trained and a dialogue text associated with the image to be trained; input the question sample into the pre-trained question-answering model to obtain predicted answer information output by the pre-trained question-answering model, and train the pre-trained question-answering model based on the predicted answer information to obtain a question-answering model.
3. The method according to claim 2, wherein the pre-trained question-answering model is trained based on the predicted answer information to obtain a question-answering model, include: Calculating an autoregressive loss value based on the predicted response information; The pre-trained question-answering model is trained based on the autoregressive loss value to obtain the question-answering model.
4. The method according to claim 2 or 3, wherein the pre-trained question-answering model is trained based on the predicted image-text matching results corresponding to the pre-trained samples, include: For the image to be trained in the pre-training sample, use the pre-training question-answering model to perform image processing on the image to be trained to obtain an image vector; For the dialogue text associated with the image to be trained in the pre-training sample, the pre-trained question-answering model is used to perform text processing on the dialogue text to obtain a dialogue vector; Based on the image vector and the dialogue vector, a predicted image-text matching result is generated; based on the predicted image-text matching result, an image-text alignment loss value is determined, and the pre-trained question-answering model is trained based on the image-text alignment loss value.
5. The method according to claim 4, wherein the pre-trained question-answering model is trained based on the image-text alignment loss value. include: Calculating a dialogue annotation alignment loss value based on the image vector, and calculating an image dialogue loss value based on the dialogue vector; The pre-trained question-answering model is trained based on the dialogue annotation alignment loss value, the image dialogue loss value, and the image-text alignment loss value.
6. The method according to claim 2, before obtaining the pre-training samples, further comprising: include: Acquire an initial training sample, wherein the initial training sample includes an image to be trained and an image annotation text corresponding to the image to be trained; perform image processing on the image to be trained using an initial question-answering model to obtain an image vector; For the image annotation text corresponding to the image to be trained, use the initial question-answering model to perform text processing on the image annotation text to obtain a text annotation vector; based on the image vector and the text annotation vector, determine the predicted image description text; and train the initial question-answering model based on the predicted image description text.
7. The method according to claim 6, wherein the initial question-answering model is trained based on the predicted image description text. include: Calculating a loss value of image and text annotation based on the image vector and the text annotation vector; Based on the predicted image description text, calculating an image-text alignment loss value; The initial question-answering model is trained according to the image-text annotation loss value and the image-text alignment loss value.
8. The method according to claim 1, after obtaining the answer information corresponding to the question information, further include: Sending the reply information to the user; receiving a feedback result from the user in response to the reply information; The model parameters in the question-answering model are adjusted based on the feedback result.
9. A question-answering method, applied to a cloud-side device, include: A question-and-answer request is received from an end-side device, wherein the question-and-answer request carries question information; the question information is input into a question-and-answer model to obtain answer information corresponding to the question information; wherein the question-and-answer model is trained based on predicted answer information, the predicted answer information is obtained by predicting answer information corresponding to a question sample using a pre-trained question-and-answer model, the pre-trained question-and-answer model is trained based on predicted image-text matching results, the predicted image-text matching results are obtained by matching an image to be trained with target semantic information using the pre-trained question-and-answer model, the target semantic information is generated based on an image description text corresponding to the image to be trained and a dialogue text associated with the image to be trained; and the answer information is sent to the end-side device.
10. A question-answering model training method, applied to cloud-side devices, include: Acquire a pre-training sample, wherein the pre-training sample includes an image to be trained, an image description text corresponding to the image to be trained, and a dialogue text associated with the image to be trained; train the pre-trained question-answering model based on the predicted image-text matching result corresponding to the pre-training sample, wherein the predicted image-text matching result is obtained by matching the image to be trained with target semantic information using the pre-trained question-answering model, and the target semantic information is generated based on the image description text and the dialogue text; acquire a question sample, wherein the question sample includes an image to be trained and a dialogue text associated with the image to be trained; input the question sample into the pre-trained question-answering model to obtain predicted answer information output by the pre-trained question-answering model, and train the pre-trained question-answering model based on the predicted answer information to obtain a question-answering model; send the model parameters of the question-answering model to the terminal-side device.
11. A text question answering method, applied to a terminal device, include: Receive text question information; input the text question information into a question-answering model to obtain text answer information corresponding to the text question information, wherein the question-answering model is obtained according to the method described in claim 10; and display the text answer information.
12. According to the method of claim 11, before inputting the text question information into the question-answering model and obtaining the text answer information corresponding to the text question information, include: Obtain the model parameters of the question-answering model in the cloud-side device; Get sample text questions; A question-answering model to be trained is constructed based on the model parameters, and the question-answering model to be trained is trained based on the text question samples to obtain a question-answering model.
13. A computing device, include: Memory and processor; The memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the method according to any one of claims 1 to 12 are implemented.
14. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the steps of the method according to any one of claims 1 to 12. 16
Citation Information
Patent Citations
Visual question and answer method, system and server
CN113205507A
Visual question and answer and visual question and answer model training method and device, equipment and storage medium
CN113392288A
Text visual question and answer method and device
CN113849623A
Cited By
Intelligent question answering method and device based on large model, electronic equipment and storage medium
CN119577085A
Intelligent question-answering method, device, electronic device, and storage medium based on large models
CN119577085B
Model training method and device, electronic equipment and computer readable storage medium
CN119578490A
Conversation generation method and device based on virtual object, equipment and storage medium
CN119720963A
Sample set construction method, question and answer model training method, question and answer processing method, request processing method and task platform
CN119904880A
