Description text generation method and device, text processing model training method

Through semantic encoding and decoding processing, combined with comments and tag generation networks, the problem of low text creation efficiency is solved, and the automatic generation of diversified text content is achieved, and the accuracy and efficiency of the text processing model is improved.

CN113590983BActive Publication Date: 2024-12-03TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202110121602.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-28
Publication Date
2024-12-03
Estimated Expiration
2041-01-28

AI Technical Summary

Technical Problem

In the prior art, text creators need to manually write a large amount of text content, resulting in inefficiency, especially when the amount of information is large, it is difficult to meet the needs of quickly generating diverse text information.

Method used

By obtaining shared content text and auxiliary description text, semantic encoding processing is performed, randomized processing is performed to determine hidden variables, and semantic decoding is performed to generate target description text. The text processing model of mutually dual structure of the network and the label generation network is realized by using comment generation networks to achieve automation Generate comments and tags.

Benefits of technology

It greatly improves the generation efficiency and accuracy of target description text, can automatically output diverse text content, make full use of shared semantic information, and reduce the burden of manual writing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113590983B_ABST
    Figure CN113590983B_ABST
Patent Text Reader

Abstract

The present application relates to the field of artificial intelligence, and specifically to a method, device, computer equipment and storage medium for generating descriptive text. The method comprises: obtaining shared content text and auxiliary description text corresponding to a target task; the text type of the auxiliary description text is one of a comment type and a label type; performing semantic encoding processing on the shared content text and the auxiliary description text respectively to obtain a corresponding shared vector sequence and an auxiliary vector sequence; performing randomization processing on the shared vector sequence, and determining shared latent variables based on the randomization processing result; performing semantic decoding processing based on the shared latent variables and the auxiliary vector sequence, and outputting a target description text corresponding to the target task, the text type of the target description text is one of a comment type and a label type, and the text type of the target description text is different from that of the auxiliary description text. The use of this method can improve the generation efficiency of the target description text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and device for describing text generation, and a training method for a text processing model. Background Art

[0002] With the development of network technology, users can access various text information anytime and anywhere, such as music reviews, news tags, blog comments, report tags, paper comments, etc. At present, the main method of manually writing text is to manually input music reviews in the corresponding comment input area through a music application, or to manually add news tags in the corresponding news adding area through a news application. However, with the development of Internet technology, the amount of text information that people can access is constantly increasing, and the demand for creative text information is also constantly increasing. For example, people hope to read more music reviews and news tags. In this way, text creators need to manually create a large amount of text content, so the method of manually writing text is inefficient. Summary of the invention

[0003] Based on this, it is necessary to provide a description text generation method, device, computer equipment and storage medium that can improve the generation efficiency of target description text in response to the above technical problems.

[0004] A description text generation method, the method comprising:

[0005] Acquire a shared content text and an auxiliary description text corresponding to the target task; the text type of the auxiliary description text is one of a comment type and a tag type;

[0006] Semantically encoding the shared content text and the auxiliary description text to obtain a corresponding shared vector sequence and an auxiliary vector sequence;

[0007] Randomizing the shared vector sequence, and determining the shared latent variable based on the randomization result;

[0008] Semantic decoding processing is performed based on the shared latent variables and the auxiliary vector sequence, and a target description text corresponding to the target task is output, wherein the text type of the target description text is one of a comment type and a label type, and the text type of the target description text is different from that of the auxiliary description text.

[0009] In one embodiment, the acquiring of the shared content text and the auxiliary description text corresponding to the target task includes:

[0010] Determine the target task and obtain clue keywords corresponding to the target task;

[0011] A search is performed based on the clue keywords to obtain the shared content text and the auxiliary description text matching the target task.

[0012] In one embodiment, the description text generation is performed through a text processing model; the text processing model includes a comment generation network and a tag generation network; the comment generation network is used to generate a target description text belonging to a comment type based on the shared content text and the auxiliary description text belonging to the tag type; the tag generation network is used to generate a target description text belonging to a tag type based on the shared content text and the auxiliary description text belonging to the comment type.

[0013] In one embodiment, the text processing model further includes a content encoding network, and the semantic encoding processing is performed on the shared content text and the auxiliary description text respectively to obtain a corresponding shared vector sequence and an auxiliary vector sequence, including:

[0014] Performing semantic encoding processing on the shared content text through the content encoding network to obtain a shared vector sequence corresponding to the shared content text;

[0015] When the auxiliary description text belongs to the tag type, the auxiliary description text is semantically encoded by the comment generation network to obtain a corresponding first auxiliary vector sequence;

[0016] When the auxiliary description text belongs to the comment type, the auxiliary description text is semantically encoded by the label generation network to obtain a corresponding second auxiliary vector sequence;

[0017] The randomizing the shared vector sequence and determining the shared latent variable based on the randomization result includes:

[0018] When the auxiliary description text belongs to the tag type, the shared vector sequence is randomized by the comment generation network, and a first shared latent variable is determined based on the processing result;

[0019] When the auxiliary description text belongs to the comment type, the shared vector sequence is randomized by the label generation network, and a second shared latent variable is determined based on the processing result;

[0020] The performing semantic decoding processing based on the shared latent variable and the auxiliary vector sequence to output a target description text corresponding to the target task includes:

[0021] When the auxiliary description text belongs to the tag type, the first auxiliary vector sequence is decoded based on the first shared latent variable through the comment generation network to obtain a target description text belonging to the comment type;

[0022] When the auxiliary description text belongs to the comment type, the second auxiliary vector sequence is decoded based on the second shared latent variable through the label generation network to obtain a target description text belonging to the label type.

[0023] In one embodiment, the decoding process of the first auxiliary vector sequence based on the first shared latent variable through the comment generation network to obtain a target description text belonging to the comment type includes:

[0024] By means of the comment generation network, based on the first shared latent variable and the word vector of the target word output last time, the first auxiliary vector sequence is decoded to obtain the target end vector sequence of the current time;

[0025] Determine the target word output at the time according to the target end vector sequence at the time through the comment generation network;

[0026] Through the comment generation network, a target description text belonging to the comment type is constructed based on each of the output target words.

[0027] In one embodiment, the training step of the text processing model includes:

[0028] Acquire a first sample training set, where the first sample training set includes a first content text, and a first sample comment and a first sample label corresponding to the first content text;

[0029] Performing semantic encoding processing on the first content text to obtain a corresponding sample content vector sequence;

[0030] By using a comment generation network in a text processing model to be trained, encoding and decoding the sample content vector sequence and the first sample label to obtain a corresponding first predicted comment;

[0031] Through the label generation network in the text processing model to be trained, the sample content vector sequence and the first sample comment are encoded and decoded to obtain a corresponding first predicted label; wherein the comment generation network and the label generation network are dual structures to each other;

[0032] Determining a dual loss based on a first difference between the first predicted label and the first sample label, and a second difference between the first predicted comment and the first sample comment;

[0033] The text processing model is trained based on the dual loss until the training end condition is met, thereby obtaining a trained text processing model; the trained text processing model is used to generate a target description text corresponding to a target task; the target description text is at least one of a target comment text and a target label text.

[0034] A description text generating device, the device comprising:

[0035] A text acquisition module, used to acquire a shared content text and an auxiliary description text corresponding to a target task; the text type of the auxiliary description text is one of a comment type and a tag type;

[0036] A randomization processing module, used to perform semantic encoding processing on the shared content text and the auxiliary description text respectively to obtain a corresponding shared vector sequence and an auxiliary vector sequence; perform randomization processing on the shared vector sequence, and determine a shared latent variable based on the randomization processing result;

[0037] A decoding module is used to perform semantic decoding processing based on the shared latent variables and the auxiliary vector sequence, and output a target description text corresponding to the target task, wherein the text type of the target description text is one of a comment type and a label type, and the text type of the target description text is different from that of the auxiliary description text.

[0038] In one embodiment, the text acquisition module is further used to determine a target task and acquire clue keywords corresponding to the target task; perform a search based on the clue keywords to obtain a shared content text and an auxiliary description text matching the target task.

[0039] In one embodiment, the randomization processing module also includes a vector sequence determination module, which is used to determine a shared word sequence corresponding to the shared content text, and determine an auxiliary word sequence corresponding to the auxiliary description text; perform forward semantic encoding and reverse semantic encoding on the shared word sequence, respectively, to obtain a forward shared encoding vector sequence and a reverse shared encoding vector sequence; perform sequence fusion processing on the forward shared encoding vector sequence and the reverse shared encoding vector sequence, to obtain a shared vector sequence corresponding to the shared content text; perform forward semantic encoding and reverse semantic encoding on the auxiliary word sequence, respectively, to obtain a forward auxiliary encoding vector sequence and a reverse auxiliary encoding vector sequence; perform sequence fusion processing on the forward auxiliary encoding vector sequence and the reverse auxiliary encoding vector sequence, to obtain an auxiliary vector sequence corresponding to the auxiliary description text.

[0040] In one embodiment, the randomization processing module also includes a latent variable determination module, which is used to convert the shared vector sequence into a corresponding target probability distribution, and determine the corresponding target mean and target variance based on the target probability distribution; when the auxiliary description text belongs to the label type, according to the target mean and the target variance, at least one sampling is performed based on the target probability distribution to obtain at least one shared latent variable corresponding to the auxiliary description text; when the auxiliary description text belongs to the comment type, the target mean is used as the shared latent variable corresponding to the auxiliary description text.

[0041] In one embodiment, the decoding module is also used to form a group of objects to be decoded by combining each shared latent variable with the auxiliary vector sequence; semantic decoding processing is performed based on each group of objects to be decoded, and at least one target description text corresponding to the target task is output, and each output target description text is different.

[0042] In one embodiment, the description text processing device is used to execute a description text processing method, and the description text processing method is executed through a text processing model; the text processing model includes a comment generation network and a label generation network; the comment generation network is used to generate a target description text belonging to a comment type based on the shared content text and the auxiliary description text belonging to the label type; the label generation network is used to generate a target description text belonging to a label type based on the shared content text and the auxiliary description text belonging to the comment type.

[0043] In one embodiment, the description text processing device is further used to perform semantic encoding processing on the shared content text through the content encoding network to obtain a shared vector sequence corresponding to the shared content text; when the auxiliary description text belongs to the tag type, perform semantic encoding processing on the auxiliary description text through the comment generation network to obtain a corresponding first auxiliary vector sequence; when the auxiliary description text belongs to the comment type, perform semantic encoding processing on the auxiliary description text through the tag generation network to obtain a corresponding second auxiliary vector sequence; when the auxiliary description text belongs to the tag type, perform semantic encoding processing on the auxiliary description text through the comment generation network to obtain a corresponding second auxiliary vector sequence; The auxiliary description text is randomized and processed, and a first shared latent variable is determined based on the processing result; when the auxiliary description text belongs to the comment type, the shared vector sequence is randomized through the label generation network, and a second shared latent variable is determined based on the processing result; when the auxiliary description text belongs to the label type, the first auxiliary vector sequence is decoded based on the first shared latent variable through the comment generation network to obtain a target description text belonging to the comment type; when the auxiliary description text belongs to the comment type, the second auxiliary vector sequence is decoded based on the second shared latent variable through the label generation network to obtain a target description text belonging to the label type.

[0044] In one embodiment, the decoding module is also used to decode the first auxiliary vector sequence through the comment generation network based on the first shared latent variable and the word vector of the target word output last time to obtain the target end vector sequence of the current time; through the comment generation network, determine the target word output this time according to the target end vector sequence of the current time; through the comment generation network, based on each of the target words output, construct a target description text belonging to the comment type.

[0045] In one embodiment, the description text processing device is further used to obtain a first sample training set, the first sample training set includes a first content text, and a first sample comment and a first sample label corresponding to the first content text; semantic encoding processing is performed on the first content text to obtain a corresponding sample content vector sequence; the sample content vector sequence and the first sample label are encoded and decoded by a comment generation network in the text processing model to be trained to obtain a corresponding first predicted comment; the sample content vector sequence and the first sample comment are encoded and decoded by a label generation network in the text processing model to be trained to obtain a corresponding first predicted label; wherein the comment generation network and the label generation network are dual structures to each other; dual loss is determined according to a first difference between the first predicted label and the first sample label, and a second difference between the first predicted comment and the first sample comment; the text processing model is trained based on the dual loss until the training end condition is met to obtain a trained text processing model; the trained text processing model is used to generate a target description text corresponding to a target task; the target description text is at least one of a target comment text and a target label text.

[0046] In one embodiment, the description text processing device is also used for, when the target task is a music review generation task, the shared content text includes at least one of the song name, lyrics text, rhythm description text, and author attribute text corresponding to the target song, the auxiliary description text is a set of music tags corresponding to the target song, and the target description text is a set of music reviews corresponding to the target song; when the target task is a music tag generation task, the shared content text includes at least one of the song name, lyrics text, rhythm description text, and author attribute text corresponding to the target song, the auxiliary description text is a set of music reviews corresponding to the target song, and the target description text is a set of music tags corresponding to the target song.

[0047] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0048] Acquire a shared content text and an auxiliary description text corresponding to the target task; the text type of the auxiliary description text is one of a comment type and a tag type;

[0049] Semantically encoding the shared content text and the auxiliary description text to obtain a corresponding shared vector sequence and an auxiliary vector sequence;

[0050] Randomizing the shared vector sequence, and determining the shared latent variable based on the randomization result;

[0051] Semantic decoding processing is performed based on the shared latent variables and the auxiliary vector sequence, and a target description text corresponding to the target task is output, wherein the text type of the target description text is one of a comment type and a label type, and the text type of the target description text is different from that of the auxiliary description text.

[0052] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0053] Acquire a shared content text and an auxiliary description text corresponding to the target task; the text type of the auxiliary description text is one of a comment type and a tag type;

[0054] Semantically encoding the shared content text and the auxiliary description text to obtain a corresponding shared vector sequence and an auxiliary vector sequence;

[0055] Randomizing the shared vector sequence, and determining the shared latent variable based on the randomization result;

[0056] Semantic decoding processing is performed based on the shared latent variables and the auxiliary vector sequence, and a target description text corresponding to the target task is output, wherein the text type of the target description text is one of a comment type and a label type, and the text type of the target description text is different from that of the auxiliary description text.

[0057] The above-mentioned description text generation method, device, computer equipment and storage medium can encode the shared content text and the auxiliary description text by obtaining the shared content text and the auxiliary description text corresponding to the target task to obtain a shared vector sequence and an auxiliary vector sequence. By obtaining a shared vector sequence that can be used to share between two target tasks, the corresponding shared latent variables can be determined based on the shared vector sequence, and then semantic decoding processing can be performed based on the shared latent variables and the auxiliary vector sequence to obtain the target description text corresponding to the target task. Since the target description text can be automatically output, compared with the traditional manual writing, the present application greatly improves the generation efficiency of the target description text.

[0058] In addition, since the corresponding target description text is obtained based on the shared latent variables shared in the two target tasks, the present application can fully utilize the semantic information shared in the comment generation task and the label generation task, thereby outputting a more accurate target description text based on the shared semantic information. And since the target description text of the comment type can be outputted based on the auxiliary text of the label type, and the target description text of the label type can be outputted based on the auxiliary text of the comment type, the accuracy of the target description text can be further improved.

[0059] A method for training a text processing model, the method comprising:

[0060] Acquire a first sample training set, where the first sample training set includes a first content text, and a first sample comment and a first sample label corresponding to the first content text;

[0061] Performing semantic encoding processing on the first content text to obtain a corresponding sample content vector sequence;

[0062] By using a comment generation network in a text processing model to be trained, encoding and decoding the sample content vector sequence and the first sample label to obtain a corresponding first predicted comment;

[0063] Through the label generation network in the text processing model to be trained, the sample content vector sequence and the first sample comment are encoded and decoded to obtain a corresponding first predicted label; wherein the comment generation network and the label generation network are dual structures to each other;

[0064] Determining a dual loss based on a first difference between the first predicted label and the first sample label, and a second difference between the first predicted comment and the first sample comment;

[0065] The text processing model is trained based on the dual loss until the training end condition is met, thereby obtaining a trained text processing model; the trained text processing model is used to generate a target description text corresponding to a target task; the target description text is at least one of a target comment text and a target label text.

[0066] A training device for a text processing model, the device comprising:

[0067] The encoding module is used to obtain a first sample training set, wherein the first sample training set includes a first content text, and a first sample comment and a first sample label corresponding to the first content text; perform semantic encoding processing on the first content text to obtain a corresponding sample content vector sequence;

[0068] An output module is used to encode and decode the sample content vector sequence and the first sample label through the comment generation network in the text processing model to be trained to obtain a corresponding first predicted comment; and to encode and decode the sample content vector sequence and the first sample comment through the label generation network in the text processing model to be trained to obtain a corresponding first predicted label; wherein the comment generation network and the label generation network are dual structures to each other;

[0069] A training module, used to determine a dual loss based on a first difference between the first predicted label and the first sample label, and a second difference between the first predicted comment and the first sample comment; train the text processing model based on the dual loss until the training end condition is met, thereby obtaining a trained text processing model; the trained text processing model is used to generate a target description text corresponding to a target task; the target description text is at least one of a target comment text and a target label text.

[0070] In one embodiment, the text processing model also includes a connection network, which is used to connect the comment generation network and the label generation network. The training module is also used to perform a first training on the comment generation network and the label generation network in the text processing model based on the dual loss until a first stopping condition is met; obtain a second sample training set, the second sample training set includes a second content text and a second sample label corresponding to the second content text, a third content text and a third sample comment corresponding to the third content text; perform a second training on the connection network in the text processing model obtained by performing the first training through the second sample training set, and stop when the second stopping condition is met; perform a third training on the text processing model obtained by performing the second training through the first sample training set and the second sample training set, and stop when the third stopping condition is met, so as to obtain a trained text processing model.

[0071] In one embodiment, the connection network includes a label connection network; the training module is also used to encode and decode the second content text and the second sample label by executing the comment generation network in the text processing model obtained by the first training to obtain a predicted comment vector sequence; convert the predicted comment vector sequence into a substitute comment vector sequence by executing the label connection network in the text processing model obtained by the first training; decode the substitute comment vector sequence by executing the label generation network in the text processing model obtained by the first training to obtain a corresponding second predicted label; determine the label difference between the second predicted label and the second sample label, and perform a second training on the label connection network based on the label difference until the second stop condition is met.

[0072] In one embodiment, the connection network includes a comment connection network; the training module is also used to encode and decode the third content text and the third sample comment by executing the label generation network in the text processing model obtained by the first training to obtain a predicted label vector sequence; convert the predicted label vector sequence into a substitute label vector sequence by executing the comment connection network in the text processing model obtained by the first training; decode the substitute label vector sequence by executing the comment generation network in the text processing model obtained by the first training to obtain a corresponding second predicted comment; determine the comment difference between the second predicted comment and the third sample comment, and perform a second training on the comment connection network based on the comment difference until the second stop condition is met.

[0073] In one embodiment, the training module is also used to jointly perform corresponding branch training on the comment generation network and the label connection network in the text processing model obtained by performing the second training based on the first content text and the first sample label corresponding to the first content text, and the second content text and the second sample label corresponding to the second content text; jointly perform corresponding branch training on the label generation network and the comment connection network in the text processing model obtained by performing the second training based on the first content text and the first sample comment corresponding to the first content text, and the third content text and the third sample comment corresponding to the third content text; and terminate the training when it is determined based on each branch training that the third stop condition is met to obtain a trained text processing model.

[0074] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0075] Acquire a first sample training set, where the first sample training set includes a first content text, and a first sample comment and a first sample label corresponding to the first content text;

[0076] Performing semantic encoding processing on the first content text to obtain a corresponding sample content vector sequence;

[0077] By using a comment generation network in a text processing model to be trained, encoding and decoding the sample content vector sequence and the first sample label to obtain a corresponding first predicted comment;

[0078] Through the label generation network in the text processing model to be trained, the sample content vector sequence and the first sample comment are encoded and decoded to obtain a corresponding first predicted label; wherein the comment generation network and the label generation network are dual structures to each other;

[0079] Determining a dual loss based on a first difference between the first predicted label and the first sample label, and a second difference between the first predicted comment and the first sample comment;

[0080] The text processing model is trained based on the dual loss until the training end condition is met, thereby obtaining a trained text processing model; the trained text processing model is used to generate a target description text corresponding to a target task; the target description text is at least one of a target comment text and a target label text.

[0081] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0082] Acquire a first sample training set, where the first sample training set includes a first content text, and a first sample comment and a first sample label corresponding to the first content text;

[0083] Performing semantic encoding processing on the first content text to obtain a corresponding sample content vector sequence;

[0084] By using a comment generation network in a text processing model to be trained, encoding and decoding the sample content vector sequence and the first sample label to obtain a corresponding first predicted comment;

[0085] Through the label generation network in the text processing model to be trained, the sample content vector sequence and the first sample comment are encoded and decoded to obtain a corresponding first predicted label; wherein the comment generation network and the label generation network are dual structures to each other;

[0086] Determining a dual loss based on a first difference between the first predicted label and the first sample label, and a second difference between the first predicted comment and the first sample comment;

[0087] The text processing model is trained based on the dual loss until the training end condition is met, thereby obtaining a trained text processing model; the trained text processing model is used to generate a target description text corresponding to a target task; the target description text is at least one of a target comment text and a target label text.

[0088] The training method, apparatus, computer equipment and storage medium of the above-mentioned text processing model can perform semantic encoding processing on the shared first content text in the first sample training set by obtaining the first sample training set to obtain the corresponding sample content vector sequence, so that the comment generation network and the label generation network can perform encoding and decoding processing through the shared sample content vector sequence and the corresponding first sample label or the first sample comment to obtain the first predicted comment and the first predicted label. By obtaining the first predicted comment and the first predicted label, the dual loss can be determined according to the first difference between the first predicted label and the first sample label, and the second difference between the first predicted comment and the first sample comment, and the text processing can be trained based on the dual loss to obtain a trained text processing model. Since the target description text can be automatically output through the trained text processing model, compared with the traditional manual writing, the present application greatly improves the generation efficiency of the target description text.

[0089] In addition, since the label generation network and comment generation network in the text processing model can be trained through the shared first content text, during the model training process, the possible shared semantic information can be fully utilized, thereby improving the accuracy of the text processing model. BRIEF DESCRIPTION OF THE DRAWINGS

[0090] Figure 1 An application environment diagram for describing a text generation method in an embodiment;

[0091] Figure 2 A flowchart of a text generation method in one embodiment is described;

[0092] Figure 3 A flowchart of text acquisition in one embodiment;

[0093] Figure 4 is a model schematic diagram of a text processing model in an embodiment;

[0094] Figure 5 A flowchart of a method for training a text processing model in one embodiment;

[0095] Fig. 6A A schematic diagram of a network connection in one embodiment;

[0096] Figure 6B A connection diagram of a network connection in another embodiment;

[0097] Figure 7 A flowchart of a text generation method in a specific embodiment is described;

[0098] Figure 8 A flowchart of a method for training a text processing model in a specific embodiment;

[0099] Fig. 9 is a structural block diagram describing a text generation device in one embodiment;

[0100] Fig.10 is a structural block diagram of a training device for a text processing model in one embodiment;

[0101] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0102] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0103] Figure 1 FIG. 1 is an application environment diagram for describing a text generation method in an embodiment. Figure 1 , the description text generation method is applied to the description text generation system 100. The description text generation system 100 includes a terminal 102 and a server 104. The terminal 102 and the server 104 can be used in conjunction to execute the content text generation method of the present application, and can also be used alone to execute the content text generation method of the present application. For example, the terminal 102 can send the shared content text and the auxiliary description text corresponding to the target task to the server 102, and the server 102 executes the description text generation method to obtain the target description text corresponding to the target task, and then returns the target description text to the terminal 102, which is displayed accordingly by the terminal 102. The terminal 102 can also execute the description text generation method after obtaining the shared content text and the auxiliary description text. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented with an independent server or a server cluster composed of multiple servers.

[0104] It should also be noted that this application relates to the field of artificial intelligence (AI) technology, in which artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making.

[0105] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0106] This application specifically relates to natural language processing (NLP) and machine learning (ML) in the field of artificial intelligence. Natural language processing is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language people use in daily life, so it is closely related to the study of linguistics. Natural language processing technology includes text processing, semantic understanding, machine translation, robot question answering, knowledge graphs and other technologies.

[0107] Among them, machine learning (ML) is a multi-disciplinary interdisciplinary subject, involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0108] It should be understood that the words "first", "second" and the like used in the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. Unless the context clearly indicates otherwise, the singular forms "a", "an" or "the" and the like do not indicate quantity limitation, but indicate the presence of at least one.

[0109] In one embodiment, Figure 2 As shown, a description text generation method is provided, which is applied to Figure 1 The computer device in the example is used to illustrate, and the computer device can be the above Figure 1 The terminal 102 or the server 104 in FIG. Figure 2 , the description text generation method specifically includes the following steps:

[0110] Step S202, obtaining the shared content text and the auxiliary description text corresponding to the target task; the text type of the auxiliary description text is one of a comment type and a tag type.

[0111] Specifically, when the target task is obtained, the computer device can directly extract the corresponding shared content text and auxiliary description text from the target task, or use the target task as an index to pull the corresponding shared content text and auxiliary description text from other computer devices. Among them, the shared content text refers to the initial text that can be shared when generating a target description text of a comment type and a target description text of a tag type. The shared content text can specifically be a text such as a sentence, a music lyrics, or a poem title, or it can be a Chinese text or an English text, etc. The auxiliary description text refers to the text that describes the shared content text. The text type of the auxiliary description text corresponds to one of the comment type and the tag type. When the auxiliary description text belongs to the comment type, the auxiliary description text can specifically be a comment text obtained by commenting on the shared content text; when the auxiliary description text belongs to the tag type, the auxiliary description text can specifically be a tag text that describes the classification attributes of the shared content text.

[0112] In one embodiment, the target task can specifically be a music review generation task, a music tag generation task, a news review generation task, or a news tag generation task, etc. When the target task is a music review generation task, the shared content text can be at least one of the song name, lyrics text, rhythm description text, and author attribute text of the target song to generate the music review; the auxiliary description text can be the music tag text obtained by classifying the attributes of the target song. When the target task is a music tag generation task, the shared content text can be at least one of the song name, lyrics text, rhythm description text, and author attribute text of the target song to generate the music tag; the auxiliary description text can be the music review text obtained by commenting on the target song. It is easy to understand that the shared content text is the common input text required for different types of target tasks, and the auxiliary description text is the input text of the corresponding type selected by the computer device based on the task type of the target task.

[0113] In one embodiment, when the shared content text and the auxiliary description text are obtained, the computer device may perform word segmentation processing on the shared content text to obtain a shared word sequence composed of each word segmentation, and perform word segmentation processing on the auxiliary description text to obtain an auxiliary word sequence composed of each word segmentation. The computer device inputs the shared word sequence and the auxiliary word sequence into the trained text processing model for the next step of processing. Among them, for the word segmentation processing of the shared content text or the auxiliary description text as Chinese text, a dictionary-based or statistical-based word segmentation method can be adopted. For the word segmentation processing of the shared content text or the auxiliary description text as English text, a word segmentation method such as splitting words according to spaces can be used. Among them, the text processing model refers to a machine learning model used to execute the description text generation method.

[0114] In one embodiment, obtaining shared content text and auxiliary description text corresponding to the target task includes: determining the target task and obtaining clue keywords corresponding to the target task; searching based on the clue keywords to obtain shared content text and auxiliary description text matching the target task.

[0115] Among them, clue keywords are keywords used to determine the shared content text and auxiliary description text that match the target task. When the target task is a music review generation task or a music tag generation task, the clue keywords can specifically be the song name, singer name, or the title of the content text to be generated.

[0116] Specifically, when determining the target task, the computer device may obtain clue keywords corresponding to the target task, and perform local or network retrieval based on the determined clue keywords to obtain the shared content text and auxiliary description text corresponding to the current target task. Figure 3When the target task is a music review generation task, and the clue keyword corresponding to the target task is a song name, the computer device can perform a network search based on the song name, determine the song identifier corresponding to the song name, and obtain the complete lyrics and music label text corresponding to the song name based on the song identifier. Further, the computer device uses the retrieved complete lyrics as the shared content text, and the music label text as the auxiliary description text to input into the pre-trained text processing model, thereby obtaining the music review related to the lyrics content, the music review related to the lyrics style, or the music review related to the listener behavior, etc. output by the text processing model, and sends at least one generated music review to the terminal for corresponding display. Figure 3 A schematic diagram of a flow chart of text acquisition in an embodiment is shown.

[0117] In this embodiment, by performing text expansion processing on key search terms, the shared content text can contain richer text information, so that target description texts from different perspectives can be output based on the richer text information, thereby enriching the diversity of the output target description texts.

[0118] Step S204 , semantic coding is performed on the shared content text and the auxiliary description text respectively to obtain a corresponding shared vector sequence and an auxiliary vector sequence.

[0119] The semantic encoding of the shared content text or the auxiliary description text is a process of converting the shared content text or the auxiliary description text into a vector. The vector sequence is a vector sequence obtained by semantically encoding the word sequence of the shared content text or the auxiliary description text.

[0120] Specifically, the computer device can semantically encode each word in the shared word sequence, extract the semantic features of each word, convert each word into a vector representation, and then obtain the shared vector sequence according to the vector representation corresponding to each word. Similarly, the computer device can semantically encode each word in the auxiliary word sequence, extract the semantic features of each word, convert each word into a vector representation, and then obtain the auxiliary vector sequence according to the vector representation corresponding to each word.

[0121] In one embodiment, the semantic encoding process is performed by a text processing model. The text processing model is a pre-trained machine learning model, which includes a content encoding network, a comment generation network, and a label generation network. The content encoding network is used to convert the shared content text into a shared vector sequence; the comment generation network is used to convert the auxiliary description text belonging to the label type into a first auxiliary vector sequence, and output the target description text of the comment type according to the first auxiliary vector sequence and the shared vector sequence; the label generation network is used to convert the auxiliary description text belonging to the comment type into a second auxiliary vector sequence, and output the target description text of the label type according to the second auxiliary vector sequence and the shared vector sequence.

[0122] Among them, the content encoding network, comment generation network and label generation network can use the same type of neural network model, or different types of neural network models. For example, the content encoding network, comment generation network and label generation network can all be CNN (Convolutional Neural Networks) models or RNN (Recurrent Neural Networks) models. Or the content encoding network, comment generation network and label generation network respectively use different neural network models, such as the encoding structure uses the RNN model, the perspective feature extraction structure uses the DNN (Deep Neural Networks) model, the decoding structure uses the CNN model, etc.

[0123] In one embodiment, the multi-layer neural network of the content coding network in the text processing model can semantically encode the shared content text layer by layer, obtain the encoded hidden layer vectors output by each layer of the neural network, and synthesize the encoded hidden layer vectors output by each layer of the neural network to obtain the corresponding shared vector sequence. Specifically, the computer device can input the spatial representation vector sequence corresponding to the shared word sequence into the first layer of the neural network in the multi-layer neural network of the content coding network, perform semantic encoding processing on the spatial representation vector sequence through the first layer of the neural network, and output the encoded hidden layer vector corresponding to the first layer of the neural network. Then, the encoded hidden layer vector output by the first layer of the neural network is used as the input of the second layer of the neural network, and the semantic encoding processing is performed by the second layer of the neural network to obtain the encoded hidden layer vector output by the second layer of the neural network. And so on, until the encoded hidden layer vector output by the last layer of the neural network is obtained. The content coding network can fuse the encoded hidden layer vectors output by each layer of the neural network to obtain a shared vector sequence. Similarly, the label generation network or the comment generation network can also encode the auxiliary description text based on the above method to obtain the corresponding auxiliary vector sequence.

[0124] The encoded hidden layer vector refers to the vector obtained by transforming the word sequence through the hidden layer when the word sequence is input into the hidden layer of the multi-layer neural network of the content coding network. Hidden layer is a term in the neural network model, which is the middle layer relative to the input layer and the output layer. The hidden layer includes the model parameters obtained by training the neural network model. Here, the hidden layer of the content coding network is the middle layer relative to the input layer of the content coding network and the output layer of the coding structure. The hidden layer of the content coding network may include multiple neural network layers.

[0125] Step S206: randomize the shared vector sequence and determine the shared latent variables based on the randomization result.

[0126] Specifically, when generating a shared vector sequence, the content coding network may perform random processing on the shared vector sequence. For example, the content coding network may process the shared vector sequence through a preset Gaussian function to convert the shared vector sequence into a Gaussian distribution; or the content coding network may process the shared vector sequence to convert the shared vector sequence into a gamma distribution, etc. Further, the text processing model may determine the shared latent variables based on the random processing result.

[0127] In one embodiment, a shared vector sequence is randomized, and shared latent variables are determined based on the randomization results, including: converting the shared vector sequence into a corresponding target probability distribution, and determining a corresponding target mean and target variance based on the target probability distribution; when the auxiliary description text is of a label type, sampling is performed at least once based on the target probability distribution according to the target mean and target variance to obtain at least one shared latent variable corresponding to the auxiliary description text; when the auxiliary description text is of a comment type, the target mean is used as the shared latent variable corresponding to the auxiliary description text.

[0128] Specifically, the content encoding network in the text processing model can perform random processing on the shared vector sequence, convert the shared vector sequence into the corresponding target probability distribution, and determine the target mean and target variance of the target probability distribution. For example, the content encoding network can convert the shared vector sequence into a Gaussian distribution and determine the mean and variance of the Gaussian distribution. When the auxiliary description text belongs to the label type, the comment generation network can sample the target probability distribution at least once according to the target mean and target variance to obtain at least one first shared latent variable. When the auxiliary description text belongs to the comment type, the label generation network uses the target mean as the second shared latent variable corresponding to the auxiliary description text. For example, in the above example, the comment generation network can sample the shared vector sequence in the Gaussian distribution for a preset number of times according to the mean and variance of the Gaussian distribution to obtain at least one first shared latent variable, and the label generation network can use the mean of the Gaussian distribution as the second shared latent variable.

[0129] In one embodiment, the content encoding network in the text processing model can obtain the mean and variance of the Gaussian distribution through the following formula: μ = W μ *H c +b μ ,σ=W σ *H c +b σ . Among them, μ represents the mean of Gaussian distribution; σ represents the variance of Gaussian distribution; H c represents the shared vector sequence; W μ 、b μ , W σ 、b σ All of them are network parameters of the content coding network. The comment generation network can obtain at least one first shared latent variable through the following formula: z1=μ+σε, ε∈(0 to 1). The tag generation network can obtain the second shared latent variable through the following formula: z2=μ.

[0130] In the above embodiment, by randomizing the shared vector sequence, the comment generation network can sample from the distribution of a random variable, thereby introducing randomness. By introducing randomness, the comment generation model can collect multiple different shared latent variables, thereby improving the diversity of the generated target description text belonging to the comment type based on multiple different shared latent variables. Since the target mean reflects the size of the average value of the randomization processing result, by using the target mean as the corresponding shared latent variable, the target description text belonging to the label type generated subsequently can be made more accurate.

[0131] Step S208, performing semantic decoding processing based on the shared latent variables and the auxiliary vector sequence, outputting a target description text corresponding to the target task, wherein the text type of the target description text is one of a comment type and a label type, and the text type of the target description text is different from that of the auxiliary description text.

[0132] Decoding is a process of converting the input auxiliary vector sequence into the target description text based on the shared latent variables. Specifically, when the auxiliary description text belongs to the label type, the comment generation network in the text processing model can decode the first shared latent variable and the first auxiliary vector sequence, and output the target description text of the comment type corresponding to the target task. When the auxiliary description text belongs to the comment type, the label generation network in the text processing model can decode the second shared latent variable and the second auxiliary vector sequence, and output the target description text of the label type corresponding to the target task.

[0133] For example, when the target task is to generate music reviews, the shared content text is "Missing is a disease - Zhang Zhenyue. When you are on the other side of the mountains and ridges, I am on a lonely road with no end. How many times in a lifetime have I lost the most important things...", and the auxiliary description text is the music tag "sadness" belonging to the tag type, the music review decoded by the comment generation network in the text processing model is: "I want to hold you in my arms, I miss you". When the target task is to generate music tags, the shared content text is "No exceptions - Mr. Lu Dan. There is something that has been simulated countless times in my heart, walking towards you, accompanying you to experience sadness and joy, maybe a simple sentence can express my feelings, but a simple sentence also makes me powerless...", and the auxiliary description text is the music review of the comment type "We are each other's past, we are all the light on the other side", the music tag decoded by the tag generation network in the text processing model is: "Healing, loneliness".

[0134] In one embodiment, a comment generation network is used to decode a first auxiliary vector sequence based on a first shared latent variable to obtain a target description text belonging to a comment type, including: a comment generation network is used to decode a first auxiliary vector sequence based on a first shared latent variable and a word vector of a target word output last time to obtain a target end vector sequence of that time; a comment generation network is used to determine a target word output this time according to the target end vector sequence of that time; a comment generation network is used to construct a target description text belonging to a comment type based on each target word output.

[0135] Specifically, when the first shared latent variable is obtained, the computer device may input the first shared latent variable into the decoding structure in the comment generation network, and the comment generation network uses the first shared latent variable as the initial decoding latent vector output by the first layer of the multi-layer neural network in the decoding structure, and decodes the first auxiliary vector sequence based on the initial decoding latent vector to obtain the word vector of the target word output by the first layer of the neural network. The computer device then uses the first shared latent variable, the initial decoding latent vector output by the first layer of the neural network, and the word vector of the target word as the input of the second layer of the neural network, triggers the second layer of the neural network, determines the decoding latent vector corresponding to the second layer of the neural network based on the first shared latent variable, the initial decoding latent vector output by the first layer of the neural network, and the word vector of the target word, and decodes the first auxiliary vector sequence based on the decoding latent vector corresponding to the second layer of the neural network to obtain the word vector of the target word output by the second layer of the neural network. And so on, until the word vector of the target word output by the last layer of the neural network is obtained, so that the comment text generation network can synthesize the word vectors of the target word output by each layer of the neural network to obtain the target description text belonging to the comment type.

[0136] In one of the embodiments, the comment generation network can decode the first auxiliary vector sequence on the first shared latent variable through the following formula to obtain the target description text belonging to the comment type.

[0137] x′ j = argmax d′∈D p(d′|x′ 0:j-1 ,y,c)

[0138] p(x j |x′ 0:j-1 ,y,c)=softmax(s j ,c j ,z1)

[0139] s j =LSTM(s j-1 ,e(x′ j-1 ))

[0140] c j =Attention(s j ,H y ), z1=μ+σε, ε∈(0 to 1)

[0141] Among them, x′ j represents the target word output by the comment generation network at time step j; y represents the auxiliary description text; c represents the shared content text; D represents the preset comment set; argmax is a function that finds the parameters of a function; softmax is a function that maps the input to a real number between 0 and 1; LSTM is a long short-term memory artificial neural network; e(x′ j-1 ) represents the word vector of the target word output by the comment generation network at time step j; c j Represents the contextual semantic vector obtained by the attention mechanism at time step j; H y represents the first auxiliary vector sequence; z1 represents the first shared latent variable.

[0142] In the above embodiment, the first auxiliary vector sequence is decoded by the decoding structure in the comment generation network according to the word vector of the target word output by the decoding structure last time, and the word vector of the target word of the current time is obtained. According to the word vector of the target word of the current time, the target word output by the comment generation network of the current time is determined. According to each target word output by the comment generation network, the corresponding target description text is generated. In this way, when the first auxiliary vector sequence is decoded by the decoding structure, the information of each hidden layer can be fused to learn a better hidden layer representation, which reduces the loss of effective information in the model processing and greatly improves the accuracy of the target description text generation.

[0143] In one embodiment, when the label generation network obtains the second shared latent variable and the second auxiliary vector sequence, the label generation network can filter out the most matching target label text from the preset label text library according to the second shared latent variable and the second auxiliary vector sequence, and output the target label text as the target description text. The label generation network can decode the second shared latent variable and the second auxiliary vector sequence through the following formula, and output the target description text of the label type corresponding to the target task.

[0144] y′=argmax s′∈S p(s′|y,c), p(y i |y,c)=softmax(H x ,z2)

[0145] Among them, y′ represents the target description text belonging to the label type; S represents the preset label text library; H x represents the second auxiliary vector sequence; z2 represents the second shared latent variable.

[0146] In the above description text generation method, by obtaining the shared content text and the auxiliary description text corresponding to the target task, the shared content text and the auxiliary description text can be encoded to obtain a shared vector sequence and an auxiliary vector sequence. By obtaining a shared vector sequence that can be used to share between two target tasks, the corresponding shared latent variables can be determined based on the shared vector sequence, and then semantic decoding processing can be performed based on the shared latent variables and the auxiliary vector sequence to obtain the target description text corresponding to the target task. Since the target description text can be automatically output, compared with the traditional manual writing, the present application greatly improves the generation efficiency of the target description text.

[0147] In addition, since the corresponding target description text is obtained based on the shared latent variables shared in the two target tasks, the present application can fully utilize the semantic information shared in the comment generation task and the label generation task, thereby outputting a more accurate target description text based on the shared semantic information. Moreover, since the target description text of the comment type can be outputted based on the auxiliary text of the label type, and the target description text of the label type can be outputted based on the auxiliary text of the comment type, the accuracy of the target description text can be further improved.

[0148] In one embodiment, semantic encoding is performed on the shared content text and the auxiliary description text respectively to obtain corresponding shared vector sequences and auxiliary vector sequences, including: determining a shared word sequence corresponding to the shared content text, and determining an auxiliary word sequence corresponding to the auxiliary description text; performing forward semantic encoding and reverse semantic encoding on the shared word sequence respectively to obtain a forward shared encoding vector sequence and a reverse shared encoding vector sequence; performing sequence fusion processing on the forward shared encoding vector sequence and the reverse shared encoding vector sequence to obtain a shared vector sequence corresponding to the shared content text; performing forward semantic encoding and reverse semantic encoding on the auxiliary word sequence respectively to obtain a forward auxiliary encoding vector sequence and a reverse auxiliary encoding vector sequence; performing sequence fusion processing on the forward auxiliary encoding vector sequence and the reverse auxiliary encoding vector sequence to obtain an auxiliary vector sequence corresponding to the auxiliary description text.

[0149] Specifically, when the shared content text or the auxiliary description text is obtained, the computer device can perform word segmentation processing on the shared content text or the auxiliary description text through a preset word segmentation algorithm to obtain a corresponding word sequence. Among them, the preset word segmentation algorithm can be freely set according to needs, for example, it can be an ICTCLASS algorithm, a jieba algorithm, or a HanNLP algorithm. Furthermore, the content encoding network in the text processing model can perform forward semantic encoding and reverse semantic encoding on the shared word sequence of the shared content text to obtain a forward shared encoding vector sequence and a reverse shared encoding vector sequence, and perform sequence fusion on the forward shared encoding vector sequence and the reverse shared encoding vector sequence based on a preset sequence fusion method to obtain a shared vector sequence corresponding to the shared content text. For example, a linear superposition fusion processing method can be used to perform sequence fusion on the forward shared encoding vector sequence and the reverse shared encoding vector sequence to obtain a shared vector sequence.

[0150] Similarly, when the auxiliary description text belongs to the label type, the auxiliary word sequence of the auxiliary description text can be forward semantically encoded and reverse semantically encoded through the encoding structure in the comment generation network to obtain a forward auxiliary encoding vector sequence and a reverse auxiliary encoding vector sequence, and the forward auxiliary encoding vector sequence and the reverse auxiliary encoding vector sequence are sequence-fused based on a preset sequence fusion method to obtain a first auxiliary vector sequence corresponding to the auxiliary description text. When the auxiliary description text belongs to the comment type, the word sequence of the auxiliary description text can be encoded through the encoding structure in the label generation network to obtain a corresponding second auxiliary vector sequence.

[0151] In one embodiment, the coding structure in the content coding network, the comment generation network, or the coding structure in the tag generation network can use the neural network LSTM (Long Short-Term Memory, long short-term memory artificial neural network) to perform forward semantic coding and reverse semantic coding on the shared content text or auxiliary description text. The following is an example of the process of performing forward semantic coding and reverse semantic coding on the process word sequence of the shared content text layer by layer through the LSTM multi-layer neural network: Taking the word sequence of the shared content text as a sequence of length m as an example, first, the computer device can segment the shared content text to obtain a shared word sequence x = (x1, x2, ..., x m ), and transform the shared word sequence into a continuous spatial representation vector sequence e(x) = (e(x1), e(x2), ..., e(x m ))e(x)=(e(x1),e(x2),...,e(x m ))e(x)=(e(x1),e(x2),...,e(x m )), through the LSTM multi-layer neural network, based on the encoded hidden layer vector output by the previous layer, the word sequence is semantically encoded layer by layer to obtain the corresponding forward shared encoding vector sequence in, LSTM forword Represents positive semantic encoding; represents the encoded hidden vector of the output of the i-th layer neural network of LSTM; e(x i ) represents the i-th space representation vector in the space representation vector sequence. Similarly, the computer device uses the LSTM multi-layer neural network to perform reverse semantic encoding on the shared content text word sequence layer by layer to obtain the reverse encoding vector sequence in, Represents the encoded hidden vector of the i-th layer neural network output of LSTM, LSTM backword Indicates reverse semantic coding, so the coding contiguous sequence obtained by sequencing the forward shared coding vector sequence and the reverse shared coding vector sequence is H c ={h1,h2,…,h m It is easy to understand that the auxiliary description text can also be encoded based on the above method.

[0152] In this embodiment, by performing forward semantic encoding and reverse semantic encoding on the shared content text and the auxiliary description text, the encoded shared vector sequence and the auxiliary vector sequence can contain richer semantic information, so that the target description text obtained by subsequently decoding the shared vector sequence and the auxiliary vector sequence can be more accurate.

[0153] In one embodiment, when the auxiliary description text belongs to the label type, semantic decoding processing is performed based on the shared latent variables and the auxiliary vector sequence, and the target description text corresponding to the target task is output, including: each shared latent variable and the auxiliary vector sequence constitute a group of objects to be decoded; semantic decoding processing is performed based on each group of objects to be decoded, and at least one target description text corresponding to the target task is output, and each output target description text is different.

[0154] Specifically, when the comment generation network samples and obtains multiple first shared latent variables, the comment generation network can form a group of objects to be decoded with each first shared latent variable and the first auxiliary vector sequence, so that the comment generation network can perform semantic decoding processing on each group of objects to be decoded in the above manner, and output at least one target description text corresponding to the target task. For example, when the target task is to generate music reviews, and the shared content text is "The power of smile - Chen Qianwen. Sunny and cloudy with occasional showers, occasionally losing the courage of the sun, even if frustration soaks the wings, the dream has never stopped flying far, and it is inevitable to cry, like a downpour, I will accompany you forward, looking up at the rainbow after the rain...", and the auxiliary description text is "inspirational", the music reviews generated by the comment generation network in the text processing model can be "I think it sounds good", "The lyrics are very inspiring" and "The power of your smile is great", etc. It is easy to understand that the label generation network can decode each group of objects to be decoded separately to obtain the corresponding target description text, and can also decode the objects to be decoded at the same time to obtain multiple target description texts. This embodiment is not limited here.

[0155] In this embodiment, by sampling the shared vector sequence after randomization processing, multiple first shared latent variables are obtained, and the first auxiliary vector sequence can be decoded based on different first shared latent variables, so as to obtain multiple different target description texts. In this way, the diversity of the generated target description texts is greatly improved.

[0156] In one embodiment, the description text generation method is executed through a text processing model; the text processing model includes a comment generation network and a tag generation network; the comment generation network is used to generate a target description text belonging to a comment type based on a shared content text and an auxiliary description text belonging to a tag type; the tag generation network is used to generate a target description text belonging to a tag type based on a shared content text and an auxiliary description text belonging to a comment type.

[0157] Specifically, the text processing model may include a comment generation network and a tag generation network, wherein the comment generation network is used to generate a target description text belonging to the comment type, and the tag generation network is used to generate a target description text belonging to the tag type. Figure 4The content encoding network in the text processing model can be used to perform semantic encoding processing on the shared content text to obtain a shared vector sequence; the comment generation network in the text processing model may include an encoding structure and a decoding structure, thereby outputting a target description text of a comment type based on the encoding structure and the decoding structure; the label generation network in the text processing model may include an encoding structure and a classification structure, thereby outputting a target description text of a label type based on the encoding structure and the classification structure. Figure 4 A model schematic diagram of a text processing model in an embodiment is shown.

[0158] In this embodiment, by setting up a comment generation network and a label generation network, the target description text of the comment type can be output based on the comment generation network, and the target description text of the label type can be output based on the label generation network, thereby greatly enriching the text type of the output target description text.

[0159] In one embodiment, the text processing model also includes a content encoding network, which performs semantic encoding processing on the shared content text and the auxiliary description text respectively to obtain corresponding shared vector sequences and auxiliary vector sequences, including: performing semantic encoding processing on the shared content text through the content encoding network to obtain a shared vector sequence corresponding to the shared content text; when the auxiliary description text belongs to the tag type, performing semantic encoding processing on the auxiliary description text through the comment generation network to obtain a corresponding first auxiliary vector sequence; when the auxiliary description text belongs to the comment type, performing semantic encoding processing on the auxiliary description text through the tag generation network to obtain a corresponding second auxiliary vector sequence; randomizing the shared vector sequence, and determining the shared latent variables based on the randomization results, including: when the auxiliary description text belongs to the tag type , through the comment generation network, the shared vector sequence is randomized, and the first shared latent variable is determined based on the processing result; when the auxiliary description text belongs to the comment type, the shared vector sequence is randomized through the label generation network, and the second shared latent variable is determined based on the processing result; semantic decoding processing is performed based on the shared latent variables and the auxiliary vector sequence, and the target description text corresponding to the target task is output, including: when the auxiliary description text belongs to the label type, the first auxiliary vector sequence is decoded based on the first shared latent variable through the comment generation network to obtain the target description text belonging to the comment type; when the auxiliary description text belongs to the comment type, the second auxiliary vector sequence is decoded based on the second shared latent variable through the label generation network to obtain the target description text belonging to the label type.

[0160] Specifically, when the shared content text is obtained, the content encoding network in the text processing model can perform semantic encoding processing on the shared content text to obtain a shared vector sequence. When the auxiliary description text of the tag type is obtained, the comment generation network in the text processing model can perform semantic encoding processing on the auxiliary description text of the tag type to obtain a corresponding first auxiliary vector sequence. When the auxiliary description text of the comment type is obtained, the tag generation network in the text processing model can perform semantic encoding processing on the auxiliary description text of the tag type to obtain a corresponding second auxiliary vector sequence.

[0161] Furthermore, when the shared vector sequence and the first auxiliary vector sequence are obtained, the comment generation model can randomize the shared vector sequence and sample the shared vector sequence that has been randomized to obtain a first shared latent vector, so that the comment generation model can perform semantic decoding on the first auxiliary vector sequence based on the first shared latent vector to obtain a target description text belonging to the comment type.

[0162] Furthermore, when the shared vector sequence and the second auxiliary vector sequence are obtained, the label generation model can perform random processing on the shared vector sequence, and use the target mean corresponding to the random processing result as the second shared latent vector, and perform semantic decoding processing on the second auxiliary vector sequence based on the second shared latent vector to obtain the target description text belonging to the label type. It is easy to understand that the shared vector sequence can also be directly randomized based on the content encoding network in the text processing model to obtain the randomized processing result. This embodiment is not limited here.

[0163] In this embodiment, by setting up a content encoding network, a comment generation network and a label generation network, the text processing model obtained based on the content encoding network, the comment generation network and the label generation network can generate both label-type target description text and comment-type target description text, thereby greatly enriching the diversity of the generated target description text.

[0164] In one embodiment, the training step of the text processing model includes: obtaining a first sample training set, the first sample training set includes a first content text, and a first sample comment and a first sample label corresponding to the first content text; performing semantic encoding processing on the first content text to obtain a corresponding sample content vector sequence; encoding and decoding the sample content vector sequence and the first sample label through a comment generation network in the text processing model to be trained to obtain a corresponding first predicted comment; encoding and decoding the sample content vector sequence and the first sample comment through a label generation network in the text processing model to be trained to obtain a corresponding first predicted label; wherein the comment generation network and the label generation network are dual structures to each other; determining a dual loss according to a first difference between the first predicted label and the first sample label, and a second difference between the first predicted comment and the first sample comment; training the text processing model based on the dual loss until the training end condition is met, and obtaining a trained text processing model; the trained text processing model is used to generate a target description text corresponding to the target task; the target description text is at least one of a target comment text and a target label text.

[0165] Specifically, before outputting the target description text based on the text processing model, the text processing model can also be trained. Further, when the first sample training set is obtained, the text processing model to be trained can encode the first content text in the first sample training set to obtain a sample content vector sequence, and encode and decode the sample content vector sequence and the first sample label through the comment generation network to obtain the corresponding first predicted comment, and encode and decode the sample content vector sequence and the first sample comment through the label generation network to obtain the corresponding first predicted label. Further, the computer device determines the dual loss based on the first difference between a predicted label and the first sample label, and the second difference between the first predicted comment and the first sample comment, and trains the text processing model in the direction of reducing the dual loss until the training end condition is met, thereby obtaining a trained text processing model.

[0166] In this embodiment, by training the text processing model, the trained text processing model can generate more accurate target description text.

[0167] In one embodiment, the target task is a music review generation task or a music tag generation task; when the target task is a music review generation task, the shared content text includes at least one of the song name, lyrics text, rhythm description text, and author attribute text corresponding to the target song, the auxiliary description text is the music tag set corresponding to the target song, and the target description text is the music review set corresponding to the target song; when the target task is a music tag generation task, the shared content text includes at least one of the song name, lyrics text, rhythm description text, and author attribute text corresponding to the target song, the auxiliary description text is the music review set corresponding to the target song, and the target description text is the music tag set corresponding to the target song.

[0168] Specifically, when the target task is a music review generation task, the shared content text may include at least one of the song name, lyrics text, rhythm description text, and author attribute text corresponding to the target song for which the music review is to be generated, and the auxiliary description text may be a set of music tags corresponding to the target song, so that the text processing model may generate a music review in the music review set corresponding to the target song based on the shared content text and the auxiliary description text. Among them, the lyrics text is a text used to record the lyrics of the music, for example, the lyrics text may be "When the sky is clear, there are occasional showers, and I occasionally lose the courage of the sun. Even if the wings are soaked, the dream never stops flying far away...". The rhythm text is a text used to describe the rhythm of the music, for example, the rhythm text may be "The rhythm of the first bar of this song is 48 beats, and the rhythm of the second bar is 54 beats". The author attribute text is a text used to record information related to the author. Among them, the author may be a lyricist, a composer, a singer, etc.; the information related to the author may be the author's name, the author's hobbies, the author's style, and the author's personality, etc. For example, the author attribute text may be "Lyricist - Xiaofang, hobby - lyricist, style - good at ancient Chinese style, gentle personality; composer - Xiaoming, hobby - composing, style - good at creating gentle tunes, gentle personality; singer - Xiaohong, hobby - singing, style - good at rap, irritable personality". The music tag set refers to a set containing at least one music tag, for example, the music tag set may be {healing, loneliness}. The music review set refers to a set containing at least one music review, for example, the music review set may be "48 beats really conform to the public aesthetic", "I hope your dreams never stop flying", etc.

[0169] Correspondingly, when the target task is a music tag generation task, the shared content text may also include at least one of the song name, lyrics text, rhythm description text, and author attribute text corresponding to the target song, and the auxiliary description text is a set of music reviews corresponding to the target song, so that the target description text is a set of music tags corresponding to the target song.

[0170] In this embodiment, by obtaining shared content texts in multiple dimensions, the review generation network can generate music reviews in multiple dimensions based on the shared content texts in multiple dimensions, thereby greatly improving the diversity of music reviews. In addition, by obtaining shared content texts in multiple dimensions, the tag generation network can integrate the shared content texts in multiple dimensions to generate more appropriate music tags.

[0171] In one embodiment, Figure 5 As shown, a text processing model training method is provided, and the text processing model training method specifically includes the following steps:

[0172] S502 : Obtain a first sample training set, where the first sample training set includes a first content text, and a first sample comment and a first sample label corresponding to the first content text.

[0173] Specifically, the first sample training set refers to the training data required for model training. Based on the first sample training set, the text processing model can adjust the model parameters accordingly. The first sample training set includes the first content text, the first sample comment and the first sample label corresponding to the first content text. Among them, the first content text refers to the shared content text required to generate the first prediction label or the first prediction comment. The first sample comment text refers to the comment text obtained by commenting on the first content text. The first label text refers to the label text obtained by classifying the text attributes of the first content text. For example, the first content text can be at least one of the song name, lyrics text, rhythm description text, and author attribute text of the sample music to be generated for predicting music reviews; the first sample comment text can be the comment text obtained by commenting on the sample music; the first sample label text can be the label text obtained by classifying the attributes of the sample music. Among them, the first content text of the first training set, and the first sample comment and the first sample label corresponding to the first content text can be obtained from multiple public data sets.

[0174] Since a first content text may have a corresponding first sample label and a first sample comment, a first content text, and a first sample label and a first sample comment corresponding to the first content text may be taken as a training data pair, so that a computer device may train a text processing model to be trained based on multiple training data pairs in the first sample training set.

[0175] S504: Perform semantic coding processing on the first content text to obtain a corresponding sample content vector sequence.

[0176] S506, encoding and decoding the sample content vector sequence and the first sample label through the comment generation network in the text processing model to be trained to obtain the corresponding first predicted comment.

[0177] S508, encoding and decoding the sample content vector sequence and the first sample comment through the label generation network in the text processing model to be trained to obtain the corresponding first predicted label; wherein the comment generation network and the label generation network are dual structures.

[0178] Specifically, when the text processing model is trained, the first content text, the first sample label and the first sample comment in the training data pair can be input into the text processing model, so that the text processing model generates a first predicted comment based on the first content text and the first sample label through the comment generation network; and the text processing model generates a first predicted label based on the first content text and the first sample comment through the label generation network, and adjusts the model parameters according to the first difference between the first predicted label and the input first sample label, and the second difference between the first predicted comment and the input first sample comment. More specifically, the text processing model can perform semantic encoding processing on the first content text to obtain a sample content vector sequence corresponding to the first content text, and perform randomization processing on the sample content vector sequence to obtain a randomization processing result. The comment generation network in the text processing model to be trained can perform semantic encoding processing on the first sample label, and determine the corresponding first sample latent vector based on the randomization processing result, and perform decoding processing based on the first sample latent vector and the first sample label that performs semantic encoding processing to obtain the corresponding first predicted comment. Among them, the first predicted comment refers to the predicted comment text output by the text processing model to be trained according to the first content text and the first sample label.

[0179] Furthermore, the label generation network in the text processing model to be trained can perform semantic encoding processing on the first sample comment, and determine the corresponding second sample latent vector based on the randomization processing result, and perform decoding processing based on the second sample latent vector and the first sample comment that performs semantic encoding processing to obtain the corresponding first predicted label. The first predicted label refers to the predicted label text output by the text processing model to be trained based on the first content text and the first sample comment. The comment generation network and the label generation network are dual structures to each other, that is, the label generation task corresponding to the label generation network and the comment task corresponding to the comment generation network are dual tasks to each other, thereby forming a closed-loop feedback system. Therefore, the relationship between the two can be used for mutual supervision to achieve dual joint training.

[0180] S510, determining a dual loss according to a first difference between the first predicted label and the first sample label, and a second difference between the first predicted comment and the first sample comment.

[0181] S512, training the text processing model based on the dual loss until the training end condition is met, and obtaining a trained text processing model; the trained text processing model is used to generate a target description text corresponding to the target task; the target description text is at least one of a target comment text and a target label text.

[0182] Specifically, when the first predicted label and the first predicted comment are obtained, the computer device can determine the first difference between the first predicted label and the input first sample label, and determine the second difference between the first predicted comment and the input first sample comment, and determine the dual loss based on the first difference and the second difference, and adjust the model parameters through the dual loss until the training end condition is met. For example, when the first content text in the training data pair is "Missing is a disease - Zhang Zhenyue. When you are on the other side of the mountains and ridges, I have no end on the lonely road...", the first sample label is "sadness", and the first sample comment is "I want to hold you in my arms, I miss you", the text processing model to be trained can generate a first predicted label "emotion" based on the first content text and the first sample comment, and generate a first predicted comment "I miss you very much" based on the first content text and the first sample label, so that the computer device can determine the first difference through "sadness" and "emotion", determine the second difference through "I want to hold you in my arms, I miss you" and "I miss you very much", and perform dual joint training on the text generation network and the label generation network in the text processing model based on the first difference and the second difference. It is easy to understand that, since the first sample label and the first sample comment both correspond to the first content text, it can be considered that the first training of the text processing model is performed through the labeled training data.

[0183] In one embodiment, the dual loss L includes the review generation network loss term L gen , label generation network loss term L class And the dual constraint loss term L dua :

[0184] L=L gen +γL class +βL dua

[0185] L gen = -logP(x|y,c)

[0186] L class = -logP(y|x,c)

[0187] Wherein, x represents the first sample comment; c represents the first content text; y represents the first sample label; P(x|y,c) represents the conditional probability of outputting the first sample comment when the input is the first sample label and the first content text; P(y|x,c) represents the conditional probability of outputting the first sample label when the input is the first sample comment and the first content text.

[0188] Furthermore, the computer device may determine the dual constraint loss term L by: dua Specifically, for the text generation network and label generation network in the text processing model, they can be trained by the following formula, that is, parameter learning:

[0189]

[0190]

[0191] Among them, the f function represents the label generation network; θ x,c→y represents the learnable parameters in the label generation network; P(y′|x,c; θ x,c→y ) represents when the input x, c and parameter θ x,c→y When , the conditional probability of output y′ is y′, which represents the first predicted label. The g function represents the comment generation network; θ y,c→x represents the learnable parameters in the review generation network; P(x′|y,c; θ y,c→x ) represents when the input y, c and parameter θ y,c→x , outputs the conditional probability of x′; x′ represents the first predicted comment.

[0192] Since the text generation network and the label generation network are dual structures, the text generation network and the label generation network have a probability correlation, which can be expressed by the following formula:

[0193]

[0194] Since the purpose of model training is to obtain the parameter θ x,c→y and parameter θ y,c→x , so that for the first sample training set, the prediction results output by the text generation network and the label generation network are used as values ​​close to the actual situation. Therefore, for supervised learning, the text processing model can be trained by minimizing the first difference and the second difference:

[0195]

[0196]

[0197] Among them, the l1 function represents the first difference; the l2 function represents the second difference; and n represents the number of training data pairs contained in the first training sample set.

[0198] By combining the probability correlation and minimizing the first difference and the second difference, we can get the equality constraint of dual training:

[0199] Constraint 1:

[0200] Constraint 2:

[0201] Constraint 3:

[0202] Based on the equality constraints of dual training, the dual constraint loss term can be obtained:

[0203] L dua =(logP(x|c)+logP(y|x,c;θ x,c→y )-logP(y|c)-logP(x|y,c;θ y,c→x )) 2

[0204] In the training method of the above-mentioned text processing model, by obtaining the first sample training set, the shared first content text in the first sample training set can be semantically encoded to obtain a corresponding sample content vector sequence, so that the comment generation network and the label generation network can perform encoding and decoding processing through the shared sample content vector sequence and the corresponding first sample label or the first sample comment to obtain the first predicted comment and the first predicted label. By obtaining the first predicted comment and the first predicted label, the dual loss can be determined based on the first difference between the first predicted label and the first sample label, and the second difference between the first predicted comment and the first sample comment, and the text processing can be trained based on the dual loss to obtain a trained text processing model. Since the target description text can be automatically output through the trained text processing model, compared with the traditional manual writing, the present application greatly improves the generation efficiency of the target description text.

[0205] In addition, since the label generation network and comment generation network in the text processing model can be trained through the shared first content text, during the model training process, the possible shared semantic information can be fully utilized, thereby improving the accuracy of the text processing model.

[0206] In one embodiment, the text processing model also includes a connection network, which is used to connect the comment generation network and the label generation network. The method also includes: obtaining a second sample training set, the second sample training set includes a second content text and a second sample label corresponding to the second content text, a third content text and a third sample comment corresponding to the third content text; training the text processing model based on the dual loss until the training end condition is met, and obtaining a trained text processing model, including: based on the dual loss, performing a first training on the comment generation network and the label generation network in the text processing model, and stopping when the first stop condition is met; performing a second training on the connection network in the text processing model obtained by performing the first training through the second sample training set, and stopping when the second stop condition is met; performing a third training on the text processing model obtained by performing the second training through the first sample training set and the second sample training set, and stopping when the third stop condition is met, and obtaining a trained text processing model.

[0207] Specifically, based on the particularity of the dual structure, model training can be performed based on unlabeled training data. For example, the unlabeled first content text and the unlabeled first sample label can be input into the comment generation network, and the comment generation network outputs the first predicted comment. The first predicted comment is input into the label generation network, and the label generation network outputs the first predicted label, so that the computer device can train the text processing model through the difference between the first predicted label and the first sample label. However, due to limitations such as discrete target gradient propagation, the utilization of unlabeled training data is limited. Therefore, in order to further improve the utilization of unlabeled training data, a connection network can be added to the text processing model, and the comment generation network and the label generation network can be connected through the connection network.

[0208] For example, refer to Fig. 6AIn order to avoid being restricted by the discrete target gradient propagation, a label connection network and a comment connection network can be added to the text processing model. Among them, the label connection network is pointed to the label generation network by the comment generation network, which is used to convert the predicted comment vector sequence generated by the comment generation network into a substitute comment vector sequence, and input it into the label generation network. The comment connection network is pointed to the comment generation network by the label generation network, which is used to convert the predicted label vector sequence generated by the label generation network into a substitute label vector sequence, and input it into the comment generation network. Among them, the predicted comment vector sequence refers to the word vector sequence corresponding to the predicted comments to be generated by the comment generation network. The substitute comment vector sequence refers to the word vector sequence that can be directly decoded through the label generation network to obtain the predicted label. The predicted label vector sequence refers to the word vector sequence corresponding to the predicted label to be generated by the label generation network. The substitute label vector sequence refers to the word vector sequence that can be directly decoded through the comment generation network to obtain the predicted comment. Fig. 6A A connection diagram of a network connection in one embodiment is shown.

[0209] It is easy to understand that by adding a label connection network, the computer device can directly convert the predicted comment vector sequence in the comment generation model into the replacement comment vector sequence in the label generation model through the label connection network, thereby skipping the process in which the comment generation model outputs the predicted comment based on the predicted comment vector sequence, and inputs the predicted comment into the label generation model, and the label generation model performs semantic encoding on the predicted comment to obtain the replacement comment vector sequence, thereby reducing the limitation of discrete target gradient propagation. Similarly, by adding a comment connection network, the predicted label vector sequence in the label generation model can also be directly converted into the replacement label vector sequence in the comment generation model, thereby reducing the limitation of discrete target gradient propagation.

[0210] Furthermore, in order to further improve the accuracy of the text processing model, after the comment generation network and the label generation network in the text processing model are first trained based on the dual loss, the text processing model can also be second trained and third trained. The computer device obtains a second sample training set, and performs second training on the connection network in the text processing model obtained by performing the first training through the second sample training set until the second stop condition is met, and performs third training on the text processing model obtained by performing the second training through the first training set and the second training set until the third stop condition is met, thereby obtaining a trained text processing model.

[0211] In one embodiment, when the first training is performed until the first stop condition is satisfied, it is considered that the training end condition has been satisfied, and the text processing model that performs the first training is used as the trained text processing model. When the third training is performed until the third stop condition is satisfied, it is considered that the training end condition has been satisfied, and the text processing model that performs the third training is used as the trained text processing model. This embodiment is not limited here.

[0212] In this embodiment, by adding a connection network, the limitation of discrete target gradient propagation can be reduced and the utilization rate of unlabeled training data can be improved.

[0213] In one embodiment, the connection network includes a label connection network; a second training is performed on the connection network in the text processing model obtained by executing the first training through a second sample training set until a second stop condition is met, including: encoding and decoding the second content text and the second sample label through the comment generation network in the text processing model obtained by executing the first training to obtain a predicted comment vector sequence; converting the predicted comment vector sequence into a substitute comment vector sequence through the label connection network in the text processing model obtained by executing the first training; decoding the substitute comment vector sequence through the label generation network in the text processing model obtained by executing the first training to obtain a corresponding second predicted label; determining the label difference between the second predicted label and the second sample label, and performing a second training on the label connection network through the label difference until the second stop condition is met.

[0214] The second sample training set includes a second content text and a second sample label corresponding to the second content text, a third content text and a third sample comment corresponding to the third content text.

[0215] Specifically, when the first training is performed until the first stop condition is met, the computer device performs encoding and decoding processing on the second content text and the second sample label in accordance with the above-mentioned encoding and decoding processing method for the content text and the sample label text by executing the comment generation network and the content encoding network in the text processing model obtained by the first training, and obtains a predicted comment vector sequence, and converts the predicted comment vector sequence into a replacement comment vector sequence by executing the label connection network in the text processing model obtained by the first training, and inputs it into the label generation network, so that the label generation network in the text processing model can decode the replacement comment vector in accordance with the above-mentioned decoding method to obtain a second predicted label. Further, the computer device determines the label difference between the second predicted label and the second sample label, and performs a second training on the label connection network in the direction of reducing the label difference until the second stop condition is met, and obtains a pre-trained label connection network.

[0216] It is worth noting that, during the second training process, the computer device fixes the network parameters of the label generation network and the comment generation network in the text processing model, and only adjusts the network parameters of the connection network.

[0217] In one embodiment, the connection network can be a fully connected layer, referring to Fig. 6A When the comment generation network generates a predicted comment vector sequence (also called comment probability distribution), the comment generation network pauses the process of determining the corresponding predicted comment based on the predicted comment vector sequence, and switches to converting the predicted comment vector into an alternative comment vector H through the label connection network. x , so that the label generation network can decode the replacement comment vector based on the randomization processing result output by the content encoding network to obtain the second predicted label, and determine the corresponding label difference based on the second predicted label and the second sample label, and determine the corresponding label loss based on the label difference: LR y = -logP(y′-y), and the label connection network is trained for the second time in the direction of reducing the label loss. Where y′ represents the second predicted label; y represents the second sample label.

[0218] In the above embodiment, by performing the second training on the label connection network, the label connection module after the second training can convert the predicted comment vector into a more accurate replacement comment vector.

[0219] In one embodiment, the connection network includes a comment connection network; a second training is performed on the connection network in the text processing model obtained by executing the first training through a second sample training set until a second stop condition is met, including: encoding and decoding a third content text and a third sample comment through a label generation network in the text processing model obtained by executing the first training to obtain a predicted label vector sequence; converting the predicted label vector sequence into a substitute label vector sequence through the comment connection network in the text processing model obtained by executing the first training; decoding the substitute label vector sequence through the comment generation network in the text processing model obtained by executing the first training to obtain a corresponding second predicted comment; determining the comment difference between the second predicted comment and the third sample comment, and performing a second training on the comment connection network through the comment difference until the second stop condition is met.

[0220] Specifically, the computer device can encode and decode the third content text and the third sample comment by executing the label generation network in the text processing model obtained by the first training to obtain a predicted label vector sequence, and decode the predicted label vector sequence by executing the comment generation network in the text processing model obtained by the first training to obtain a second predicted comment. Further, the computer device determines the comment difference between the second predicted comment and the third sample comment, and performs a second training on the comment connection network in the direction of reducing the comment difference until the second stop condition is met, thereby obtaining a pre-trained comment connection network. In one embodiment, the second training of the text processing model includes performing a second training on the label connection network and performing a second training on the comment connection network. Correspondingly, the second stop condition includes that the label connection network performing the second training meets the preset stop condition, or the comment connection network performing the second training meets the preset stop condition.

[0221] In one embodiment, reference Figure 6B When the label generation network generates a predicted label vector sequence (also called label probability distribution), the label generation network suspends the process of determining the corresponding predicted label based on the predicted label vector sequence, and turns to converting the predicted label vector into an alternative label vector H through the comment connection network. y , so that the comment generation network can decode the replacement label vector based on the randomization processing result output by the content encoding network to obtain the second predicted comment, determine the corresponding comment difference based on the second predicted comment and the second sample comment, and determine the corresponding comment loss based on the comment difference: LR x = -logP(x′-x), and the label connection network is trained for the second time in the direction of reducing the label loss. Where x′ represents the second predicted comment; x represents the second sample comment. Figure 6B A connection diagram of a network connection in another embodiment is shown.

[0222] In one embodiment, the text processing model can also be trained for the second time through the first sample training set. The computer device splits the paired first sample labels and first sample comments, and performs the second training on the label connection network through the first content text and the corresponding first sample labels; and performs the second training on the comment connection network through the first content text and the corresponding first sample comments. That is, the computer device uses the first content text and the first sample label in the first sample training set as the second content text and the second sample label to perform the second training on the label connection network, and uses the first content text and the first sample comment in the first sample training set as the third content text and the third sample comment to perform the second training on the comment connection network.

[0223] In the above embodiment, by performing the second training on the comment connection network, the comment connection module after the second training can convert the predicted label vector into a more accurate replacement label vector.

[0224] In one embodiment, a third training is performed on a text processing model obtained by performing the second training by using a first sample training set and a second sample training set, and the training is stopped when a third stopping condition is satisfied, thereby obtaining a trained text processing model, including: based on the first content text and a first sample label corresponding to the first content text, and the second content text and a second sample label corresponding to the second content text, a comment generation network and a label connection network in the text processing model obtained by performing the second training are jointly performed with corresponding branch training; based on the first content text and a first sample comment corresponding to the first content text, and the third content text and a third sample comment corresponding to the third content text, a label generation network and a comment connection network in the text processing model obtained by performing the second training are jointly performed with corresponding branch training; when it is determined based on each branch training that the third stopping condition is satisfied, the training is terminated to obtain a trained text processing model.

[0225] Specifically, after executing the second training, in order to make full use of the unlabeled training data to further train the text processing model to improve the accuracy of the text processing model, the computer device can also fine-tune each network in the text processing model obtained by executing the second training based on the first sample training set and the second sample training set. The computer device uses the first content text and the first sample label corresponding to the first content text as a pair of training data pairs, and the second content text and the second sample label corresponding to the second content text as a pair of training training data pairs, and based on each training data pair, the comment generation network and the label connection network are jointly trained with corresponding branches. Correspondingly, the computer device uses the first content text and the first sample comment corresponding to the first content text as a pair of training data pairs, and the third content text and the third sample comment corresponding to the third content text as a pair of training data pairs, and the label generation network and the comment connection network are jointly trained with corresponding branches, and the training is terminated when it is determined based on each branch training that the third stop condition is met, thereby obtaining a trained text processing model.

[0226] In one embodiment, since the comment generation network and the label generation network form a dual structure and form a closed loop during the data conversion process, this feature can be used to perform unsupervised second and third training, thereby making full use of unlabeled data. In order to better understand unsupervised training, the following example uses the third training of a text processing model based on a first content text and a first sample label corresponding to the first content text as an example. Since the comment generation network and the label generation network form a dual structure, they have the following relationship:

[0227] g(f(x,c))≡x

[0228] f(g(y,c))≡y

[0229] Among them, the f function represents the label generation network, the g function represents the comment generation network, x represents the sample comment, c represents the content text, and y represents the sample label.

[0230] When the first content text and the first sample label are input, the first content text and the first sample label can be encoded and decoded by the comment generation network to obtain a probability distribution corresponding to the third predicted comment to be output, that is, a predicted comment vector corresponding to the third predicted comment to be output is obtained:

[0231] H y =Encoder(y)

[0232] P x =Decoder(H y ,z)

[0233] Among them, H y is the encoding result obtained after encoding the first sample label; P x is the predicted comment vector corresponding to the third predicted comment to be output; z represents the shared latent vector corresponding to the first content text.

[0234] For the convenience of description, in the following, during the execution of the third training, the predicted comment output by the comment generation network is referred to as the third predicted comment, and the predicted label output by the label generation network is referred to as the third predicted label. When the predicted comment vector corresponding to the third predicted comment to be output is obtained, the predicted comment vector corresponding to the third predicted comment to be output can be converted into a replacement comment vector corresponding to the third predicted comment to be output through the label connection network, thereby skipping the process of inputting the discrete target into the label generation network and encoding the discrete target based on the label generation network:

[0235] H′ x =Connection(P x )

[0236] y′=argmax s′∈S (P y (s′)

[0237] P y =Classifier(H x ′,z)

[0238] Among them, H′ x represents the alternative comment vector corresponding to the third predicted comment to be output; the alternative comment vector corresponding to the third predicted comment to be output refers to, which can be used for direct decoding to obtain the probability distribution of the predicted label. S represents the label text library; z represents the shared latent vector; y′ represents the third predicted label.

[0239] Further, when a third predicted label is obtained by decoding the alternative comment vector through the label generation model, the computer device may determine the corresponding label branch loss based on the difference between the third predicted label and the first sample label: Lb y =-logP(y′-y), and the comment generation network and the label connection network are trained for the third time in the direction of reducing the label branch loss. Similarly, when the label generation network and the comment connection network in the text processing model obtained by performing the second training are jointly trained for corresponding branches based on the first content text and the first sample comment corresponding to the first content text, and the third content text and the third sample comment corresponding to the third content text, the computer device can also determine the corresponding comment branch loss based on the difference between the third predicted comment and the corresponding first sample comment (or third sample comment) when obtaining the third predicted comment output by the comment generation model: Lb x = -logP(x′-x), and perform a third training on the comment generation network and the label connection network in the direction of reducing the comment branch loss.

[0240] In the above embodiment, by executing the connection network obtained by the second training, the text processing model is subjected to the third training, which can skip the process of re-encoding the discrete targets after inputting the discrete targets, thereby not only improving the encoding efficiency of the model, but also reducing the propagation limitation of the discrete target gradient. In this way, the unlabeled training data can be fully utilized to perform unsupervised training on the text processing model, thereby greatly improving the accuracy of the text processing model.

[0241] In addition, since the text processing model can be subjected to supervised first training based on paired first sample labels and first sample comments, and unsupervised second training and third training can be conducted based on unpaired second labels and third sample comments, various types of training data are fully utilized, thereby improving the accuracy of the text processing model based on the fully utilized training data.

[0242] In another specific embodiment, Figure 7 As shown, the description text generation method provided by the present application includes the following steps:

[0243] S702, determining a target task, and obtaining clue keywords corresponding to the target task.

[0244] S704, searching based on the clue keywords to obtain the shared content text and auxiliary description text matching the target task; the text type of the auxiliary description text is one of a comment type and a tag type.

[0245] S706: Determine a shared word sequence corresponding to the shared content text, and determine an auxiliary word sequence corresponding to the auxiliary description text.

[0246] S708, perform forward semantic encoding and reverse semantic encoding on the shared word sequence respectively to obtain a forward shared encoding vector sequence and a reverse shared encoding vector sequence; perform sequence fusion processing on the forward shared encoding vector sequence and the reverse shared encoding vector sequence to obtain a shared vector sequence corresponding to the shared content text.

[0247] S710, perform forward semantic coding and reverse semantic coding on the auxiliary word sequence respectively to obtain a forward auxiliary coding vector sequence and a reverse auxiliary coding vector sequence; perform sequence fusion processing on the forward auxiliary coding vector sequence and the reverse auxiliary coding vector sequence to obtain an auxiliary vector sequence corresponding to the auxiliary description text.

[0248] S712, converting the shared vector sequence into a corresponding target probability distribution, and determining a corresponding target mean and target variance based on the target probability distribution.

[0249] S714, when the auxiliary description text belongs to the label type, sampling is performed at least once based on the target probability distribution according to the target mean and the target variance to obtain at least one shared latent variable corresponding to the auxiliary description text, and each shared latent variable is respectively combined with the auxiliary vector sequence to form a group of objects to be decoded.

[0250] S716, based on the first shared latent variable in a group of objects to be decoded and the word vector of the target word output last time, decode the first auxiliary vector sequence to obtain the target end vector sequence of the current time; determine the target word outputted at the current time according to the target end vector sequence of the current time; based on each output target word, construct a target description text corresponding to a group of objects to be decoded and belonging to the comment type.

[0251] S718, when the auxiliary description text belongs to the comment type, the target mean is used as the shared latent variable corresponding to the auxiliary description text; semantic decoding processing is performed based on the shared latent variable and the auxiliary vector sequence, and the target description text belonging to the label type is output.

[0252] In the above embodiment, by obtaining the shared content text and the auxiliary description text corresponding to the target task, the shared content text and the auxiliary description text can be encoded to obtain a shared vector sequence and an auxiliary vector sequence. By obtaining a shared vector sequence that can be used to share between two target tasks, the corresponding shared latent variables can be determined based on the shared vector sequence, and semantic decoding processing can be performed based on the shared latent variables and the auxiliary vector sequence to obtain the target description text corresponding to the target task. Since the target description text can be automatically output, compared with the traditional method that requires manual writing, the present application greatly improves the efficiency of generating the target description text. In another specific embodiment, such as Figure 8 As shown, the training method of the text processing model provided in this application includes the following steps:

[0253] S802, obtaining a first sample training set, the first sample training set including a first content text, and a first sample comment and a first sample label corresponding to the first content text; performing semantic encoding processing on the first content text to obtain a corresponding sample content vector sequence.

[0254] S804, encoding and decoding the sample content vector sequence and the first sample label through the comment generation network in the text processing model to be trained to obtain the corresponding first predicted comment.

[0255] S806, encoding and decoding the sample content vector sequence and the first sample comment through the label generation network in the text processing model to be trained to obtain the corresponding first predicted label; wherein the comment generation network and the label generation network are dual structures.

[0256] S808, determining a dual loss based on a first difference between the first predicted label and the first sample label, and a second difference between the first predicted comment and the first sample comment; performing a first training on a comment generation network and a label generation network in the text processing model based on the dual loss until a first stopping condition is met.

[0257] S810 , obtaining a second sample training set, where the second sample training set includes a second content text and a second sample label corresponding to the second content text, a third content text and a third sample comment corresponding to the third content text.

[0258] S812, by executing the comment generation network in the text processing model obtained by the first training, encode and decode the second content text and the second sample label to obtain a predicted comment vector sequence; by executing the label connection network in the text processing model obtained by the first training, convert the predicted comment vector sequence into a replacement comment vector sequence.

[0259] S814, by executing the label generation network in the text processing model obtained by the first training, the replacement comment vector sequence is decoded to obtain the corresponding second predicted label; the label difference between the second predicted label and the second sample label is determined, and the label connection network is trained for the second time based on the label difference until the second stop condition is met.

[0260] S816, by executing the label generation network in the text processing model obtained by the first training, the third content text and the third sample comment are encoded and decoded to obtain a predicted label vector sequence; by executing the comment connection network in the text processing model obtained by the first training, the predicted label vector sequence is converted into a replacement label vector sequence.

[0261] S818, by executing the comment generation network in the text processing model obtained by the first training, decoding the replacement label vector sequence to obtain the corresponding second predicted comment; determining the comment difference between the second predicted comment and the third sample comment, and performing a second training on the comment connection network based on the comment difference until the second stop condition is met.

[0262] S820 performs corresponding branch training on the comment generation network and the label connection network in the text processing model obtained by executing the second training based on the first content text and the first sample label corresponding to the first content text, and the second content text and the second sample label corresponding to the second content text; performs corresponding branch training on the label generation network and the comment connection network in the text processing model obtained by executing the second training based on the first content text and the first sample comment corresponding to the first content text, and the third content text and the third sample comment corresponding to the third content text.

[0263] S822, when it is determined based on the training of each branch that the third stopping condition is met, the training is terminated to obtain a trained text processing model.

[0264] It should be understood that although Figure 2 , 5 The steps in the flowcharts of 7-8 are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 , 5, at least part of the steps in 7-8 may include multiple steps or multiple stages. These steps or stages do not necessarily have to be executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily one by one, but can be executed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0265] The present application also provides an application scenario, which applies the above-mentioned description text generation method. Specifically, the application of the description text generation method in the application scenario is as follows:

[0266] When the target task is a news comment generation task, the computer device can obtain the clue keywords corresponding to the target task, and perform a network search based on the clue keywords to obtain the complete news content and news tags corresponding to the clue keywords. The computer device inputs the complete news content and news tags into the text processing model, and the text processing model outputs at least one news comment based on the input news content and news tags according to the above-described text generation method. Similarly, when the target task is a news tag generation task, the computer device can input the news content and news comments into the text processing model, so that the text processing model can output the corresponding news tags.

[0267] The present application also provides an application scenario, which applies the above-mentioned description text generation method. Specifically, the application of the description text generation method in this application scenario is as follows:

[0268] When the target task is a poem generation task, the computer device can obtain the poem title and poem tag (also known as the poem mood) of the poem to be generated, and input the poem title and poem tag into the text processing model, and the text processing model outputs the corresponding poem. Correspondingly, when the target task is a poem tag generation task, the computer device can obtain the poem title and the complete poem content, so that the text processing model can output the corresponding poem tag based on the poem title and the complete poem content.

[0269] It is easy to understand that the above description text generation method can be used not only to output music reviews and music tags, news reviews and news tags, poems and poetry tags, but also to output blog reviews and blog tags, novel reviews and novel tags, etc. It can be understood that the above scenarios are only for illustrative purposes and are not intended to limit this application.

[0270] In one embodiment, Fig. 9As shown, a description text generation device 900 is provided. The device can adopt a software module or a hardware module, or a combination of the two to become a part of a computer device. The device specifically includes: a text acquisition module 902, a randomization processing module 904 and a decoding module 906, wherein:

[0271] The text acquisition module 902 is used to acquire the shared content text and the auxiliary description text corresponding to the target task; the text type of the auxiliary description text is one of a comment type and a tag type.

[0272] The randomization processing module 904 is used to perform semantic encoding processing on the shared content text and the auxiliary description text respectively to obtain corresponding shared vector sequences and auxiliary vector sequences; perform randomization processing on the shared vector sequence, and determine the shared latent variables based on the randomization processing results.

[0273] The decoding module 906 is used to perform semantic decoding processing based on the shared latent variables and the auxiliary vector sequence, and output a target description text corresponding to the target task. The text type of the target description text is one of a comment type and a label type, and the text type of the target description text is different from that of the auxiliary description text.

[0274] In one embodiment, the text acquisition module 902 is further used to determine a target task and acquire clue keywords corresponding to the target task; perform a search based on the clue keywords to obtain a shared content text and an auxiliary description text matching the target task.

[0275] In one embodiment, the randomization processing module 904 also includes a vector sequence determination module 9041, which is used to determine a shared word sequence corresponding to the shared content text, and determine an auxiliary word sequence corresponding to the auxiliary description text; perform forward semantic encoding and reverse semantic encoding on the shared word sequence, respectively, to obtain a forward shared encoding vector sequence and a reverse shared encoding vector sequence; perform sequence fusion processing on the forward shared encoding vector sequence and the reverse shared encoding vector sequence, to obtain a shared vector sequence corresponding to the shared content text; perform forward semantic encoding and reverse semantic encoding on the auxiliary word sequence, respectively, to obtain a forward auxiliary encoding vector sequence and a reverse auxiliary encoding vector sequence; perform sequence fusion processing on the forward auxiliary encoding vector sequence and the reverse auxiliary encoding vector sequence, to obtain an auxiliary vector sequence corresponding to the auxiliary description text.

[0276] In one embodiment, the randomization processing module 904 also includes a latent variable determination module 9042, which is used to convert the shared vector sequence into a corresponding target probability distribution, and determine the corresponding target mean and target variance based on the target probability distribution; when the auxiliary description text belongs to the label type, according to the target mean and target variance, at least one sampling is performed based on the target probability distribution to obtain at least one shared latent variable corresponding to the auxiliary description text; when the auxiliary description text belongs to the comment type, the target mean is used as the shared latent variable corresponding to the auxiliary description text.

[0277] In one embodiment, the decoding module 906 is also used to form a group of objects to be decoded by combining each shared latent variable with the auxiliary vector sequence; semantic decoding processing is performed based on each group of objects to be decoded, and at least one target description text corresponding to the target task is output, and each output target description text is different.

[0278] In one embodiment, the description text processing device 900 is used to execute a description text processing method, and the description text processing method is executed through a text processing model; the text processing model includes a comment generation network and a label generation network; the comment generation network is used to generate a target description text belonging to a comment type based on shared content text and auxiliary description text belonging to a label type; the label generation network is used to generate a target description text belonging to a label type based on shared content text and auxiliary description text belonging to a comment type.

[0279] In one embodiment, the description text processing device 900 is also used to perform semantic encoding processing on the shared content text through a content encoding network to obtain a shared vector sequence corresponding to the shared content text; when the auxiliary description text belongs to the tag type, the auxiliary description text is semantically encoded through a comment generation network to obtain a corresponding first auxiliary vector sequence; when the auxiliary description text belongs to the comment type, the auxiliary description text is semantically encoded through a label generation network to obtain a corresponding second auxiliary vector sequence; when the auxiliary description text belongs to the tag type, the shared vector sequence is randomized through the comment generation network, and a first shared latent variable is determined based on the processing result; when the auxiliary description text belongs to the comment type, the shared vector sequence is randomized through the label generation network, and a second shared latent variable is determined based on the processing result; when the auxiliary description text belongs to the tag type, the first auxiliary vector sequence is decoded through the comment generation network based on the first shared latent variable to obtain a target description text belonging to the comment type; when the auxiliary description text belongs to the comment type, the second auxiliary vector sequence is decoded through the label generation network based on the second shared latent variable to obtain a target description text belonging to the tag type.

[0280] In one embodiment, the decoding module 906 is also used to decode the first auxiliary vector sequence through the comment generation network based on the first shared latent variable and the word vector of the target word output last time to obtain the target end vector sequence of the current time; determine the target word output this time according to the target end vector sequence of the current time through the comment generation network; and construct a target description text belonging to the comment type based on the output target words through the comment generation network.

[0281] In one embodiment, the description text processing device 900 is further used to obtain a first sample training set, the first sample training set includes a first content text, and a first sample comment and a first sample label corresponding to the first content text; semantic encoding is performed on the first content text to obtain a corresponding sample content vector sequence; the sample content vector sequence and the first sample label are encoded and decoded by a comment generation network in the text processing model to be trained to obtain a corresponding first predicted comment; the sample content vector sequence and the first sample comment are encoded and decoded by a label generation network in the text processing model to be trained to obtain a corresponding first predicted label; wherein the comment generation network and the label generation network are dual structures to each other; dual loss is determined according to a first difference between the first predicted label and the first sample label, and a second difference between the first predicted comment and the first sample comment; the text processing model is trained based on the dual loss until the training end condition is met to obtain a trained text processing model; the trained text processing model is used to generate a target description text corresponding to the target task; the target description text is at least one of a target comment text and a target label text.

[0282] In one embodiment, the description text processing device 900 is also used for, when the target task is a music review generation task, the shared content text includes at least one of the song name, lyrics text, rhythm description text, and author attribute text corresponding to the target song, the auxiliary description text is a set of music tags corresponding to the target song, and the target description text is a set of music reviews corresponding to the target song; when the target task is a music tag generation task, the shared content text includes at least one of the song name, lyrics text, rhythm description text, and author attribute text corresponding to the target song, the auxiliary description text is a set of music reviews corresponding to the target song, and the target description text is a set of music tags corresponding to the target song.

[0283] like Fig.10 As shown, a text processing model training device 1000 is provided. The device can adopt a software module or a hardware module, or a combination of the two to become a part of a computer device. The device specifically includes: an encoding module 1002, an output module 1004 and a training module 1006, wherein:

[0284] The encoding module 1002 is used to obtain a first sample training set, which includes a first content text, a first sample comment corresponding to the first content text, and a first sample label; perform semantic encoding processing on the first content text to obtain a corresponding sample content vector sequence;

[0285] The output module 1004 is used to encode and decode the sample content vector sequence and the first sample label through the comment generation network in the text processing model to be trained to obtain the corresponding first predicted comment; and encode and decode the sample content vector sequence and the first sample comment through the label generation network in the text processing model to be trained to obtain the corresponding first predicted label; wherein the comment generation network and the label generation network are dual structures to each other;

[0286] The training module 1006 is used to determine the dual loss based on the first difference between the first predicted label and the first sample label, and the second difference between the first predicted comment and the first sample comment; the text processing model is trained based on the dual loss until the training end condition is met to obtain a trained text processing model; the trained text processing model is used to generate a target description text corresponding to the target task; the target description text is at least one of a target comment text and a target label text.

[0287] In one embodiment, the text processing model also includes a connection network, which is used to connect the comment generation network and the label generation network. The training module 1006 is also used to perform a first training on the comment generation network and the label generation network in the text processing model based on the dual loss until the first stop condition is met; obtain a second sample training set, the second sample training set includes a second content text and a second sample label corresponding to the second content text, a third content text, and a third sample comment corresponding to the third content text; perform a second training on the connection network in the text processing model obtained by performing the first training through the second sample training set, and stop when the second stop condition is met; perform a third training on the text processing model obtained by performing the second training through the first sample training set and the second sample training set, and stop when the third stop condition is met, so as to obtain a trained text processing model.

[0288] In one embodiment, the connection network includes a label connection network; the training module 1006 is also used to encode and decode the second content text and the second sample label by executing the comment generation network in the text processing model obtained by the first training to obtain a predicted comment vector sequence; the predicted comment vector sequence is converted into a substitute comment vector sequence by executing the label connection network in the text processing model obtained by the first training; the substitute comment vector sequence is decoded by the label generation network in the text processing model obtained by the first training to obtain a corresponding second predicted label; the label difference between the second predicted label and the second sample label is determined, and the label connection network is subjected to a second training based on the label difference until the second stop condition is met.

[0289] In one embodiment, the connection network includes a comment connection network; the training module 1006 is also used to encode and decode the third content text and the third sample comment by executing the label generation network in the text processing model obtained by the first training to obtain a predicted label vector sequence; convert the predicted label vector sequence into a substitute label vector sequence by executing the comment connection network in the text processing model obtained by the first training; decode the substitute label vector sequence by executing the comment generation network in the text processing model obtained by the first training to obtain a corresponding second predicted comment; determine the comment difference between the second predicted comment and the third sample comment, and perform a second training on the comment connection network based on the comment difference until the second stop condition is met.

[0290] In one embodiment, the training module 1006 is also used to jointly perform corresponding branch training on the comment generation network and the label connection network in the text processing model obtained by performing the second training based on the first content text and the first sample label corresponding to the first content text, and the second content text and the second sample label corresponding to the second content text; jointly perform corresponding branch training on the label generation network and the comment connection network in the text processing model obtained by performing the second training based on the first content text and the first sample comment corresponding to the first content text, and the third content text and the third sample comment corresponding to the third content text; and terminate the training when it is determined based on each branch training that the third stop condition is met, thereby obtaining a trained text processing model.

[0291] For the specific definition of the description text generation device and the training device of the text processing model, please refer to the definition of the description text generation method and the training method of the text processing model in the above text, which will not be repeated here. The various modules in the above-mentioned description text generation device and the training device of the text processing model can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0292] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.11 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store descriptive text processing data and model training data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a descriptive text generation method and a text processing model training method are implemented.

[0293] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0294] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0295] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned method embodiments.

[0296] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0297] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0298] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A description text generation method, characterized in that: The method comprises: Acquire a shared content text and an auxiliary description text corresponding to the target task; the text type of the auxiliary description text is one of a comment type and a tag type; Semantic encoding is performed on the shared content text and the auxiliary description text respectively to obtain a corresponding shared vector sequence and an auxiliary vector sequence; wherein when the auxiliary description text is of a tag type, the obtained auxiliary vector sequence is a first auxiliary vector sequence; and when the auxiliary description text is of a comment type, the obtained auxiliary vector sequence is a second auxiliary vector sequence; Randomizing the shared vector sequence, and determining a shared latent variable based on the randomization result; wherein, when the auxiliary description text is of a label type, the determined shared latent variable is a first shared latent variable; and when the auxiliary description text is of a comment type, the determined shared latent variable is a second shared latent variable; Performing semantic decoding processing based on the shared latent variable and the auxiliary vector sequence, outputting a target description text corresponding to the target task, wherein the text type of the target description text is one of a comment type and a label type, and the text type of the target description text is different from that of the auxiliary description text; The performing semantic decoding processing based on the shared latent variable and the auxiliary vector sequence to output a target description text corresponding to the target task includes: When the auxiliary description text belongs to the tag type, the first auxiliary vector sequence is decoded based on the first shared latent variable through the comment generation network to obtain a target description text belonging to the comment type; When the auxiliary description text belongs to the comment type, the second auxiliary vector sequence is decoded based on the second shared latent variable through the label generation network to obtain the target description text belonging to the label type.

2. The method according to claim 1, characterized in that The performing semantic encoding processing on the shared content text and the auxiliary description text respectively to obtain a corresponding shared vector sequence and an auxiliary vector sequence includes: Determining a shared word sequence corresponding to the shared content text, and determining an auxiliary word sequence corresponding to the auxiliary description text; Performing forward semantic coding and reverse semantic coding on the shared word sequence respectively to obtain a forward shared coding vector sequence and a reverse shared coding vector sequence; Performing sequence fusion processing on the forward shared coding vector sequence and the reverse shared coding vector sequence to obtain a shared vector sequence corresponding to the shared content text; Performing forward semantic coding and reverse semantic coding on the auxiliary word sequence respectively to obtain a forward auxiliary coding vector sequence and a reverse auxiliary coding vector sequence; The forward auxiliary coding vector sequence and the reverse auxiliary coding vector sequence are subjected to sequence fusion processing to obtain an auxiliary vector sequence corresponding to the auxiliary description text.

3. The method according to claim 1, characterized in that The randomizing the shared vector sequence and determining the shared latent variable based on the randomization result includes: Converting the shared vector sequence into a corresponding target probability distribution, and determining a corresponding target mean and target variance based on the target probability distribution; When the auxiliary description text belongs to the label type, sampling is performed at least once based on the target probability distribution according to the target mean and the target variance to obtain at least one shared latent variable corresponding to the auxiliary description text; When the auxiliary description text belongs to the comment type, the target mean is used as a shared latent variable corresponding to the auxiliary description text.

4. The method according to claim 3, characterized in that When the auxiliary description text belongs to a label type, the semantic decoding process is performed based on the shared latent variable and the auxiliary vector sequence to output a target description text corresponding to the target task, including: Each shared latent variable and the auxiliary vector sequence constitute a group of objects to be decoded; Semantic decoding processing is performed on each group of objects to be decoded, and at least one target description text corresponding to the target task is output, and each output target description text is different.

5. The method according to claim 1, characterized in that The method is executed through a text processing model; the text processing model includes a comment generation network and a tag generation network; the comment generation network is used to generate a target description text belonging to a comment type based on the shared content text and the auxiliary description text belonging to the tag type; the tag generation network is used to generate a target description text belonging to a tag type based on the shared content text and the auxiliary description text belonging to the comment type.

6. The method according to claim 5, characterized in that The text processing model further includes a content encoding network, and the semantic encoding processing is performed on the shared content text and the auxiliary description text respectively to obtain a corresponding shared vector sequence and an auxiliary vector sequence, including: Performing semantic encoding processing on the shared content text through the content encoding network to obtain a shared vector sequence corresponding to the shared content text; When the auxiliary description text belongs to the tag type, the auxiliary description text is semantically encoded by the comment generation network to obtain a corresponding first auxiliary vector sequence; When the auxiliary description text belongs to the comment type, the auxiliary description text is semantically encoded by the label generation network to obtain a corresponding second auxiliary vector sequence; The randomizing the shared vector sequence and determining the shared latent variable based on the randomization result includes: When the auxiliary description text belongs to the tag type, the shared vector sequence is randomized by the comment generation network, and a first shared latent variable is determined based on the processing result; When the auxiliary description text belongs to a comment type, the shared vector sequence is randomized through the label generation network, and a second shared latent variable is determined based on the processing result.

7. The method according to any one of claims 1 to 6, characterized in that The target task is a music review generation task or a music tag generation task; When the target task is a music review generation task, the shared content text includes at least one of a song name, lyrics text, rhythm description text, and author attribute text corresponding to the target song, the auxiliary description text is a set of music tags corresponding to the target song, and the target description text is a set of music reviews corresponding to the target song; When the target task is a music tag generation task, the shared content text includes at least one of the song name, lyrics text, rhythm description text, and author attribute text corresponding to the target song, the auxiliary description text is a set of music reviews corresponding to the target song, and the target description text is a set of music tags corresponding to the target song.

8. A method for training a text processing model, characterized in that: The method comprises: Acquire a first sample training set, where the first sample training set includes a first content text, and a first sample comment and a first sample label corresponding to the first content text; Performing semantic encoding processing on the first content text to obtain a corresponding sample content vector sequence; By using a comment generation network in a text processing model to be trained, encoding and decoding the sample content vector sequence and the first sample label to obtain a corresponding first predicted comment; Through the label generation network in the text processing model to be trained, the sample content vector sequence and the first sample comment are encoded and decoded to obtain a corresponding first predicted label; wherein the comment generation network and the label generation network are dual structures to each other; Determining a dual loss based on a first difference between the first predicted label and the first sample label, and a second difference between the first predicted comment and the first sample comment; The text processing model is trained based on the dual loss until the training end condition is met, thereby obtaining a trained text processing model; the trained text processing model is used to generate a target description text corresponding to a target task; the target description text is at least one of a target comment text and a target label text.

9. The method according to claim 8, characterized in that The text processing model further includes a connection network, wherein the connection network is used to connect the comment generation network and the tag generation network. The method further includes: Acquire a second sample training set, where the second sample training set includes a second content text and a second sample label corresponding to the second content text, a third content text and a third sample comment corresponding to the third content text; The text processing model is trained based on the dual loss until a training end condition is met to obtain a trained text processing model, including: Based on the dual loss, performing a first training on the comment generation network and the label generation network in the text processing model until a first stopping condition is met; Performing second training on the connection network in the text processing model obtained by performing the first training using the second sample training set, until a second stopping condition is met; The text processing model obtained by executing the second training is subjected to a third training by using the first sample training set and the second sample training set, and the training is stopped until a third stopping condition is satisfied, thereby obtaining a trained text processing model.

10. The method according to claim 9, characterized in that The connection network includes a label connection network; the second training is performed on the connection network in the text processing model obtained by performing the first training through the second sample training set until a second stopping condition is met, including: By executing the comment generation network in the text processing model obtained by the first training, encoding and decoding the second content text and the second sample label, a predicted comment vector sequence is obtained; Converting the predicted comment vector sequence into a replacement comment vector sequence by executing a label connection network in the text processing model obtained by the first training; By executing the label generation network in the text processing model obtained by the first training, the replacement comment vector sequence is decoded to obtain a corresponding second predicted label; A label difference between the second predicted label and the second sample label is determined, and the label connection network is second trained based on the label difference until a second stopping condition is met.

11. The method according to claim 9, characterized in that The connection network includes a comment connection network; the second training is performed on the connection network in the text processing model obtained by performing the first training through the second sample training set until a second stopping condition is met, including: By executing the label generation network in the text processing model obtained by the first training, encoding and decoding the third content text and the third sample comment are performed to obtain a predicted label vector sequence; Converting the predicted label vector sequence into a replacement label vector sequence by executing a comment connection network in the text processing model obtained by the first training; By executing the comment generation network in the text processing model obtained by the first training, the replacement label vector sequence is decoded to obtain a corresponding second predicted comment; Determine the difference between the second predicted comment and the third sample comment, and perform a second training on the comment connection network based on the comment difference until a second stopping condition is met.

12. The method according to claim 9, characterized in that The method of performing a third training on the text processing model obtained by performing the second training by using the first sample training set and the second sample training set until a third stopping condition is met to obtain a trained text processing model comprises: Based on the first content text and the first sample label corresponding to the first content text, and the second content text and the second sample label corresponding to the second content text, jointly performing corresponding branch training on the comment generation network and the label connection network in the text processing model obtained by performing the second training; Based on the first content text and the first sample comment corresponding to the first content text, and the third content text and the third sample comment corresponding to the third content text, jointly performing corresponding branch training on the label generation network and the comment connection network in the text processing model obtained by performing the second training; When it is determined based on the training of each branch that the third stopping condition is met, the training is terminated to obtain a trained text processing model.

13. A description text generation device, characterized in that: The device comprises: A text acquisition module, used to acquire a shared content text and an auxiliary description text corresponding to a target task; the text type of the auxiliary description text is one of a comment type and a tag type; A randomization processing module, used to perform semantic encoding processing on the shared content text and the auxiliary description text respectively to obtain corresponding shared vector sequences and auxiliary vector sequences; perform randomization processing on the shared vector sequences, and determine shared latent variables based on the randomization processing results; wherein, when the auxiliary description text belongs to a tag type, the obtained auxiliary vector sequence is a first auxiliary vector sequence; when the auxiliary description text belongs to a comment type, the obtained auxiliary vector sequence is a second auxiliary vector sequence; when the auxiliary description text belongs to a tag type, the determined shared latent variable is a first shared latent variable; when the auxiliary description text belongs to a comment type, the determined shared latent variable is a second shared latent variable; A decoding module is used to perform semantic decoding processing based on the shared latent variables and the auxiliary vector sequence, and output a target description text corresponding to the target task, wherein the text type of the target description text is one of a comment type and a label type, and the text type of the target description text is different from that of the auxiliary description text; the semantic decoding processing based on the shared latent variables and the auxiliary vector sequence, and outputting the target description text corresponding to the target task, includes: when the auxiliary description text belongs to the label type, decoding the first auxiliary vector sequence based on the first shared latent variable through a comment generation network to obtain a target description text belonging to the comment type; when the auxiliary description text belongs to the comment type, decoding the second auxiliary vector sequence based on the second shared latent variable through a label generation network to obtain a target description text belonging to the label type.

14. The device according to claim 13, characterized in that The randomization processing module also includes a vector sequence determination module, which is used to determine a shared word sequence corresponding to the shared content text, and determine an auxiliary word sequence corresponding to the auxiliary description text; perform forward semantic encoding and reverse semantic encoding on the shared word sequence respectively to obtain a forward shared encoding vector sequence and a reverse shared encoding vector sequence; perform sequence fusion processing on the forward shared encoding vector sequence and the reverse shared encoding vector sequence to obtain a shared vector sequence corresponding to the shared content text; perform forward semantic encoding and reverse semantic encoding on the auxiliary word sequence respectively to obtain a forward auxiliary encoding vector sequence and a reverse auxiliary encoding vector sequence; perform sequence fusion processing on the forward auxiliary encoding vector sequence and the reverse auxiliary encoding vector sequence to obtain an auxiliary vector sequence corresponding to the auxiliary description text.

15. The device according to claim 13, characterized in that The randomization processing module also includes a latent variable determination module, which is used to convert the shared vector sequence into a corresponding target probability distribution, and determine the corresponding target mean and target variance based on the target probability distribution; when the auxiliary description text belongs to the label type, according to the target mean and the target variance, at least one sampling is performed based on the target probability distribution to obtain at least one shared latent variable corresponding to the auxiliary description text; when the auxiliary description text belongs to the comment type, the target mean is used as the shared latent variable corresponding to the auxiliary description text.

16. The device according to claim 15, characterized in that The decoding module is also used to form a group of objects to be decoded by combining each shared latent variable with the auxiliary vector sequence; perform semantic decoding processing based on each group of objects to be decoded, and output at least one target description text corresponding to the target task, and each output target description text is different.

17. The device according to claim 13, characterized in that The device is executed through a text processing model; the text processing model includes a comment generation network and a tag generation network; the comment generation network is used to generate a target description text belonging to a comment type based on the shared content text and the auxiliary description text belonging to the tag type; the tag generation network is used to generate a target description text belonging to a tag type based on the shared content text and the auxiliary description text belonging to the comment type.

18. The device according to claim 17, characterized in that The text processing model also includes a content encoding network, and the randomization processing module is also used to perform semantic encoding processing on the shared content text through the content encoding network to obtain a shared vector sequence corresponding to the shared content text; when the auxiliary description text belongs to the tag type, the auxiliary description text is semantically encoded through the comment generation network to obtain a corresponding first auxiliary vector sequence; when the auxiliary description text belongs to the comment type, the auxiliary description text is semantically encoded through the tag generation network to obtain a corresponding second auxiliary vector sequence; when the auxiliary description text belongs to the tag type, the shared vector sequence is randomized through the comment generation network, and a first shared latent variable is determined based on the processing result; when the auxiliary description text belongs to the comment type, the shared vector sequence is randomized through the tag generation network, and a second shared latent variable is determined based on the processing result.

19. The device according to claim 13, characterized in that The target task is a music review generation task or a music tag generation task; When the target task is a music review generation task, the shared content text includes at least one of a song name, lyrics text, rhythm description text, and author attribute text corresponding to the target song, the auxiliary description text is a set of music tags corresponding to the target song, and the target description text is a set of music reviews corresponding to the target song; When the target task is a music tag generation task, the shared content text includes at least one of the song name, lyrics text, rhythm description text, and author attribute text corresponding to the target song, the auxiliary description text is a set of music reviews corresponding to the target song, and the target description text is a set of music tags corresponding to the target song.

20. A training device for a text processing model, characterized in that: The device comprises: The encoding module is used to obtain a first sample training set, wherein the first sample training set includes a first content text, and a first sample comment and a first sample label corresponding to the first content text; perform semantic encoding processing on the first content text to obtain a corresponding sample content vector sequence; An output module is used to encode and decode the sample content vector sequence and the first sample label through the comment generation network in the text processing model to be trained to obtain a corresponding first predicted comment; and to encode and decode the sample content vector sequence and the first sample comment through the label generation network in the text processing model to be trained to obtain a corresponding first predicted label; wherein the comment generation network and the label generation network are dual structures to each other; A training module, used to determine a dual loss based on a first difference between the first predicted label and the first sample label, and a second difference between the first predicted comment and the first sample comment; train the text processing model based on the dual loss until the training end condition is met, thereby obtaining a trained text processing model; the trained text processing model is used to generate a target description text corresponding to a target task; the target description text is at least one of a target comment text and a target label text.

21. The device according to claim 20, characterized in that The text processing model also includes a connection network, which is used to connect the comment generation network and the label generation network. The training module is also used to obtain a second sample training set, which includes a second content text and a second sample label corresponding to the second content text, a third content text, and a third sample comment corresponding to the third content text; based on the dual loss, the comment generation network and the label generation network in the text processing model are first trained until a first stopping condition is met; through the second sample training set, the connection network in the text processing model obtained by performing the first training is second trained until a second stopping condition is met; through the first sample training set and the second sample training set, the text processing model obtained by performing the second training is third trained until a third stopping condition is met, thereby obtaining a trained text processing model.

22. The device according to claim 21, characterized in that The connection network includes a label connection network; the training module is further used to perform encoding and decoding processing on the second content text and the second sample label by executing the comment generation network in the text processing model obtained by the first training to obtain a predicted comment vector sequence; convert the predicted comment vector sequence into a substitute comment vector sequence by executing the label connection network in the text processing model obtained by the first training; and perform decoding processing on the substitute comment vector sequence by executing the label generation network in the text processing model obtained by the first training to obtain a corresponding second predicted label; A label difference between the second predicted label and the second sample label is determined, and the label connection network is second trained based on the label difference until a second stopping condition is met.

23. The device according to claim 21, characterized in that The connection network includes a comment connection network; the training module is also used to encode and decode the third content text and the third sample comment by executing the label generation network in the text processing model obtained by the first training to obtain a predicted label vector sequence; convert the predicted label vector sequence into a substitute label vector sequence by executing the comment connection network in the text processing model obtained by the first training; decode the substitute label vector sequence by executing the comment generation network in the text processing model obtained by the first training to obtain a corresponding second predicted comment; determine the comment difference between the second predicted comment and the third sample comment, and perform a second training on the comment connection network based on the comment difference until the second stop condition is met.

24. The device according to claim 21, characterized in that The training module is also used to jointly perform corresponding branch training on the comment generation network and the label connection network in the text processing model obtained by performing the second training based on the first content text and the first sample label corresponding to the first content text, and the second content text and the second sample label corresponding to the second content text; jointly perform corresponding branch training on the label generation network and the comment connection network in the text processing model obtained by performing the second training based on the first content text and the first sample comment corresponding to the first content text, and the third content text and the third sample comment corresponding to the third content text; and terminate the training when it is determined based on each branch training that the third stop condition is met, thereby obtaining a trained text processing model.

25. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

26. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.

27. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

Citation Information

Patent Citations

  • An information output method and device

    CN109902283A

  • Commodity comment label automatic generation method, device and system for multi-task learning

    CN111325571A

  • Music comment generation method based on deep learning

    CN111626041A

  • Summary generating apparatus, summary generating method and computer program

    US20200159755A1

  • Training image and text embedding models

    US20200250538A1