Corpus generation method, device, system, storage medium and electronic device

By using corpus generation rules and the Rule2Text engine, high-quality text corpus is generated by combining index elements and text elements, which solves the problem of low corpus generation efficiency and improves the accuracy of intelligent assistant model training and human-computer dialogue.

CN114970733BActive Publication Date: 2025-09-09GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210636838.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-07
Publication Date
2025-09-09
Estimated Expiration
2042-06-07

AI Technical Summary

Technical Problem

In the existing technology, the efficiency of corpus generation is low and the cost is high, which makes it difficult to meet the demand for large amounts of high-quality text corpora, especially when the corpus structure and semantics vary greatly in different application fields and business scenarios.

Method used

Corpus generation rules are adopted to randomly determine words from the word set through index elements, and text elements are combined to generate text corpus to avoid manual annotation. The Rule2Text engine and Simbert model are integrated for data enhancement and negative sample mining.

Benefits of technology

The efficiency of generating high-quality text corpora has been improved, the cost has been reduced, the generated corpora are of higher quality, adapted to the needs of different application fields and business scenarios, and the accuracy of model training and human-computer dialogue of intelligent assistants has been improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114970733B_ABST
    Figure CN114970733B_ABST
Patent Text Reader

Abstract

The present disclosure provides a corpus generation method, corpus generation system, corpus generation device, storage medium, and electronic device, relating to the field of artificial intelligence technology. The corpus generation method includes: obtaining a corpus generation task, the corpus generation task including corpus generation rules; when the corpus generation rules include an index element, determining a first term from a set of terms corresponding to the index element; and generating a first text corpus based on the first term. The present disclosure can improve the efficiency of corpus generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a corpus generation method, a corpus generation system, a corpus generation device, a storage medium, and an electronic device. Background Art

[0002] With the rapid development of deep learning technology, the natural language understanding (NLU) capabilities of intelligent assistants have also made significant progress. NLU models support machine understanding of text content in task-based conversations, thereby enabling human-computer interaction. The accuracy of NLU models in understanding text content is closely related to the quality of the corpus used to train the models.

[0003] Because the structure and semantics of corpora vary across different application domains and business scenarios, manual annotation is currently the most common method. However, model training requires a large amount of text corpora, and manual annotation is inefficient in generating corpora. Summary of the Invention

[0004] The purpose of the present disclosure is to provide a corpus generation method, a corpus generation system, a corpus generation device, a storage medium and an electronic device, thereby overcoming, at least to a certain extent, the problem of low efficiency in generating corpus due to the limitations and defects of related technologies.

[0005] According to a first aspect of the present disclosure, a corpus generation method is provided, comprising: obtaining a corpus generation task, the corpus generation task including a corpus generation rule; when the corpus generation rule includes an index element, determining a first word from a word set corresponding to the index element; and generating a first text corpus in combination with the first word.

[0006] According to a second aspect of the present disclosure, a corpus generation system is provided, comprising: a client, configured to provide a configuration interface for a corpus generation task, and generate a corpus generation task in response to configuration operations on the configuration interface; and a server, configured to generate text corpus using the above-mentioned corpus generation method.

[0007] According to a third aspect of the present disclosure, a corpus generation device is provided, comprising: a task acquisition module for acquiring a corpus generation task, the corpus generation task including a corpus generation rule; a word determination module for randomly determining a first word from a word set corresponding to an index element when the corpus generation rule includes an index element; and a corpus generation module for generating a first text corpus in combination with the first word.

[0008] According to a fourth aspect of the present disclosure, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned corpus generation method is implemented.

[0009] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the above-mentioned corpus generation method by executing the executable instructions.

[0010] In the technical solutions provided in some embodiments of the present disclosure, a corpus generation task is obtained, and the corpus generation task includes a corpus generation rule; when the corpus generation rule includes an index element, a first word is determined from the word set corresponding to the index element; and a first text corpus is generated in combination with the first word. In an exemplary solution of the present disclosure, when the corpus generation rule includes an index element, a word is determined from the word set corresponding to the index element through the corpus generation rule, thereby generating high-quality text corpus. This method avoids the process of generating high-quality text using manual annotation methods, thereby greatly improving the efficiency of generating text corpus.

[0011] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and those skilled in the art can derive other drawings based on these drawings without inventive effort. In the drawings:

[0013] Figure 1 Schematically shows a structural diagram of a corpus generation system according to an exemplary embodiment of the present disclosure;

[0014] Figure 2 A schematic diagram of a process of a corpus generation method according to an exemplary embodiment of the present disclosure is schematically shown;

[0015] Figure 3 Schematically shows a schematic diagram of a word attribute graph established according to an exemplary embodiment of the present disclosure;

[0016] Figure 4 A schematic diagram of formulating corpus generation rules according to an exemplary embodiment of the present disclosure is schematically shown;

[0017] Figure 5 Schematically shows a process diagram of generating text corpus from a rule table of the first task type according to an exemplary embodiment of the present disclosure;

[0018] Figure 6Schematically illustrates a process diagram of generating text corpus from a rule table of the second task type according to an exemplary embodiment of the present disclosure;

[0019] Figure 7 Schematically illustrates a process diagram of generating text corpus from a rule table of the third task type according to an exemplary embodiment of the present disclosure;

[0020] Figure 8 A schematic diagram of a process for generating similar sentences according to an exemplary embodiment of the present disclosure is schematically shown;

[0021] Figure 9 Schematically shows a schematic diagram of a process of generating text corpus according to a rule in an exemplary embodiment of the present disclosure;

[0022] Figure 10 Schematically shows a schematic diagram of an interactive interface for generating text based on rules according to an exemplary embodiment of the present disclosure;

[0023] Figure 11 Schematically shows a block diagram of a corpus generation device according to an exemplary embodiment of the present disclosure;

[0024] Figure 12 Schematically shows a block diagram of another corpus generation device according to an exemplary embodiment of the present disclosure;

[0025] Figure 13 A block diagram schematically illustrates an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the present disclosure will be more comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or that other methods, components, devices, steps, etc. may be employed. In other cases, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0027] In addition, the accompanying drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0028] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all steps. For example, some steps may be decomposed, while some steps may be combined or partially combined, so the actual execution order may change according to actual circumstances.

[0029] The corpus generation method provided by the exemplary embodiment of the present disclosure can be applied to any application scenario that requires the use of corpus. For example, in the field of intelligent assistants, users can issue voice commands to intelligent electronic devices. After the intelligent electronic devices recognize the received voice into text, they return the voice to the user through semantic matching of the corresponding corpus to realize the human-computer question and answer process. In the above-mentioned human-computer question and answer process, it is necessary to generate a large amount of high-quality text corpus as sample data for model training to achieve accuracy in the human-computer question and answer process, thereby improving the core competitiveness of the intelligent assistant.

[0030] Currently, the structure and semantics of corpora vary across different application domains and business scenarios. To generate high-quality text corpora, manual annotation is often used. However, given the demand for large amounts of high-quality text corpora, manual annotation is costly and inefficient.

[0031] In light of the above-mentioned issues, the disclosed embodiments propose a corpus generation solution that can be integrated into the rule-to-text tool Rule2Text. In this solution, a server can obtain a corpus generation task, which includes corpus generation rules. When the corpus generation rules include index elements, text corpus can be generated based on the terms identified by the index elements. This solution uses corpus generation rules to directly generate high-quality text corpus, avoiding the low efficiency and high cost of corpus generation caused by manual annotation methods.

[0032] Figure 1 Schematically shows a structural diagram of a corpus generation system according to an exemplary embodiment of the present disclosure. Figure 1As shown, the system includes a client 10 and a server 12. The client 10 provides a configuration interface for corpus generation tasks. Users can perform configuration operations on the task configuration interface, and the client 10 responds to the configuration operations to generate a corpus generation task. The corpus generation task includes corpus generation rules. The server 12 can obtain the corpus generation task generated by the client 10 and, if the corpus generation rules include an index element, determine a word from the word set corresponding to the index element and generate text corpus based on the determined word.

[0033] It should be noted that the number of clients 10 and servers 12 is merely exemplary, and any greater or lesser number falls within the scope of protection of this application. Moreover, in the above example operating scenario, the client 10 can be a mobile phone, a server, a PDA (Personal Digital Assistant), a notebook, or any other computing device with networking capabilities. The server 12 can be a single server or a server cluster consisting of multiple servers. The network for communication between the client 10 and the server 12 can include various types of wired and wireless networks, and this disclosure does not impose any restrictions on this.

[0034] After understanding the system architecture diagram of the corpus generation method provided by the present disclosure, combined with Figure 2 The scheme of the corpus generation method provided in the embodiment of the present disclosure is described in detail.

[0035] Figure 2 This is a flow chart of a method for generating corpus provided by an embodiment of the present disclosure. The present disclosure provides a method for generating corpus, which can be executed by any device for executing a method for generating corpus, and the device can be implemented by software and / or hardware. In this embodiment, the device can be integrated into Figure 1 In the server 12 shown. Figure 2 As shown, the corpus generation method provided by the embodiment of the present disclosure includes the following steps:

[0036] S20. Obtain a corpus generation task, where the corpus generation task includes corpus generation rules.

[0037] A corpus generation task is a business request to generate text corpora. It includes corpus generation rules. Text corpora can be generated according to these rules. This rule-based text generation process can be integrated into the Rule2Text engine. Corpus generation rules are referred to as Rule2Text rules. For example, corpus generation rules can be set by users based on business needs.

[0038] In an exemplary embodiment of the present disclosure, a corpus generation task may also include task configuration information, such as task type, whether the generated corpus requires data augmentation, whether similar sentences are generated, negative sample corpus, etc. Users can determine the configuration information based on their business needs on the configuration interface of the corpus generation task provided by the client.

[0039] Regarding the task types included in the configuration information for the corpus generation task, the exemplary embodiments of this disclosure use natural language processing (NLP) tasks as an example. The configuration information can include three common NLP task types: text classification, sequence labeling, and semantic matching. Table 1 shows the task definitions and data formats for the corresponding task types.

[0040] Table 1

[0041]

[0042] S22. When the corpus generation rule includes an index element, determine a first word from the word set corresponding to the index element.

[0043] The corpus generation rules may include index elements, which are index names for a series of word sets. For example, for a series of word sets that express the meaning of closing, such as close, turn off, shut down, shut down, exit, etc., the index name, which is also an index element, can be defined as close.

[0044] Specifically, when the corpus generation rules include an index element, a first term can be determined from the set of terms corresponding to the index element. For example, if the index name is "close," a term can be determined as the first term from a set of terms that express the meaning of "close," such as "turn off," "turn off," "turn off," "turn off for a while," and "exit." It should be understood that a corpus generation rule can include one or more index elements.

[0045] The following is a detailed description of the process of corresponding the index elements included in the corpus generation rule to the word set and determining the first word from the word set.

[0046] In an exemplary embodiment of the present disclosure, a rich vocabulary is integrated into the Rule2Text engine to support the word sets corresponding to index elements. This vocabulary can randomly generate word types such as entities, events, actions, and moods, covering common terms in different conversational domains. The vocabulary can be composed of two parts: enumerable words and non-enumerable words. Enumerable words are a series of words accumulated over long periods of time in business operations. Non-enumerable words refer to entities with a very large value space that is not easy to manually enumerate, such as names, titles, and time periods.

[0047] For example, Table 2 shows enumerable words, and each enumerable word has its corresponding word type and unique index name. Table 3 shows non-enumerable words for surnames, given names, and titles, and each non-enumerable word also includes a word type and a unique index name.

[0048] Table 2

[0049] Word Type Index Name Word collection entity food Milk, bread, sushi, hamburgers, pastries... entity daily necessities Keys, nail clippers, comb, thermos cup... entity …… …… event physical exercise Playing football, basketball, swimming, climbing, riding a bike... event …… …… action Open Open, open, open... action closure Close, turn off, turn off, turn off, exit... action …… …… Tone Tone prefix Xiaobu, Xiaobu Xiaobu, hello, hi, hello, hey... Tone …… ……

[0050] Table 3

[0051]

[0052]

[0053] The Rule2Text engine also integrates a randomization program that randomly combines word sets corresponding to multiple index names according to certain rules to generate smooth and grammatical words. Table 3 shows the process for randomly generating a name. First, the surname, given name, and title index names and their corresponding word sets are established. Then, a name is randomly generated by combining "surname + given name," "surname + title," "given name + title," and so on.

[0054] In an exemplary embodiment of the present disclosure, for the above-mentioned semantic matching task category, an attribute graph between vocabulary tables can also be established to determine whether the semantics expressed by text 1 and text 2 are consistent, such as establishing synonyms and antonyms. For example, the attribute graph of words is integrated into the Rule2Text engine to establish the relationship between words. Figure 3 The following schematically illustrates a word attribute graph established according to an exemplary embodiment of the present disclosure. Figure 3 , taking "mother" as the benchmark word for the research, its synonyms can be different ways of addressing with the same meaning as "mother", and its antonyms also include "mother", but they do not refer to the same person as "mother". In this way, we can judge whether the semantics expressed in two different texts are consistent. For example, calling mother and calling mommy have the same semantics, while calling mother and calling auntie have different semantics.

[0055] In another exemplary embodiment of the present disclosure, in addition to integrating the lexicons described in the aforementioned embodiments, the Rule2Text engine allows users to add new lexicons to accommodate new application areas. The corpus generation task involves adding a new lexicon, which, along with the existing lexicon, forms a target lexicon. A first term is determined from the set of terms in the target lexicon corresponding to the index element. For example, when adding a new lexicon, the new lexicon can be submitted to Rule2Text using the same method used to create an existing lexicon.

[0056] Specifically, the user can add a new vocabulary on the configuration interface displayed on the client, so that the newly added vocabulary is added to the corpus generation task and sent to the server. When adding a new vocabulary, you can add new words to the word set corresponding to the existing index name or create a new index name and a corresponding word set. Taking the enumerable words shown in Table 2 as an example, if the user is in the fast food industry, the user can add common words related to the fast food industry to the word set corresponding to the index name of the food in the existing vocabulary, such as hamburgers, French fries, chicken rolls, etc. You can also create a new index name and add the word set corresponding to the index name. For example, create a word type of event, the index name is fast food production, and the corresponding word set is making hamburgers, fried chicken steak, boiling rice noodles, etc. After the new vocabulary is established, it can be combined with the existing vocabulary to form a target vocabulary to support the word set corresponding to the index element, so as to determine a first word in the word set provided by the target vocabulary.

[0057] In the process of generating a corpus generation task, the target lexicon is formed by using the newly added lexicon included in the corpus generation task and the existing lexicon, thereby determining the first word in the word set corresponding to the target lexicon and the index element, thereby avoiding the situation where the corpus generated in the open source corpus set does not match the specific application field and task. This method can customize the corpus set according to the user's business needs, ensure the high quality of the generated corpus, and then use the generated corpus to improve the quality of business services.

[0058] S24. Generate a first text corpus based on the first word.

[0059] After a first word is determined in step S22, a first text corpus can be generated in combination with the generated first word. For example, if the index elements included in the corpus generation rule are "tone prefix," "open," and "application," and the determined first words are "hello," "open," and "WeChat," the generated first text corpus is: "hello, open WeChat."

[0060] In an exemplary embodiment of the present disclosure, when the corpus generation rule includes an index element, the corpus generation rule also includes a text element; when generating the first text corpus in combination with the first word, a second word is determined based on the text element; and the first text corpus is generated in combination with the second word.

[0061] Specifically, the corpus generation rule includes both index elements and text elements. A first word is determined from the set of words corresponding to the index element, and a second word can be determined according to the text element, so as to generate a first text corpus based on the determined first word and second word. The text element is the specific text information included. The text element may be not easily added to the set of words corresponding to the index element, such as "把" (ba), "将" (jiang), and "", that is, a space character, etc., or any determined word. Assuming that the second word corresponding to the text element is "把" (ba), then the generated first text corpus includes "把" (ba). For example, the index element is distinguished by {}, and the text element is distinguished by [], for example, for [把]{应用程序}{关闭} (ba {application}{close}), the text element determines the second word as [把] (ba), and the first words corresponding to the index element are {微信} (WeChat) and {关一下} (close it), then the corresponding generated first text corpus is: 把微信关一下 (Close WeChat).

[0062] Exemplarily, for the set of words corresponding to the index element, it is determined that the input word can be a text element. For example, for the index element in Table 2 being physical exercise, assuming that it is determined to generate only the first text corpus with "踢足球" (play football) as the first word, then "踢足球" (play football) is set as the text element.

[0063] When the corpus generation rule includes both index elements and text elements, the words with the same meaning can be classified through the index element, and each word in the set of words corresponding to the same index element can be substituted for each other to generate a large number of text corpora. Through the text element, the words that are not easily classified can be added to the text corpus, so as to quickly generate high-quality text corpora through the corpus generation rule, avoiding the problem of low efficiency caused by the manual annotation method.

[0064] In the exemplary embodiment of the present disclosure, the text element may include two or more candidate words; when determining a second word according to the text element, the selection probability of each candidate word is obtained; according to the selection probability of each candidate word, a second word is determined from each candidate word.

[0065] Specifically, a text element may contain one or multiple candidate words. For example, a text element may be "[ba]" or "[ba|jiang]". When a text element includes two or more candidate words, the selection probabilities of each candidate word can be obtained, and then the second word can be determined according to the probabilities of the candidate words. The selection probabilities of each candidate word can be set to equal probabilities or unequal probabilities. When the probabilities are unequal, the sum of the selection probabilities of the candidate words included in a text element is 100%. For example, when a text element includes "[ba|jiang| ]", assuming that the probability of determining "ba" as the second word is 60%, the probability of determining "jiang" as the second word is 30%, and the probability of determining the space character " " as the second word is 10%, then the sum of the probabilities of "ba", "jiang", and the space character " " is 100%.

[0066] When a text element includes multiple candidate words, by setting the selection probabilities of each candidate word, words with higher occurrence probabilities can be set with higher probabilities when generating text corpora, so as to generate high-quality text corpora according to business requirements.

[0067] In an exemplary embodiment of the present disclosure, the corpus generation rule may only include text elements. When the corpus generation rule only includes text elements, a third word is determined according to the text element; a fourth text corpus is generated according to the third word.

[0068] Specifically, the corpus generation rule may not include index elements and only include text elements, that is, text corpora are generated only through text elements. For example, "[weather][how|what about]", assuming that the determined third word is "[weather][how]", then the generated fourth text corpus can be: How's the weather?

[0069] The process of generating text corpora only through text elements can also quickly generate high-quality text corpora, avoiding the problem of low efficiency in generating corpora caused by manual annotation, thereby improving the efficiency of generating high-quality corpora.

[0070] In the technical solutions provided by some embodiments of the present disclosure, by obtaining a corpus generation task, the corpus generation task includes a corpus generation rule; when the corpus generation rule includes index elements, a first word is determined from the set of words corresponding to the index element; a first text corpus is generated in combination with the first word. This method can use the corpus generation rule included in the corpus generation task to determine a first word from the set of words corresponding to the index element, and generate a high-quality text corpus according to the corpus generation rule in combination with the determined word. The text corpus of this method is annotated according to the corpus generation rule, avoiding the need to use manual annotation methods to generate high-quality text corpora in some technologies, thereby greatly improving the efficiency of generating high-quality corpora and reducing the cost of corpus generation.

[0071] In an exemplary embodiment of the present disclosure, when generating a first text corpus by combining a first term, a Rule2Text rule for generating the first text corpus can be pre-defined. The user can define the corpus generation rule on a configuration interface according to the specified Rule2Text rule. Then, according to the defined corpus generation rule, a first term is determined from the term set corresponding to the index element, and finally, the first text corpus is generated by combining the first term according to the corpus generation rule.

[0072] After using Rule2Text rules to determine words from a word set and generating text corpus based on the determined words, you need to formulate another Rule2Text rule to generate text corpus based on the determined words.

[0073] The following will be combined Figure 4 The process of formulating corpus generation rules and the process of using rules and words to generate text corpus are explained in detail.

[0074] Figure 4 The following schematically shows a schematic diagram of formulating corpus generation rules according to an exemplary embodiment of the present disclosure. Figure 4 ,First, when formulating Rule2Text rules to generate text corpus for the determined words, in step S41, the rule grammar of the Rule2Text ,rule is written.

[0075] The corpus generation rules can be referred to as Rule2Text rules, or simply referred to as rules in the following description.

[0076] For example, as shown in Table 4, Table 4 is a series of Rule2Text rule grammars formulated in the Rule2Text engine for combining words to generate text corpus.

[0077] It should be understood that users can freely design prescribed symbols and regular symbol names according to their own needs.

[0078] Table 4

[0079]

[0080] refer to Figure 4 , the index element uses {}. When determining a first word from the word set corresponding to the index element {open}, a word will be randomly selected from the word set corresponding to {open} as the first word.

[0081] Exemplarily, when there are multiple parallel index elements in {}, they can be separated by the element separator "|". For example, {time|date} means randomly generating a time or a date from the existing word library. Text elements use [], for example, [put|will|], which means randomly selecting one from "put", "will", and the empty string as the determined word. Using the element separator can generate various text corpora.

[0082] Exemplarily, if high-frequency elements and low-frequency elements can be set during the process of randomly selecting parallel elements of index elements and text elements, the generation probability of elements can be specified by the probability symbol "@" in Table 4, and the sum of the probabilities of parallel elements is 1. For example, for the parallel index elements {time|date}, {time@0.7|date@0.3} can be set, then {time@0.7|date@0.3} means that there is a 70% probability of generating time and a 30% probability of generating date.

[0083] For a sequence labeling task, the sequence labeling symbol "-" in Table 4 can be used to mark the word category of an entity. Taking the index elements, text elements, and the corresponding word sets shown in Table 5 as an example, and combining with the BIO tags shown in Table 1, the labeling symbol "-" is used for sequence labeling. For example, for "Zhang San", marking the person name of the index element as the name entity, the rule is formulated as {person name - name}. Then, after labeling according to the rule, "Zhang" corresponds to B - name, and "San" corresponds to I - name.

[0084] Table 5

[0085]

[0086] For a semantic matching task, the text pair separator ";" in Table 4 can be used to separate two rules. This text pair separator can be used to generate a pair of texts, for example, {text 1};{text 2}. The semantic constraint symbol "~" in Table 4 can also be used to generate synonyms or antonyms. Assume that "~N" represents the normalization word (Normalization), "~S" represents the synonym of the normalization word (Synonym), and "~A" represents the antonym of the normalization word.

[0087] Exemplarily, for a semantic matching task, generating high-quality corpora lies in using samples that are prone to misjudgment during model training. For example, "Mom's birthday; Zhang San's birthday" is a negative sample that is not prone to misjudgment, and the model is not likely to misjudge. While "Mom's birthday; Aunt's birthday" is a negative sample that is prone to misjudgment, and the model is likely to misjudge it as a positive sample, that is, "Mom's birthday; Mom's birthday". To improve the accuracy of the model, the semantic constraint symbol "~" can be used to generate synonyms or antonyms.

[0088] Taking the text pairs shown in Table 6 as an example, the synonyms and antonyms of the benchmark word are obtained from the vocabulary. If the synonym or antonym of the benchmark word does not exist in the vocabulary, the benchmark word itself is used as a synonym, and a non-benchmark word is randomly generated from the word set where the benchmark word is located as an antonym.

[0089] Table 6

[0090] rule Sample text {relative ~ N}; {relative ~ S} Dad {relative ~ N}; {relative ~ A} mother; aunt {Name~N}; {Name~S} Zhang San; Zhang San {name~N}; {name~A} Zhang San; Li Si

[0091] Next, based on the formulation of the above rule grammar, a rule table is formulated for the user's current task category. In step S43, a rule table for the relevant task type is formulated.

[0092] In the exemplary embodiment of the present disclosure, the rule table can be divided into four columns: rule, name, label, and number. "Rule" is the area for writing rules; "Name" is the unique index name for the rule, i.e., an index element, which can be left blank; the "Label" column is the classification label for the text generated by the rule; and "Number" controls the number of texts generated by the rule and can be entered as a positive integer. The "Name" in the rule table can be used as an index element in other rules to form composite rules.

[0093] Finally, in step S45 , Rule2Text rules are formulated according to the rule syntax and the rule table, and the Rule2Text engine parses the Rule2Text rules to generate text corpus.

[0094] In an exemplary embodiment of the present disclosure, a user can write Rule2Text rules based on the rule grammar written in step S41 and the rule table of the task formulated in step S43. Then, the Rule2Text engine can parse the Rule2Text rules written by the user according to the internal rule grammar and rule table, thereby generating text corpus for the determined words according to the Rule2Text rules.

[0095] Figure 5 、 Figure 6 、 Figure 7 The following schematic diagrams respectively illustrate the process of generating text corpus from rule tables for three task types: text classification, sequence labeling, and semantic matching.

[0096] Figure 5 The following schematically illustrates a process diagram of generating text corpus from a rule table of the first task type according to an exemplary embodiment of the present disclosure. Figure 5For tasks with a text classification task type, the index element or text element of "rule" in the rule table is written according to the rule syntax and is named by default. Each text corpus generated according to the rule is labeled accordingly. For example, if the rule is {Close}{Application}, the label is app_close, and the number is 100, then all 100 text corpora generated according to this rule will be used for text classification and their labels will all be _label_app_close.

[0097] Figure 6 The following schematically illustrates a process diagram of generating text corpus from a rule table of the second task type according to an exemplary embodiment of the present disclosure. Figure 6 For tasks with the sequence labeling task type, the index elements or text elements of "rules" in the rule table are written according to the rule syntax and are named by default. The text corpora generated by the rules all achieve the sequence labeling task. For example, for the rule {date-data}{location-area}[weather][how|how], the 100 text corpora generated according to this rule have all completed the sequence labeling task.

[0098] Figure 7 The following schematically illustrates a process diagram of generating text corpus from a rule table of the third task type according to an exemplary embodiment of the present disclosure. Figure 7 ,For tasks whose task type is semantic matching, in the rule table, the index elements or text elements of ,“rule” are written in accordance with the rule syntax and the ,naming is omitted. Figure 7 The "query" in the query is used as a name and can also be used as an index element to form a compound rule. For example, {query};{answer1} is a compound rule. This rule enables semantic matching of generated text pairs.

[0099] The pre-set rule syntax and rule table in this process constrain the process of writing rules, which helps users write rules according to the set method and improves the efficiency of generating text corpus.

[0100] In the field of intelligent assistants, for example, semantic matching tasks, rule-generated text lacks rich sentence structure and a lack of colloquialism, making it poorly suited for real-world human-computer dialogue. Furthermore, in real-world human-computer question-and-answer scenarios, user voice queries often contain numerous speech recognition errors, grammatical errors, colloquialisms, and noise, differing from the distribution of rule-generated text. To mitigate this distribution gap and improve the performance of human-computer question-and-answer models, the Rule2Text engine processes the first text corpus generated by rules.

[0101] The following is a detailed description of the process of further processing the first text corpus generated by the rule.

[0102] In an exemplary embodiment of the present disclosure, semantic similarity conversion is performed on the first text corpus to obtain the second text corpus.

[0103] For example, Figure 8 The following schematically illustrates a process diagram for generating similar sentences according to an exemplary embodiment of the present disclosure. Figure 8 Simbert is used to generate similar sentences. Simbert is a pre-trained language model based on the UniLM idea and BERT, which combines retrieval and generation tasks. When using Simbert, given a text corpus, Simbert can generate a group of semantically similar sentences. Figure 8 In the example, when a first text corpus named query is generated according to the rules, Simbert can generate similar sentences corresponding to the query. Simbert uses the Transformer structure to achieve similarity conversion between sentences, where SOS is the sentence start identifier and EOS is the sentence end identifier. S1 can be the first text corpus, and S2 can be the second text corpus.

[0104] Simbert generates a set of similar sentences from the first text corpus at a certain ratio. These sentences are then ranked, and a second text corpus is randomly selected from the ranked results to replace the first text corpus. The Simbert model acquires a large amount of sample data during pre-training, so similarity conversion can significantly enrich the sentence structure of the generated text corpus, improving its quality.

[0105] In another exemplary embodiment of the present disclosure, noise is added to the first text corpus to obtain a third text corpus.

[0106] Specifically, noise can be added to the first text corpus to capture features of spoken conversations, assisting the machine in simulating spoken expressions, thereby generating a third text corpus. This process can be referred to as data augmentation. Table 7 lists the types of noise addition, solutions, and examples. By adding noise, users can accurately generate text corpora for spoken conversations with intelligent assistants that contain a large number of speech recognition errors, grammatical errors, colloquialisms, and noise, thereby improving the quality of the generated text corpus.

[0107] Table 7

[0108]

[0109] In another exemplary embodiment of the present disclosure, in order to balance the positive and negative samples in the model training process, the first text corpus can be decomposed into word granularity to obtain the word granularity decomposition result of the first text corpus; the word granularity decomposition result of the first text corpus is used to search in the manually annotated evaluation set to obtain the negative sample corpus corresponding to the first text corpus.

[0110] Among them, word-granularity decomposition is to decompose a sentence into independent words. For example, "call mom" can be decomposed into "call mom". Negative samples are text corpora generated during the semantic matching process that contain words in the positive sample but are unrelated to the user's query. For example, negative samples of "call mom" can be "Who invented the telephone?", "I like my mom", "Send WeChat to mom", "Please pay my electricity bill", etc.

[0111] At present, in order to realize business functions, users usually only focus on the acquisition of positive samples, thereby generating a large number of positive samples through Rule2Text rules. However, this method makes it difficult to obtain negative samples, resulting in an imbalance problem of positive and negative samples in the data set used to train the model. Training the model with a data set that is unbalanced between positive and negative samples will cause the model to have an excessive recall rate problem, where the recall rate is also called sensitivity, specifically the number of positive samples correctly predicted by the model / the number of positive samples in the actual observation data. The problem of excessive recall rate may make it difficult for the model to detect negative samples. The exemplary embodiment of the present disclosure can randomly select queries that are not in the current task field as negative samples from the manually labeled evaluation set, but the obtained negative samples are quite different from the positive samples, making it difficult to solve the problem of excessive recall of the model. Therefore, it is necessary to obtain semantically similar negative samples to improve the accuracy of model training using the generated text corpus.

[0112] In an exemplary embodiment of the present disclosure, term frequency-inverse document frequency (TF-IDF) is an indicator that can effectively mine similar texts. Taking the word w as an example, the calculation method is shown in Formula 1, Formula 2, and Formula 3:

[0113] TF-IDF=TF*IDF (Formula 1)

[0114]

[0115]

[0116] For example, let's take the query "call mom" as an example to illustrate the solution for mining negative samples. First, the query is decomposed into word granularity:

[0117] Call Mom --> Call Mom

[0118] Then, according to Formula 2, the term frequencies of each word can be calculated as follows: TF(beat) = 0.167, TF(electric) = 0.167, TF(phone) = 0.167, TF(give) = 0.167, TF(mom) = 0.333.

[0119] Suppose there are 1 million queries in the manually annotated evaluation set. Among them, 100,000 queries contain "beat", 10,000 queries contain "electric", 20,000 queries contain "phone", 100,000 queries contain "give", and 15,000 queries contain "mom". Then, according to Formula 3, the inverse document frequencies of each word particle can be determined as follows:

[0120] IDF(beat) = log(1000000 / *******) = 1;

[0121] IDF(electric) = log(1000000 / *******) = 2;

[0122] IDF(phone) = log(1000000 / *******) = 1.7;

[0123] IDF(give) = log(1000000 / *******) = 1;

[0124] IDF(mom) = log(1000000 / *******) = 1.82.

[0125] Then, according to Formula 1, the TF-IDF of the query is [(mom, 0.607), (electric, 0.333), (phone, 0.283), (beat, 0.167), (give, 0.167)].

[0126] Set the TF-IDF threshold and confirm negative samples according to the threshold. Suppose the TF-IDF threshold is equal to 0.3. Then, the words greater than the threshold are "mom" and "electric". Search for queries containing the same words in the manually annotated evaluation set. The search results are [Who is the inventor of the telephone, I like mom, Send a WeChat message to mom, Help me pay the electricity bill,...]. The search results can be used as negative samples, thus establishing a data set with positive samples.

[0127] By processing the first text corpus as described above, the quality of the generated text corpus is improved, making the generated corpus have a richer sentence structure. Then, model training is carried out according to the data set composed of the generated corpus, improving the accuracy of the model and enhancing the competitiveness of the intelligent assistant.

[0128] It should be understood that the method for processing the first text corpus described above is also applicable to the fourth text corpus generated according to the text elements only contained in the corpus generation rule and the third words determined according to the text elements.

[0129] The following will be combined with Note: Some numbers in the original text are replaced with ******* as they seem to be incomplete in the provided content. You may need to correct them according to the actual situation. Figure 9 、 Figure 10 The entire process of corpus generation is explained in detail.

[0130] Figure 9 The following schematically illustrates a process diagram of generating text corpus according to a rule according to an exemplary embodiment of the present disclosure. Figure 9 The overall framework for rule-generated text corpora consists of three processes: pre-task processing, rule-generated text, and post-task processing. Pre-task processing includes steps such as task configuration, customizing the domain vocabulary, and developing rule tables, primarily completing the necessary preparations for rule-generated text. Rule-generated text is automatically executed by the Rule2Text engine, converting manual rules into text. Post-task processing, including steps such as data augmentation, Simbert, and negative sample mining, further processes the rule-generated text to enrich the sentence structure of the rule-generated text corpus and rapidly generate a large amount of high-quality corpus.

[0131] Specifically, during the task pre-processing phase, users can select task configuration information based on actual business needs, such as the task type, whether the generated corpus requires data augmentation, whether to generate similar sentences, and negative sample corpus. Customizing the domain lexicon allows users to customize word sets not found in the general lexicon to meet their business needs. A general lexicon, or an existing lexicon, requires users to create a rule table based on the Rule2Text rule syntax. The Rule2Text engine then analyzes the defined rules and generates text corpus according to the task configuration requirements.

[0132] Finally, data augmentation can be used to add noise to the generated text corpus, perform semantic similarity conversion on the generated text corpus through Simbert, and perform word granularity decomposition on the generated text corpus through negative sample mining; the word granularity decomposition results of the generated text corpus are used to search in the manually annotated evaluation set to obtain the negative sample corpus corresponding to the generated text corpus.

[0133] Taking the NLU model as an example, Figure 9 The process of generating text corpora using the rules shown here greatly improves the efficiency of NLU models in acquiring datasets. Users can customize a small set of terms and rules for specific tasks to generate any number of text corpora. As shown in Table 8, this significantly improves efficiency compared to manual online query annotation solutions.

[0134] Table 8

[0135]

[0136] At the same time, in terms of optimizing model effects, the Rule2Text engine can quickly generate corpus according to business needs. In the pre-task processing stage, you can use a customized domain vocabulary to add the word set required for the business to generate a large number of semantically rich sentences; in the post-task processing stage, it also integrates SimBERT generation, data enhancement, negative sample mining and other tools to enrich the sentence structure of the generated corpus. As shown in Table 9, when the vocabulary and rules are well prepared, the effect of Rule2Text on optimizing the model effect can be similar to that of the online manual query annotation scheme. It can be seen from Tables 8 and 9 that the use of the corpus generation method provided by the present disclosure can improve the efficiency of corpus generation while achieving an effect similar to that of the manual annotation method.

[0137] Table 9

[0138]

[0139] Figure 10 The following schematically shows an interactive interface diagram for generating text based on a rule according to an exemplary embodiment of the present disclosure. Figure 10 The present disclosure also provides an interactive interface for rule-generated text, which is divided into a title bar, a menu bar, a configuration center, a vocabulary editing area, a rule editing area, and a data generation area module.

[0140] Among them, the menu bar contains the user's account information. After the user registers and logs in to the account, he can store personal work files in the cloud to keep work records, so that the user can directly use the established rules to quickly generate text corpus and improve the user experience.

[0141] by Figure 9 As an example, the process of generating text corpus according to the rules shown in the following example, first, the user can Figure 10 The configuration center shown completes the task configuration. Various parameters are presented in a drop-down menu, allowing users to select different configuration parameters based on different task requirements. Users can first view the existing general vocabulary in the list of existing vocabularies. If they do not meet the task requirements, they can add words in the vocabulary editing area and determine the word set based on the existing vocabularies.

[0142] Next, users can create a rule table in the Rule Editing area based on the Rule2Text rule syntax. Finally, click the Run button once the table is complete. The user's added configuration information, word list, and rules are uploaded to the cloud to generate the corpus generation task. The cloud service then activates the Rule2Text engine, which randomly generates a specified amount of text based on each rule.

[0143] If users configure data augmentation, similarity generation, and negative sample mining in the configuration center, they can also invoke the data augmentation and Simbert similar sentence generation modules to generalize the generated text and use the TF-IDF algorithm to mine relevant negative samples from online datasets. Finally, based on the configured task type, the generated text data is packaged into datasets of different formats, returned to the client, and displayed in the data generation area. Users can download the generated text corpus by clicking the download button. This interactive interface lowers the barrier to entry for using the Rule2Text engine and improves the user experience.

[0144] It should be noted that although the steps of the method of the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all steps must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0145] Furthermore, this exemplary embodiment also provides a corpus generation device.

[0146] Figure 11 Schematically shows a block diagram of a corpus generation device according to an exemplary embodiment of the present disclosure. Figure 11 According to an exemplary embodiment of the present disclosure, the corpus generating device 11 may include a task acquiring module 110 , a word determining module 112 , and a corpus generating module 114 .

[0147] The task acquisition module 110 can be used to acquire a corpus generation task, which includes a corpus generation rule; the word determination module 112 can be used to randomly determine a first word from a word set corresponding to an index element when the corpus generation rule includes an index element; the corpus generation module 114 can be used to generate a first text corpus in combination with the first word.

[0148] The corpus generation device 11 provided in the embodiment of the present disclosure can execute the technical solution of the corpus generation method in any of the above embodiments. Its implementation principle and beneficial effects are similar to those of the corpus generation method. Please refer to the implementation principle and beneficial effects of the corpus generation method, and no further details will be given here.

[0149] Furthermore, this exemplary embodiment also provides another corpus generation device.

[0150] Figure 12 Schematically shows a block diagram of a corpus generation device according to an exemplary embodiment of the present disclosure. Figure 12According to an exemplary embodiment of the present disclosure, the corpus generating device 12 may include a corpus generating module 120 , a corpus converting module 122 , a noise adding module 124 , and a corpus decomposing module 126 .

[0151] According to an exemplary embodiment of the present disclosure, the corpus generation module 120 may be configured to determine a second word according to a text element; and generate a first text corpus by combining the first word and the second word.

[0152] According to an exemplary embodiment of the present disclosure, the corpus generation module 120 may be configured to obtain a selection probability of each candidate word; and determine a second word from each candidate word according to the selection probability of each candidate word.

[0153] According to an exemplary embodiment of the present disclosure, the corpus conversion module 122 performs semantic similarity conversion on the first text corpus to obtain a second text corpus.

[0154] According to an exemplary embodiment of the present disclosure, the noise adding module 124 adds noise to the first text corpus to obtain a third text corpus.

[0155] According to an exemplary embodiment of the present disclosure, the corpus decomposition module 126 can be used to perform word granularity decomposition on the first text corpus to obtain a word granularity decomposition result of the first text corpus; and use the word granularity decomposition result of the first text corpus to search in the manually annotated evaluation set to obtain a negative sample corpus corresponding to the first text corpus.

[0156] According to an exemplary embodiment of the present disclosure, the corpus generation module 120 may be configured to determine a first word from a word set corresponding to an index element in a target vocabulary.

[0157] According to an exemplary embodiment of the present disclosure, the corpus generation module 120 may be configured to determine a third word according to the text element when the corpus generation rule only includes text elements; and generate a fourth text corpus according to the third word.

[0158] The corpus generation device 12 provided in the embodiment of the present disclosure can execute the technical solution of the corpus generation method in any of the above-mentioned embodiments. Its implementation principle and beneficial effects are similar to those of the corpus generation method. Please refer to the implementation principle and beneficial effects of the corpus generation method, and no further details will be given here.

[0159] Since the functional modules of the program execution performance analysis device according to the embodiment of the present invention are the same as those in the above-mentioned method invention embodiment, they will not be described in detail here.

[0160] In exemplary embodiments of the present disclosure, a computer-readable storage medium is also provided, on which is stored a program product capable of implementing the methods described above. In some possible implementations, various aspects of the present invention may also be implemented in the form of a program product comprising program code that, when executed on a terminal device, causes the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the "Exemplary Methods" section above.

[0161] According to an embodiment of the present invention, a program product for implementing the above-mentioned method can be a portable compact disc read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, and the program can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0162] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0163] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0164] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0165] The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, and the like, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0166] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.

[0167] Those skilled in the art will appreciate that various aspects of the present invention may be implemented as systems, methods, or program products. Therefore, various aspects of the present invention may be implemented in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits," "modules," or "systems."

[0168] Refer to the following Figure 13 An electronic device 1300 according to this embodiment of the present invention will be described. Figure 13 The electronic device 1300 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present invention.

[0169] like Figure 13 As shown, electronic device 1300 is implemented as a general-purpose computing device. Components of electronic device 1300 may include, but are not limited to, the aforementioned at least one processing unit 1310, the aforementioned at least one storage unit 1320, a bus 1330 connecting various system components (including storage unit 1320 and processing unit 1310), and a display unit 1340.

[0170] The storage unit stores program codes, which can be executed by the processing unit 1310, so that the processing unit 1310 performs the steps according to various exemplary embodiments of the present invention described in the "Exemplary Method" section above. For example, the processing unit 1310 can perform the following steps: Figure 2 Steps S20 to S24 shown in FIG.

[0171] The storage unit 1320 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 13201 and / or a cache memory unit 13202 , and may further include a read-only memory unit (ROM) 13203 .

[0172] The storage unit 1320 may also include a program / utility 13204 having a set (at least one) of program modules 13205, such program modules 13205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0173] Bus 1330 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0174] The electronic device 1300 can also communicate with one or more external devices 1400 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 1300, and / or any device that enables the electronic device 1300 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication can occur via an input / output (I / O) interface 1350. Furthermore, the electronic device 1300 can also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 1360. As shown, the network adapter 1360 communicates with other modules of the electronic device 1300 via a bus 1330. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 1300, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0175] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.

[0176] Furthermore, the above-described figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention and are not intended to be limiting. It is readily understood that the processes illustrated in the above-described figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0177] It should be noted that although several modules or units of the device for action execution are mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.

[0178] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow from the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.

[0179] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A corpus generation method, characterized in that: include: Obtaining a corpus generation task, wherein the corpus generation task includes corpus generation rules; In a case where the corpus generation rule includes an index element and a text element, a first word is determined from a word set corresponding to the index element, and a second word is determined based on the text element; wherein the index element is an index name of the word set, and the text element includes text information; The first word and the second word are combined to generate a first text corpus.

2. The corpus generation method according to claim 1, characterized in that: The text element includes more than two candidate words; wherein a second word is determined based on the text element and includes: Obtaining the selection probability of each candidate word; A second word is determined from the candidate words according to the selection probability of each candidate word.

3. The corpus generation method according to claim 1, wherein: The corpus generation method further includes: The first text corpus is subjected to semantic similarity conversion to obtain a second text corpus.

4. The corpus generation method according to claim 1, wherein: The corpus generation method further includes: Noise is added to the first text corpus to obtain a third text corpus.

5. The corpus generation method according to claim 1, wherein: The corpus generation method further includes: Performing word granulation decomposition on the first text corpus to obtain a word granulation decomposition result of the first text corpus; The word granularity decomposition result of the first text corpus is used to search in the manually annotated evaluation set to obtain a negative sample corpus corresponding to the first text corpus.

6. The corpus generation method according to any one of claims 1 to 5, characterized in that: The corpus generation task includes adding a new vocabulary, and the new vocabulary and the existing vocabulary constitute a target vocabulary; wherein determining a first word from the word set corresponding to the index element includes: A first word is determined from a word set in a target vocabulary corresponding to the index element.

7. The corpus generation method according to claim 1, wherein: The corpus generation method further includes: In a case where the corpus generation rule includes only text elements, determining a third word according to the text elements; A fourth text corpus is generated based on the third word.

8. A corpus generation system, characterized in that: include: The client is used to provide a configuration interface for the corpus generation task and generate the corpus generation task in response to configuration operations on the configuration interface; A server, configured to generate text corpus using the corpus generation method according to any one of claims 1 to 7.

9. A corpus generation device, characterized in that: include: A task acquisition module is used to acquire a corpus generation task, wherein the corpus generation task includes corpus generation rules; a word determination module for determining a first word from a word set corresponding to the index element, and determining a second word based on the text element, when the corpus generation rule includes an index element and a text element; wherein the index element is an index name of the word set, and the text element includes text information; A corpus generation module is used to generate a first text corpus by combining the first word and the second word.

10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the corpus generation method according to any one of claims 1 to 7 is implemented.

11. An electronic device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor is configured to execute the corpus generation method according to any one of claims 1 to 7 by executing the executable instructions.

Citation Information

Patent Citations

  • Corpus generation method, device, electronic equipment and readable storage medium

    CN110399499A

  • Noise-inserted corpus generation method and device, equipment and readable storage medium

    CN113392643A