A method, device, medium and equipment for generating paraphrased text
Through unsupervised learning and context matching models, high-quality repost text is directly generated from the unmarked corpus, which solves the problem of dependence on labeled data in the existing technology and realizes efficient repost text generation.
Patent Information
- Application Number
- CN202111209549.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-18
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2041-10-18
AI Technical Summary
The existing text relay generation methods rely on a large amount of labeled data, and manually generating relay text is time-consuming and difficult to meet the needs of large-scale neural network models.
Unsupervised learning method is adopted, and context matching relationship learning is performed on the label-free corpus using language model tools, and a context matching model is generated. Candidate transfer text pairs are obtained through the context matching model, and high-quality candidate pairs are screened based on semantics and word differences, and finally a repost is formed. Text generation model.
High-quality repost text is generated without labeling data, which reduces dependence on labeling data, shortens the time to generate labeling data, and reduces the workload.
Smart Images

Figure CN114139515B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of language processing technology, and in particular to a method, device, storage medium and computer equipment for generating a paraphrase text. Background Art
[0002] Paraphrase Generation means that given a sentence, the model generates a sentence with the same semantics but different form. For example, "You are so beautiful" and "You look so beautiful" have basically the same meaning, but are different in expression (such as vocabulary and grammar).
[0003] Most existing text paraphrase generation methods use the "supervised learning" method to train the model, that is, to learn a paraphrase text generation model based on a large amount of labeled data. The paraphrase text generation model can learn the paraphrase rules contained in the labeled data for unlabeled paraphrase generation. However, this supervised learning method relies on a large number of labeled paraphrase text pairs, which is a big challenge for the amount of data, because manually generating paraphrased text is relatively time-consuming, especially when a large amount of labeled data is needed. For example, the currently popular labeled paraphrase text pair dataset Quora contains 140K sentence pairs, which still cannot meet the needs of training large-scale neural network models. Summary of the invention
[0004] The present invention provides a method, device, storage medium and computer equipment for generating a reported text, which can obtain high-quality reported text without any annotation data, thereby reducing the dependence on the annotation data, shortening the time required for generating the annotation data and reducing the workload.
[0005] In order to solve the above problem, a technical solution adopted by the present invention is to provide a method for generating a paraphrase text, the method comprising:
[0006] The language model tool is used to perform unsupervised learning on the context matching relationship of each sentence in the predetermined unlabeled corpus to obtain a context matching model;
[0007] Using a context matching model to obtain multiple contexts and multiple contexts of at least one given sentence, combining each given sentence, the contexts of each given sentence, or the contexts of each given sentence in pairs to obtain multiple candidate paraphrased text pairs corresponding to each given sentence, and then obtaining a set of candidate paraphrased text pairs for each given sentence;
[0008] According to the semantics and different words of the two texts of each candidate paraphrase text pair, low-quality candidate paraphrase text pairs in each candidate paraphrase text pair set are screened out to obtain a high-quality candidate paraphrase text pair set corresponding to each given sentence; and
[0009] The language model tool is used to perform unsupervised learning on the paraphrase rules of each candidate paraphrase text pair in each high-quality candidate paraphrase text pair set to obtain a paraphrase text generation model, and the paraphrase text generation model is further used to generate the paraphrase text.
[0010] Another technical solution adopted by the present invention is to provide a device for generating a paraphrase text, the device comprising:
[0011] A context matching model generation module, which is used to use a language model tool to perform unsupervised learning on the context matching relationship of each sentence in a predetermined unlabeled corpus to obtain a context matching model;
[0012] A candidate paraphrase text pair set generation module, which is used to obtain multiple preceding and following contexts of at least one given sentence by using a context matching model, and to combine each given sentence, the preceding contexts of each given sentence, or the following contexts of each given sentence in pairs to obtain multiple candidate paraphrase text pairs corresponding to each given sentence, and then obtain a candidate paraphrase text pair set for each given sentence;
[0013] A module for generating a set of high-quality candidate paraphrased text pairs, which is used to screen out low-quality candidate paraphrased text pairs in each set of candidate paraphrased text pairs based on the semantics and different words of the two texts of each candidate paraphrased text pair, and obtain a set of high-quality candidate paraphrased text pairs corresponding to each given sentence; and
[0014] The paraphrase text generation module is used to use the language model tool to perform unsupervised learning on the paraphrase rules of each candidate paraphrase text pair in each high-quality candidate paraphrase text pair set to obtain a paraphrase text generation model, and further use the paraphrase text generation model to generate paraphrase text.
[0015] In another technical solution of the present invention, a computer-readable storage medium is provided, which stores computer instructions, wherein the computer instructions are operated to execute the method for generating a paraphrase in the solution.
[0016] In another technical solution of the present invention, a computer device is provided, which includes a processor and a memory, wherein the memory stores computer instructions, wherein the processor operates the computer instructions to execute the method for generating a paraphrase in the solution.
[0017] The beneficial effects that can be achieved by the technical solution of the present invention are: the present invention proposes a method, device, storage medium and computer equipment for generating a paraphrase text, which can obtain high-quality paraphrase text without the need for annotated data, thereby reducing the dependence on annotated data, shortening the time required to generate annotated data, and reducing the workload. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] Figure 1 A schematic diagram of a specific implementation of a method for generating a paraphrase text according to the present invention;
[0020] Figure 2 A schematic diagram of a specific example of a method for generating a paraphrase text according to the present invention;
[0021] Figure 3 The figure is a schematic diagram of a specific implementation of a device for generating a paraphrase text according to the present invention.
[0022] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0023] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer and more definite definition of the protection scope of the present invention.
[0024] 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 "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0025] Figure 1 Shown is a schematic diagram of a specific implementation of a method for generating a reported text according to the present invention.
[0026] In this specific implementation, the method for generating a paraphrase text mainly includes:
[0027] Process S101: using a language model tool to perform unsupervised learning on the context matching relationship of each sentence in a predetermined unlabeled corpus to obtain a context matching model;
[0028] Process S102: using a context matching model to obtain multiple contexts and multiple contexts of at least one given sentence, combining each given sentence, the contexts of each given sentence, or the contexts of each given sentence in pairs to obtain multiple candidate paraphrased text pairs corresponding to each given sentence, and then obtaining a set of candidate paraphrased text pairs for each given sentence;
[0029] Process S103: based on the semantics and different words of the two texts of each candidate paraphrase text pair, low-quality candidate paraphrase text pairs in each candidate paraphrase text pair set are screened out to obtain a high-quality candidate paraphrase text pair set corresponding to each given sentence;
[0030] Process S104: using a language model tool to perform unsupervised learning on the paraphrase rules of each candidate paraphrase text pair in each high-quality candidate paraphrase text pair set to obtain a paraphrase text generation model, and further using the paraphrase text generation model to generate paraphrase text.
[0031] By using the method for generating a reported text proposed by the present invention, high-quality reported text can be obtained without any annotation data, thereby reducing the dependence on the annotation data, shortening the time required for generating the annotation data, and reducing the workload.
[0032] exist Figure 1 In the specific implementation shown, the method for generating a reported text of the present invention includes a process S101, using a language model tool to perform unsupervised learning on the context matching relationship of each sentence in a predetermined unannotated corpus to obtain a context matching model. This process predetermines the unannotated corpus, reduces the dependence on the annotated data, shortens the time required to generate the annotated data, reduces the workload, and obtains the context matching model in this process, so as to further obtain the context and context of the given sentence according to the context matching model, thereby further obtaining a candidate reported text pair.
[0033] Specifically, in practical applications, an unlabeled corpus can be input into a language model tool, and this language model tool performs unsupervised learning on the context matching relationship of each sentence in the unlabeled corpus to obtain a context matching model. The unsupervised learning here means that no data is labeled, so that it can output context and score. Among them, the language model tool and the learning process are both existing technologies and will not be described in detail. This process further obtains the context and context of a given sentence based on the context matching model, thereby further obtaining a candidate paraphrase text pair.
[0034] In a specific embodiment of the present invention, the unlabeled corpus includes unlabeled data crawled from the Internet. This process reduces the dependence on labeled data, and can train a context matching model based on the unlabeled corpus, so as to further obtain the context and context of a given sentence based on the context matching model, thereby further obtaining candidate paraphrased text pairs.
[0035] Specifically, a massive amount of unlabeled data can be directly crawled from the Internet to form an unlabeled corpus, such as crawling a massive amount of unlabeled data from encyclopedia knowledge, forums, news information, social media, etc. to form an unlabeled corpus. The unlabeled data here refers to unprocessed data.
[0036] exist Figure 1 In the specific implementation shown, the method for generating a reported text of the present invention includes process S102, using a context matching model to obtain multiple contexts and multiple contexts of at least one given sentence, combining each given sentence, the contexts of each given sentence, or the contexts of each given sentence in pairs to obtain multiple candidate reported text pairs corresponding to each given sentence, and then obtaining a candidate reported text pair set for each given sentence. This process is to further filter out low-quality candidate reported text pairs in the candidate reported text pair set, obtain high-quality candidate reported text pairs, and then obtain a high-quality candidate reported text pair set.
[0037] Specifically, referring to the present invention Figure 2 A schematic diagram of a specific example of a method for generating a reported text is provided. For example, a given sentence S is input into a context matching model, and the context matching model can perform diversified decoding to obtain multiple contexts and multiple contexts of S. The number of generated contexts and contexts can be set manually. The "diversified decoding" means that given a sentence, the context matching model can generate a lot of contexts for the sentence. Take "I love Beijing" as an example. From a human perspective, there can be many possibilities after or before "I love Beijing". The context matching model can generate "university" or "Old Summer Palace", etc. Therefore, "diversified decoding" is actually imitating the way humans write sentences, that is, a sentence can be followed by many other contexts, and a sentence can be preceded by many other contexts, and they all conform to our language habits. Reference Figure 2 , given sentence S is input into the context matching model, and the previous context S1, previous context S2, following context S3, and following context S4 are generated.
[0038] Since all generated contexts or preceding contexts are based on the given sentence S, they all inherit the semantics of the given sentence S, so they may be semantically similar. Of course, the generated contexts or preceding contexts may also be semantically similar to the given sentence S. For example, given "I love Beijing", the context matching model generates the context "Old Summer Palace", then a pair of "candidate paraphrased text pairs" can be formed. For another example, if the given sentence is "I love her very much, but", the context matching model may generate the contexts "She doesn't love me" and "She doesn't like me very much". Both of these contexts inherit the sentence "I love her very much, but", and both express the same meaning, so they can form two pairs of "candidate paraphrased text pairs".
[0039] Therefore, a given sentence S, a preceding text S1, a preceding text S2, a following text S3, and a following text S4 are combined in pairs to obtain a plurality of candidate paraphrased text pairs. For example, a given sentence S is combined with a preceding text S1 to obtain a candidate paraphrased text pair 1, a given sentence S is combined with a preceding text S2 to obtain a candidate paraphrased text pair 2, a given sentence S is combined with a following text S3 to obtain a candidate paraphrased text pair 3, a given sentence S is combined with a following text S4 to obtain a candidate paraphrased text pair 4, preceding text S1 is combined with preceding text S2 to obtain a candidate paraphrased text pair 5, preceding text S1 is combined with following text S3 to obtain a candidate paraphrased text pair 6, preceding text S1 is combined with following text S4 to obtain a candidate paraphrased text pair 7, preceding text S2 is combined with following text S3 to obtain a candidate paraphrased text pair 8, preceding text S2 is combined with following text S4 to obtain a candidate paraphrased text pair 9, and following text S3 is combined with following text S4 to obtain a candidate paraphrased text pair 10. The 10 candidate paraphrased text pairs are unioned to obtain a candidate paraphrased text pair set.
[0040] exist Figure 1 In the specific implementation shown, the method for generating a reported text of the present invention includes process S103, wherein low-quality candidate reported text pairs in each candidate reported text pair set are screened out according to the semantics and different words of the two texts of each candidate reported text pair, so as to obtain a high-quality candidate reported text pair set corresponding to each given sentence. This process is to further improve the reported accuracy of the reported text generation model and improve the reported quality.
[0041] In a specific embodiment of the present invention, the process of screening out low-quality candidate paraphrased text pairs in each candidate paraphrased text pair set according to the semantics and different words of the two texts of each candidate paraphrased text pair to obtain a high-quality candidate paraphrased text pair set corresponding to each given sentence includes: using a scoring function to score the matching score and the similarity score of the candidate paraphrased text pair according to the semantics of the two texts of the candidate paraphrased text pair, and scoring the diversity score of the candidate paraphrased text pair according to the number of different words in the two texts of the candidate paraphrased text pair; screening out low-quality candidate paraphrased text pairs in each candidate paraphrased text pair set according to the matching score, the similarity score and the diversity score to obtain a high-quality candidate paraphrased text pair set corresponding to each given sentence.
[0042] Among them, the matching score is the matching degree score between the candidate paraphrased text pair and its corresponding given sentence when the given sentence corresponding to the candidate paraphrased text pair is used as its context; the similarity score is the semantic similarity degree score of the two texts of the candidate paraphrased text pair; and the diversity score is the formal difference degree score of the two texts of the candidate paraphrased text pair.
[0043] Specifically, the matching score refers to the matching score between the candidate paraphrased text pair and the given sentence S corresponding to the candidate paraphrased text pair when the given sentence S corresponding to the candidate paraphrased text pair is used as its context. This score encourages both texts in the candidate paraphrased text pair to match the same context S. The higher the score, the higher the coherence between the candidate paraphrased text pair and the context. The scoring function calculation formula for the matching score is as follows:
[0044] S LM (s i ,s j )=p(s i |c)+p(s j |c)
[0045] In the formula, p(s i |c) represents the sentence s i The matching score in context c, p(s j |c) represents the sentence s j The matching score in context c, S LM (s i ,s j ) represents the candidate paraphrase text pair (s i ,s j ) in the same context c, where c is the given sentence S in the above example.
[0046] The similarity score refers to the semantic similarity score of the two texts in the candidate paraphrase text pair, which can also be understood as the coherence of the two texts. Two sentences with similar semantics have stronger coherence, while two completely unrelated sentences have poor coherence. Therefore, if the coherence of two sentences is stronger, the possibility that they are semantically similar is greater. The scoring function calculation formula for the similarity score is as follows:
[0047] S Mutual (s i ,s j )=p(s i |s j )+p(s j |s i )
[0048] In the formula, p(s i |s j ) represents the sentence s i With the sentence s j The similarity between them, p(s j |s i ) also represents the sentence s i With sentence s j The similarity between them is only related to p(s i |s j ) in different directions.
[0049] The diversity score refers to the score of the degree of formal difference between the two texts of the candidate paraphrase text pair, which encourages greater formal differences between sentence pairs. The scoring function calculation formula for the diversity score is as follows:
[0050]
[0051] In the formula, |s i ∩s j | indicates the sentence s i With the sentence s j The number of identical words in |s i ∪s j | indicates the sentence s i With sentence s j The number of different words in .
[0052] In practical applications, a matching threshold can be set for the matching score, a similarity threshold can be set for the similarity score, and a diversity score threshold can be set for the diversity score. Since the matching score and the similarity score are related to semantics, and the diversity score is related to the number of different words, if the accuracy is not considered, at least one of the three scores can be selected as a criterion for screening out low-quality candidate paraphrased text pairs. For example, the matching score and the diversity score are selected as the evaluation criteria. When the matching score of the candidate paraphrased text pair is less than the matching threshold, and the diversity score of the candidate paraphrased text pair is less than the diversity threshold, the candidate paraphrased text pair is considered to be a low-quality candidate paraphrased text pair and is screened out to obtain a high-quality candidate paraphrased text pair set corresponding to the given sentence.
[0053] In a specific embodiment of the present invention, the process of screening out low-quality candidate paraphrased text pairs in each candidate paraphrased text pair set according to the matching score, the similarity score and the diversity score includes calculating the sum of the matching score, the similarity score and the diversity score to obtain the sentence pair score of the candidate paraphrased text pair; if the sentence pair score is less than a preset score threshold, the candidate paraphrased text pair is screened out to obtain a high-quality candidate paraphrased text pair set corresponding to each given sentence.
[0054] Preferably, in order to maximize the accuracy of paraphrasing, the above three scores are used as criteria for screening out low-quality candidate paraphrased text pairs. In a specific example of the present invention, the sum of the matching score, the similarity score and the diversity score is calculated to obtain the sentence pair score of the candidate paraphrased text pair, and a score threshold is set in advance. If the sentence pair score is less than the preset score threshold, the candidate paraphrased text pair is screened out to obtain a set of high-quality candidate paraphrased text pairs corresponding to the given sentence.
[0055] exist Figure 1 In the specific implementation shown, the method for generating a reported text of the present invention includes process S104, using a language model tool to perform unsupervised learning on the reported text rules of each candidate reported text pair in each high-quality candidate reported text pair set to obtain a reported text generation model, and further using the reported text generation model to generate reported text. This process is convenient for generating high-quality reported text using the trained reported text generation model.
[0056] In a specific embodiment of the present invention, after obtaining the above-mentioned high-quality candidate paraphrased text pair set, a language model tool is used to learn the paraphrasing rules of each text pair in the high-quality candidate paraphrased text pair set and the annotated paraphrased text pair set to obtain a paraphrased text generation model, and the paraphrased text generation model is further used to generate paraphrased text. This process fully combines the advantages of supervised learning and unsupervised learning, so that the paraphrased text generation model can still guarantee the output of high-quality paraphrased text in certain specific fields.
[0057] Specifically, since the reported text generation model of the present invention is trained completely in an unsupervised manner, it may not cover all types of input texts, such as texts in certain specific fields. Therefore, a small amount of annotated data can be further used to train the reported text generation model, so that it can better perceive and learn the laws of reported text generation in specific fields, and fully combine the advantages of supervised learning and unsupervised learning.
[0058] Figure 3 Shown is a schematic diagram of a specific implementation of a paraphrase text generation device of the present invention.
[0059] In this specific implementation, the paraphrase text generation device mainly includes:
[0060] Module 301: A context matching model generation module, which is used to use a language model tool to perform unsupervised learning on the context matching relationship of each sentence in a predetermined unannotated corpus to obtain a context matching model. This module predetermines the unannotated corpus, reduces the reliance on annotated data, shortens the time required to generate annotated data, reduces the workload, and obtains a context matching model in this process, so as to further obtain the context and context of a given sentence according to the context matching model, thereby further obtaining a candidate paraphrase text pair.
[0061] Module 302: A candidate paraphrased text pair set generation module, which is used to obtain multiple contexts and multiple contexts of at least one given sentence using a context matching model, and to combine each given sentence, the contexts of each given sentence, or the contexts of each given sentence in pairs to obtain multiple candidate paraphrased text pairs corresponding to each given sentence, and then obtain a candidate paraphrased text pair set for each given sentence. This module is used to further filter out low-quality candidate paraphrased text pairs in the candidate paraphrased text pair set, obtain high-quality candidate paraphrased text pairs, and then obtain a high-quality candidate paraphrased text pair set.
[0062] Module 303: A module for generating a set of high-quality candidate paraphrased text pairs, which is used to screen out low-quality candidate paraphrased text pairs in each candidate paraphrased text pair set based on the semantics and different words of the two texts of each candidate paraphrased text pair, and obtain a set of high-quality candidate paraphrased text pairs corresponding to each given sentence. This module is used to further improve the paraphrasing accuracy of the paraphrased text generation model and improve the paraphrasing quality.
[0063] Module 304: a reported text generation module, which is used to use a language model tool to perform unsupervised learning on the reported text rules of each candidate reported text pair in each high-quality candidate reported text pair set to obtain a reported text generation model, and further use the reported text generation model to generate reported text. This module is used to generate high-quality reported text using the trained reported text generation model.
[0064] In a specific embodiment of the present invention, the unlabeled corpus in the module 301 includes unlabeled data crawled from the Internet. This process reduces the dependence on labeled data, and can train a context matching model based on the unlabeled corpus, so as to further obtain the context and context of a given sentence based on the context matching model, thereby further obtaining candidate paraphrased text pairs.
[0065] In a specific embodiment of the present invention, the module 304 can also be used to learn the paraphrase rules of each high-quality candidate paraphrase text pair set and each text pair in the annotated paraphrase text pair set using a language model tool to obtain a paraphrase text generation model, and further use the paraphrase text generation model to generate paraphrase text. This module fully combines the advantages of supervised learning and unsupervised learning, so that the paraphrase text generation model can still guarantee the output of high-quality paraphrase text in certain specific fields.
[0066] By using the device for generating a paraphrased text of the present invention, high-quality paraphrased text can be obtained without any annotation data, thereby reducing the dependence on the annotation data, shortening the time required for generating the annotation data, and reducing the workload.
[0067] The device for generating a reported text provided by the present invention can be used to execute the method for generating a reported text described in any of the above embodiments. The implementation principle and technical effect thereof are similar and will not be described in detail herein.
[0068] In another specific embodiment of the present invention, a computer-readable storage medium stores computer instructions, wherein the computer instructions are operated to execute the method for generating a paraphrase text described in any embodiment. The storage medium may be directly in hardware, in a software module executed by a processor, or in a combination of the two.
[0069] The software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable disk, CD-ROM or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from and write information to the storage medium.
[0070] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, discrete gates or transistor logic, discrete hardware components, or any combination thereof. A general-purpose processor may be a microprocessor, but in an alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration. In an alternative, the storage medium may be integrated with the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In an alternative, the processor and the storage medium may reside in a user terminal as discrete components.
[0071] In a specific embodiment of the present application, a computer device includes a processor and a memory, wherein the memory stores computer instructions, wherein the processor operates the computer instructions to execute the method for generating a paraphrase text described in any embodiment.
[0072] In the embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0073] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0074] The above are merely embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structural transformations made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for generating a paraphrase text, characterized in that: include, The language model tool is used to perform unsupervised learning on the context matching relationship of each sentence in the predetermined unlabeled corpus to obtain a context matching model; Using the context matching model to obtain multiple contexts and multiple contexts of at least one given sentence, and combining each of the given sentences, each of the contexts of the given sentences, or each of the contexts of the given sentences in pairs to obtain multiple candidate paraphrased text pairs corresponding to each of the given sentences, thereby obtaining a set of candidate paraphrased text pairs for each of the given sentences; According to the semantics and different words of the two texts of each candidate paraphrase text pair, the low-quality candidate paraphrase text pairs in each candidate paraphrase text pair set are screened out to obtain a high-quality candidate paraphrase text pair set corresponding to each given sentence, including: Using a scoring function, scoring the matching score and the similarity score of the candidate paraphrased text pair according to the semantics of the two texts of the candidate paraphrased text pair, and scoring the diversity score of the candidate paraphrased text pair according to the number of different words in the two texts of the candidate paraphrased text pair, The low-quality candidate paraphrase text pairs in each candidate paraphrase text pair set are screened out according to the matching score, the similarity score, and the diversity score to obtain a high-quality candidate paraphrase text pair set corresponding to each given sentence, The matching score is a score of the matching degree between the candidate paraphrased text pair and the given sentence corresponding to the candidate paraphrased text pair when the given sentence corresponding to the candidate paraphrased text pair is used as its context; the similarity score is a score of the semantic similarity degree between the two texts of the candidate paraphrased text pair; the diversity score is a score of the formal difference degree between the two texts of the candidate paraphrased text pair; and, The language model tool is used to perform unsupervised learning on the paraphrase rules of each candidate paraphrase text pair in each set of high-quality candidate paraphrase text pairs to obtain a paraphrase text generation model, and the paraphrase text generation model is further used to generate the paraphrase text.
2. The method for generating a paraphrase text according to claim 1, wherein: After obtaining the high-quality candidate paraphrase text pair set, The language model tool is used to learn the paraphrase rules of each text pair in the high-quality candidate paraphrase text pair set and the annotated paraphrase text pair set to obtain the paraphrase text generation model, and the paraphrase text generation model is further used to generate the paraphrase text.
3. The method for generating a paraphrase text according to claim 1, wherein: The process of screening out low-quality candidate paraphrased text pairs in each candidate paraphrased text pair set according to the matching score, the similarity score and the diversity score comprises: The sum of the matching score, the similarity score and the diversity score is calculated to obtain a sentence pair score of the candidate reported text pair; if the sentence pair score is less than a preset score threshold, the candidate reported text pair is screened out to obtain a set of high-quality candidate reported text pairs corresponding to each given sentence.
4. The method for generating a paraphrase text according to claim 1, wherein: The unlabeled corpus includes unlabeled data crawled from the Internet.
5. A device for generating a paraphrase text, characterized in that: include, A context matching model generation module, which is used to use a language model tool to perform unsupervised learning on the context matching relationship of each sentence in a predetermined unlabeled corpus to obtain a context matching model; A candidate paraphrase text pair set generation module, which is used to obtain multiple preceding and following contexts of at least one given sentence by using the context matching model, and to combine each of the given sentences, each preceding context of the given sentence, or each following context of the given sentence in pairs to obtain multiple candidate paraphrase text pairs corresponding to each of the given sentences, and then obtain a candidate paraphrase text pair set for each of the given sentences; A module for generating a high-quality candidate paraphrased text pair set is used to screen out low-quality candidate paraphrased text pairs in each candidate paraphrased text pair set according to the semantics and different words of the two texts of each candidate paraphrased text pair, so as to obtain a high-quality candidate paraphrased text pair set corresponding to each given sentence, comprising: Using a scoring function, scoring the matching score and the similarity score of the candidate paraphrased text pair according to the semantics of the two texts of the candidate paraphrased text pair, and scoring the diversity score of the candidate paraphrased text pair according to the number of different words in the two texts of the candidate paraphrased text pair, The low-quality candidate paraphrase text pairs in each candidate paraphrase text pair set are screened out according to the matching score, the similarity score, and the diversity score to obtain a high-quality candidate paraphrase text pair set corresponding to each given sentence, The matching score is a score of the matching degree between the candidate paraphrased text pair and the given sentence corresponding to the candidate paraphrased text pair when the given sentence corresponding to the candidate paraphrased text pair is used as its context; the similarity score is a score of the semantic similarity degree between the two texts of the candidate paraphrased text pair; the diversity score is a score of the formal difference degree between the two texts of the candidate paraphrased text pair; and, A reported text generation module is used to use the language model tool to perform unsupervised learning on the reported text rules of each candidate reported text pair in each set of high-quality candidate reported text pairs to obtain a reported text generation model, and further use the reported text generation model to generate the reported text.
6. The device for generating a paraphrase text according to claim 5, wherein: The reported text generation module is used to use the language model tool to learn the reported text rules of each text pair in the high-quality candidate reported text pair set and the annotated reported text pair set to obtain the reported text generation model, and further use the reported text generation model to generate the reported text.
7. A computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are operated to execute the paraphrase text generation method according to any one of claims 1 to 4.
8. A computer device comprising a processor and a memory, wherein the memory stores computer instructions, wherein: The processor operates the computer instructions to execute the method for generating a paraphrase according to any one of claims 1 to 4.
Citation Information
Patent Citations
Method for automatically generating text and related apparatus
CN108664465A
Entity relationship extraction method and system in text, storage medium, and electronic device
CN109472033A
Customer intention identification method and device and customer service system
CN110266900A
Chinese word segmentation method, training equipment and computer readable storage medium
CN111666758A
