Artificial intelligence-based text augmentation methods, devices, equipment, and storage media

By extracting keyword tuples from the text to be expanded and processing them to generate targeted text, the problem of unpredictable text expansion is solved, the controllability and semantic similarity of text generation are achieved, and the training effect of deep learning models is improved.

CN114385791BActive Publication Date: 2025-12-02PING AN TECH (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210040654.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-14
Publication Date
2025-12-02
Estimated Expiration
2042-01-14

AI Technical Summary

Technical Problem

Existing text augmentation methods generate unpredictable text, leading to poor training results and decreased accuracy for deep learning models.

Method used

The initial keyword tuples are extracted from the text to be expanded, and multiple target keyword tuples are generated using preset rules. These tuples are then input into a text generation model to generate targeted text. Semantic similarity is calculated, and texts below a threshold are removed.

Benefits of technology

It enables control over the expanded text, ensuring that the generated targeted text is semantically similar to the text to be expanded, thus avoiding arbitrary generation and improving the accuracy of model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114385791B_ABST
    Figure CN114385791B_ABST
Patent Text Reader

Abstract

This invention discloses a text augmentation method, apparatus, device, and storage medium based on artificial intelligence. The method includes: extracting an initial keyword tuple from a pre-acquired text to be augmented; processing the initial keyword tuple based on preset rules to obtain multiple target keyword tuples that differ from the initial keyword tuple; inputting the multiple target keyword tuples into a pre-trained text generation model to generate multiple targeted texts, the text generation model being trained based on historical text data; calculating the semantic similarity between each targeted text and the text to be augmented; and removing targeted texts with semantic similarity below a preset similarity threshold. This invention achieves orderly and targeted text augmentation by extracting an initial keyword tuple from the text to be augmented, processing the initial keyword tuple to obtain multiple target keyword tuples, and then using the target keyword tuples to generate targeted text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of AI-based text augmentation, and in particular to an AI-based text augmentation method, apparatus, device, and storage medium. Background Technology

[0002] With the rapid development of smart terminals and network technologies, people are increasingly accustomed to using smart terminals to fulfill various needs. In human-computer interaction scenarios, semantic parsing is an essential step. It primarily involves analyzing the user's voice input to understand their intent and converting it into a structured data format that machines can understand. Deep learning models are frequently used in the semantic parsing process.

[0003] To ensure the accuracy of semantic understanding, modern deep learning models often require a large amount of labeled data for training to accurately capture text semantics. However, the labeling process for training samples consumes significant human and resource resources. Currently, a feasible approach is to use autoregressive models to automatically generate a large amount of training text. However, the content of the text generated in this way is unpredictable. Training a deep learning model with this unpredictable text may lead to poor training results and ultimately a decrease in the model's accuracy. Summary of the Invention

[0004] This application provides a text augmentation method, apparatus, device, and storage medium based on artificial intelligence to solve the problem that the text augmented by existing text augmentation methods is unpredictable.

[0005] To address the aforementioned technical problems, this application provides a text augmentation method based on artificial intelligence, comprising: extracting an initial keyword tuple from a pre-acquired text to be augmented; processing the initial keyword tuple based on preset rules to obtain multiple target keyword tuples that differ from the initial keyword tuple; inputting the multiple target keyword tuples into a pre-trained text generation model to generate multiple targeted texts, the text generation model being trained based on historical text data; calculating the semantic similarity between each targeted text and the text to be augmented; and removing targeted texts with semantic similarity lower than a preset similarity threshold.

[0006] As a further improvement of the present invention, the steps of pre-training the text generation model include: obtaining training sample text and the initial training keyword tuple corresponding to the training sample text; processing the initial training keyword tuple based on preset rules to obtain multiple target training keyword tuples that are different from the initial training keyword tuple; inputting the multiple target training keyword tuples into the text generation model to be trained to generate multiple training oriented texts; and updating the text generation model through backpropagation based on the multiple training oriented texts, the training sample text, and a preset loss function.

[0007] As a further improvement of the present invention, the initial keyword tuple is processed based on preset rules to obtain multiple target keyword tuples that are different from the initial keyword tuple, including: performing random number of synonym replacements and / or random number deletions and / or random shuffling of the order of keywords in the initial keyword tuple to obtain multiple target keyword tuples.

[0008] As a further improvement of the present invention, the initial keyword tuple is extracted from the pre-acquired text to be expanded, including: using a pre-built word segmenter to segment the text to be expanded to obtain multiple candidate words and the attributes of each candidate word; according to the attributes, using a preset scoring algorithm to score the multiple candidate words respectively to obtain the scoring results; sorting the multiple candidate words in descending order according to the scoring results, and selecting the top preset number of candidate words to construct the initial keyword tuple.

[0009] As a further improvement of the present invention, the initial keyword tuple is extracted from the pre-acquired text to be expanded, including: using a pre-built word segmenter to segment the text to be expanded to obtain multiple candidate words; using a pre-built relational lexicon to filter relational words among the multiple candidate words, and using the remaining candidate words to construct the initial keyword tuple.

[0010] As a further improvement of the present invention, after extracting the initial keyword tuple from the pre-acquired text to be expanded, the method further includes: when the number of keywords in the initial keyword tuple is lower than a preset number threshold, querying the extended keywords of each keyword in the initial keyword tuple from a preset extended keyword knowledge base; and adding the extended keywords to the initial keyword tuple.

[0011] As a further improvement of the present invention, before adding the extended keywords to the initial keyword tuple, the method further includes: inputting the extended keywords and the keywords in the initial keyword tuple into a text generation model to obtain extended text; calculating the semantic similarity between the extended text and the text to be expanded; determining whether the semantic similarity is higher than a preset similarity threshold; if so, allowing the step of adding the extended keywords to the initial keyword tuple to be executed.

[0012] To address the aforementioned technical problems, another technical solution adopted in this application is: providing an artificial intelligence-based text expansion device, comprising: an extraction module for extracting initial keyword tuples from pre-acquired text to be expanded; a processing module for processing the initial keyword tuples according to preset rules to obtain multiple target keyword tuples that differ from the initial keyword tuples; a generation module for inputting the multiple target keyword tuples into a pre-trained text generation model to generate multiple directional texts, wherein the text generation model is trained based on historical text data; a calculation module for calculating the semantic similarity between each directional text and the text to be expanded; and a removal module for removing directional texts with semantic similarity lower than a preset similarity threshold.

[0013] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide a computer device, the computer device including a processor and a memory coupled to the processor, the memory storing program instructions, when the program instructions are executed by the processor, causing the processor to perform the steps of any of the above-mentioned artificial intelligence-based text expansion methods.

[0014] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a storage medium storing program instructions capable of implementing the above-mentioned artificial intelligence-based text expansion method.

[0015] The beneficial effects of this application are as follows: The AI-based text augmentation method of this application extracts initial keyword tuples composed of keywords from the text to be augmented, processes these initial keyword tuples according to preset rules to obtain multiple target keyword tuples, and then uses these multiple target keyword tuples to generate multiple augmented targeted texts. Because there are differences between the target keyword tuples and the initial keyword tuples, the targeted texts generated based on the target keyword tuples will not be completely identical to the text to be augmented. There are still many common keywords between the target keyword tuples and the initial keyword tuples, making the semantics of the generated targeted texts and the text to be augmented relatively similar. Furthermore, the targeted texts are filtered based on the similarity between the texts, deleting targeted texts with large semantic deviations, thereby achieving control over the augmented text rather than generating text arbitrarily. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating the artificial intelligence-based text augmentation method according to the first embodiment of the present invention.

[0017] Figure 2 This is a flowchart illustrating the artificial intelligence-based text augmentation method according to the second embodiment of the present invention.

[0018] Figure 3This is a schematic diagram of the functional modules of the text expansion device based on artificial intelligence according to an embodiment of the present invention;

[0019] Figure 4 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention;

[0020] Figure 5 This is a schematic diagram of the structure of the storage medium according to an embodiment of the present invention. Detailed Implementation

[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0022] The terms "first," "second," and "third" in this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. All directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of this application are only used to explain the relative positional relationships and movements between components in a specific orientation (as shown in the figures). If the specific orientation changes, the directional indications also change accordingly. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0023] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0024] Figure 1 This is a flowchart illustrating the AI-based text augmentation method according to the first embodiment of the present invention. It should be noted that if substantially the same result is achieved, the method of the present invention is not necessarily identical. Figure 1The illustrated process sequence is limited. For example... Figure 1 As shown, the method includes the following steps:

[0025] Step S101: Extract the initial keyword tuple from the pre-acquired text to be expanded.

[0026] It is important to understand that keywords are words that can express the central content of a document. They can largely reflect the semantics of a text. Therefore, in this embodiment, in order to achieve targeted expansion of the text to be expanded, the keyword tuples extracted from the text to be expanded can be processed so that the processed keyword tuples can generate targeted text that is not exactly the same as the text to be expanded. Because there is a large overlap in keywords, the semantics of the final generated text are relatively close, thereby achieving targeted control.

[0027] Specifically, in step S101, before expanding the text to be expanded, all keywords need to be extracted from the text to be expanded, and then all keywords are combined into an initial keyword tuple. When expanding the sample text used to train the deep learning model, the text to be expanded is a pre-labeled training sample.

[0028] In this embodiment, to reduce the cost of manually annotating the training set, an unsupervised keyword extraction method is used. Unsupervised methods do not require manual annotation of the training set; they extract keywords by identifying important words in the text, making it faster. Compared to supervised keyword extraction methods, it eliminates the cost of manual annotation. Therefore, in some embodiments, step S101 specifically includes:

[0029] 1. Use a pre-built word segmenter to segment the text to be expanded, and obtain multiple candidate words and the attributes of each candidate word.

[0030] Specifically, after obtaining the text to be expanded by the user, the text can be segmented using NLP algorithms or feature template extraction algorithms to obtain multiple candidate words and their attributes. It is important to understand that the words extracted from the text include both necessary and unnecessary keywords. Unnecessary keywords do not possess specific semantic meaning in the text; their function may be to ensure text coherence. These keywords do not need to participate in the keyword processing of this application. Therefore, in this embodiment, when extracting keywords, all keywords are first considered as candidate words.

[0031] 2. Based on the attributes, use a preset scoring algorithm to score multiple candidate words separately to obtain the scoring results.

[0032] It should be noted that the preset scoring algorithm includes one of the following: TD-IDF, TextRank, and LDA. TD-IDF is a keyword extraction algorithm based on statistical features, which extracts keywords from a document by utilizing statistical information about the words in the document. TextRank is a keyword extraction algorithm based on a word graph model, which first constructs a language network graph of the document, then analyzes the language network graph to find words or phrases that play an important role; these phrases are the document's keywords. LDA is a keyword extraction algorithm based on a topic model, which mainly utilizes the properties of topic distribution in topic models to extract keywords.

[0033] 3. Sort multiple candidate words in descending order based on the scoring results, and select the top-ranked candidate words to construct an initial keyword tuple.

[0034] Specifically, after obtaining the scores of all candidate words, all candidate words are sorted in descending order of scores from high to low. Then, a predetermined number of candidate words are selected from the top-ranked ones as the final keywords, and these keywords are used to construct the initial keyword tuple.

[0035] Furthermore, in some embodiments, step S101 further includes:

[0036] 1. Use a pre-built word segmenter to segment the text to be expanded to obtain multiple candidate words.

[0037] 2. Filter the relation words among multiple candidate words using a pre-built relation word library, and construct the initial keyword tuple using the remaining candidate words.

[0038] Specifically, a text mainly includes keywords and relation words that string keywords together into sentences, such as words like "is", "of", and "one". These relation words do not have specific semantics. In order to reduce the impact of relation words on text expansion, in this embodiment, after obtaining multiple candidate words, a pre-built relation word library is used to filter the multiple candidate words, thereby filtering out relation words in the multiple candidate words.

[0039] Step S102: Process the initial keyword tuple based on preset rules to obtain multiple target keyword tuples that are different from the initial keyword tuple.

[0040] It's important to understand that text generation models generate text based on keywords; therefore, different keywords will result in different generated text. In this embodiment, after obtaining the initial keyword tuple for the text to be expanded, the keywords in this initial keyword tuple are processed according to preset rules to obtain multiple target keyword tuples that differ from the initial keyword tuple. Each processing step generates one target keyword tuple; therefore, multiple processing steps can generate multiple target keyword tuples.

[0041] Furthermore, in some embodiments, the preset rule can be to perform synonym replacement on keywords. Because the semantic similarity between synonyms is extremely high, after synonym replacement, the semantic similarity between the text generated from the keyword tuples after synonym replacement and the text to be expanded is also extremely high. Therefore, the specific steps of processing the initial keyword tuples based on the preset rule to obtain multiple target keyword tuples that are different from the initial keyword tuples include:

[0042] Replace the keywords in the initial keyword tuple with a random number of synonyms to obtain multiple target keyword tuples.

[0043] For example, taking the text to be expanded, "Shenzhen is a prosperous city in the south," as an example, the initial keyword tuple extracted is [Shenzhen, south, prosperous, city]. "Prosperous" can be replaced with the synonym "flourishing," resulting in the target keyword tuple [Shenzhen, south, prosperous, city]. Further replacing the keyword "south" with "south side" yields two target keyword tuples: [Shenzhen, south side, prosperous, city] and [Shenzhen, south side, prosperous, city]. Through this synonym replacement method, multiple target keyword tuples can be obtained.

[0044] Furthermore, in some embodiments, the preset rule can be to reduce keywords. Therefore, the step of processing the initial keyword tuple based on the preset rule to obtain multiple target keyword tuples that differ from the initial keyword tuple specifically includes:

[0045] Randomly remove a number of keywords from the initial keyword tuple to obtain multiple target keyword tuples.

[0046] For example, taking the text to be expanded, "Shenzhen is a prosperous city in the south," as an example, the initial keyword tuple is [Shenzhen, south, prosperous, city]. Deleting the keyword "south" gives the target keyword tuple [Shenzhen, prosperous, city]. Deleting the keyword "prosperous" gives the target keyword tuple [Shenzhen, south, city].

[0047] Furthermore, in some embodiments, the preset rule can be to shuffle the order of keywords. Therefore, the step of processing the initial keyword tuple based on the preset rule to obtain multiple target keyword tuples that differ from the initial keyword tuple specifically includes:

[0048] The order of keywords in the initial keyword tuple is randomly shuffled to obtain multiple target keyword tuples.

[0049] It is important to understand that in this embodiment, when extracting the initial keyword tuple from the text to be expanded, the keywords are extracted into the initial keyword tuple in order of their position in the text. For example, taking the text to be expanded, "Shenzhen is a prosperous city in the south," as an example, the extracted initial keyword tuple is [Shenzhen, South, Prosperous, City], and the order of the keywords is "Shenzhen - South - Prosperous - City". Then, the order of the keywords is shuffled, for example, "Shenzhen" and "City" are swapped, and the target keyword tuple [City, South, Prosperous, Shenzhen] is obtained.

[0050] Furthermore, in some embodiments, the keywords are replaced with synonyms, keywords are deleted, and the order of keywords is shuffled. These three methods of processing keywords can be implemented individually or in combination. Both individual and combined implementations can yield the target keyword tuple. This invention does not limit the process of implementing them individually or in combination.

[0051] It should be understood that, in the above embodiments, the replacement, deletion, or scrambling of keywords is one way of processing keywords given in this embodiment. Other keyword processing methods that can significantly change the semantics of the text to be expanded are all within the protection scope of this invention.

[0052] Step S103: Input multiple target keyword tuples into a pre-trained text generation model to generate multiple targeted texts. The text generation model is trained based on historical text data.

[0053] In step S103, it should be noted that the text generation model is pre-trained. After obtaining multiple target keyword tuples, the target keyword tuples are input into the text generation model. For each target keyword tuple input, the text generation model generates a targeted text based on the target keyword tuple. For example, when the target keyword tuple is [Shenzhen, South, Prosperity, City], the generated targeted text is "Shenzhen is a prosperous city in the South". When the target keyword tuple is [Shenzhen, South, City], the generated targeted text is "Shenzhen is a city in the South".

[0054] Furthermore, the text generation model is pre-trained, and the steps for pre-training the text generation model include:

[0055] 1. Obtain the training sample text and the corresponding initial training keyword tuple.

[0056] 2. Process the initial training keyword tuples based on preset rules to obtain multiple target training keyword tuples that differ from the initial training keyword tuples.

[0057] Specifically, the preset rules can include replacing keywords with synonyms, deleting keywords, or shuffling the order of keywords.

[0058] 3. Input multiple target training keyword tuples into the text generation model to be trained to generate multiple training targeted texts.

[0059] 4. Update the text generation model through backpropagation based on multiple training targeted texts, training sample texts, and a preset loss function.

[0060] For example, the target keyword tuple can be [Shenzhen, South, Prosperous, City], [Shenzhen, South, City], [City, South, Prosperous, Shenzhen], and the training sample text is "Shenzhen is a prosperous city in the South". The distribution of [Shenzhen, South, Prosperous, City], [Shenzhen, South, City], and [City, South, Prosperous, Shenzhen] is input into the text generation model to be trained, and corresponding training targeted texts are generated respectively. Then, the training targeted text and the training sample text "Shenzhen is a prosperous city in the South" are combined with a preset loss function for backpropagation to update the text generation model.

[0061] Step S104: Calculate the semantic similarity between each targeted text and the text to be expanded.

[0062] In step S104, after obtaining the directional text, the distribution converts both the directional text and the text to be expanded into vector representations, and then calculates the cosine distance between the two vector representations. Based on the cosine distance, the semantic similarity between the directional text and the text to be expanded is confirmed.

[0063] Step S105: Remove targeted texts with semantic similarity lower than the preset similarity threshold.

[0064] In step S105, after calculating the semantic similarity, targeted text with a semantic similarity lower than a preset similarity threshold is removed. The preset similarity threshold is set in advance. By deleting targeted text with a semantic similarity lower than the preset similarity threshold, text with significant ambiguity to the text to be expanded is avoided, thus ensuring the controllability of text generation.

[0065] The first embodiment of the present invention provides an AI-based text augmentation method that extracts initial keyword tuples from the text to be augmented, processes these initial keyword tuples according to preset rules to obtain multiple target keyword tuples, and then uses these target keyword tuples to generate multiple augmented targeted texts. Because there are differences between the target keyword tuples and the initial keyword tuples, the targeted texts generated from the target keyword tuples are not entirely identical to the text to be augmented; there are still many shared keywords between the target keyword tuples and the initial keyword tuples. This results in the generated targeted texts having relatively similar semantics to the text to be augmented. Furthermore, the targeted texts are filtered based on the similarity between the texts, deleting those with significant semantic deviations. This achieves control over the augmented text, rather than generating text arbitrarily.

[0066] Figure 2 This is a flowchart illustrating the artificial intelligence-based text augmentation method according to the second embodiment of the present invention. It should be noted that if substantially the same result is achieved, the method of the present invention does not necessarily require further elaboration. Figure 2 The illustrated process sequence is limited. For example... Figure 2 As shown, the method includes the following steps:

[0067] Step S201: Extract the initial keyword tuple from the pre-acquired text to be expanded.

[0068] In this embodiment, Figure 2 Step S201 and Figure 1 The steps in step S101 are similar and will not be repeated here for the sake of simplicity.

[0069] Step S202: When the number of keywords in the initial keyword tuple is lower than the preset number threshold, query the extended keywords of each keyword in the initial keyword tuple from the preset extended keyword knowledge base.

[0070] It should be noted that this extended keyword knowledge base is pre-set. Specifically, the Apriori algorithm can be used to mine tuples of related feature words, thereby constructing this extended keyword knowledge base.

[0071] In step S202, after obtaining the initial keyword tuple, if the number of keywords in the initial keyword tuple is lower than a preset threshold, it indicates that the text to be expanded is a short text. The number of keywords extracted from a short text is small, and processing these keywords could lead to significant semantic changes. In this embodiment, the short text is expanded into a long text to facilitate subsequent text expansion. Therefore, in this embodiment, when the number of keywords in the initial keyword tuple is lower than the preset threshold, corresponding extended keywords are queried from a preset extended keyword knowledge base, and the extended keywords are used to expand the content of the text to be expanded.

[0072] Step S203: Add the expanded keywords to the initial keyword tuple.

[0073] In step S203, after the extended keywords are found, the extended keywords are added to the initial keyword tuple to expand the initial keyword tuple so that the number of keywords in the initial keyword tuple exceeds a preset threshold.

[0074] Furthermore, to avoid significant deviations between the semantics and the text to be expanded due to expansion, step S203 includes the following:

[0075] 1. Input the expanded keywords and the keywords from the initial keyword tuple into the text generation model to obtain the expanded text;

[0076] 2. Calculate the semantic similarity between the expanded text and the text to be expanded;

[0077] 3. Determine whether the semantic similarity is higher than the preset similarity threshold;

[0078] 4. If so, then the step of adding the expanded keywords to the initial keyword tuple is allowed.

[0079] Specifically, after obtaining the expanded keywords, the expanded text of the text to be expanded is generated using the expanded keywords and the keywords in the initial keyword tuple. Then, the semantic similarity between the expanded text and the text to be expanded is calculated. Only when the semantic similarity is higher than a preset similarity threshold is it allowed to add the expanded keywords to the initial keyword tuple, thereby avoiding significant semantic deviations after the text to be expanded is expanded. Step S204: The initial keyword tuple is processed based on preset rules to obtain multiple target keyword tuples that differ from the initial keyword tuple.

[0080] In this embodiment, Figure 2 Step S204 and Figure 1 Step S102 is similar and will not be repeated here for the sake of simplicity.

[0081] Step S205: Input multiple target keyword tuples into a pre-trained text generation model to generate multiple targeted texts. The text generation model is trained based on historical text data.

[0082] In this embodiment, Figure 2 Step S205 and Figure 1 Step S103 is similar and will not be repeated here for the sake of simplicity.

[0083] Step S206: Calculate the semantic similarity between each targeted text and the text to be expanded.

[0084] In this embodiment, Figure 2 Step S206 and Figure 1 Step S104 is similar and will not be repeated here for the sake of simplicity.

[0085] Step S207: Remove targeted texts with semantic similarity lower than the preset similarity threshold.

[0086] In this embodiment, Figure 2 Step S207 and Figure 1 Step S105 is similar and will not be repeated here for the sake of simplicity.

[0087] The AI-based text expansion method of the second embodiment of the present invention, based on the first embodiment, determines whether the text to be expanded is a short text by judging the number of keywords in the initial keyword tuple. If it is a short text, the initial keyword tuple of the short text is expanded to reduce the impact of subsequent keyword processing on semantics. Furthermore, when expanding the short text, the semantics of the expanded text are also judged to avoid excessive deviation between the expanded semantics and the original semantics of the text to be expanded.

[0088] Figure 3 This is a schematic diagram of the functional modules of an artificial intelligence-based text expansion device according to an embodiment of the present invention. Figure 3 As shown, the AI-based text augmentation device 30 includes an extraction module 31, a processing module 32, a generation module 33, a calculation module 34, and a removal module 35.

[0089] Extraction module 31 is used to extract initial keyword tuples from the pre-acquired text to be expanded;

[0090] The processing module 32 is used to process the initial keyword tuple based on preset rules to obtain multiple target keyword tuples that are different from the initial keyword tuple;

[0091] The generation module 33 is used to input multiple target keyword tuples into a pre-trained text generation model to generate multiple targeted texts. The text generation model is trained based on historical text data.

[0092] Calculation module 34 is used to calculate the semantic similarity between each targeted text and the text to be expanded;

[0093] The removal module 35 is used to remove targeted text with semantic similarity lower than a preset similarity threshold.

[0094] Optionally, the AI-based text augmentation device 30 further includes a training module for pre-training a text generation model. The specific operations of the training module in training the text generation model include: acquiring training sample text and the initial training keyword tuples corresponding to the training sample text; processing the initial training keyword tuples based on preset rules to obtain multiple target training keyword tuples that differ from the initial training keyword tuples; inputting the multiple target training keyword tuples into the text generation model to be trained to generate multiple training oriented texts; and updating the text generation model through backpropagation based on the multiple training oriented texts, the training sample text, and a preset loss function.

[0095] Optionally, the operation of processing module 32 to process the initial keyword tuple based on preset rules to obtain multiple target keyword tuples that are different from the initial keyword tuple can also be: performing random number of synonym replacements and / or random number deletions and / or random shuffling of the order of keywords in the initial keyword tuple to obtain multiple target keyword tuples.

[0096] Optionally, the extraction module 31 may perform the operation of extracting the initial keyword tuple from the pre-acquired text to be expanded as follows: use a pre-built word segmenter to segment the text to be expanded to obtain multiple candidate words and the attributes of each candidate word; according to the attributes, use a preset scoring algorithm to score the multiple candidate words respectively to obtain the scoring results; sort the multiple candidate words in descending order according to the scoring results, and select the top preset number of candidate words to construct the initial keyword tuple.

[0097] Optionally, the extraction module 31 may perform the operation of extracting the initial keyword tuple from the pre-acquired text to be expanded as follows: use a pre-built word segmenter to segment the text to be expanded to obtain multiple candidate words; use a pre-built relational lexicon to filter the relational words among the multiple candidate words, and use the remaining candidate words to construct the initial keyword tuple.

[0098] Optionally, after the extraction module 31 performs the operation of extracting the initial keyword tuple from the pre-acquired text to be expanded, it is further used to: when the number of keywords in the initial keyword tuple is lower than a preset number threshold, query the extended keywords of each keyword in the initial keyword tuple from the preset background knowledge base; and add the extended keywords to the initial keyword tuple.

[0099] Optionally, before the extraction module 31 performs the operation of adding the extended keywords to the initial keyword tuple, it is further configured to: input the extended keywords and the keywords in the initial keyword tuple into the text generation model to obtain the extended text; calculate the semantic similarity between the extended text and the text to be expanded; determine whether the semantic similarity is higher than a preset similarity threshold; if so, allow the step of adding the extended keywords to the initial keyword tuple to be performed.

[0100] For further details regarding the implementation techniques of each module in the AI-based text expansion device described in the above embodiments, please refer to the description of the AI-based text expansion method in the above embodiments, which will not be repeated here.

[0101] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0102] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. Figure 4 As shown, the computer device 40 includes a processor 41 and a memory 42 coupled to the processor 41. The memory 42 stores program instructions. When the program instructions are executed by the processor 41, the processor 41 performs the steps of the artificial intelligence-based text expansion method described in any of the above embodiments.

[0103] The processor 41 can also be referred to as a CPU (Central Processing Unit). The processor 41 may be an integrated circuit chip with signal processing capabilities. The processor 41 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor.

[0104] See Figure 5 , Figure 5This is a schematic diagram of the structure of a storage medium according to an embodiment of the present invention. The storage medium of this embodiment stores program instructions 51 capable of implementing all the above methods. These program instructions 51 can be stored in the storage medium in the form of a software product, including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, or computer devices such as computers, servers, mobile phones, and tablets.

[0105] In the several embodiments provided in this application, it should be understood that the disclosed computer devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.

[0106] Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units. The above are merely embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made based on the description and drawings of this application, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A text augmentation method based on artificial intelligence, characterized in that, include: Initial keyword tuples are extracted from the pre-acquired text to be expanded; After extracting the initial keyword tuple from the pre-acquired text to be expanded, the method further includes: when the number of keywords in the initial keyword tuple is lower than a preset threshold, querying the extended keywords of each keyword in the initial keyword tuple from a preset extended keyword knowledge base; adding the extended keywords to the initial keyword tuple; the extended keyword knowledge base is constructed by mining tuples of related feature words. Before adding the extended keywords to the initial keyword tuple, the method further includes inputting the extended keywords and the keywords in the initial keyword tuple into a text generation model to obtain extended text. Calculate the semantic similarity between the expanded text and the text to be expanded; determine whether the semantic similarity is higher than a preset similarity threshold; If so, then the step of adding the expanded keyword to the initial keyword tuple is allowed; The initial keyword tuple is processed based on preset rules to obtain multiple target keyword tuples that are different from the initial keyword tuple; The initial keyword tuple is processed based on preset rules to obtain multiple target keyword tuples that differ from the initial keyword tuple. This includes performing random number of synonym replacements and / or random number of deletions and / or random shuffling of the order of keywords in the initial keyword tuple to obtain multiple target keyword tuples; The multiple target keyword tuples are respectively input into a pre-trained text generation model to generate multiple targeted texts. The text generation model is trained based on historical text data. Calculate the semantic similarity between each targeted text and the text to be expanded; The targeted text with a semantic similarity lower than a preset similarity threshold is removed.

2. The text augmentation method based on artificial intelligence according to claim 1, characterized in that, The steps for pre-training the text generation model include: Obtain the training sample text and the initial training keyword tuple corresponding to the training sample text; The initial training keyword tuple is processed based on the preset rules to obtain multiple target training keyword tuples that are different from the initial training keyword tuples. The multiple target training keyword tuples are respectively input into the text generation model to be trained to generate multiple training targeted texts; The text generation model is updated by backpropagation based on the multiple training targeted texts, the training sample texts, and a preset loss function.

3. The text augmentation method based on artificial intelligence according to claim 1, characterized in that, The process of extracting initial keyword tuples from pre-acquired text to be expanded includes: The text to be expanded is segmented using a pre-built word segmenter to obtain multiple candidate words and the attributes of each candidate word; Based on the attributes, a preset scoring algorithm is used to score the multiple candidate words respectively to obtain the scoring results; The candidate words are sorted in descending order based on the scoring results, and the top preset number of candidate words are selected to construct the initial keyword tuple.

4. The text augmentation method based on artificial intelligence according to claim 1, characterized in that, The process of extracting initial keyword tuples from pre-acquired text to be expanded includes: The text to be expanded is segmented using a pre-built word segmenter to obtain multiple candidate words; The relation words among the multiple candidate words are filtered using a pre-built relation word library, and the initial keyword tuple is constructed using the remaining candidate words.

5. A text expansion device based on artificial intelligence, characterized in that, include: The extraction module is used to extract initial keyword tuples from the pre-acquired text to be expanded; The extraction module is further configured to, when the number of keywords in the initial keyword tuple is lower than a preset threshold, query the extended keywords of each keyword in the initial keyword tuple from a preset extended keyword knowledge base; add the extended keywords to the initial keyword tuple; the extended keyword knowledge base is constructed by mining tuples of related feature words; Before performing the operation of adding the extended keywords to the initial keyword tuple, the extraction module is also used to input the extended keywords and the keywords in the initial keyword tuple into the text generation model to obtain the extended text; Calculate the semantic similarity between the expanded text and the text to be expanded; determine whether the semantic similarity is higher than a preset similarity threshold; If so, then the step of adding the expanded keyword to the initial keyword tuple is allowed; The processing module is used to process the initial keyword tuple based on preset rules to obtain multiple target keyword tuples that are different from the initial keyword tuple; The initial keyword tuple is processed based on preset rules to obtain multiple target keyword tuples that differ from the initial keyword tuple. This includes performing random number of synonym replacements and / or random number of deletions and / or random shuffling of the order of keywords in the initial keyword tuple to obtain multiple target keyword tuples; The generation module is used to input the multiple target keyword tuples into a pre-trained text generation model to generate multiple targeted texts. The text generation model is trained based on historical text data. The calculation module is used to calculate the semantic similarity between each targeted text and the text to be expanded; The removal module is used to remove the targeted text whose semantic similarity is lower than a preset similarity threshold.

6. A computer device, characterized in that, The computer device includes a processor and a memory coupled to the processor, the memory storing program instructions that, when executed by the processor, cause the processor to perform the steps of the artificial intelligence-based text augmentation method as described in any one of claims 1-4.

7. A storage medium, characterized in that, The system stores program instructions capable of implementing the AI-based text augmentation method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Training corpus expansion method and device and intention recognition model training method and device

    CN112651238A