A method, device, equipment and storage medium for generating multilingual text
Through the adversarial generation network and multilingual text generation model, combined with language information and sentence grammar information, the problem of unnatural multilingual text generation in the existing technology is solved, and smooth, natural and diverse multilingual text generation is achieved, satisfying multiple needs. Requirements for language text generation.
Patent Information
- Application Number
- CN202111033454.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-03
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2041-09-03
AI Technical Summary
The existing technology is difficult to generate smooth and natural multilingual text, and in multilingual text generation applications, multilingual text is difficult to obtain and cannot meet the needs of multilingual text generation.
The multilingual text generation model in the adversarial generation network is used to generate multilingual text using a pre-established multilingual word list. The discriminant network is unable to distinguish the generated text from the real text through the training target. It combines the language information and sentence grammar information to generate a human-friendly text. Multilingual text expressing habits.
It realizes the automatic generation of smooth, natural and diverse multilingual texts, meets the needs of multilingual text generation, and can generate texts that meet real characteristics in mixed language scenarios of different languages.
Smart Images

Figure CN113743089B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of text generation, and in particular to a multilingual text generation method, device, equipment and storage medium. Background Art
[0002] Text generation is a difficult research direction in natural language processing, and its application scenarios are numerous and extensive. In recent years, text generation has made great progress in information extraction, dialogue systems, novel synthesis, and advertising copy generation.
[0003] With the development of globalization, the phenomenon of mixing different languages in text or speech is becoming more and more obvious in important scenarios of text generation applications such as daily communication and informal information. In addition, in the fields of language discrimination, multilingual speech synthesis, and multilingual speech recognition, a large amount of multilingual text corpus is needed. However, in real life, multilingual texts are often mixed with monolingual texts and account for a low proportion, that is, a large amount of multilingual texts are difficult to obtain.
[0004] In summary, in order to meet the needs of certain text generation application scenarios for multilingual text generation, as well as the needs of certain fields for large amounts of multilingual text, a multilingual text generation solution is urgently needed. Summary of the invention
[0005] In view of this, the present application provides a multilingual text generation method, device, equipment and storage medium for automatically generating multilingual text, and its technical solution is as follows:
[0006] A multilingual text generation method, comprising:
[0007] Acquire a multilingual word list, wherein the multilingual word list includes a plurality of entries, each entry includes a word and language information of the word;
[0008] A multilingual text generation model established in advance is used to generate multilingual text based on the multilingual word list, wherein the multilingual text generation model generates text with the goal of generating multilingual text that meets the characteristics of real multilingual text.
[0009] Optionally, the multilingual text generation model adopts a generation network in a generative adversarial network;
[0010] The training goal of the multilingual text generation model is to make the discriminant network in the adversarial generation network unable to distinguish whether the input multilingual text is the text generated by the generation network or the real text.
[0011] Optionally, generating a multilingual text based on the multilingual word list includes:
[0012] According to the language information in the multilingual word list, randomly sampling a number of entries from the multilingual word list to form a target word list;
[0013] A multilingual text is generated based on the target word list.
[0014] Optionally, generating a multilingual text based on the target word list includes:
[0015] Determine a feature vector of each entry in the target word list and a feature vector of the target word list, wherein the feature vector of the target word list is a feature vector of all entries in the target word list as a whole;
[0016] Based on the feature vector of the target word list, determining a vector containing sentence grammar information as a global planning latent variable;
[0017] A multilingual text is generated based on the global planning latent variables, the feature vector of each entry in the target word list, and the feature vector of the target word list.
[0018] Optionally, the determining, based on the feature vector of the target word list, a vector containing sentence grammar information as a global planning latent variable includes:
[0019] Based on the feature vector of the target word list, determining a normal distribution obeyed by the feature vector of the target word list;
[0020] A number of values are sampled from the normal distribution to obtain the global planning latent variables.
[0021] Optionally, generating a multilingual text based on the global planning latent variable, the feature vector of each entry in the target word list, and the feature vector of the target word list includes:
[0022] Based on the global planning latent variables and the feature vector of each entry in the target word list, determining the entry participating in text generation from the target word list as the target entry;
[0023] A multilingual text is generated based on the feature vector of the target word list, the global plan latent variable and the feature vector of the target term.
[0024] Optionally, the determining, based on the global planned latent variables and the feature vector of each entry in the target word list, the entry participating in text generation from the target word list as the target entry includes:
[0025] Based on the global planning latent variables and the feature vector of each entry in the target word list, predict the probability of each entry in the target word list participating in text generation;
[0026] Based on the probability of each term in the target word list participating in text generation, the term in the target word list participating in text generation is determined as the target term.
[0027] Optionally, determining the entries in the target word list that participate in text generation based on the probability of each entry in the target word list participating in text generation includes:
[0028] If there are entries in the target word list whose probability of participating in text generation is greater than a preset probability threshold, the entries whose probability of participating in text generation is greater than the preset probability threshold are determined as the entries participating in text generation;
[0029] If there is no entry in the target word list whose probability of participating in text generation is greater than the preset probability threshold, the entry with the highest probability of participating in text generation is determined as the entry participating in text generation.
[0030] Optionally, generating a multilingual text based on the feature vector of the target word list, the global plan latent variable, and the feature vector of the target term includes:
[0031] Calculate the mean of the feature vectors of all target terms;
[0032] The mean of the feature vectors of all target terms, the feature vector of the target word list, and the global project latent variable are decoded to obtain multilingual text.
[0033] Optionally, decoding the mean of the feature vectors of all target terms, the feature vector of the target word list, and the global plan latent variable to obtain the multilingual text includes:
[0034] At each decoding moment, determining a text prediction vector at the current decoding moment according to the mean of the feature vectors of all target terms, the feature vector of the target word list, the global plan latent variable, and the text prediction vector at the previous decoding moment;
[0035] Using the text prediction vector at the current decoding moment as a prediction basis, predict the probability that the word generated at the current decoding moment is each word in the multilingual dictionary;
[0036] The word generated at the current decoding moment is determined according to the probability that the word generated at the current decoding moment is each word in the multilingual dictionary.
[0037] Optionally, the process of establishing the multilingual text generation model includes:
[0038] Using a generative network in a generative adversarial network as a multilingual text generation model, and generating multilingual text based on the multilingual word list as the multilingual generated text;
[0039] Inputting the multilingual generated text into the discriminant network in the adversarial generative network to obtain the probability that the multilingual generated text is a true text;
[0040] Determining a language diversity indicator value corresponding to the multilingual generated text, wherein the language diversity indicator value can represent the language diversity of the corresponding text;
[0041] Based on the probability that the multilingual generated text is a true text and the language diversity indicator value corresponding to the multilingual generated text, the parameters of the multilingual text generation model are updated.
[0042] Optionally, determining the language diversity indicator value corresponding to the multilingual generated text includes:
[0043] Calculating an average value of representation vectors of the language to which a target word in the multilingual generated text belongs as an average language representation vector, wherein the target word is a word in an entry in the multilingual word table that participates in text generation;
[0044] A language diversity indicator value corresponding to the multilingual generated text is determined according to the number of target words in the multilingual generated text, the representation vector of the language to which the target words in the multilingual generated text belong, and the average language representation vector.
[0045] A multilingual text generation device, comprising: a multilingual word list acquisition module and a multilingual text generation module;
[0046] The multilingual word list acquisition module is used to acquire a multilingual word list, wherein the multilingual word list includes a plurality of entries, each entry includes a word and language information of the word;
[0047] The multilingual text generation module is used to generate multilingual text based on the multilingual word list by using a pre-established multilingual text generation model, wherein the multilingual text generation model generates text with the goal of generating multilingual text that meets the characteristics of real multilingual text.
[0048] A multilingual text generation device, comprising: a memory and a processor;
[0049] The memory is used to store programs;
[0050] The processor is used to execute the program to implement each step of any of the above-mentioned methods for generating multilingual texts.
[0051] A readable storage medium stores a computer program, which, when executed by a processor, implements each step of any of the above-mentioned methods for generating multilingual texts.
[0052] Through the above scheme, it can be known that the multilingual text generation method, device, equipment and storage medium provided by the present application first obtain a multilingual word list, and then use the pre-established multilingual text generation model to generate multilingual text based on the multilingual word list. The multilingual text generation method provided by the present application can automatically generate multilingual text. Since the multilingual text is generated using the multilingual text generation model, and the multilingual text generation model generates text with the goal of generating multilingual text that meets the characteristics of real multilingual text, the multilingual text generated using the multilingual text generation model meets the characteristics of real multilingual text, that is, the multilingual text generation method provided by the present application can generate fluent and natural multilingual text that meets the human expression habits. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0054] Figure 1 A schematic diagram of a process for generating multilingual texts provided in an embodiment of the present application;
[0055] Figure 2 A schematic diagram of a process for generating a multilingual text based on a target word list provided in an embodiment of the present application;
[0056] Figure 3 A schematic diagram of a process for generating multilingual text based on a global planning latent variable, a feature vector of each entry in a target word list, and a feature vector of a target word list provided in an embodiment of the present application;
[0057] Figure 4 A possible structural diagram of a multilingual text generation model provided in an embodiment of the present application;
[0058] Figure 5 A schematic diagram of a process in which an input encoding module in a multilingual text generation model provided in an embodiment of the present application processes an input target word list;
[0059] Figure 6 A schematic diagram of a process for obtaining a plan vector by a calculation processing module in a multilingual text generation model provided in an embodiment of the present application;
[0060] Figure 7 A schematic diagram of generating multilingual text by a sentence generation module in a multilingual text generation model provided in an embodiment of the present application;
[0061] Figure 8 A schematic diagram of a process for establishing a multilingual text generation model provided in an embodiment of the present application;
[0062] Fig. 9 A schematic diagram of a flow chart of a training discriminant network provided in an embodiment of the present application;
[0063] Fig.10 A schematic diagram of the structure of a multilingual text generation device provided in an embodiment of the present application;
[0064] Fig.11 A schematic diagram of the structure of a multilingual text generation device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0066] In order to generate multilingual texts, the applicant conducted research and the initial idea was to adopt a rule-based multilingual text generation scheme, that is, to set a large number of multilingual text generation rules and generate multilingual texts according to the set multilingual text generation rules.
[0067] However, in the process of studying the rule-based multilingual text generation scheme, the applicant found that the rule-based multilingual text generation scheme has many defects, such as requiring more expert knowledge, difficulty in generating a large amount of varied multilingual texts, the generated texts are not fluent and natural enough, and are not in line with human expression habits, etc.
[0068] In view of the problems existing in the rule-based multilingual text generation scheme, the inventor of this case continued to study and finally proposed a multilingual text generation method with better effect. This method does not require much expert knowledge, can automatically generate fluent and natural multilingual texts that conform to human expression habits, and can generate rich and diverse multilingual texts. The multilingual text generation method provided by this application can be applied to any scenario where multilingual text needs to be generated.
[0069] The multilingual text generation method provided by the present application can be applied to an electronic device with data processing capabilities, which can be a server on the network side (can be a single server, or multiple servers or a server cluster), or a terminal used by the user side, such as a PC, notebook, PAD, smart phone, etc. Next, the multilingual text generation method provided by the present application is introduced through the following embodiments.
[0070] First embodiment
[0071] See also Figure 1 , shows a schematic flow chart of a multilingual text generation method provided in an embodiment of the present application, the method may include:
[0072] Step S101: Obtain a multilingual word list.
[0073] The multilingual word list includes multiple entries, each of which includes a word and the language information of the word. An example of a multilingual word list is shown below:
[0074] Language word Chinese I English plan Chinese Hello English document … …
[0075] In the above table, <Chinese, I> is an entry, <English, plan> is an entry, <Chinese, hello> is an entry, <English, document> is an entry, and so on.
[0076] The multilingual word list in this embodiment can be a word list of two languages, such as a Chinese and English word list, or a word list of three or more languages, such as a Chinese, English and French word list. It should be noted that the words in the multilingual word list are words that often appear in texts of other languages, for example, the English word "plan" is a word that often appears in Chinese texts.
[0077] Step S102: Generate multilingual text based on a multilingual word list using a pre-established multilingual text generation model.
[0078] In this embodiment, the generation of multilingual text based on the multilingual word list is implemented by using a pre-established multilingual text generation model, wherein the multilingual text generation model generates text with the goal of generating multilingual text that conforms to the characteristics of real multilingual text. The multilingual text generated by the multilingual text generation model with the goal of generating multilingual text that conforms to the characteristics of real multilingual text is fluent and natural, and conforms to human expression habits.
[0079] In a possible implementation, the multilingual text generation model may adopt the generation network in the generative adversarial network, which is obtained through training. When training the multilingual text generation model, the training objective is to make the discriminative network in the generative adversarial network unable to distinguish whether the input multilingual text is the text generated by the generation network or the real text. It should be noted that the discriminative network in the generative adversarial network being unable to distinguish whether the input multilingual text is the text generated by the generation network or the real text means that after inputting the multilingual text generated by the generation network, which is the multilingual text generation model, into the discriminative network, the discriminative network determines it as the real text.
[0080] There are various implementation manners for using the pre-established multilingual text generation model to generate multilingual text based on the multilingual word list:
[0081] In a possible implementation manner, the multilingual word list can be directly input into the pre-established multilingual text generation model, and the multilingual text generation model generates multilingual text according to the input multilingual word list.
[0082] Considering that the multilingual text generated by directly inputting the multilingual word list into the multilingual text generation model performs poorly in terms of diversity, in order to improve the diversity of the generated text, this embodiment provides another relatively preferred implementation manner:
[0083] According to the language information in the multilingual word list, several entries are randomly sampled from the multilingual word list to form a target word list, and the target word list is input into the pre-established multilingual text generation model, and the multilingual text generation model generates multilingual text according to the input target word list.
[0084] Among them, the process of randomly sampling several entries from the multilingual word list according to the language information in the multilingual word list to form a target word list may include: sampling several words from the words of each language in the multilingual word list, and the entries where the sampled words are located form the target word list.
[0085] Exemplarily, the multilingual word list obtained in step S101 includes {Chinese: "你好", Chinese: "世界", English: "hello", English: "world", English: "hi"}. The sampling quantity for each language can be set (the sampling quantity for each language can be set according to specific circumstances, and the sampling quantities for each language can be the same or different). Assuming that the sampling quantity for each language is 1, then randomly抽取 1 word from the two words "你好" and "世界" in the language "Chinese", and randomly抽取 1 word from the three words "hello", "world", and "hi" in the language "English". A possible extraction result is {Chinese: "世界", English: "hello"}.
[0086] The multilingual text generation method provided in the embodiment of the present application first obtains a multilingual word list, and then uses a pre-established multilingual text generation model to generate multilingual text based on the multilingual word list. The multilingual text generation method provided in the embodiment of the present application can automatically generate multilingual text. Since the multilingual text is generated using the multilingual text generation model, and the multilingual text generation model generates text with the goal of generating multilingual text that meets the characteristics of real multilingual text, the multilingual text generated using the multilingual text generation model meets the characteristics of real multilingual text, that is, it is fluent and natural and in line with human expression habits.
[0087] In addition, the multilingual text generation method provided in the embodiment of the present application can generate multilingual text based on a multilingual word list. According to the language information in the multilingual word list, a number of entries can be randomly sampled from the multilingual word list to form a target word list, and then the multilingual text can be generated according to the target word list. This method makes the generated multilingual text more diverse.
[0088] Second embodiment
[0089] The above-mentioned embodiment mentioned that multilingual text can be generated based on a multilingual word list. When generating multilingual text based on the multilingual word list, the multilingual text can be generated directly based on the multilingual word list, or a target word list can be formed by sampling a number of entries from the multilingual word list according to language information, and the multilingual text is generated based on the target word list. Since "generating multilingual text directly based on the multilingual word list" and "generating multilingual text based on the target word list" are the same, this embodiment takes "generating multilingual text based on the target word list" as an example to introduce the generation process of multilingual text.
[0090] See also Figure 2 , showing a schematic diagram of a process of generating multilingual text based on a target word list, which may include:
[0091] Step S201: Determine the feature vector of each entry in the target word list and the feature vector of the target word list.
[0092] In this embodiment, the word embedding vector of each term in the target word list (i.e., the representation vector of each term) can be determined, and then the feature vector of each term in the target word list is determined according to the word embedding vector of each term in the target word list. After obtaining the feature vector of each term in the target word list, the feature vector of the target word list can be further determined according to the feature vector of each term in the target word list. It should be noted that the feature vector of the target word list is the feature vector of all terms in the target word list as a whole.
[0093] Among them, the process of determining the word embedding vector of any entry in the target word list may include: determining the word embedding vector of the words in the entry, and determining the language embedding vector of the language information in the entry; splicing the word embedding vector of the words in the entry with the language embedding vector of the language information in the entry, and using the spliced vector as the word embedding vector of the entry.
[0094] Step S202: Based on the feature vector of the target vocabulary, determine a vector containing sentence grammar information as a global planning latent variable.
[0095] Among them, sentence grammatical information is syntactic information, which includes sentence structure information (or sentence component information), dependency relationship information between words in the sentence, etc.
[0096] Specifically, based on the feature vector of the target word list, the process of determining the vector containing the sentence grammar information as the global planning latent variable may include:
[0097] Step S2021: Based on the feature vector of the target word list, determine the normal distribution that the feature vector of the target word list conforms to.
[0098] Specifically, the mean μ can be determined based on the feature vector of the target word list. p and variance σ p , to get the mean value μ p The variance is σ p Normal distribution
[0099] Step S2022: Sample a number of values from a normal distribution to obtain global planning latent variables.
[0100] Several values sampled from a normal distribution form a global planning latent variable containing the sentence grammatical information.
[0101] Step S203: Generate multilingual text based on the global planning latent variables, the feature vector of each entry in the target word list, and the feature vector of the target word list.
[0102] See also Figure 3 , showing a schematic diagram of a process of generating multilingual text based on a global planning latent variable, a feature vector of each entry in a target word list, and a feature vector of a target word list, which may include:
[0103] Step S301: Based on the global planning latent variables and the feature vector of each entry in the target word list, the entry participating in text generation is determined from the target word list as the target entry, and the feature vector of the determined target entry constitutes a planning vector.
[0104] Among them, the plan vector represents the information of the terms that will be involved in the subsequent text generation.
[0105] Specifically, based on the global planning latent variables and the feature vector of each entry in the target word list, the process of determining the entries involved in text generation from the target word list includes:
[0106] Step S3011: Based on the global planning latent variables and the feature vector of each entry in the target word list, predict the probability of each entry in the target word list participating in text generation.
[0107] Based on the global planned latent variables and the feature vector of each term in the target word list, the probability of each term in the target word list participating in text generation is predicted, which is essentially a binary classification prediction for each term in the target word list.
[0108] Step S3012: Determine the entries in the target word list that participate in text generation based on the probability of each entry in the target word list participating in text generation.
[0109] Specifically, based on the probability of each entry in the target word list participating in text generation, the process of determining the entries in the target word list participating in text generation may include: if there are entries in the target word list whose probability of participating in text generation is greater than a preset probability threshold, then the entries with a probability of participating in text generation greater than the preset probability threshold are determined as the entries participating in text generation; if there are no entries in the target word list whose probability of participating in text generation is greater than the preset probability threshold, then the entry with the highest probability of participating in text generation is determined as the entry participating in text generation.
[0110] For example, the target word list includes three entries, namely d1, d2, and d3. The probabilities of the three entries participating in text generation are P1, P2, and P3, respectively. Assume that the preset probability threshold is P th , if P1 is greater than P th , P2 is less than P th , P3 is greater than P th , then d1 and d3 are determined as the entries participating in the subsequent text generation. If P1, P2 and P3 are all less than the preset probability threshold P th , then the term with the highest probability of participating in text generation is determined as the term participating in text generation. Assuming P3 is the largest, d3 is determined as the term participating in text generation.
[0111] The above method of determining the entries in the target word list that participate in text generation based on the probability of each entry in the target word list participating in text generation ensures that there will be entries participating in subsequent text generation no matter what.
[0112] Step S302: Generate multilingual text based on the feature vector of the target vocabulary, the global plan latent variable and the plan vector.
[0113] Specifically, based on the feature vector of the target vocabulary, the global planned latent variables and the planned vector, a multilingual text is generated. The process of generating the multilingual text may include: calculating the mean of the feature vectors of all target terms in the planned vector, decoding the mean of the feature vectors of all target terms, the feature vector of the target vocabulary and the global planned latent variables to obtain the multilingual text.
[0114] More specifically, the process of decoding the mean of the feature vectors of all target terms, the feature vectors of the target word list, and the global planned latent variables includes: at each decoding moment, according to the mean of the feature vectors of the target terms, the feature vectors of the target word list, the global planned latent variables and the text prediction vector (vector used to predict text) determined at the previous decoding moment, determining the text prediction vector of the current decoding moment, based on the text prediction vector of the current decoding moment, determining the word generated at the current decoding moment from a pre-built multilingual word dictionary.
[0115] Third embodiment
[0116] The first embodiment mentioned that the generation of multilingual text based on the target word list can be achieved by a pre-established multilingual text generation model. Based on the above-mentioned second embodiment, this embodiment focuses on the structure of the multilingual text generation model and the establishment process of the multilingual text generation model.
[0117] This embodiment first introduces the structure of the multilingual text generation model.
[0118] See also Figure 4 , shows a possible structural diagram of a multilingual text generation model provided by this embodiment, which may include: an input encoding module 401, a plan processing module 402 and a sentence generation module 403. Among them:
[0119] The input of the input encoding module 401 is the target word list. After the target word list is input into the input encoding module 401, the input encoding module 401 encodes it and outputs the feature vector of each entry in the target word list, the feature vector of the target word list and the global plan latent variable containing the sentence grammar information. Figure 5 The input encoding module 401 processes the input target word list and outputs the feature vector of each entry in the target word list ( Figure 5 h1~h N ), the feature vector of the target vocabulary, and the global planning latent variable containing the sentence grammar information ( Figure 5 z in P ) schematic diagram.
[0120] In a possible implementation, the input encoding module 401 may include: a word embedding vector determination submodule, a feature vector determination submodule, and a global plan latent variable determination submodule. Among them, the word embedding vector determination submodule is used to determine the word embedding vector of each term in the target word list (the specific determination method of the word embedding vector of each term can be found in the relevant part of the above embodiment); the feature vector determination submodule is used to determine the feature vector of each term in the target word list and the feature vector of the target word list according to the word embedding vector of each term in the target word list; the global plan latent variable determination submodule is used to determine the global plan latent variable containing sentence grammar information according to the feature vector of the target word list (the specific determination method of the global plan latent variable can be found in the relevant part of the above embodiment).
[0121] Optionally, the feature vector determination submodule may include a recurrent neural network, such as a bidirectional GRU, and the feature vectors of each entry in the target word list are passed through a recurrent neural network, such as a bidirectional GRU, to obtain a feature vector H of the target word list:
[0122]
[0123] Where x represents the target word list, x = {d1, d2, ..., d N}, d1 represents the first entry in the target word list, ..., d N represents the Nth entry in the target word list, Represents the output of the recurrent neural network when encoding the first term from back to front. Represents the output of the recurrent neural network when encoding the Nth term from front to back.
[0124] The i-th entry d in the target word list i The eigenvector h i It is expressed as:
[0125]
[0126] Optionally, the global plan latent variable determination submodule may include a normal distribution determination submodule and a sampling submodule. The normal distribution determination submodule may be a multi-layer perceptron, which is used to determine the mean μ according to the feature vector H of the target word list. p and variance σ p , that is, input the feature vector H of the target word list into the multilayer perceptron to obtain μ p and logσ p :
[0127] [μ p ; log σ p ]=MLP θ (H) (3)
[0128] Among them, MLP represents a multi-layer perceptron, and θ represents the training parameters of the multi-layer perceptron.
[0129] In getting μ p and log σ p After that, through log σ p Available p , and finally the mean μ can be obtained p and variance σ p , so that the feature vector of the target word list conforms to the normal distribution After obtaining the normal distribution, the sampling submodule can be used to sample several values on the normal distribution to obtain the global plan latent variable. It should be noted that the process of determining the normal distribution that the feature vector of the target word list conforms to and sampling from the normal distribution can be regarded as the process of compressing and reconstructing information to obtain the most concise information (corresponding to several values sampled on the normal distribution). Since the reconstructed information is the most core, most abstract, and global information, it can be considered to contain sentence grammar information. It should also be noted that in the training stage, since the discriminant network supervision is used as the generation network of the multilingual text generation model to produce texts of better quality, the multilingual text generation model can eventually reconstruct the most core, most abstract, and global information through continuous learning, that is, the above-mentioned global plan latent variables.
[0130] The plan processing module 402 is used to determine the entries participating in text generation from the target word list as target entries based on the global plan latent variables and the feature vectors of each entry in the target word list, and the feature vectors of the determined target entries form a plan vector. Figure 6 A schematic diagram showing the process of the calculation processing module 402 obtaining the planning vector.
[0131] Optionally, the plan processing module 402 may include a probability prediction submodule and a plan vector acquisition submodule. Optionally, the probability prediction submodule may be a fully connected network that performs binary classification prediction on each entry in the target word list. Specifically, for an entry d in the target word list, i , the probability prediction submodule can predict the term d by the following formula i Probability of participating in text generation:
[0132] P(d i ∈g)=σ(v p tanh(W p [h i ;z P ]+b p )) (4)
[0133] Among them, h iIndicates the term d i The eigenvector of P represents the global planning latent variable, g represents the planning vector, v p , W p , b p is a trainable parameter.
[0134] After the probability prediction submodule predicts the probability of each term in the target word list participating in text generation, the plan vector acquisition submodule can determine the term participating in text generation, i.e., the target term, according to the probability predicted by the probability prediction submodule, and then obtain the plan vector g composed of the feature vectors of the determined target terms.
[0135] Sentence generation module 403, for generating a sentence based on the feature vector g of the target word list and the global plan latent variable z P and the planning vector g, generating multilingual texts. Figure 7 A schematic diagram showing the generation of multilingual text by the sentence generation module 403 is shown.
[0136] Optionally, the sentence generation module 403 may include: an average pooling submodule and a decoding submodule. The average pooling submodule is used to perform average pooling on the plan vector g, that is, to calculate the mean g′ of the feature vector of each target word in the plan vector, and the decoding submodule is used to average the feature vector H of the target word list and the global plan latent variable z. P The mean g′ of the feature vector of each target term in the plan vector is decoded to obtain the multilingual text.
[0137] Among them, the decoding submodule decodes at each decoding moment according to the feature vector H of the target word table and the global plan hidden variable z P The mean g′ of the feature vectors of each target term in the plan vector and the text prediction vector h determined at the last decoding moment t-1 (vector used to predict text), determine the text prediction vector h at the current decoding moment t , determine the text generated at the current decoding moment based on the text prediction vector at the current decoding moment.
[0138] When determining the text generated at the current decoding moment according to the text prediction vector at the current decoding moment, the text prediction vector at the current decoding moment is used as a basis to determine the words generated at the current decoding moment from a pre-built multilingual word dictionary. Specifically, the probability of the words generated at the current decoding moment being each word in the multilingual word dictionary (all words in several languages) is predicted based on the text prediction vector at the current decoding moment, and the words generated at the current decoding moment are determined based on the predicted probabilities. More specifically, the word corresponding to the maximum probability among the determined probabilities is determined as the word generated at the current decoding moment.
[0139] Optionally, the decoding submodule can be a Transformer module or a recurrent neural network (such as GRU). When the decoding submodule is GRU, the text prediction vector h at the current decoding moment is t It can be expressed as:
[0140] h t =GRU([H; z P ; g′], h t-1 ) (5)
[0141] At each decoding time t, the text prediction vector h of the previous decoding time t-1 is t-1 As input, the output text prediction vector h t Enter the fully connected layer and the Softmax layer and select the word at the decoding time t.
[0142] It should be noted that the words in the multilingual word list are only the words that frequently appear in texts of other languages, but these words alone cannot form a complete sentence. For example, a multilingual word list containing "hello" and "awesome" needs to be interspersed with some other words to form a complete sentence. For example, "hello" and "awesome" need to be interspersed with "China" and "is" to form a complete sentence "hello, China is awesome".
[0143] In view of this, the present embodiment sets the output dimension of the above-mentioned fully connected layer to be the size of the entire multilingual word dictionary rather than the size of the multilingual word list. After the output of the fully connected layer passes through the Softmax layer, the probability that the word generated at the decoding time t is each word in the multilingual word dictionary can be obtained, and the word corresponding to the maximum probability is determined as the word generated at the decoding time t.
[0144] For example, the multilingual word dictionary contains three words "I", "love", and "China". The output dimension of the fully connected layer is set to 3, and the text prediction vector h at the decoding time t is t After entering the fully connected layer and the Softmax layer, the probabilities of the words generated at decoding time t being "I", "love", and "China" are [0.1, 0.3, 0.6]. Since the probability of the word generated at decoding time t being "China" is the largest (0.6), "China" is determined to be the word generated at decoding time t.
[0145] It should be noted that the present application sets the output dimension of the fully connected layer to be the size of the entire multilingual word dictionary, so that every word in the multilingual word dictionary has the possibility of being selected for sentence construction. As for which one is selected in each step, the model learns and adjusts itself. In addition, it should be noted that although every word in the multilingual word dictionary can be used to make sentences, the main meaning and syntax of the sentence are mainly determined by the words in the target word list, that is, the words are selected from the target word list for sentence construction.
[0146] In addition, when the sentence generation module outputs a special sentence ending word, the entire text generation ends. Optionally, a sentence ending word, such as "EOS", can be set in a multilingual word dictionary. At a certain decoding moment, if the probability that the generated word is the sentence ending word is the highest, the sentence ending word is determined as the generated word, and the text generation ends at this time.
[0147] The above content provides a structure of a multilingual text generation model and a process of implementing multilingual text generation under this structure. It should be noted that this embodiment does not limit the structure of the multilingual text generation model to the above structure. The above structure is only an example. Any structure that can generate multilingual text according to the multilingual text generation method provided in the second embodiment belongs to the scope of protection of this application.
[0148] Next, the process of building a multilingual generative model is introduced.
[0149] See also Figure 8 , showing a schematic diagram of the process of establishing a multilingual text generation model, which may include:
[0150] Step S801: using a generative network in a generative adversarial network as a multilingual text generation model, and generating multilingual text based on a multilingual word list as a multilingual generated text.
[0151] The process of generating multilingual text based on a multilingual word list using a generative network in a generative adversarial network as a multilingual text generation model is similar to the implementation process of the above-mentioned "step S102: generating multilingual text based on a multilingual word list using a pre-established multilingual text generation model", and the details can be referred to the above-mentioned embodiment, which will not be described in detail in this embodiment.
[0152] Step S802a: input the multilingual generated text into the discriminant network in the adversarial generative network to obtain the probability that the multilingual generated text is a real text.
[0153] Step S802b: Determine the language diversity indicator value corresponding to the multilingual generated text.
[0154] Among them, the language diversity indicator value can represent the language diversity of the corresponding text.
[0155] Specifically, the process of determining the language diversity indicator value corresponding to the multilingual generated text may include: calculating the average value of the representation vectors of the languages to which the target words in the multilingual generated text belong as the average language representation vector; and determining the language diversity indicator value corresponding to the multilingual generated text according to the number of target words in the multilingual generated text, the representation vectors of the languages to which the target words in the multilingual generated text belong, and the average language representation vector. The target words are words in the entries in the multilingual word list that participate in text generation.
[0156] More specifically, the language diversity indicator value L corresponding to the multilingual generated text can be calculated as follows: lang :
[0157]
[0158] Among them, M represents the number of target words in the multilingual generated text, Represents the representation vector of the language to which the mth target word in the multilingual generated text belongs, μ l Represents the average language representation vector. It should be noted that the larger the language diversity indicator value, the more languages are involved in text generation. Introducing the language diversity indicator value during training can prevent the multilingual text generation model from tending to generate monolingual sentences.
[0159] It should be noted that this embodiment is not limited to the calculation method shown in formula (6) for calculating the language diversity indicator value corresponding to the multilingual generated text, and other calculation methods can also be used. For example, the average value of the representation vector of the language to which the target words in the multilingual generated text belong can be calculated as the average language representation vector, and then the absolute value of the difference between the representation vector of the language to which each target word in the multilingual generated text belongs and the average language representation vector is calculated to obtain the absolute value of the difference corresponding to each target word in the multilingual generated text, and the average of all the absolute values of the difference is obtained, and the obtained average is used as the language diversity indicator value corresponding to the multilingual generated text.
[0160] Step S803: updating the parameters of the multilingual text generation model based on the probability that the multilingual generated text is the real text and the language diversity indicator value corresponding to the multilingual generated text.
[0161] Specifically, the prediction loss of the multilingual text generation model is determined according to the probability that the multilingual generated text is the real text and the language diversity indicator value corresponding to the multilingual generated text, and the parameters of the multilingual text generation model are updated according to the prediction loss of the multilingual text generation model.
[0162] More specifically, the prediction loss LG of the multilingual text generation model can be calculated as follows:
[0163]
[0164] Where y represents the multilingual text generated by the multilingual text generation model, D(G(y)) represents the probability that the multilingual text y is the real text, and L lang It is the language diversity indicator value corresponding to the multilingual text generated by the multilingual text generation model, λ is the hyperparameter of the balance loss term, Expressing expectation.
[0165] The multilingual text generation model is trained iteratively for multiple times according to the above process until the training end condition is met (for example, the preset number of training times is reached, or the performance of the multilingual text generation model meets the requirements). The model obtained after the training is completed is the established multilingual text generation model.
[0166] It should be noted that the generative network and the discriminative network as a multilingual text generation model can be trained separately. When training the discriminative network, the parameters of the generative network as a multilingual text generation model are fixed. When training the generative network as a multilingual text generation model, the parameters of the discriminative network are fixed. The above training process is the process of training the generative network as a multilingual text generation model by fixing the parameters of the discriminative network. Next, the process of training the discriminative network by fixing the parameters of the generative network as a multilingual text generation model is introduced.
[0167] See also Fig. 9 , showing a schematic diagram of the process of training a discriminant network, which may include:
[0168] Step S901: obtaining multilingual text generated by a generative network serving as a multilingual text generation model as multilingual generated text, and obtaining multilingual real text.
[0169] Among them, the multilingual real text is the multilingual text collected in the real scene.
[0170] Step S902: input the multilingual generated text and the multilingual real text into the discriminant network to obtain the probability that the multilingual generated text is the real text and the probability that the multilingual real text is the real text.
[0171] This application uses the idea of generative adversarial learning and a discriminant network to promote the generative network as a multilingual text generation model to generate text that is natural and in line with human habits. The input of the discriminant network is the multilingual text generated by the generative network as a multilingual text generation model and the multilingual text collected in real scenes. Optionally, the discriminant network can use a multilingual BERT combined with a bidirectional LSTM and a fully connected layer.
[0172] Step S903: Based on the probability that the multilingual generated text is the real text and the probability that the multilingual real text is the real text, the parameters of the discriminant network are updated.
[0173] Specifically, the prediction loss of the discriminant network is determined according to the probability that the multilingual generated text is the real text and the probability that the multilingual real text is the real text, and the parameters of the discriminant network are updated according to the prediction loss of the discriminant network.
[0174] More specifically, the prediction loss L of the discriminant network can be determined according to the following formula: D :
[0175]
[0176] Where x represents multilingual real text, y represents multilingual text generated by the multilingual text generation model, D(x) represents the probability that x is a real text, and D(G(y)) represents the probability that y is a real text. Expressing expectation.
[0177] The multilingual text generation model provided by this embodiment can generate multilingual text that is fluent and natural and conforms to human expression habits.
[0178] Fourth embodiment
[0179] The embodiment of the present application also provides a multilingual text generation device. The multilingual text generation device provided in the embodiment of the present application is described below. The multilingual text generation device described below and the multilingual text generation method described above can be referenced to each other.
[0180] See also Fig.10 , shows a schematic diagram of the structure of a multilingual text generation device provided in an embodiment of the present application, which may include: a multilingual word list acquisition module 1001 and a multilingual text generation module 1002.
[0181] A multilingual word list acquisition module 1001 is used to acquire a multilingual word list, wherein the multilingual word list includes a plurality of entries, each entry includes a word and language information of the word;
[0182] The multilingual text generation module 1002 is used to generate multilingual text based on the multilingual word list by using a pre-established multilingual text generation model, wherein the multilingual text generation model generates text with the goal of generating multilingual text that meets the characteristics of real multilingual text.
[0183] Optionally, the multilingual text generation model adopts a generation network in a generative adversarial network;
[0184] The training goal of the multilingual text generation model is to make the discriminant network in the adversarial generation network unable to distinguish whether the input multilingual text is the text generated by the generation network or the real text.
[0185] Optionally, the multilingual text generation module 1002 includes: a term sampling module and a text generation module.
[0186] A word sampling module, used for randomly sampling a number of words from the multilingual word list to form a target word list according to the language information in the multilingual word list;
[0187] The text generation module is used to generate multilingual text based on the target word list.
[0188] Optionally, when the text generation module generates the multilingual text based on the target word list, it is specifically used to:
[0189] Determine a feature vector of each term in the target word list and a feature vector of the target word list, wherein the feature vector of the target word list is a feature vector of all terms in the target word list as a whole; based on the feature vector of the target word list, determine a vector containing sentence grammar information as a global planning latent variable; based on the global planning latent variable, the feature vector of each term in the target word list and the feature vector of the target word list, generate a multilingual text.
[0190] Optionally, when the text generation module determines the vector containing the sentence grammar information based on the feature vector of the target word list as the global planning latent variable, it is specifically used to:
[0191] Based on the feature vector of the target word list, determine the normal distribution obeyed by the feature vector of the target word list; sample a number of values from the normal distribution to obtain the global planning latent variable.
[0192] Optionally, when the text generation module generates the multilingual text based on the global planned latent variables, the feature vector of each entry in the target word list, and the feature vector of the target word list, it is specifically used to:
[0193] Based on the global planning latent variables and the feature vector of each entry in the target word list, the entries participating in text generation are determined from the target word list as target entries; based on the feature vector of the target word list, the global planning latent variables and the feature vector of the target entry, a multilingual text is generated.
[0194] Optionally, the text generation module is specifically used to determine the entry participating in text generation from the target word list as the target entry based on the global plan latent variable and the feature vector of each entry in the target word list:
[0195] Based on the global planning latent variables and the feature vector of each entry in the target word list, the probability of each entry in the target word list participating in text generation is predicted; based on the probability of each entry in the target word list participating in text generation, the entry in the target word list participating in text generation is determined as the target entry.
[0196] Optionally, when the text generation module determines the entries in the target word list that participate in text generation based on the probability of each entry in the target word list participating in text generation, it is specifically used to:
[0197] If there are entries in the target word list whose probability of participating in text generation is greater than a preset probability threshold, the entries with the probability of participating in text generation greater than the preset probability threshold are determined as the entries participating in text generation; if there are no entries in the target word list whose probability of participating in text generation is greater than the preset probability threshold, the entry with the highest probability of participating in text generation is determined as the entry participating in text generation.
[0198] Optionally, when the text generation module generates the multilingual text based on the feature vector of the target word list, the global plan latent variable and the feature vector of the target term, it is specifically used to:
[0199] Calculate the mean of the feature vectors of all target terms; decode the mean of the feature vectors of all target terms, the feature vector of the target word list, and the global plan latent variable to obtain a multilingual text.
[0200] Optionally, when the text generation module decodes the mean of the feature vectors of all target terms, the feature vector of the target word list, and the global plan latent variable to obtain the multilingual text, it is specifically used to:
[0201] At each decoding moment, a text prediction vector at the current decoding moment is determined based on the mean of the feature vectors of all target terms, the feature vector of the target word list, the global plan latent variables, and the text prediction vector at the previous decoding moment; the probability that the word generated at the current decoding moment is each word in the multilingual dictionary is predicted based on the text prediction vector at the current decoding moment; and the word generated at the current decoding moment is determined based on the probability that the word generated at the current decoding moment is each word in the multilingual dictionary.
[0202] Optionally, the multilingual text generation device provided in the embodiment of the present application may further include: a model building module. The model building module includes: a multilingual generated text acquisition module, a text discrimination module, a language diversity indicator value determination module and a model parameter updating module.
[0203] A multilingual generated text acquisition module, used to generate multilingual text as the multilingual generated text based on the multilingual word list by using a generation network in the adversarial generation network as a multilingual text generation model;
[0204] A text discrimination module, used for inputting the multilingual generated text into the discrimination network in the adversarial generative network to obtain the probability that the multilingual generated text is a real text;
[0205] A language diversity indicator value determination module, used to determine a language diversity indicator value corresponding to the multilingual generated text, wherein the language diversity indicator value can represent the language diversity of the corresponding text;
[0206] The model parameter updating module is used to update the parameters of the multilingual text generation model based on the probability that the multilingual generated text is a real text and the language diversity indicator value corresponding to the multilingual generated text.
[0207] Optionally, when determining the language diversity indicator value corresponding to the multilingual generated text, the language diversity indicator value determination module is specifically configured to:
[0208] An average value of representation vectors of the languages to which target words in the multilingual generated text belong is calculated as an average language representation vector, wherein the target words are words in entries participating in text generation in the multilingual word table; and a language diversity indicator value corresponding to the multilingual generated text is determined according to the number of target words in the multilingual generated text, the representation vectors of the languages to which the target words in the multilingual generated text belong, and the average language representation vector.
[0209] The multilingual text generation device provided in the embodiment of the present application first obtains a multilingual word list, and then uses a pre-established multilingual text generation model to generate multilingual text based on the multilingual word list. The multilingual text generation device provided in the embodiment of the present application can automatically generate multilingual text. Since the multilingual text is generated using the multilingual text generation model, and the multilingual text generation model generates text with the goal of generating multilingual text that meets the characteristics of real multilingual text, the multilingual text generated using the multilingual text generation model meets the characteristics of real multilingual text, that is, it is fluent and natural and meets the expression habits of human beings.
[0210] Fifth embodiment
[0211] The present application also provides a multilingual text generation device. Fig.11 , shows a schematic diagram of the structure of the multilingual text generation device, the multilingual text generation device may include: at least one processor 1101, at least one communication interface 1102, at least one memory 1103 and at least one communication bus 1104;
[0212] In the embodiment of the present application, the number of the processor 1101, the communication interface 1102, the memory 1103, and the communication bus 1104 is at least one, and the processor 1101, the communication interface 1102, and the memory 1103 communicate with each other through the communication bus 1104;
[0213] The processor 1101 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention;
[0214] The memory 1103 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;
[0215] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to:
[0216] Acquire a multilingual word list, wherein the multilingual word list includes a plurality of entries, each entry includes a word and language information of the word;
[0217] A multilingual text generation model established in advance is used to generate multilingual text based on the multilingual word list, wherein the multilingual text generation model generates text with the goal of generating multilingual text that meets the characteristics of real multilingual text.
[0218] Optionally, the detailed functions and extended functions of the program may refer to the above description.
[0219] Sixth embodiment
[0220] The embodiment of the present application further provides a readable storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:
[0221] Acquire a multilingual word list, wherein the multilingual word list includes a plurality of entries, each entry includes a word and language information of the word;
[0222] A multilingual text generation model established in advance is used to generate multilingual text based on the multilingual word list, wherein the multilingual text generation model generates text with the goal of generating multilingual text that meets the characteristics of real multilingual text.
[0223] Optionally, the detailed functions and extended functions of the program may refer to the above description.
[0224] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0225] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0226] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for generating multilingual text, characterized in that: include: Acquire a multilingual word list, wherein the multilingual word list includes a plurality of entries, each entry includes a word and language information of the word; The words in the multilingual word list are words that frequently appear in texts in other languages; A multilingual text generation model established in advance is used to generate a multilingual text based on the multilingual word list, wherein the multilingual text is a text containing words in multiple languages; the multilingual text generation model generates text with the goal of generating a multilingual text that conforms to the characteristics of a real multilingual text, and the multilingual text generated by the multilingual text generation model with the goal of generating a multilingual text that conforms to the characteristics of a real multilingual text is fluent and natural and conforms to human expression habits; the multilingual text generation model adopts a generation network in an adversarial generation network; the training goal of the multilingual text generation model is to make it impossible for a discriminant network in the adversarial generation network to distinguish whether the input multilingual text is a text generated by the generation network or a real text.
2. The multilingual text generation method according to claim 1, characterized in that: The generating of multilingual text based on the multilingual word list includes: According to the language information in the multilingual word list, randomly sampling a number of entries from the multilingual word list to form a target word list; A multilingual text is generated based on the target word list.
3. The multilingual text generation method according to claim 2, characterized in that: The generating of multilingual text based on the target word list includes: Determine a feature vector of each entry in the target word list and a feature vector of the target word list, wherein the feature vector of the target word list is a feature vector of all entries in the target word list as a whole; Based on the feature vector of the target word list, determining a vector containing sentence grammar information as a global planning latent variable; A multilingual text is generated based on the global planning latent variables, the feature vector of each entry in the target word list, and the feature vector of the target word list.
4. The multilingual text generation method according to claim 3, characterized in that: The step of determining a vector containing sentence grammar information based on the feature vector of the target word list as a global planning latent variable includes: Based on the feature vector of the target word list, determining a normal distribution obeyed by the feature vector of the target word list; A number of values are sampled from the normal distribution to obtain the global planning latent variables.
5. The multilingual text generation method according to claim 3, characterized in that: The generating of multilingual text based on the global planning latent variables, the feature vector of each entry in the target word list, and the feature vector of the target word list comprises: Based on the global planning latent variables and the feature vector of each entry in the target word list, determining the entry participating in text generation from the target word list as the target entry; A multilingual text is generated based on the feature vector of the target word list, the global plan latent variable and the feature vector of the target term.
6. The multilingual text generation method according to claim 5, characterized in that: The step of determining, based on the global planned latent variables and the feature vector of each term in the target word list, terms participating in text generation from the target word list as target terms, comprises: Based on the global planning latent variables and the feature vector of each entry in the target word list, predict the probability of each entry in the target word list participating in text generation; Based on the probability of each term in the target word list participating in text generation, the term in the target word list participating in text generation is determined as the target term.
7. The multilingual text generation method according to claim 6, characterized in that: The step of determining the entries in the target word list that participate in text generation based on the probability of each entry in the target word list participating in text generation comprises: If there are entries in the target word list whose probability of participating in text generation is greater than a preset probability threshold, the entries whose probability of participating in text generation is greater than the preset probability threshold are determined as the entries participating in text generation; If there is no entry in the target word list whose probability of participating in text generation is greater than the preset probability threshold, the entry with the highest probability of participating in text generation is determined as the entry participating in text generation.
8. The multilingual text generation method according to claim 5, characterized in that: The step of generating a multilingual text based on the feature vector of the target word list, the global plan latent variable, and the feature vector of the target word entry includes: Calculate the mean of the feature vectors of all target terms; The mean of the feature vectors of all target terms, the feature vector of the target word list, and the global project latent variable are decoded to obtain multilingual text.
9. The multilingual text generation method according to claim 8, characterized in that: The decoding of the mean of the feature vectors of all target terms, the feature vector of the target word list, and the global plan latent variable to obtain the multilingual text includes: At each decoding moment, determining a text prediction vector at the current decoding moment according to the mean of the feature vectors of all target terms, the feature vector of the target word list, the global plan latent variable, and the text prediction vector at the previous decoding moment; Using the text prediction vector at the current decoding moment as a prediction basis, predict the probability that the word generated at the current decoding moment is each word in the multilingual dictionary; The word generated at the current decoding moment is determined according to the probability that the word generated at the current decoding moment is each word in the multilingual dictionary.
10. The multilingual text generation method according to claim 1, characterized in that: The process of establishing the multilingual text generation model includes: Using a generative network in a generative adversarial network as a multilingual text generation model, and generating multilingual text based on the multilingual word list as the multilingual generated text; Inputting the multilingual generated text into the discriminant network in the adversarial generative network to obtain the probability that the multilingual generated text is a true text; Determining a language diversity indicator value corresponding to the multilingual generated text, wherein the language diversity indicator value can represent the language diversity of the corresponding text; The parameters of the multilingual text generation model are updated based on the probability that the multilingual generated text is a real text and the language diversity indicator value corresponding to the multilingual generated text.
11. The multilingual text generation method according to claim 10, characterized in that: The determining of the language diversity indicator value corresponding to the multilingual generated text includes: Calculating an average value of representation vectors of the language to which a target word in the multilingual generated text belongs as an average language representation vector, wherein the target word is a word in an entry in the multilingual word table that participates in text generation; A language diversity indicator value corresponding to the multilingual generated text is determined according to the number of target words in the multilingual generated text, the representation vector of the language to which the target words in the multilingual generated text belong, and the average language representation vector.
12. A multilingual text generation device, characterized in that: include: Multilingual vocabulary acquisition module and multilingual text generation module; The multilingual word list acquisition module is used to acquire a multilingual word list, wherein the multilingual word list includes a plurality of entries, each entry includes a word and language information of the word; The words in the multilingual word list are words that frequently appear in texts in other languages; The multilingual text generation module is used to generate multilingual text based on the multilingual word list by using a pre-established multilingual text generation model, wherein the multilingual text is a text containing words in multiple languages; the multilingual text generation model generates text with the goal of generating multilingual text that meets the characteristics of real multilingual text, and the multilingual text generated by the multilingual text generation model with the goal of generating multilingual text that meets the characteristics of real multilingual text is fluent and natural and conforms to human expression habits; the multilingual text generation model adopts a generation network in an adversarial generation network; the training goal of the multilingual text generation model is to make it impossible for the discriminant network in the adversarial generation network to distinguish whether the input multilingual text is the text generated by the generation network or the real text.
13. A multilingual text generation device, characterized in that: include: Memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the multilingual text generation method according to any one of claims 1 to 11.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the multilingual text generation method according to any one of claims 1 to 11 is implemented.
