WO2020134154A1 - Artificial intelligence-based text data enhancement method and device, equipment and storage medium - Google Patents
Artificial intelligence-based text data enhancement method and device, equipment and storage medium Download PDFInfo
- Publication number
- WO2020134154A1 WO2020134154A1 PCT/CN2019/103684 CN2019103684W WO2020134154A1 WO 2020134154 A1 WO2020134154 A1 WO 2020134154A1 CN 2019103684 W CN2019103684 W CN 2019103684W WO 2020134154 A1 WO2020134154 A1 WO 2020134154A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- text
- fluency
- output
- word order
- model
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/35—Clustering; Classification
Definitions
- This application belongs to the field of artificial intelligence technology, and relates to text data enhancement methods, devices, equipment, and storage media based on artificial intelligence.
- the text generation model can convert one or more input texts into one or more output texts.
- Embodiments of the present application provide an artificial intelligence-based text data enhancement method, device, device, and storage medium, which are designed to increase the amount of input text data.
- the artificial intelligence-based text data enhancement method includes:
- the first output text is provided as a second input text to the text generation model, so that the text is generated
- the model converts the second input text into at least one second output text until the text generation model meets a preset condition, and the word order fluency of the second output text is less than the word order fluency of the correct text.
- the artificial intelligence-based text data enhancement device includes:
- the text training module is used to provide the first input text in the text database to the text generation model, and the text generation model converts the first input text into at least one first output text;
- a word order fluency calculation module used to calculate the word order fluency of the first output text
- Word order fluency comparison module used to compare the word order fluency of the first output text with the word order fluency of the correct text
- the input text increment module is used to provide the first output text as the second input text to the text generation when the word sequence fluency of the first output text is greater than or equal to the word sequence fluency of the correct text A model so that the text generation model converts the second input text into at least one second output text until the text generation model meets a preset condition, and the fluency of the word sequence of the second output text is less than the correct Fluency of the word order of the text.
- a computer device includes a memory and a processor.
- the memory stores computer-readable instructions.
- the processor executes the computer-readable instructions, any of the steps of the artificial intelligence-based text data enhancement method described above is implemented.
- a computer-readable storage medium having computer-readable instructions stored thereon when the computer-readable instructions are executed by one or more processors to implement any of the above artificial intelligence-based text data enhancement methods A step of.
- the text generation model by providing the first output text with a word order fluency greater than or equal to the correct text as the second input text to the text generation model, the text generation model will The second input text is converted into at least one piece of the second output text. The text generation model incorrectly trains the second input text, so that the word order fluency of the second output text is less than the word order fluency of the correct text.
- the amount of data used to train the text generation model is further increased, which is helpful to reduce the training time of the text generation model, so that the text generation model can achieve convergence in a shorter time, which is beneficial to overcome The problem of insufficient data training for the text generation model.
- FIG. 1 is a schematic diagram of a text data enhancement method based on artificial intelligence described in an embodiment of the present application
- FIG. 2 is another schematic diagram of an artificial intelligence-based text data enhancement method described in an embodiment of this application.
- FIG. 3 is a schematic diagram of text generation training of a seq2seq model of an intelligent customer service robot in an embodiment of this application;
- FIG. 4 is another schematic diagram of text generation training of a seq2seq model of an intelligent customer service robot in an embodiment of the present application
- FIG. 5 is a schematic diagram of an artificial intelligence-based text data enhancement device according to an embodiment of the application.
- FIG. 6 is a block diagram of the basic structure of the computer device 100 in an embodiment of the present application.
- An embodiment of the present application discloses a text data enhancement method based on artificial intelligence.
- FIG. 1 is a schematic diagram of an artificial intelligence-based text data enhancement method according to an embodiment of the application
- FIG. 2 is an artificial intelligence-based text data enhancement method according to an embodiment of the application. Another schematic of the method.
- the text data enhancement method based on artificial intelligence includes:
- S1 Provide the first input text in the text database to the text generation model, and convert the first input text into at least one first output text by the text generation model.
- S4a When the word order fluency of the first output text is greater than or equal to the word order fluency of the correct text, provide the first output text as the second input text to the text generation model, so that the The text generation model converts the second input text into at least one second output text until the text generation model meets a preset condition, and the word order fluency of the second output text is less than the word order fluency of the correct text.
- the preset condition includes that the text generation model achieves convergence.
- the first output text with a word order fluency greater than or equal to the correct text is provided as the second input text to the text generation model, and the text generation model will The second input text is converted into at least one piece of the second output text.
- the text generation model incorrectly trains the second input text, so that the word order fluency of the second output text is less than the word order fluency of the correct text.
- the "wrong training" can be understood as providing the first output text with a word order fluency greater than or equal to the correct text as the second input text to the text generation model for training, resulting in a word order fluency less than The second output text of the correct text.
- the text generation model can recombine the morphemes of the second input text, the second input text itself is usually not combined. Therefore, if the second input text whose word order fluency is greater than or equal to the correct text is input into the text generation model, at least one of the second outputs whose word order fluency is less than the correct text will be combined text.
- the text generation model is input by the second input text with a word order fluency greater than or equal to the correct text, and the second input text is converted into At least one of the second output texts, thus further increasing the amount of data used to train the text generation model, which is beneficial to reduce the training time of the text generation model, so that the text generation model can be shortened Achieve convergence within time.
- S1, S2, S3, and S4a may be repeated until the text generation model converges, and stop providing the second input text to the text generation model.
- the text data enhancement method based on artificial intelligence after S3 further includes:
- the first output text converted into a text sequence model with a word order fluency less than the correct text is re-provided to the text generation model, so the text database can be increased
- the amount of data is beneficial to overcome the problem of insufficient data amount of the text database, reduces the difficulty of obtaining the first input text that meets the requirements, and improves the training efficiency of the text generation model.
- S1, S2, S3, and S4b may be repeated until the text generation model converges, and then stop providing the first input text to the text generation model.
- the calculating the word order fluency of the first output text includes:
- f(x) represents the fluency of the word order;
- x ⁇ i) refers to the language of the following P(x i ) given the above of the first output text Model probability.
- the language model probability is obtained by calculating a language model
- the language model includes an n-gram language model and a neural probabilistic language model.
- the first output text is: I like it. Among them, "I” is above, then “like” is below.
- the first output text is: I like apples. Among them, "I like” is above, then “Apple” is below.
- the "above” can be understood as the words and sentences that have been given and determined, and the “below” can be understood as the words and sentences appearing after the "above” in the language model.
- “Language model probability” refers to the probability that a certain kind of context appears when given the context above. The probabilities of different language models appearing behind the same above are different. On the basis of combining the above, usually the following words with fluency greater than or equal to the correct text have a relatively large probability of language models. For example, given the above “I like it", the probability of the language model below “eating apples” is greater than the probability of the language model below “dislikes”.
- H(x) can be understood as information entropy, and the greater the information entropy, the greater the uncertainty of a certain word or sentence appearing below.
- the word order fluency of the correct text is 1.6.
- the text generation model converts five first output texts.
- the fluency of the word sequence of the five first output texts is 0.7, 0.9, 1.2, 1.8, and 1.4, respectively.
- the first output text with a word order fluency of 1.8 is free of speech problems, and the first output text with a flow degree of 0.7, 0.9, 1.2, and 1.4 is considered to have a speech disease. 4 said first output texts with language problems are stored in the text database, and then provided to the text generation model for training.
- the first output text without linguistics directly provides the text generation model for error training, and the word order fluency obtained by performing error training on the text generation model is less than the second output of the correct text
- the text is provided to the text generation model for training, and the amount of data used for training the text generation model is increased.
- the step of providing the first output text as the second input text to the text generation model includes: forming the first output text and the correct text into one text data Yes, the first output text in the text data pair is provided to the text generation model as the second input text.
- the first output text corresponds to only one correct text.
- the text generation model includes: an RNN (Recurrent Neural Network) structure model and a seq2seq model.
- RNN Recurrent Neural Network
- the purpose of providing the first input text and the second input text to the text generation model is to converge the text generation model, so when the text generation model converges, stop providing the text generation model with The first input text and the second input text.
- FIG. 3 it is a schematic diagram of text generation training of a seq2seq model of an intelligent customer service robot in an embodiment of the present application.
- the specific implementation process is detailed as follows:
- S51 Obtain a text data pair in a preset text database, and input the text data pair to the seq2seq model, where the text data pair includes the first output text.
- the first input text and the correct text for text generation training constitute the text data pair and are stored in the text database.
- the text data pair in the text database is retrieved, and the first output text in the text data pair is provided to the seq2seq model .
- S52 Calculate the word order fluency of the first output text through the seq2seq model, compare the word order fluency with the word order fluency of the correct text, and determine the comparison result.
- the seq2seq model converts the first output text into multiple pieces of the first output text. All the first output texts converted from the seq2seq model constitute an output text set. Then calculate the word order fluency of each of the first output texts. Compare the word order fluency of each first output text with the corresponding word order fluency of the correct text.
- the step of determining whether the seq2seq model has converged does not limit the position shown in FIG. 3. For example, after the seq2seq model converts the first input text into multiple first output texts, it can be determined whether the seq2seq model has converged.
- the above process of supplying the first output text with a word order fluency less than the correct text to the seq2seq model for text generation training is cyclically performed until it is determined that the seq2seq model has converged. After the seq2seq model converges, the loop will end, and the first input text will be stopped for the seq2seq model.
- FIG. 4 another schematic diagram of text generation training of the seq2seq model of the intelligent customer service robot in an embodiment of the present application is described in detail as follows:
- S61 Obtain a text data pair in a preset text database, and input the text data pair to the seq2seq model, where the text data pair includes the first output text.
- the first input text and the correct text used for text generation training form a text data pair and are stored in a text database.
- the text data pair in the text database is retrieved, and the first output text in the text data pair is provided to the seq2seq model.
- S62 Calculate the word order fluency of the first output text through the seq2seq model, compare the word order fluency with the word order fluency of the correct text, and determine the comparison result;
- the seq2seq model converts the first input text into multiple first output texts. All the first output texts converted from the seq2seq model constitute an output text set. Then calculate the word order fluency of each of the first output texts. Compare the word order fluency of each first output text with the corresponding word order fluency of the correct text.
- step S62 it is determined whether the seq2seq model has converged.
- the seq2seq model When the seq2seq model does not converge, the first output text in the output text set whose word order fluency is greater than or equal to the correct text is provided as the second input text to the seq2seq model, and then the The seq2seq model converts the second input text into a plurality of second output texts whose word order fluency is less than the correct text.
- the plurality of second output texts whose word order fluency is less than the correct text form a new output text set.
- Each second output text and the correct text form a new text data pair, and are stored in the text database.
- the first input text provided to the seq2seq model of the intelligent customer service robot is "the sun rises from the east", and the corresponding correct text is "the sun rises from the east”.
- the seq2seq model of the intelligent customer service robot converts the first input text "rising from the east sun” into multiple first output texts.
- Table 1 only shows a number of possible first output texts, not all possible first output texts of the first input text "Rising from the East Sun” after conversion by the seq2seq model.
- each first output text shown in Table 1 is less than 1, so there is a certain language disorder.
- the word order fluency of each first output text shown in Table 1 is less than 1. All the first output texts shown in Table 1 are paired with the correct texts to form text data pairs, and stored in the text database. At this time, all the first output text shown in Table 1 is converted into the first input text, and provided to the seq2seq model of the intelligent customer service robot for the next round of text generation training.
- the text database will be able to provide multiple times of the first input text to the seq2seq model of the intelligent customer service robot. Therefore, the seq2seq model of the intelligent customer service robot will be able to automatically increase the first input text during the training process, so that the text data is enhanced, which is beneficial to overcome the problem of insufficient input text data and reduces the amount of first input text that meets the requirements. difficult.
- the first input text of the seq2seq model provided to the intelligent customer service robot is "Guo Zu I You Love", and the corresponding correct text is "Mother I Love You”.
- the seq2seq model of the intelligent customer service robot converts the first input text "Guo Zu I You Love” into multiple first output texts.
- Table 2 only shows a number of possible first output texts, not all possible first output texts of the first input text "Guo Zu I You Love” after conversion by the seq2seq model.
- the word order fluency of the part of the first output text in Table 2 is less than 1, indicating that there is a linguistic disorder in the part of the first output text.
- the word order fluency of the first output text "I love your motherland” is greater than 1, so there is no linguistic disorder in the first output text.
- the first output text "I love your motherland” is provided as the second input text to the seq2seq model of the intelligent customer service robot.
- the seq2seq model of the intelligent customer service robot will erroneously train the second input text "I love your motherland” and convert it into several second output texts with a word order fluency of less than 1.
- a plurality of second output texts obtained by error training and having the second order text with a fluency of less than 1 and the correct text form text data pairs and stored in the text database.
- several second output texts with less than 1 word order fluency obtained from wrong training are retrieved from the text database and provided to the intelligent The seq2seq model of the customer service robot is trained.
- the above method for incorrectly training the second input text to obtain several second output texts with a word order fluency of less than 1 can also automatically increase the amount of text data, play a role in enhancing text data, and help to further overcome the lack of input text data The problem of reducing the difficulty of obtaining the first input text that meets the requirements.
- the value of the word order fluency in Table 1 and Table 2 is positive, in some possible embodiments of the present application, the value of the word order fluency may also be a negative value.
- An embodiment of the present application discloses a text data enhancement device based on artificial intelligence.
- FIG. 5 it is a schematic diagram of an artificial intelligence-based text data enhancement device according to an embodiment of the present application.
- the text data enhancement device based on artificial intelligence includes:
- the text training module 10 is used to provide the first input text in the text database to the text generation model, and the text generation model converts the first input text into at least one first output text;
- the word order fluency calculation module 20 is used to calculate the word order fluency of the first output text
- Word order fluency comparison module 30 used to compare the word order fluency of the first output text with the word order fluency of the correct text
- the input text increment module 40 is configured to provide the first output text as the second input text to the text when the word sequence fluency of the first output text is greater than or equal to the word sequence fluency of the correct text Generating a model so that the text generation model converts the second input text into at least one second output text until the text generation model meets a preset condition, and the fluency of the word sequence of the second output text is less than the Fluency of the word order of the correct text.
- the word order fluency calculation module 20 calculates the word order fluency of the first output text by the following formula:
- f(x) represents the fluency of the word order;
- x ⁇ i) refers to the language of the following P(x i ) given the above of the first output text Model probability.
- the word order fluency calculation module 20 obtains the language model probability through language model calculation, and the language model includes an n-gram language model and a neural probabilistic language model.
- the text training module 10 composes the first output text and the correct text into a text data pair, and sets the first output text in the text data pair as the The second input text is provided to the text generation model.
- the text training module 10 performs error training on the second input text through the text generation model so that the word order fluency of the second output text is less than the word order of the correct text Fluency.
- the input text increment module 40 is further configured to provide the first output text when the word order fluency of the first output text is less than the word order fluency of the correct text Generate a model for the text.
- the text training module 10 stops providing the text input model with the first input text and the second input text.
- FIG. 6 is a basic structural block diagram of the computer device 100 in an embodiment of the present application.
- the computer device 100 includes a memory 101, a processor 102, and a network interface 103 that communicate with each other through a system bus. It should be noted that FIG. 6 only shows the computer device 100 having the components 101-103, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
- the computer device here is a device that can automatically perform numerical calculation and/or information processing according to preset or stored instructions, and its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), programmable gate array (Field-Programmable Gate Array, FPGA), digital processor (Digital Signal Processor, DSP), embedded equipment, etc.
- ASIC Application Specific Integrated Circuit
- FPGA Field-Programmable Gate Array
- DSP Digital Signal Processor
- the computer device may be a computing device such as a desktop computer, a notebook, a palmtop computer and a cloud server.
- the computer device can interact with the user through a keyboard, a mouse, a remote control, a touchpad, or a voice control device.
- the memory 101 includes one or more computer-readable storage media storing computer-readable instructions, the computer-readable storage media including a flash memory, a hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), Random access memory (RAM), static random access memory (SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk Wait.
- the memory 101 may be an internal storage unit of the computer device 100, such as a hard disk or a memory of the computer device 100.
- the memory 101 may also be an external storage device of the computer device 100, for example, a plug-in hard disk equipped on the computer device 100, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash card (Flash Card), etc.
- the memory 101 may also include both the internal storage unit of the computer device 100 and its external storage device.
- the memory 101 is generally used to store an operating system and various application software installed on the computer device 100, such as the computer-readable instructions of the artificial intelligence-based text data enhancement method described above.
- the memory 101 may also be used to temporarily store various types of data that have been output or will be output.
- the processor 102 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip.
- the processor 102 is generally used to control the overall operation of the computer device 100.
- the processor 102 is configured to execute computer-readable instructions or process data stored in the memory 101, for example, computer-readable instructions to execute the above artificial intelligence-based text data enhancement method.
- the network interface 103 may include a wireless network interface or a wired network interface, and the network interface 103 is generally used to establish a communication connection between the computer device 100 and other electronic devices.
- the present application also provides another implementation manner, that is, to provide a computer-readable storage medium that stores computer-readable instructions corresponding to entry of document information, and computer-readable instructions corresponding to entry of document information
- the instructions may be executed by at least one processor, so that the at least one processor executes the steps of any of the above artificial intelligence-based text data enhancement methods.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Machine Translation (AREA)
Abstract
The present application relates to the technical field of artificial intelligence, and relates to an artificial intelligence-based text data enhancement method and device, equipment and a storage medium. The method comprises: providing a first input text in a text database to a text generation model, and the text generation model converting the first input text into at least one first output text; calculating the word order fluency of the first output text; comparing the word order fluency of the first output text to the word order fluency of a correct text; and when the word order fluency of the first output text is greater than or equal to the word order fluency of the correct text, providing the first output text as a second input text to the text generation model, so that the text generation model converts the second input text into at least one second output text, the word order fluency of the second output text being less than that of the correct text. Thus, the data size of text generation model training is increased.
Description
【交叉引用】【cross reference】
本申请以2018年12月29日提交的申请号为201811641967.2,名称为“基于人工智能的文本数据增强方法、装置、设备及存储介质”的中国发明专利申请为基础,并要求其优先权。This application is based on the Chinese invention patent application filed on December 29, 2018, with the application number 201811641967.2, titled "Artificial Intelligence-based Text Data Enhancement Methods, Devices, Equipment, and Storage Media," and claims priority.
本申请属于人工智能技术领域,涉及基于人工智能的文本数据增强方法、装置、设备及存储介质。This application belongs to the field of artificial intelligence technology, and relates to text data enhancement methods, devices, equipment, and storage media based on artificial intelligence.
目前,文本生成模型能够将一条或一条以上的输入文本转化成一条或一条以上的输出文本。为了让所述文本生成模型能够生成语病少、语义更准确的输出文本,需要给所述文本生成模型提供大量的输入文本,使得所述文本生成模型能够收敛。Currently, the text generation model can convert one or more input texts into one or more output texts. In order for the text generation model to generate output text with less linguistics and more accurate semantics, it is necessary to provide the text generation model with a large amount of input text so that the text generation model can converge.
现有的技术条件下,要获得符合要求的大量的输入文本是非常困难的,使得对于所述文本生成模型进行的训练很难达到理想的效果,也即所述文本生成模型不易实现收敛。此外,现有技术中难以对所述文本生成模型转化获得的输出文本进行语病检查,因此制约了所述文本生成模型的实际应用。Under the existing technical conditions, it is very difficult to obtain a large amount of input text that meets the requirements, making it difficult to achieve the desired effect on the training of the text generation model, that is, the text generation model is not easy to achieve convergence. In addition, in the prior art, it is difficult to perform a linguistic check on the output text obtained by conversion of the text generation model, thus restricting the practical application of the text generation model.
【发明内容】[Invention content]
本申请实施例提供了一种基于人工智能的文本数据增强方法、装置、设备及存储介质,旨在增加输入文本的数据量。Embodiments of the present application provide an artificial intelligence-based text data enhancement method, device, device, and storage medium, which are designed to increase the amount of input text data.
一种基于人工智能的文本数据增强方法,所述基于人工智能的文本数据增强方法包括:An artificial intelligence-based text data enhancement method. The artificial intelligence-based text data enhancement method includes:
将文本数据库中的第一输入文本提供给文本生成模型,并由所述文本生成模型将所述第一输入文本转化成至少一条第一输出文本;Providing the first input text in the text database to a text generation model, and converting the first input text into at least one first output text by the text generation model;
计算所述第一输出文本的语序流畅度;Calculating the word order fluency of the first output text;
将所述第一输出文本的语序流畅度与正确文本的语序流畅度比较;Compare the word order fluency of the first output text with the word order fluency of the correct text;
当所述第一输出文本的语序流畅度大于或者等于所述正确文本的语序流畅度时,将所述第一输出文本作为第二输入文本提供给所述文本生成模型,以使得所述文本生成模型将所述第二输入文本转化成至少一条第二输出文本,直至所述文本生成模型满足预设条件,所述第二输出文本的语序流畅度小于所述正确文本的语序流畅度。When the word order fluency of the first output text is greater than or equal to the word order fluency of the correct text, the first output text is provided as a second input text to the text generation model, so that the text is generated The model converts the second input text into at least one second output text until the text generation model meets a preset condition, and the word order fluency of the second output text is less than the word order fluency of the correct text.
一种基于人工智能的文本数据增强装置,所述基于人工智能的文本数据增强装置包括:An artificial intelligence-based text data enhancement device. The artificial intelligence-based text data enhancement device includes:
文本训练模块,用于将文本数据库中的第一输入文本提供给文本生成模型,并由所述文本生成模型将所述第一输入文本转化成至少一条第一输出文本;The text training module is used to provide the first input text in the text database to the text generation model, and the text generation model converts the first input text into at least one first output text;
语序流畅度计算模块,用于计算所述第一输出文本的语序流畅度;A word order fluency calculation module, used to calculate the word order fluency of the first output text;
语序流畅度比较模块,用于将所述第一输出文本的语序流畅度与正确文本的语序流畅度比较;Word order fluency comparison module, used to compare the word order fluency of the first output text with the word order fluency of the correct text;
输入文本增量模块,用于当所述第一输出文本的语序流畅度大于或者等于所述正确文本的语序流畅度时,将所述第一输出文本作为第二输入文本提供给所述文本生成模型,以使得所述文本生成模型将所述第二输入文本转化成至少一条第二输出文本,直至所述文本生成模型满足预设条件,所述第二输出文本的语序流畅度小于所述正确文本的语序流畅度。The input text increment module is used to provide the first output text as the second input text to the text generation when the word sequence fluency of the first output text is greater than or equal to the word sequence fluency of the correct text A model so that the text generation model converts the second input text into at least one second output text until the text generation model meets a preset condition, and the fluency of the word sequence of the second output text is less than the correct Fluency of the word order of the text.
一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述处理器执行所述计算机可读指令时实现上述任一种基于人工智能的文本数据增强方法的步骤。A computer device includes a memory and a processor. The memory stores computer-readable instructions. When the processor executes the computer-readable instructions, any of the steps of the artificial intelligence-based text data enhancement method described above is implemented.
一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可读指令所述计算机可读指令被一个或多个处理器执行时实现上述任一种基于人工智能的文本数据增强方法的步骤。A computer-readable storage medium having computer-readable instructions stored thereon when the computer-readable instructions are executed by one or more processors to implement any of the above artificial intelligence-based text data enhancement methods A step of.
与现有技术相比,本申请公开的技术方案主要有以下有益效果:Compared with the prior art, the technical solution disclosed in this application mainly has the following beneficial effects:
在本申请的实施例中,通过将语序流畅度大于或者等于所述正确文本的所述第一输出文本作为所述第二输入文本提供给所述文本生成模型,并由所述文本生成模型将所述第二输入文本转化成至少一条所述第二输出文本。所述文本生成模型对所述第二输入文本进行错误训练,使得所述第二输出文本的语序流畅度小于所述正确文本的语序流畅度。通过以语序流畅度大于或者等于所述正确文本的所述第二输入文本输入所述文本生成模型,并由所述文本生成模型将所述第二输入文本转化成至少一条所述第二输出文本,因此进一步增加了用于 给所述文本生成模型训练的数据量,有利于减少节省所述文本生成模型的训练时间,使得所述文本生成模型能够在更短的时间内实现收敛,有利于克服给所述文本生成模型训练的数据量不足的问题。In an embodiment of the present application, by providing the first output text with a word order fluency greater than or equal to the correct text as the second input text to the text generation model, the text generation model will The second input text is converted into at least one piece of the second output text. The text generation model incorrectly trains the second input text, so that the word order fluency of the second output text is less than the word order fluency of the correct text. Inputting the text generation model by the second input text with a word order fluency greater than or equal to the correct text, and converting the second input text into at least one second output text by the text generation model Therefore, the amount of data used to train the text generation model is further increased, which is helpful to reduce the training time of the text generation model, so that the text generation model can achieve convergence in a shorter time, which is beneficial to overcome The problem of insufficient data training for the text generation model.
为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。In order to more clearly explain the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. Those of ordinary skill in the art can obtain other drawings based on these drawings without paying any creative labor.
图1为本申请的一实施例中所述基于人工智能的文本数据增强方法的示意图;1 is a schematic diagram of a text data enhancement method based on artificial intelligence described in an embodiment of the present application;
图2为本申请的一实施例中所述基于人工智能的文本数据增强方法的另一示意图;2 is another schematic diagram of an artificial intelligence-based text data enhancement method described in an embodiment of this application;
图3为本申请的一实施例中智能客服机器人的seq2seq模型进行文本生成训练的示意图;3 is a schematic diagram of text generation training of a seq2seq model of an intelligent customer service robot in an embodiment of this application;
图4为本申请的一实施例中智能客服机器人的seq2seq模型进行文本生成训练的另一示意图;4 is another schematic diagram of text generation training of a seq2seq model of an intelligent customer service robot in an embodiment of the present application;
图5为本申请的一实施例中所述基于人工智能的文本数据增强装置的示意图;5 is a schematic diagram of an artificial intelligence-based text data enhancement device according to an embodiment of the application;
图6为本申请的一实施例中计算机设备100基本结构框图。FIG. 6 is a block diagram of the basic structure of the computer device 100 in an embodiment of the present application.
附图标记说明:Description of reference signs:
为了便于理解本申请,下面将参照相关附图对本申请进行更全面的描述。附图中给出了本申请的较佳实施例。但是,本申请可以以许多不同的形式来实现,并不限于本文所描述的实施例。相反地,提供这些实施例的目的是使对本 申请的公开内容的理解更加透彻全面。In order to facilitate understanding of the application, the application will be described more fully below with reference to related drawings. The drawings show preferred embodiments of the present application. However, this application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中在本申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field of the present application. The terminology used in the specification of the present application herein is for the purpose of describing specific embodiments only, and is not intended to limit the present application.
本申请的一实施例公开一种基于人工智能的文本数据增强方法。An embodiment of the present application discloses a text data enhancement method based on artificial intelligence.
参考图1和图2,其中图1为本申请的一实施例中所述基于人工智能的文本数据增强方法的示意图,图2为本申请的一实施例中所述基于人工智能的文本数据增强方法的另一示意图。Referring to FIGS. 1 and 2, FIG. 1 is a schematic diagram of an artificial intelligence-based text data enhancement method according to an embodiment of the application, and FIG. 2 is an artificial intelligence-based text data enhancement method according to an embodiment of the application. Another schematic of the method.
如图1中所示意的,所述基于人工智能的文本数据增强方法包括:As illustrated in FIG. 1, the text data enhancement method based on artificial intelligence includes:
S1:将文本数据库中的第一输入文本提供给文本生成模型,并由所述文本生成模型将所述第一输入文本转化成至少一条第一输出文本。S1: Provide the first input text in the text database to the text generation model, and convert the first input text into at least one first output text by the text generation model.
S2:计算所述第一输出文本的语序流畅度。S2: Calculate the fluency of the word sequence of the first output text.
S3:将所述第一输出文本的语序流畅度与正确文本的语序流畅度比较。S3: Compare the fluency of the word sequence of the first output text with the fluency of the word sequence of the correct text.
S4a:当所述第一输出文本的语序流畅度大于或者等于所述正确文本的语序流畅度时,将所述第一输出文本作为第二输入文本提供给所述文本生成模型,以使得所述文本生成模型将所述第二输入文本转化成至少一条第二输出文本,直至所述文本生成模型满足预设条件,所述第二输出文本的语序流畅度小于所述正确文本的语序流畅度。所述预设条件包括所述文本生成模型实现收敛。S4a: When the word order fluency of the first output text is greater than or equal to the word order fluency of the correct text, provide the first output text as the second input text to the text generation model, so that the The text generation model converts the second input text into at least one second output text until the text generation model meets a preset condition, and the word order fluency of the second output text is less than the word order fluency of the correct text. The preset condition includes that the text generation model achieves convergence.
在本申请实施例的S4a中,将语序流畅度大于或者等于所述正确文本的所述第一输出文本作为所述第二输入文本提供给所述文本生成模型,并由所述文本生成模型将所述第二输入文本转化成至少一条所述第二输出文本。所述文本生成模型对所述第二输入文本进行错误训练,使得所述第二输出文本的语序流畅度小于所述正确文本的语序流畅度。所述“错误训练”可以理解成是将语序流畅度大于或者等于所述正确文本的所述第一输出文本作为所述第二输入文本提供给所述文本生成模型进行训练,得到语序流畅度小于所述正确文本的所述第二输出文本。In S4a of the embodiment of the present application, the first output text with a word order fluency greater than or equal to the correct text is provided as the second input text to the text generation model, and the text generation model will The second input text is converted into at least one piece of the second output text. The text generation model incorrectly trains the second input text, so that the word order fluency of the second output text is less than the word order fluency of the correct text. The "wrong training" can be understood as providing the first output text with a word order fluency greater than or equal to the correct text as the second input text to the text generation model for training, resulting in a word order fluency less than The second output text of the correct text.
由于所述文本生成模型能够将所述第二输入文本的语素进行重新组合,通常不会组合出所述第二输入文本本身。因此如果是将语序流畅度大于或者等于所述正确文本的所述第二输入文本输入所述文本生成模型,则会组合得出语序流畅度小于所述正确文本的的至少一条所述第二输出文本。在本申请的实施例中,通过以语序流畅度大于或者等于所述正确文本的所述第二输入文本输入所 述文本生成模型,并由所述文本生成模型将所述第二输入文本转化成至少一条所述第二输出文本,因此进一步增加了用于给所述文本生成模型训练的数据量,有利于减少节省所述文本生成模型的训练时间,使得所述文本生成模型能够在更短的时间内实现收敛。Since the text generation model can recombine the morphemes of the second input text, the second input text itself is usually not combined. Therefore, if the second input text whose word order fluency is greater than or equal to the correct text is input into the text generation model, at least one of the second outputs whose word order fluency is less than the correct text will be combined text. In an embodiment of the present application, the text generation model is input by the second input text with a word order fluency greater than or equal to the correct text, and the second input text is converted into At least one of the second output texts, thus further increasing the amount of data used to train the text generation model, which is beneficial to reduce the training time of the text generation model, so that the text generation model can be shortened Achieve convergence within time.
S1、S2、S3、S4a可以反复进行,直至所述文本生成模型收敛时,停止给所述文本生成模型提供所述第二输入文本。S1, S2, S3, and S4a may be repeated until the text generation model converges, and stop providing the second input text to the text generation model.
如图2中所示意的,为了进一步增加输入文本的数据量,在S3后所述基于人工智能的文本数据增强方法还包括:As illustrated in FIG. 2, in order to further increase the data volume of the input text, the text data enhancement method based on artificial intelligence after S3 further includes:
S4b:当所述第一输出文本的语序流畅度小于所述正确文本的语序流畅度时,将所述第一输出文本提供给所述文本生成模型。S4b: When the word order fluency of the first output text is less than the word order fluency of the correct text, the first output text is provided to the text generation model.
在本申请的实施例中,通过将所述文本生成模型转化成的语序流畅度小于所述正确文本的的所述第一输出文本重新提供给所述文本生成模型,因此能够增加所述文本数据库数据量,有利于克服所述文本数据库的数据量不足的问题,降低了获取符合要求的所述第一输入文本的困难,提高了所述文本生成模型的训练效率。In the embodiment of the present application, the first output text converted into a text sequence model with a word order fluency less than the correct text is re-provided to the text generation model, so the text database can be increased The amount of data is beneficial to overcome the problem of insufficient data amount of the text database, reduces the difficulty of obtaining the first input text that meets the requirements, and improves the training efficiency of the text generation model.
S1、S2、S3以及S4b可以反复进行,直至所述文本生成模型收敛时,停止给所述文本生成模型提供所述第一输入文本。S1, S2, S3, and S4b may be repeated until the text generation model converges, and then stop providing the first input text to the text generation model.
需要说明的是,图1中示意的各步骤与图2中示意的各步骤可以同时执行。此外,S4a和S4b的执行顺序并无先后之分。It should be noted that the steps shown in FIG. 1 and the steps shown in FIG. 2 can be performed simultaneously. In addition, the execution order of S4a and S4b is not different.
在本申请的一些实施例中,所述计算所述第一输出文本的语序流畅度包括:In some embodiments of the present application, the calculating the word order fluency of the first output text includes:
f(x)表示所述语序流畅度;P(x
i|x<i)指的是给定所述第一输出文本的上文,所述第一输出文本的下文P(x
i)的语言模型概率。
f(x) represents the fluency of the word order; P(x i |x<i) refers to the language of the following P(x i ) given the above of the first output text Model probability.
进一步地,在本申请的实施例中,所述语言模型概率通过语言模型计算获得,所述语言模型包括n-gram语言模型和神经概率语言模型。Further, in the embodiment of the present application, the language model probability is obtained by calculating a language model, and the language model includes an n-gram language model and a neural probabilistic language model.
在本申请的实施例中,所述“上文”和所述“下文”可以作如下的理解:In the embodiments of the present application, the "above" and the "below" can be understood as follows:
“上文”为所述第一输出文本的主语时,“下文”为所述第一输出文本的谓语。例如,所述第一输出文本为:我喜欢。其中,“我”为上文,则“喜欢”为下文。When "above" is the subject of the first output text, "below" is the predicate of the first output text. For example, the first output text is: I like it. Among them, "I" is above, then "like" is below.
“上文”为所述第一输出文本的主语和谓语时,“下文”为所述第一输出文 本的宾语。例如,所述第一输出文本为:我喜欢苹果。其中,“我喜欢”为上文,则“苹果”为下文。When "above" is the subject and predicate of the first output text, "below" is the object of the first output text. For example, the first output text is: I like apples. Among them, "I like" is above, then "Apple" is below.
总而言之,所述“上文”可以理解成是已经给出的且确定的词句,所述“下文”可以理解成是在语言模型中出现在“上文”后面的词句。In a word, the "above" can be understood as the words and sentences that have been given and determined, and the "below" can be understood as the words and sentences appearing after the "above" in the language model.
“语言模型概率”指的是在给定上文时,某一种下文出现的概率。出现在同一上文后面的不同下文的语言模型概率是不一样的。在结合上文的基础上,通常语序流畅度大于或者等于所述正确文本的下文具有相对较大的语言模型概率。例如,给定上文“我喜欢”时,下文为“吃苹果”的语言模型概率要大于下文为“不喜欢”的语言模型概率。"Language model probability" refers to the probability that a certain kind of context appears when given the context above. The probabilities of different language models appearing behind the same above are different. On the basis of combining the above, usually the following words with fluency greater than or equal to the correct text have a relatively large probability of language models. For example, given the above "I like it", the probability of the language model below "eating apples" is greater than the probability of the language model below "dislikes".
在本申请的实施例中,H(x)可以理解成信息熵,所述信息熵越大表明下文出现某一词句的不确定性越大。In the embodiment of the present application, H(x) can be understood as information entropy, and the greater the information entropy, the greater the uncertainty of a certain word or sentence appearing below.
下面将举例说明所述第一输出文本的语序流畅度与对应的所述正确文本的语序流畅度比较。An example will be given below to compare the word order fluency of the first output text with the corresponding word order fluency of the correct text.
假定所述正确文本的语序流畅度为1.6。所述第一输入文本输入所述文本生成模型后,所述文本生成模型转化出5条所述第一输出文本。5条所述第一输出文本的语序流畅度分别为0.7、0.9、1.2、1.8、1.4。假定认为语序流畅度为1.8的所述第一输出文本没有语病,而流程度为0.7、0.9、1.2、1.4的所述第一输出文本则认为有语病。将有语病的4条所述第一输出文本存入所述文本数据库中,然后提供给所述文本生成模型进行训练。而将没有语病的1条所述第一输出文本则直接提供所述文本生成模型进行错误训练,将所述文本生成模型进行错误训练获得的语序流畅度小于所述正确文本的所述第二输出文本提供给所述文本生成模型进行训练,增用于给所述文本生成模型训练的数据量。It is assumed that the word order fluency of the correct text is 1.6. After the first input text is input to the text generation model, the text generation model converts five first output texts. The fluency of the word sequence of the five first output texts is 0.7, 0.9, 1.2, 1.8, and 1.4, respectively. It is assumed that the first output text with a word order fluency of 1.8 is free of speech problems, and the first output text with a flow degree of 0.7, 0.9, 1.2, and 1.4 is considered to have a speech disease. 4 said first output texts with language problems are stored in the text database, and then provided to the text generation model for training. The first output text without linguistics directly provides the text generation model for error training, and the word order fluency obtained by performing error training on the text generation model is less than the second output of the correct text The text is provided to the text generation model for training, and the amount of data used for training the text generation model is increased.
在本申请的一些实施例中,所述将所述第一输出文本作为第二输入文本提供给所述文本生成模型的步骤包括:将所述第一输出文本与所述正确文本组成一个文本数据对,将所述文本数据对中的所述第一输出文本为所述第二输入文本提供给所述文本生成模型。所述第一输出文本对应唯一一条所述正确文本。In some embodiments of the present application, the step of providing the first output text as the second input text to the text generation model includes: forming the first output text and the correct text into one text data Yes, the first output text in the text data pair is provided to the text generation model as the second input text. The first output text corresponds to only one correct text.
由于所述第一输出文本需要与对应的所述正确文本比较语序流畅度,因此将所述第一输出文本与对应的所述正确文本组成一个所述文本数据对有利于快速确定与所述第一输出文本进行语序流畅度比较的所述正确文本。Since the first output text needs to compare the word order fluency with the corresponding correct text, it is advantageous to quickly determine the An output text for the correct text for word order fluency comparison.
在本申请的一些实施例中,所述文本生成模型包括:RNN(Recurrent Neural Network,神经网络)结构模型和seq2seq模型。将所述第一输入文本和所述第 二输入文本提供给所述文本生成模型的目的在于使所述文本生成模型收敛,因此当所述文本生成模型收敛时,停止给所述文本生成模型提供所述第一输入文本和所述第二输入文本。In some embodiments of the present application, the text generation model includes: an RNN (Recurrent Neural Network) structure model and a seq2seq model. The purpose of providing the first input text and the second input text to the text generation model is to converge the text generation model, so when the text generation model converges, stop providing the text generation model with The first input text and the second input text.
下面将以智能客服机器人的seq2seq模型进行文本生成训练为例进一步阐述上述实施例中文本数据增强的方法的具体应用。The specific application of the text data enhancement method in the above embodiment will be further explained by taking the seq2seq model of the intelligent customer service robot for text generation training as an example.
参考图3,为本申请的一实施例中智能客服机器人的seq2seq模型进行文本生成训练的示意图。其具体实现过程详叙如下:Referring to FIG. 3, it is a schematic diagram of text generation training of a seq2seq model of an intelligent customer service robot in an embodiment of the present application. The specific implementation process is detailed as follows:
S51:获取预设的文本数据库中的文本数据对,并将文本数据对输入到seq2seq模型,其中,文本数据对包括第一输出文本。S51: Obtain a text data pair in a preset text database, and input the text data pair to the seq2seq model, where the text data pair includes the first output text.
如图3中所示意的,用于文本生成训练的所述第一输入文本和所述正确文本组成所述文本数据对并存储在所述文本数据库中。对所述智能客服机器人的seq2seq模型进行文本生成训练时,调取所述文本数据库中的所述文本数据对,并将所述文本数据对中的所述第一输出文本提供给所述seq2seq模型。As illustrated in FIG. 3, the first input text and the correct text for text generation training constitute the text data pair and are stored in the text database. When performing text generation training on the seq2seq model of the intelligent customer service robot, the text data pair in the text database is retrieved, and the first output text in the text data pair is provided to the seq2seq model .
S52:通过seq2seq模型计算第一输出文本的语序流畅度,并将该语序流畅度与正确文本的语序流畅度比较,确定比较结果。S52: Calculate the word order fluency of the first output text through the seq2seq model, compare the word order fluency with the word order fluency of the correct text, and determine the comparison result.
所述seq2seq模型将所述第一输出文本转化成多条所述第一输出文本。由所述seq2seq模型转化获得的所有所述第一输出文本组成输出文本集合。然后计算每一条所述第一输出文本的语序流畅度。将每一条所述第一输出文本的语序流畅度与对应的所述正确文本的语序流畅度比较。The seq2seq model converts the first output text into multiple pieces of the first output text. All the first output texts converted from the seq2seq model constitute an output text set. Then calculate the word order fluency of each of the first output texts. Compare the word order fluency of each first output text with the corresponding word order fluency of the correct text.
S53:根据比较结果,判断seq2seq模型是否收敛。S53: According to the comparison result, determine whether the seq2seq model has converged.
判断所述seq2seq模型是否收敛。当所述seq2seq模型没有收敛时,将语序流畅度小于所述正确文本的所述第一输出文本与所述正确文本组成新的文本数据对,并存储至所述文本数据库中。Determine whether the seq2seq model has converged. When the seq2seq model does not converge, the first output text whose word order fluency is less than the correct text and the correct text form a new text data pair, and store it in the text database.
需要说明的是,判断所述seq2seq模型是否收敛的步骤并不限定图3中示意的位置。例如,在所述seq2seq模型将所述第一输入文本转化成多条所述第一输出文本后就可以判断所述seq2seq模型是否收敛。It should be noted that the step of determining whether the seq2seq model has converged does not limit the position shown in FIG. 3. For example, after the seq2seq model converts the first input text into multiple first output texts, it can be determined whether the seq2seq model has converged.
S54:若seq2seq模型没有收敛,则返回通过seq2seq模型计算第一输出文本的语序流畅度的步骤继续执行,直到seq2seq模型收敛,得到训练好的seq2seq模型。S54: If the seq2seq model does not converge, return to the step of calculating the word order fluency of the first output text through the seq2seq model, and continue to execute until the seq2seq model converges to obtain the trained seq2seq model.
在判断得出seq2seq模型没有收敛时,计算每一条所述第一输出文本的语序流畅度,然后将每一条所述第一输出文本的语序流畅度与对应的所述正确文本 的语序流畅度比较。When it is determined that the seq2seq model does not converge, calculate the word order fluency of each first output text, and then compare the word order fluency of each first output text with the corresponding word order fluency of the correct text .
上述将语序流畅度小于所述正确文本的所述第一输出文本提供给所述seq2seq模型进行文本生成训练的过程循环进行,直至判断得出所述seq2seq模型收敛。在所述seq2seq模型收敛后将结束循环,停止给所述seq2seq模型提供所述第一输入文本。The above process of supplying the first output text with a word order fluency less than the correct text to the seq2seq model for text generation training is cyclically performed until it is determined that the seq2seq model has converged. After the seq2seq model converges, the loop will end, and the first input text will be stopped for the seq2seq model.
参考图4,为本申请的一实施例中智能客服机器人的seq2seq模型进行文本生成训练的另一示意图,其具体实现过程详叙如下:Referring to FIG. 4, another schematic diagram of text generation training of the seq2seq model of the intelligent customer service robot in an embodiment of the present application is described in detail as follows:
S61:获取预设的文本数据库中的文本数据对,并将该文本数据对输入到seq2seq模型,其中,文本数据对包括第一输出文本。S61: Obtain a text data pair in a preset text database, and input the text data pair to the seq2seq model, where the text data pair includes the first output text.
如图4中所示意的,用于文本生成训练的所述第一输入文本和所述正确文本组成文本数据对并存储在文本数据库中。对所述智能客服机器人的seq2seq模型进行文本生成训练时,调取所述文本数据库中的文本数据对,并将文本数据对中的所述第一输出文本提供给seq2seq模型。As illustrated in FIG. 4, the first input text and the correct text used for text generation training form a text data pair and are stored in a text database. When performing text generation training on the seq2seq model of the intelligent customer service robot, the text data pair in the text database is retrieved, and the first output text in the text data pair is provided to the seq2seq model.
S62:通过seq2seq模型计算第一输出文本的语序流畅度,并将语序流畅度与正确文本的语序流畅度比较,确定比较结果;S62: Calculate the word order fluency of the first output text through the seq2seq model, compare the word order fluency with the word order fluency of the correct text, and determine the comparison result;
所述seq2seq模型将所述第一输入文本转化成多条所述第一输出文本。由所述seq2seq模型转化获得的所有所述第一输出文本组成输出文本集合。然后计算每一条所述第一输出文本的语序流畅度。将每一条所述第一输出文本的语序流畅度与对应的所述正确文本的语序流畅度比较。The seq2seq model converts the first input text into multiple first output texts. All the first output texts converted from the seq2seq model constitute an output text set. Then calculate the word order fluency of each of the first output texts. Compare the word order fluency of each first output text with the corresponding word order fluency of the correct text.
S63:根据比较结果,判断seq2seq模型是否收敛;S63: According to the comparison result, judge whether the seq2seq model has converged;
根据步骤S62中得到的语序流畅度比较结果,判断所述seq2seq模型是否收敛。According to the word order fluency comparison result obtained in step S62, it is determined whether the seq2seq model has converged.
S64:若seq2seq模型未收敛,则将语序流畅度不小于正确文本的语序流畅度的第一输出文本,作为第二输出文本,并将第二输出文本进行分割后,输入到seq2seq模型中,继续计算分割后的第二输出文本的语序流畅度,直到所述seq2seq模型收敛,得到训练好的seq2seq模型。S64: If the seq2seq model does not converge, the first output text with word order fluency not less than the correct text is used as the second output text, and the second output text is segmented and input into the seq2seq model to continue Calculate the word order fluency of the segmented second output text until the seq2seq model converges to obtain a trained seq2seq model.
当所述seq2seq模型没有收敛时,将所述输出文本集合中语序流畅度大于或者等于所述正确文本的所述第一输出文本作为所述第二输入文本提供给所述seq2seq模型,然后由所述seq2seq模型将所述第二输入文本转化成多条语序流畅度小于所述正确文本的所述第二输出文本。所述多条语序流畅度小于所述正确文本的所述第二输出文本组成新的输出文本集合。将每一条所述第二输出文 本与所述正确文本组成新的文本数据对,并存储至所述文本数据库中。将语序流畅度大于或者等于所述正确文本的所述第二输入文本转换成多条语序流畅度小于所述正确文本的所述第二输出文本,并提供给所述seq2seq模型进行文本生成训练的过程循环进行,直至判断得出所述seq2seq模型收敛。在所述seq2seq模型收敛后将结束循环,停止给所述seq2seq模型提供所述第二输入文本。When the seq2seq model does not converge, the first output text in the output text set whose word order fluency is greater than or equal to the correct text is provided as the second input text to the seq2seq model, and then the The seq2seq model converts the second input text into a plurality of second output texts whose word order fluency is less than the correct text. The plurality of second output texts whose word order fluency is less than the correct text form a new output text set. Each second output text and the correct text form a new text data pair, and are stored in the text database. Convert the second input text with a word order fluency greater than or equal to the correct text into multiple second output texts with a word order fluency less than the correct text, and provide the seq2seq model for text generation training The process loops until it is determined that the seq2seq model has converged. After the seq2seq model converges, the loop will end, and the second input text will be stopped from being provided to the seq2seq model.
下面将列举出实例说明本申请实施例中的技术方案。The following will list examples to illustrate the technical solutions in the embodiments of the present application.
表格1Table 1
请参考表格1,在表格1中提供给所述智能客服机器人的seq2seq模型的第一输入文本为“升起从东边太阳”,对应的所述正确文本为“太阳从东边升起”。所述智能客服机器人的seq2seq模型将第一输入文本“升起从东边太阳”转化成多条第一输出文本。表格1中只是展示了若干可能的第一输出文本,并不是第一输入文本“升起从东边太阳”在经seq2seq模型转化后所有可能的第一输出文本。Please refer to Table 1. In Table 1, the first input text provided to the seq2seq model of the intelligent customer service robot is "the sun rises from the east", and the corresponding correct text is "the sun rises from the east". The seq2seq model of the intelligent customer service robot converts the first input text "rising from the east sun" into multiple first output texts. Table 1 only shows a number of possible first output texts, not all possible first output texts of the first input text "Rising from the East Sun" after conversion by the seq2seq model.
假定所述正确文本“太阳从东边升起”的语序流畅度为1。表格1中所展示的各第一输出文本的语序流畅度都小于1,因此均存在一定的语病。表格1中所展示的各第一输出文本的语序流畅度小于1。将表格1中展示的所有第一输出文本分别与所述正确文本组成文本数据对,并存储在文本数据库中。此时,表格1中展示的所有第一输出文本转化成第一输入文本,并提供给所述智能客服机器人的seq2seq模型进行下一轮的文本生成训练。It is assumed that the correctness of the correct text "the sun rises from the east" is 1. The word order fluency of each first output text shown in Table 1 is less than 1, so there is a certain language disorder. The word order fluency of each first output text shown in Table 1 is less than 1. All the first output texts shown in Table 1 are paired with the correct texts to form text data pairs, and stored in the text database. At this time, all the first output text shown in Table 1 is converted into the first input text, and provided to the seq2seq model of the intelligent customer service robot for the next round of text generation training.
当表格1中的输入文本一栏拥有更多的第一输入文本时,将会获得更多的第一输出文本。在所述智能客服机器人的seq2seq模型的下一轮的文本生成训练中,文本数据库将能够向所述智能客服机器人的seq2seq模型提供数倍的第一输入文本。因此所述智能客服机器人的seq2seq模型在训练过程中将能够自动增加第一输入文本,使得文本数据得到增强,有利于克服输入文本数据量不足的问 题,降低了获取符合要求的第一输入文本的困难。When the input text column in Table 1 has more first input text, more first output text will be obtained. In the next round of text generation training of the seq2seq model of the intelligent customer service robot, the text database will be able to provide multiple times of the first input text to the seq2seq model of the intelligent customer service robot. Therefore, the seq2seq model of the intelligent customer service robot will be able to automatically increase the first input text during the training process, so that the text data is enhanced, which is beneficial to overcome the problem of insufficient input text data and reduces the amount of first input text that meets the requirements. difficult.
表格2Form 2
请参考表格2,在表格2中提供给所述智能客服机器人的seq2seq模型的第一输入文本为“国祖我你爱”,对应的所述正确文本为“祖国我爱你”。所述智能客服机器人的seq2seq模型将第一输入文本“国祖我你爱”转化成多条第一输出文本。表格2中只是展示了若干可能的第一输出文本,并不是第一输入文本“国祖我你爱”在经seq2seq模型转化后所有可能的第一输出文本。Please refer to Table 2. In Table 2, the first input text of the seq2seq model provided to the intelligent customer service robot is "Guo Zu I You Love", and the corresponding correct text is "Mother I Love You". The seq2seq model of the intelligent customer service robot converts the first input text "Guo Zu I You Love" into multiple first output texts. Table 2 only shows a number of possible first output texts, not all possible first output texts of the first input text "Guo Zu I You Love" after conversion by the seq2seq model.
假定所述正确文本“祖国我爱你”的语序流畅度为1。在表格2中部分的第一输出文本的语序流畅度小于1,说明这部分第一输出文本存在语病。此外在表格2中,第一输出文本“我爱你祖国”的语序流畅度大于1,因此该条第一输出文本不存在语病。将第一输出文本“我爱你祖国”作为所述第二输入文本提供给所述智能客服机器人的seq2seq模型。所述智能客服机器人的seq2seq模型将会对第二输入文本“我爱你祖国”进行错误训练,转化成若干条语序流畅度小于1的第二输出文本。然后将错误训练获得的若干条语序流畅度小于1的第二输出文本与所述正确文本组成文本数据对存入文本数据库中。在所述智能客服机器人的seq2seq模型的下一轮的文本生成训练中,从所述文本数据库中调取错误训练获得的若干条语序流畅度小于1的第二输出文本,并提供给所述智能客服机器人的seq2seq模型进行训练。上述对第二输入文本进行错误训练获得若干条语序流畅度小于1的第二输出文本的方法同样能够自动增加文本数据量,起到增强文本数据的作用,并且有利于进一步克服输入文本数据量不足的问题,降低了获取符合要求的第一输入文本的困难。It is assumed that the correct order of the correct text "I love you in the motherland" is 1. The word order fluency of the part of the first output text in Table 2 is less than 1, indicating that there is a linguistic disorder in the part of the first output text. In addition, in Table 2, the word order fluency of the first output text "I love your motherland" is greater than 1, so there is no linguistic disorder in the first output text. The first output text "I love your motherland" is provided as the second input text to the seq2seq model of the intelligent customer service robot. The seq2seq model of the intelligent customer service robot will erroneously train the second input text "I love your motherland" and convert it into several second output texts with a word order fluency of less than 1. Then, a plurality of second output texts obtained by error training and having the second order text with a fluency of less than 1 and the correct text form text data pairs and stored in the text database. In the next round of text generation training of the seq2seq model of the intelligent customer service robot, several second output texts with less than 1 word order fluency obtained from wrong training are retrieved from the text database and provided to the intelligent The seq2seq model of the customer service robot is trained. The above method for incorrectly training the second input text to obtain several second output texts with a word order fluency of less than 1 can also automatically increase the amount of text data, play a role in enhancing text data, and help to further overcome the lack of input text data The problem of reducing the difficulty of obtaining the first input text that meets the requirements.
需要说明的是,虽然表格1和表格2中语序流畅度的值为正,但是在本申请的一些可能的实施例中,所述语序流畅度的值也可以是负值。It should be noted that although the value of the word order fluency in Table 1 and Table 2 is positive, in some possible embodiments of the present application, the value of the word order fluency may also be a negative value.
本申请的一实施例公开了一种基于人工智能的文本数据增强装置。An embodiment of the present application discloses a text data enhancement device based on artificial intelligence.
参考图5,为本申请的一实施例中所述基于人工智能的文本数据增强装置的示意图。Referring to FIG. 5, it is a schematic diagram of an artificial intelligence-based text data enhancement device according to an embodiment of the present application.
如图5中所示意的,所述基于人工智能的文本数据增强装置包括:As illustrated in FIG. 5, the text data enhancement device based on artificial intelligence includes:
文本训练模块10,用于将文本数据库中的第一输入文本提供给文本生成模型,并由所述文本生成模型将所述第一输入文本转化成至少一条第一输出文本;The text training module 10 is used to provide the first input text in the text database to the text generation model, and the text generation model converts the first input text into at least one first output text;
语序流畅度计算模块20,用于计算所述第一输出文本的语序流畅度;The word order fluency calculation module 20 is used to calculate the word order fluency of the first output text;
语序流畅度比较模块30,用于将所述第一输出文本的语序流畅度与正确文本的语序流畅度比较;Word order fluency comparison module 30, used to compare the word order fluency of the first output text with the word order fluency of the correct text;
输入文本增量模块40,用于当所述第一输出文本的语序流畅度大于或者等于所述正确文本的语序流畅度时,将所述第一输出文本作为第二输入文本提供给所述文本生成模型,以使得所述文本生成模型将所述第二输入文本转化成至少一条第二输出文本,直至所述文本生成模型满足预设条件,所述第二输出文本的语序流畅度小于所述正确文本的语序流畅度。The input text increment module 40 is configured to provide the first output text as the second input text to the text when the word sequence fluency of the first output text is greater than or equal to the word sequence fluency of the correct text Generating a model so that the text generation model converts the second input text into at least one second output text until the text generation model meets a preset condition, and the fluency of the word sequence of the second output text is less than the Fluency of the word order of the correct text.
在本申请的一些实施例中,所述语序流畅度计算模块20通过以下公式计算所述第一输出文本的语序流畅度:In some embodiments of the present application, the word order fluency calculation module 20 calculates the word order fluency of the first output text by the following formula:
f(x)表示所述语序流畅度;P(x
i|x<i)指的是给定所述第一输出文本的上文,所述第一输出文本的下文P(x
i)的语言模型概率。
f(x) represents the fluency of the word order; P(x i |x<i) refers to the language of the following P(x i ) given the above of the first output text Model probability.
在本申请的一些实施例中,所述语序流畅度计算模块20通过语言模型计算获得所述语言模型概率,所述语言模型包括n-gram语言模型和神经概率语言模型。In some embodiments of the present application, the word order fluency calculation module 20 obtains the language model probability through language model calculation, and the language model includes an n-gram language model and a neural probabilistic language model.
在本申请的一些实施例中,所述文本训练模块10将所述第一输出文本与所述正确文本组成一个文本数据对,将所述文本数据对中的所述第一输出文本为所述第二输入文本提供给所述文本生成模型。In some embodiments of the present application, the text training module 10 composes the first output text and the correct text into a text data pair, and sets the first output text in the text data pair as the The second input text is provided to the text generation model.
在本申请的一些实施例中,所述文本训练模块10通过所述文本生成模型对所述第二输入文本进行错误训练,使得所述第二输出文本的语序流畅度小于所述正确文本的语序流畅度。In some embodiments of the present application, the text training module 10 performs error training on the second input text through the text generation model so that the word order fluency of the second output text is less than the word order of the correct text Fluency.
在本申请的一些实施例中,所述输入文本增量模块40还用于当所述第一输出文本的语序流畅度小于所述正确文本的语序流畅度时,将所述第一输出文本提供给所述文本生成模型。In some embodiments of the present application, the input text increment module 40 is further configured to provide the first output text when the word order fluency of the first output text is less than the word order fluency of the correct text Generate a model for the text.
在本申请的一些实施例中,当所述文本生成模型收敛时,所述文本训练模块10停止给所述文本生成模型提供所述第一输入文本和所述第二输入文本。In some embodiments of the present application, when the text generation model converges, the text training module 10 stops providing the text input model with the first input text and the second input text.
本申请的一实施例公开了一种计算机设备。具体请参考图6,为本申请的一实施例中计算机设备100基本结构框图。An embodiment of the present application discloses a computer device. For details, please refer to FIG. 6, which is a basic structural block diagram of the computer device 100 in an embodiment of the present application.
如图6中所示意的,所述计算机设备100包括通过系统总线相互通信连接存储器101、处理器102、网络接口103。需要指出的是,图6中仅示出了具有组件101-103的计算机设备100,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。本技术领域技术人员应当理解,这里的计算机设备是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程门阵列(Field-Programmable Gate Array,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。As illustrated in FIG. 6, the computer device 100 includes a memory 101, a processor 102, and a network interface 103 that communicate with each other through a system bus. It should be noted that FIG. 6 only shows the computer device 100 having the components 101-103, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead. Those skilled in the art should understand that the computer device here is a device that can automatically perform numerical calculation and/or information processing according to preset or stored instructions, and its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), programmable gate array (Field-Programmable Gate Array, FPGA), digital processor (Digital Signal Processor, DSP), embedded equipment, etc.
所述计算机设备可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述计算机设备可以与用户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互。The computer device may be a computing device such as a desktop computer, a notebook, a palmtop computer and a cloud server. The computer device can interact with the user through a keyboard, a mouse, a remote control, a touchpad, or a voice control device.
所述存储器101包括一个或多个存储有计算机可读指令的计算机可读存储介质,所述计算机可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,所述存储器101可以是所述计算机设备100的内部存储单元,例如该计算机设备100的硬盘或内存。在另一些实施例中,所述存储器101也可以是所述计算机设备100的外部存储设备,例如该计算机设备100上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,所述存储器101还可以既包括所述计算机设备100的内部存储单元也包括其外部存储设备。本实施例中,所述存储器101通常用于存储安装于所述计算机设备100的操作系统和各类应用软件,例如上述基于人工智能的文本数据增强方法的计算机可读指令等。此外,所述存储器101还可以用于暂时地存储已经输出或者将要输出的各类数据。The memory 101 includes one or more computer-readable storage media storing computer-readable instructions, the computer-readable storage media including a flash memory, a hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), Random access memory (RAM), static random access memory (SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk Wait. In some embodiments, the memory 101 may be an internal storage unit of the computer device 100, such as a hard disk or a memory of the computer device 100. In other embodiments, the memory 101 may also be an external storage device of the computer device 100, for example, a plug-in hard disk equipped on the computer device 100, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash card (Flash Card), etc. Of course, the memory 101 may also include both the internal storage unit of the computer device 100 and its external storage device. In this embodiment, the memory 101 is generally used to store an operating system and various application software installed on the computer device 100, such as the computer-readable instructions of the artificial intelligence-based text data enhancement method described above. In addition, the memory 101 may also be used to temporarily store various types of data that have been output or will be output.
所述处理器102在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器102通常用于控制所述计算机设备100的总体操作。本实施例中,所述处理器102用于运行所述存储器101中存储的计算机可读指令或者处理数据,例如运行上述基于人工智能的文本数据增强方法的计算机可读指令。In some embodiments, the processor 102 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 102 is generally used to control the overall operation of the computer device 100. In this embodiment, the processor 102 is configured to execute computer-readable instructions or process data stored in the memory 101, for example, computer-readable instructions to execute the above artificial intelligence-based text data enhancement method.
所述网络接口103可包括无线网络接口或有线网络接口,该网络接口103 通常用于在所述计算机设备100与其他电子设备之间建立通信连接。The network interface 103 may include a wireless network interface or a wired network interface, and the network interface 103 is generally used to establish a communication connection between the computer device 100 and other electronic devices.
本申请还提供了另一种实施方式,即提供一种计算机可读存储介质,所述计算机可读存储介质存储有单据信息录入对应的计算机可读指令,所述单据信息录入对应的计算机可读指令可被至少一个处理器执行,以使所述至少一个处理器执行上述任意一种基于人工智能的文本数据增强方法的步骤。The present application also provides another implementation manner, that is, to provide a computer-readable storage medium that stores computer-readable instructions corresponding to entry of document information, and computer-readable instructions corresponding to entry of document information The instructions may be executed by at least one processor, so that the at least one processor executes the steps of any of the above artificial intelligence-based text data enhancement methods.
最后应说明的是,显然以上所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例,附图中给出了本申请的较佳实施例,但并不限制本申请的专利范围。本申请可以以许多不同的形式来实现,相反地,提供这些实施例的目的是使对本申请的公开内容的理解更加透彻全面。尽管参照前述实施例对本申请进行了详细的说明,对于本领域的技术人员来而言,其依然可以对前述各具体实施方式所记载的技术方案进行修改,或者对其中部分技术特征进行等效替换。凡是利用本申请说明书及附图内容所做的等效结构,直接或间接运用在其他相关的技术领域,均同理在本申请专利保护范围之内。Finally, it should be noted that the above-described embodiments are obviously only a part of the embodiments of the present application, but not all the embodiments. The preferred embodiments of the present application are given in the drawings, but do not limit the patents of the present application range. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the foregoing embodiments, for those skilled in the art, they can still modify the technical solutions described in the foregoing specific embodiments, or equivalently replace some of the technical features . Any equivalent structure made by using the description and drawings of this application, directly or indirectly used in other related technical fields, is also within the scope of patent protection of this application.
Claims (20)
- 一种基于人工智能的文本数据增强方法,其特征在于,包括:A text data enhancement method based on artificial intelligence, which is characterized by including:将文本数据库中的第一输入文本提供给文本生成模型,并由所述文本生成模型将所述第一输入文本转化成至少一条第一输出文本;Providing the first input text in the text database to a text generation model, and converting the first input text into at least one first output text by the text generation model;计算所述第一输出文本的语序流畅度;Calculating the word order fluency of the first output text;将所述第一输出文本的语序流畅度与正确文本的语序流畅度比较;Compare the word order fluency of the first output text with the word order fluency of the correct text;当所述第一输出文本的语序流畅度大于或者等于所述正确文本的语序流畅度时,将所述第一输出文本作为第二输入文本提供给所述文本生成模型,以使得所述文本生成模型将所述第二输入文本转化成至少一条第二输出文本,直至所述文本生成模型满足预设条件,所述第二输出文本的语序流畅度小于所述正确文本的语序流畅度。When the word order fluency of the first output text is greater than or equal to the word order fluency of the correct text, the first output text is provided as a second input text to the text generation model, so that the text is generated The model converts the second input text into at least one second output text until the text generation model meets a preset condition, and the word order fluency of the second output text is less than the word order fluency of the correct text.
- 根据权利要求1所述的基于人工智能的文本数据增强方法,其特征在于,所述计算所述第一输出文本的语序流畅度包括:The artificial intelligence-based text data enhancement method according to claim 1, wherein the calculating the word order fluency of the first output text comprises:f(x)表示所述语序流畅度;P(x i|x<i)指的是给定所述第一输出文本的上文,所述第一输出文本的下文P(x i)的语言模型概率。 f(x) represents the fluency of the word order; P(x i |x<i) refers to the language of the following P(x i ) given the above of the first output text Model probability.
- 根据权利要求2所述的基于人工智能的文本数据增强方法,其特征在于,所述语言模型概率通过语言模型计算获得,所述语言模型包括n-gram语言模型和神经概率语言模型。The artificial intelligence-based text data enhancement method according to claim 2, wherein the language model probability is obtained by calculating a language model, and the language model includes an n-gram language model and a neural probabilistic language model.
- 根据权利要求1所述的基于人工智能的文本数据增强方法,其特征在于,所述将所述第一输出文本作为第二输入文本提供给所述文本生成模型的步骤包括:将所述第一输出文本与所述正确文本组成一个文本数据对,将所述文本数据对中的所述第一输出文本为所述第二输入文本提供给所述文本生成模型。The artificial intelligence-based text data enhancement method according to claim 1, wherein the step of providing the first output text as the second input text to the text generation model includes: The output text and the correct text form a text data pair, and the first output text in the text data pair is provided to the text generation model as the second input text.
- 根据权利要求1所述的基于人工智能的文本数据增强方法,其特征在于,通过所述文本生成模型对所述第二输入文本进行错误训练,使得所述第二输出文本的语序流畅度小于所述正确文本的语序流畅度。The artificial intelligence-based text data enhancement method according to claim 1, wherein the second input text is erroneously trained by the text generation model so that the second order text is fluent in word order State the fluency of the word order of the correct text.
- 根据权利要求1所述的基于人工智能的文本数据增强方法,其特征在于,所述基于人工智能的文本数据增强方法还包括:The artificial intelligence-based text data enhancement method according to claim 1, wherein the artificial intelligence-based text data enhancement method further comprises:获取预设的文本数据库中的文本数据对,并将所述文本数据对输入到所述 seq2seq模型,其中,所述文本数据对包括所述第一输出文本;Acquiring text data pairs in a preset text database, and inputting the text data pairs into the seq2seq model, wherein the text data pairs include the first output text;通过所述seq2seq模型计算第一输出文本的语序流畅度,并将所述语序流畅度与正确文本的语序流畅度比较,确定比较结果;Calculating the word order fluency of the first output text through the seq2seq model, comparing the word order fluency with the word order fluency of the correct text, and determining the comparison result;根据所述比较结果,判断所述seq2seq模型是否收敛;According to the comparison result, determine whether the seq2seq model has converged;若所述seq2seq模型未收敛,则返回所述通过所述seq2seq模型计算第一输出文本的语序流畅度的步骤继续执行,直到所述seq2seq模型收敛,得到训练好的seq2seq模型。If the seq2seq model does not converge, return to the step of calculating the word order fluency of the first output text by using the seq2seq model until the seq2seq model converges to obtain the trained seq2seq model.
- 根据权利要求1所述的基于人工智能的文本数据增强方法,其特征在于,所述基于人工智能的文本数据增强方法还包括:The artificial intelligence-based text data enhancement method according to claim 1, wherein the artificial intelligence-based text data enhancement method further comprises:获取预设的文本数据库中的文本数据对,并将所述文本数据对输入到所述seq2seq模型,其中,所述文本数据对包括所述第一输出文本;Acquiring text data pairs in a preset text database, and inputting the text data pairs into the seq2seq model, wherein the text data pairs include the first output text;通过所述seq2seq模型计算第一输出文本的语序流畅度,并将所述语序流畅度与正确文本的语序流畅度比较,确定比较结果;Calculating the word order fluency of the first output text through the seq2seq model, comparing the word order fluency with the word order fluency of the correct text, and determining the comparison result;根据所述比较结果,判断所述seq2seq模型是否收敛;According to the comparison result, determine whether the seq2seq model has converged;若所述seq2seq模型未收敛,则将语序流畅度不小于所述正确文本的语序流畅度的第一输出文本,作为第二输出文本,并将所述第二输出文本进行分割后,输入到所述seq2seq模型中,继续计算分割后的第二输出文本的语序流畅度,直到所述seq2seq模型收敛,得到训练好的seq2seq模型。If the seq2seq model does not converge, the first output text whose word order fluency is not less than the word order fluency of the correct text is used as the second output text, and the second output text is segmented and input to all In the seq2seq model, continue to calculate the word order fluency of the segmented second output text until the seq2seq model converges to obtain a trained seq2seq model.
- 一种基于人工智能的文本数据增强装置,其特征在于,包括:A text data enhancement device based on artificial intelligence, which is characterized by comprising:文本训练模块,用于将文本数据库中的第一输入文本提供给文本生成模型,并由所述文本生成模型将所述第一输入文本转化成至少一条第一输出文本;The text training module is used to provide the first input text in the text database to the text generation model, and the text generation model converts the first input text into at least one first output text;语序流畅度计算模块,用于计算所述第一输出文本的语序流畅度;A word order fluency calculation module, used to calculate the word order fluency of the first output text;语序流畅度比较模块,用于将所述第一输出文本的语序流畅度与正确文本的语序流畅度比较;Word order fluency comparison module, used to compare the word order fluency of the first output text with the word order fluency of the correct text;输入文本增量模块,用于当所述第一输出文本的语序流畅度大于或者等于所述正确文本的语序流畅度时,将所述第一输出文本作为第二输入文本提供给所述文本生成模型,以使得所述文本生成模型将所述第二输入文本转化成至少一条第二输出文本,直至所述文本生成模型满足预设条件,所述第二输出文本的语序流畅度小于所述正确文本的语序流畅度。The input text increment module is used to provide the first output text as the second input text to the text generation when the word sequence fluency of the first output text is greater than or equal to the word sequence fluency of the correct text A model so that the text generation model converts the second input text into at least one second output text until the text generation model meets a preset condition, and the fluency of the word sequence of the second output text is less than the correct Fluency of the word order of the text.
- 根据权利要求8所述的基于人工智能的文本数据增强装置,其特征在于,所述输入文本增量模块包括:The artificial intelligence-based text data enhancement device according to claim 8, wherein the input text increment module includes:文本配对单元,用于将所述第一输出文本与所述正确文本组成一个文本数 据对,将所述文本数据对中的所述第一输出文本为所述第二输入文本提供给所述文本生成模型。A text matching unit, configured to form a text data pair of the first output text and the correct text, and provide the first output text in the text data pair as the second input text to the text Generate the model.
- 根据权利要求8所述的基于人工智能的文本数据增强装置,其特征在于,还包括:The text data enhancement device based on artificial intelligence according to claim 8, further comprising:文本选取模块,用于当所述第一输出文本的语序流畅度小于所述正确文本的语序流畅度时,将所述第一输出文本提供给所述文本生成模型。The text selection module is configured to provide the first output text to the text generation model when the word order fluency of the first output text is less than the word order fluency of the correct text.
- 一种计算机设备,包括存储器和处理器,其特征在于,所述存储器中存储有可在所述处理器上运行的计算机可读指令所述处理器执行所述计算机可读指令时实现如下基于人工智能的文本数据增强方法的步骤:A computer device, including a memory and a processor, characterized in that the memory stores computer readable instructions executable on the processor. When the processor executes the computer readable instructions, the following implementation is based on manual The steps of the intelligent text data enhancement method:将文本数据库中的第一输入文本提供给文本生成模型,并由所述文本生成模型将所述第一输入文本转化成至少一条第一输出文本;Providing the first input text in the text database to a text generation model, and converting the first input text into at least one first output text by the text generation model;计算所述第一输出文本的语序流畅度;Calculating the word order fluency of the first output text;将所述第一输出文本的语序流畅度与正确文本的语序流畅度比较;Compare the word order fluency of the first output text with the word order fluency of the correct text;当所述第一输出文本的语序流畅度大于或者等于所述正确文本的语序流畅度时,将所述第一输出文本作为第二输入文本提供给所述文本生成模型,以使得所述文本生成模型将所述第二输入文本转化成至少一条第二输出文本,直至所述文本生成模型满足预设条件,所述第二输出文本的语序流畅度小于所述正确文本的语序流畅度。When the word order fluency of the first output text is greater than or equal to the word order fluency of the correct text, the first output text is provided as a second input text to the text generation model, so that the text is generated The model converts the second input text into at least one second output text until the text generation model meets a preset condition, and the word order fluency of the second output text is less than the word order fluency of the correct text.
- 根据权利要求11所述的计算机设备,其特征在于,计算所述第一输出文本的语序流畅度包括:The computer device according to claim 11, wherein calculating the word order fluency of the first output text comprises:f(x)表示所述语序流畅度;P(x i|x<i)指的是给定所述第一输出文本的上文,所述第一输出文本的下文P(x i)的语言模型概率。 f(x) represents the fluency of the word order; P(x i |x<i) refers to the language of the following P(x i ) given the above of the first output text Model probability.
- 根据权利要求12所述的计算机设备,其特征在于,所述语言模型概率通过语言模型计算获得,所述语言模型包括n-gram语言模型和神经概率语言模型。The computer device according to claim 12, wherein the language model probability is obtained by calculating a language model, and the language model includes an n-gram language model and a neural probabilistic language model.
- 根据权利要求11所述的计算机设备,其特征在于,所述将所述第一输出文本作为第二输入文本提供给所述文本生成模型的步骤包括:将所述第一输出文本与所述正确文本组成一个文本数据对,将所述文本数据对中的所述第一输出文本为所述第二输入文本提供给所述文本生成模型。The computer device according to claim 11, wherein the step of providing the first output text as the second input text to the text generation model includes: combining the first output text with the correct The text forms a text data pair, and the first output text in the text data pair is provided to the text generation model as the second input text.
- 根据权利要求11所述的计算机设备,其特征在于,通过所述文本生成 模型对所述第二输入文本进行错误训练,使得所述第二输出文本的语序流畅度小于所述正确文本的语序流畅度。The computer device according to claim 11, wherein the second input text is erroneously trained by the text generation model so that the second-order text has a smoother word order than the correct text degree.
- 一种计算机可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理执行如下步骤:A computer-readable storage medium, characterized in that, when the computer-readable instructions are executed by one or more processors, the one or more processes perform the following steps:将文本数据库中的第一输入文本提供给文本生成模型,并由所述文本生成模型将所述第一输入文本转化成至少一条第一输出文本;Providing the first input text in the text database to a text generation model, and converting the first input text into at least one first output text by the text generation model;计算所述第一输出文本的语序流畅度;Calculating the word order fluency of the first output text;将所述第一输出文本的语序流畅度与正确文本的语序流畅度比较;Compare the word order fluency of the first output text with the word order fluency of the correct text;当所述第一输出文本的语序流畅度大于或者等于所述正确文本的语序流畅度时,将所述第一输出文本作为第二输入文本提供给所述文本生成模型,以使得所述文本生成模型将所述第二输入文本转化成至少一条第二输出文本,直至所述文本生成模型满足预设条件,所述第二输出文本的语序流畅度小于所述正确文本的语序流畅度。When the word order fluency of the first output text is greater than or equal to the word order fluency of the correct text, the first output text is provided as a second input text to the text generation model, so that the text is generated The model converts the second input text into at least one second output text until the text generation model meets a preset condition, and the word order fluency of the second output text is less than the word order fluency of the correct text.
- 根据权利要求16所述的计算机可读存储介质,其特征在于,计算所述第一输出文本的语序流畅度包括:The computer-readable storage medium of claim 16, wherein calculating the word order fluency of the first output text comprises:f(x)表示所述语序流畅度;P(x i|x<i)指的是给定所述第一输出文本的上文,所述第一输出文本的下文P(x i)的语言模型概率。 f(x) represents the fluency of the word order; P(x i |x<i) refers to the language of the following P(x i ) given the above of the first output text Model probability.
- 根据权利要求17所述的计算机可读存储介质,其特征在于,所述语言模型概率通过语言模型计算获得,所述语言模型包括n-gram语言模型和神经概率语言模型。The computer-readable storage medium according to claim 17, wherein the language model probability is obtained by calculating a language model, and the language model includes an n-gram language model and a neural probabilistic language model.
- 根据权利要求16所述的计算机可读存储介质,其特征在于,所述将所述第一输出文本作为第二输入文本提供给所述文本生成模型的步骤包括:将所述第一输出文本与所述正确文本组成一个文本数据对,将所述文本数据对中的所述第一输出文本为所述第二输入文本提供给所述文本生成模型。The computer-readable storage medium according to claim 16, wherein the step of providing the first output text as the second input text to the text generation model includes: The correct text forms a text data pair, and the first output text in the text data pair is provided to the text generation model as the second input text.
- 根据权利要求16所述的计算机可读存储介质,其特征在于,通过所述文本生成模型对所述第二输入文本进行错误训练,使得所述第二输出文本的语序流畅度小于所述正确文本的语序流畅度。The computer-readable storage medium according to claim 16, wherein the second input text is erroneously trained by the text generation model so that the second order text has a smoother word order than the correct text Fluency of word order.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811641967.2A CN109614492B (en) | 2018-12-29 | 2018-12-29 | Text data enhancement method, device, equipment and storage medium based on artificial intelligence |
CN201811641967.2 | 2018-12-29 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020134154A1 true WO2020134154A1 (en) | 2020-07-02 |
Family
ID=66017355
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/103684 WO2020134154A1 (en) | 2018-12-29 | 2019-08-30 | Artificial intelligence-based text data enhancement method and device, equipment and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109614492B (en) |
WO (1) | WO2020134154A1 (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109614492B (en) * | 2018-12-29 | 2024-06-18 | 平安科技(深圳)有限公司 | Text data enhancement method, device, equipment and storage medium based on artificial intelligence |
CN110580290B (en) | 2019-09-12 | 2022-12-13 | 北京小米智能科技有限公司 | Method and device for optimizing training set for text classification |
CN112818082A (en) * | 2019-11-15 | 2021-05-18 | 北京沃东天骏信息技术有限公司 | Evaluation text pushing method and device |
CN113570046B (en) * | 2021-09-22 | 2022-02-18 | 苏州浪潮智能科技有限公司 | Data enhancement method, system, device and computer readable storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107832310A (en) * | 2017-11-27 | 2018-03-23 | 首都师范大学 | Structuring argument generation method and system based on seq2seq models |
CN108427665A (en) * | 2018-03-15 | 2018-08-21 | 广州大学 | A kind of text automatic generation method based on LSTM type RNN models |
US20180365231A1 (en) * | 2017-06-19 | 2018-12-20 | Beijing Baidu Netcom Science And Technology Co., Ltd. | Method and apparatus for generating parallel text in same language |
CN109062937A (en) * | 2018-06-15 | 2018-12-21 | 北京百度网讯科技有限公司 | The method of training description text generation model, the method and device for generating description text |
CN109614492A (en) * | 2018-12-29 | 2019-04-12 | 平安科技(深圳)有限公司 | Text data Enhancement Method, device, equipment and storage medium based on artificial intelligence |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
SG10201600432YA (en) * | 2011-02-21 | 2016-02-26 | Univ Singapore | Apparatus, system, and method for annotation of media files with sensor data |
CN103678285A (en) * | 2012-08-31 | 2014-03-26 | 富士通株式会社 | Machine translation method and machine translation system |
CN103810999B (en) * | 2014-02-27 | 2016-10-19 | 清华大学 | Language model training method based on Distributed Artificial Neural Network and system thereof |
US10540957B2 (en) * | 2014-12-15 | 2020-01-21 | Baidu Usa Llc | Systems and methods for speech transcription |
CN106484681B (en) * | 2015-08-25 | 2019-07-09 | 阿里巴巴集团控股有限公司 | A kind of method, apparatus and electronic equipment generating candidate translation |
CN107274903B (en) * | 2017-05-26 | 2020-05-19 | 北京搜狗科技发展有限公司 | Text processing method and device for text processing |
CN108647207B (en) * | 2018-05-08 | 2022-04-05 | 上海携程国际旅行社有限公司 | Natural language correction method, system, device and storage medium |
-
2018
- 2018-12-29 CN CN201811641967.2A patent/CN109614492B/en active Active
-
2019
- 2019-08-30 WO PCT/CN2019/103684 patent/WO2020134154A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180365231A1 (en) * | 2017-06-19 | 2018-12-20 | Beijing Baidu Netcom Science And Technology Co., Ltd. | Method and apparatus for generating parallel text in same language |
CN107832310A (en) * | 2017-11-27 | 2018-03-23 | 首都师范大学 | Structuring argument generation method and system based on seq2seq models |
CN108427665A (en) * | 2018-03-15 | 2018-08-21 | 广州大学 | A kind of text automatic generation method based on LSTM type RNN models |
CN109062937A (en) * | 2018-06-15 | 2018-12-21 | 北京百度网讯科技有限公司 | The method of training description text generation model, the method and device for generating description text |
CN109614492A (en) * | 2018-12-29 | 2019-04-12 | 平安科技(深圳)有限公司 | Text data Enhancement Method, device, equipment and storage medium based on artificial intelligence |
Also Published As
Publication number | Publication date |
---|---|
CN109614492A (en) | 2019-04-12 |
CN109614492B (en) | 2024-06-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020134154A1 (en) | Artificial intelligence-based text data enhancement method and device, equipment and storage medium | |
US20240062111A1 (en) | Training encoder model and/or using trained encoder model to determine responsive action(s) for natural language input | |
US11782981B2 (en) | Method, apparatus, server, and storage medium for incorporating structured entity | |
US10706084B2 (en) | Method and device for parsing question in knowledge base | |
US12131728B2 (en) | Method and apparatus of training natural language processing model, and method and apparatus of processing natural language | |
WO2018120889A1 (en) | Input sentence error correction method and device, electronic device, and medium | |
WO2020258487A1 (en) | Method and apparatus for sorting question-answer relationships, and computer device and storage medium | |
US20210319344A1 (en) | Natural language question answering | |
EP3852000A1 (en) | Method and apparatus for processing semantic description of text entity, device and storage medium | |
CN111159220B (en) | Method and apparatus for outputting structured query statement | |
WO2024207587A1 (en) | Question answering scoring method, question answering scoring apparatus, electronic device and storage medium | |
WO2020244475A1 (en) | Method and apparatus for language sequence labeling, storage medium, and computing device | |
US11790174B2 (en) | Entity recognition method and apparatus | |
WO2022095354A1 (en) | Bert-based text classification method and apparatus, computer device, and storage medium | |
US20230061778A1 (en) | Conversation information processing method, apparatus, computer- readable storage medium, and device | |
KR101627428B1 (en) | Method for establishing syntactic analysis model using deep learning and apparatus for perforing the method | |
WO2023184633A1 (en) | Chinese spelling error correction method and system, storage medium, and terminal | |
US20230013796A1 (en) | Method and apparatus for acquiring pre-trained model, electronic device and storage medium | |
WO2024212756A1 (en) | Picture segmentation method and apparatus, medium, and electronic device | |
US10614796B2 (en) | Method of and system for processing a user-generated input command | |
WO2023040742A1 (en) | Text data processing method, neural network training method, and related devices | |
KR102608867B1 (en) | Method for industry text increment, apparatus thereof, and computer program stored in medium | |
US20240202499A1 (en) | Element text processing method and apparatus, electronic device, and storage medium | |
WO2020052060A1 (en) | Method and apparatus for generating correction statement | |
US20240265207A1 (en) | Training of an object linking model |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19904260 Country of ref document: EP Kind code of ref document: A1 |