Statement generation method and device, equipment, storage medium and program product

Generating generalized sentences through word segmentation and conjunction mining, the problem of poor training effect of voice command control in the existing technology is solved, significantly increasing the number of training samples and improving the training effect.

CN119167911APending Publication Date: 2024-12-20ROX MOTOR TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411178833.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

In the prior art, the training effect of voice command control is poor, because the number of generated training corpus is limited, resulting in high limitations in association and cannot reach a certain order of magnitude.

Method used

By performing word segmentation on the sentence, mining conjunctions, generating a generalized word list, and filling it into the target template according to the sentence components to generate generalized sentences, thereby enriching the number of training samples in the training set.

Benefits of technology

The training effect of voice command control is improved, and a large number of generalized statements are generated automatically, which reduces the need for manual association expansion and significantly increases the number of training samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119167911A_ABST
    Figure CN119167911A_ABST
Patent Text Reader

Abstract

The invention discloses a statement generation method and device, equipment, a storage medium and a program product, and relates to the technical field of semantic processing. The statement generation method comprises the steps of obtaining a first statement; performing word segmentation processing on the first statement to obtain at least one segmented word corresponding to the first statement; associated word mining is carried out on the segmented words to obtain generalization word lists corresponding to the segmented words, and the generalization word lists comprise the segmented words and associated words corresponding to the segmented words; according to sentence components of the segmented words in the first statement, generalized word lists corresponding to the segmented words are filled in a target template, and a target file is obtained; according to the target file, a second statement corresponding to the first statement is generated, and the second statement is a generalization statement of the first statement. According to the method and the device, a large number of generalization statements can be obtained without manual association expansion, so that the number of training samples in a statement training set is greatly increased, and the training effect of voice instruction control can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of semantic processing technology, and in particular, relates to a sentence generation method, apparatus, device, storage medium and program product. Background Art

[0002] In modern new energy vehicles, controlling vehicles through voice commands is very popular and convenient. Voice commands are triggered by keywords, and the accuracy of voice command control depends on the testing and verification of a large number of words and sentences. Therefore, a large amount of training corpus needs to be created for voice command control training.

[0003] In existing methods, training corpus is mainly generated by manually creating multiple complete sentences.

[0004] However, this method has very large associative limitations, and the number cannot reach a certain level, resulting in poor training results for voice command control. Summary of the invention

[0005] The embodiments of the present application provide a sentence generation method, apparatus, device, storage medium and program product, which can greatly enrich the number of training samples in the sentence training set and improve the training effect of voice command control.

[0006] In one aspect of an embodiment of the present application, a sentence generation method is provided, the method comprising:

[0007] Get the first statement;

[0008] Performing word segmentation processing on the first sentence to obtain at least one word segmentation corresponding to the first sentence;

[0009] Perform associative word mining on the segmented words to obtain a list of generalized words corresponding to each segmented word. The generalized word list includes the segmented words and the associative words corresponding to the segmented words.

[0010] According to the sentence components of the segmented words in the first sentence, the generalized word lists corresponding to the segmented words are filled into the target template to obtain the target file;

[0011] A second statement corresponding to the first statement is generated according to the target file, and the second statement is a generalized statement of the first statement.

[0012] In one aspect of an embodiment of the present application, a sentence generation device is provided, the device comprising:

[0013] A statement acquisition module, used for acquiring a first statement;

[0014] A sentence segmentation module, used to perform a segmentation process on the first sentence to obtain at least one segmentation corresponding to the first sentence;

[0015] The associated word mining module is used to mine associated words for the segmented words, and obtain a list of generalized words corresponding to each segmented word, wherein the generalized word list includes the segmented words and the associated words corresponding to the segmented words;

[0016] A list filling module is used to fill in the generalized word list corresponding to each segmented word into the target template according to the sentence components of the segmented word in the first sentence to obtain a target file;

[0017] The statement generation module is used to generate a second statement corresponding to the first statement according to the target file, and the second statement is a generalized statement of the first statement.

[0018] In one aspect of an embodiment of the present application, an electronic device is provided, which includes: a memory and a program or instruction stored in the memory and executable on a processor, wherein when the program or instruction is executed by the processor, a statement generation method as provided in any aspect of the above-mentioned embodiment of the present application is implemented.

[0019] In one aspect of an embodiment of the present application, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, a statement generation method provided in any aspect of the above-mentioned embodiment of the present application is implemented.

[0020] According to one aspect of an embodiment of the present application, a computer program product is provided. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes a statement generation method provided in any aspect of the embodiment of the present application described above.

[0021] In the sentence generation method provided in the embodiment of the present application, the first sentence is first split into each participle, and then the associated words are mined for each participle, and the alternative words of each participle are expanded to obtain the generalized word list corresponding to the participle. Then, according to the sentence components of the participle in the target sentence, it is judged whether the words in each generalized word set are indispensable words for the generalized sentence constituting the first sentence, and the generalized word list corresponding to each participle is filled into the target template to generate a target file, and finally, the second sentence corresponding to the first sentence is generated according to the target file. In this way, the embodiment of the present application generates a generalized word list by expanding the associated words for each participle, and then fills each generalized word list into the target template to generate a target file according to the sentence components of the participle corresponding to the generalized word list in the first sentence, so that a variety of combinations of words in each generalized word list can be obtained according to the target file, and a large number of generalized sentences can be obtained without manual association expansion, thereby greatly enriching the number of training samples in the sentence training set, and can improve the training effect of voice command control. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0023] Figure 1 It is a flowchart of a sentence generation method provided by an embodiment of the present application;

[0024] Figure 2 is a flowchart of a sentence generation method provided by another embodiment of the present application;

[0025] Figure 3 It is a structural diagram of a sentence generation device provided by an embodiment of the present application;

[0026] Figure 4 It is a structural diagram of a sentence generation device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0027] The features and exemplary embodiments of each aspect of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0028] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0029] It should be noted that the acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations.

[0030] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0031] In the related art, the training corpus is mainly generated by manually creating multiple complete sentences. However, this method has very large association limitations, and the number cannot reach a certain level, resulting in poor training effect of voice command control.

[0032] The purpose of the present application is to provide a sentence generation method, device, equipment, storage medium and program product. In the sentence generation method provided in the embodiment of the present application, the first sentence is first split into each participle, and then the associated words are mined for each participle, and the alternative words of each participle are expanded to obtain the generalized word list corresponding to the participle. Then, according to the sentence components of the participle in the target sentence, it is judged whether the words in each generalized word set are indispensable words for the generalized sentence constituting the first sentence, and the generalized word list corresponding to each participle is filled into the target template to generate a target file, and finally, the second sentence corresponding to the first sentence is generated according to the target file. In this way, the embodiment of the present application generates a generalized word list by expanding the associated words for each participle, and then fills each generalized word list into the target template to generate a target file according to the sentence components of the participle corresponding to the generalized word list in the first sentence, so that a variety of combinations of words in each generalized word list can be obtained according to the target file, and a large number of generalized sentences can be obtained without artificial association expansion, thereby greatly enriching the number of training samples in the sentence training set, and can improve the training effect of voice command control.

[0033] The following describes specific embodiments of the statement generation method, apparatus, device, storage medium, and program product provided in the embodiments of the present application.

[0034] First, a specific embodiment of the sentence generation method provided by the embodiment of the present application is introduced. Figure 1 As shown, a flow chart of a statement generation method is provided. The statement generation method is applied to a server. The statement generation method may include the following S101 to S105.

[0035] S101, obtaining a first statement.

[0036] In this embodiment, the first sentence is a sentence representing a request or an instruction. For example, the first sentence may be "please play some songs".

[0037] As an example, the server may receive a first statement input by a user, or may obtain the first statement from a statement library storing historical instruction statements.

[0038] S102: Perform word segmentation processing on the first sentence to obtain at least one word segmentation corresponding to the first sentence.

[0039] In this embodiment, word segmentation is an operation of splitting a sentence into multiple words.

[0040] As an example, when the server obtains the first sentence "Please play some songs", the first sentence can be split into four words "please", "play", "some" and "songs".

[0041] S103, performing associated word mining on the segmented words to obtain a generalized word list corresponding to each segmented word, wherein the generalized word list includes the segmented words and the associated words corresponding to the segmented words.

[0042] In this embodiment, the associated words are at least one of synonyms, near synonyms, and words that express the same meaning in the same context. For example, the associated words corresponding to "please" may include "I want", "I think" and "need".

[0043] As an example, after splitting a sentence into multiple participles, the server matches each participle with a preset knowledge corpus that stores various types of synonymous word groups and synonymous word groups, and obtains the associated words corresponding to the participles. Finally, the participles and the corresponding associated words are combined to obtain a list of generalized words corresponding to the participles.

[0044] As another example, after splitting a sentence into multiple participles, the server inputs each participle into a pre-trained word vector model to obtain the associated words corresponding to the participles. Finally, the participles and the corresponding associated words are combined to obtain a list of generalized words corresponding to the participles.

[0045] S104, according to the sentence components of the segmented words in the first sentence, fill in the generalized word list corresponding to each segmented word into the target template to obtain the target file.

[0046] In this embodiment, the sentence component of the participle in the first sentence can be a subject, a predicate, an object, an attributive, an adverbial or a complement.

[0047] According to the sentence component of the participle in the first sentence, it can be determined whether the participle is an indispensable component constituting the first sentence.

[0048] The target file includes a generalized word list corresponding to each segmentation word and an identification of whether the words in the generalized word list are required words.

[0049] As an example, when the sentence component of a participle in the first sentence is a predicate, the server determines that the participle is an indispensable component in the first sentence, that is, the participle is a required word. At this time, the generalized word list corresponding to the participle is filled in the required word part of the target template.

[0050] Then continue to judge the sentence component of the next participle in the first sentence. When the sentence component of the next participle in the first sentence is a complement, determine that the next participle is an indispensable component in the first sentence, that is, the participle is an optional word. At this time, fill in the generalized word list corresponding to the next participle into the optional word part in the target template.

[0051] In this way, after the generalized word lists corresponding to each segmentation word are filled into the target template according to the preset filling strategy, the target file can be obtained.

[0052] S105: Generate a second statement corresponding to the first statement according to the target file, where the second statement is a generalized statement of the first statement.

[0053] In this embodiment, the second sentence is a generalized sentence of the first sentence. For example, when the first sentence is "please play some songs", the corresponding second sentence can be "please order some songs", "please play some music" or "please play a few pieces of music".

[0054] As an example, after obtaining the target file, the server extracts multiple words from each generalized word list based on the generalized word list corresponding to each word segment in the target file and the identification of whether the words in the generalized word list are required words, and arranges them to generate multiple second sentences corresponding to the first sentence.

[0055] Through this embodiment, the first sentence is first split into individual participles, and then the associated words are mined for each participle, and the alternative words of each participle are expanded, so as to obtain the generalized word list corresponding to the participle. Then, according to the sentence components of the participle in the target sentence, it is judged whether the words in each generalized word set are indispensable words for the generalized sentence constituting the first sentence, and the generalized word list corresponding to each participle is filled into the target template to generate a target file, and finally, the second sentence corresponding to the first sentence is generated according to the target file. In this way, the embodiment of the present application generates a generalized word list by expanding the associated words for each participle, and then fills each generalized word list into the target template to generate a target file according to the sentence components of the participle corresponding to the generalized word list in the first sentence, so that a variety of combinations of words in each generalized word list can be obtained according to the target file, and a large number of generalized sentences can be obtained without manual associative expansion, thereby greatly enriching the number of training samples in the sentence training set, and can improve the training effect of voice command control.

[0056] As an optional embodiment, S104 may specifically include:

[0057] When the sentence component of the participle in the first sentence is a predicate or an object component, fill the generalization word list corresponding to the participle into the target template in the way of required words.

[0058] When the sentence component of the participle in the first sentence is a modifier component, fill the generalization word list corresponding to the participle into the target template in the way of optional words.

[0059] In this embodiment, when the sentence component of the participle in the first sentence is a predicate or an object component, it indicates that the participle is an indispensable component in the first sentence, that is, the participle is a required word. At this time, fill the generalization word list corresponding to the participle into the target template in the way of required words.

[0060] Exemplarily, the participle is "play", and the corresponding generalization word list includes "play", "play some", and "broadcast". "Play" is a predicate, that is, the participle is a required word. At this time, fill the generalization word list corresponding to the participle into the target template in the preset way of required words with () brackets, and separate the words in the generalization word list with "|". Thus, the generalization word list corresponding to the participle filled into the target template is ("play" | "play some" | "broadcast").

[0061] When the sentence component of the participle in the first sentence is a modifier component, it indicates that the participle is an optional component in the first sentence, that is, the participle is an optional word. At this time, fill the generalization word list corresponding to the participle into the target template in the way of optional words.

[0062] Exemplarily, the participle is "please", and the corresponding generalization word list includes "please", "I want", "I would like", and "need". "Please" is a modifier, that is, the participle is an optional word. At this time, fill the generalization word list corresponding to the participle into the target template in the preset way of optional words with [] brackets, and separate the words in the generalization word list with "|". Thus, the generalization word list corresponding to the participle filled into the target template is ["please" | "I want" | "I would like" | "need"].

[0063] Through this embodiment, according to the sentence component of the participle in the first sentence, fill the generalization word list corresponding to the participle into the target template, so as to obtain the target file. In this way, subsequently, according to the target file, the optional replacement words of each participle can be accurately identified, and it can be accurately judged whether each participle is an indispensable component for forming the first sentence, so that various combination ways of the words in each generalization word list can be obtained, and then a large number of generalized sentences can be obtained.

[0064] As an optional embodiment, after S103, the sentence generation method may further include:

[0065] Matching the word segmentation with a preset semantic list to obtain a word matching result, wherein the preset semantic list includes at least one semantic slot and a word value corresponding to the semantic slot, and the semantic slot is used to represent a semantic type;

[0066] When the word matching result indicates that there is a target semantic slot matching the segmentation in the preset semantic list, the word value corresponding to the target semantic slot in the preset semantic list is filled into the generalized word list corresponding to the segmentation.

[0067] In this embodiment, as shown in Table 1, a preset semantic list is provided. The preset semantic list includes at least one semantic slot and a word value corresponding to the semantic slot. For example, when the semantic slot is a singer, the word values ​​corresponding to the semantic slot are Jay Chou and Andy Lau; when the semantic slot is a number, the word values ​​corresponding to the semantic slot are 5, 6, 7, 8 and 9.

[0068] Table 1 Preset semantics list

[0069] Semantic slot Word Value number 【5|6|7|8|9】 Performers Guo Degang singer

Jay Chou | Andy Lau

[0070] As an example, when the segmented word is 5, it will be impossible to find the associated words corresponding to 5, that is, there is still only 5 in the corresponding generalized word list.

[0071] The server can further match 5 with the preset semantic list and find that there is a target semantic slot "number" class matching 5 in the preset semantic list. Then, the word value "[5|6|7|8|9]" corresponding to the semantic slot of the "number" class is filled into the generalized word list corresponding to the word segmentation, so that the corresponding generalized word list includes "[5|6|7|8|9]".

[0072] Through this embodiment, after the server mines the associated words for the segmented words and obtains the generalized word list, the segmented words are further matched with the preset semantic list. If there is a target semantic slot matching the segmented words in the preset semantic list, the generalized word list corresponding to the segmented words is further expanded. This can further expand the combination of words and improve the generalization ability of the sentence.

[0073] As an optional embodiment, the second statement includes the first generalized statement;

[0074] S105 may specifically include:

[0075] Obtain a list of first generalized words filled in the target file according to the mandatory word filling method;

[0076] Cartesian product operations are performed between the first generalized word lists to obtain various first word matching modes corresponding to the target file;

[0077] According to each first word matching mode, extract corresponding words from the first generalized word list respectively;

[0078] The extracted words are sorted according to a target order to generate first generalized sentences corresponding to the first sentence. The target order is the order of the participles corresponding to each generalized word list in the first sentence.

[0079] In this embodiment, the Cartesian product operation is used to calculate all possible word matching modes between the generalized word lists.

[0080] The target order is the order of the participles corresponding to each generalized word list in the first sentence.

[0081] As an example, the server obtains the first generalized word list filled in the target file according to the mandatory word filling method, which is ("play"|"come on"|"broadcast") and ("song"|"music").

[0082] Then, a Cartesian product operation is performed on the first generalized word list, and the first word matching mode can be obtained as "play + song", "play + music", "come + song", "come + music", "broadcast + song" and "broadcast + music".

[0083] Finally, corresponding words are extracted from the first generalized word list in sequence according to the first word matching method, and the word segments corresponding to the generalized word list are sorted in the order of their sequence in the first sentence, thereby generating first generalized sentences corresponding to the first sentence.

[0084] Through this embodiment, according to each first generalized word list filled in the target file according to the mandatory word filling method, a variety of word combinations are expanded, which can improve the generalization ability of the sentence. At the same time, this application can ensure that the final generalized sentence is relatively concise by only expanding the mandatory words, thereby improving the efficiency of language processing.

[0085] As an optional embodiment, the second statement includes a second generalized statement;

[0086] S105 may specifically include:

[0087] Obtaining each first generalized word list filled in the required word filling method and each second generalized word list filled in the optional word filling method in the target file;

[0088] The following steps are executed repeatedly until various selection methods of the second generalized word list are traversed:

[0089] Performing a Cartesian product operation between each first generalized word list and at least one second generalized word list to obtain various second word matching modes corresponding to the target file;

[0090] According to each second word matching mode, extract corresponding words from the first generalized word list and the second generalized word list respectively;

[0091] The extracted words are sorted according to a target order to generate second generalized sentences corresponding to the first sentence. The target order is the order of the participles corresponding to each generalized word list in the first sentence.

[0092] In this embodiment, the Cartesian product operation is used to calculate all possible word matching modes between the generalized word lists.

[0093] The target order is the order of the participles corresponding to each generalized word list in the first sentence.

[0094] As an example, the server obtains each first generalized word list filled in the target file in the required word filling mode and each second generalized word list filled in the optional word filling mode. Assume that the second generalized word list includes list A, list B and list C.

[0095] Then, at least one second generalized word list is selected to perform Cartesian product operations with each first generalized word list to obtain various second word matching methods. Finally, corresponding words are extracted from the first generalized word list and the second generalized word list in turn according to the second word matching method, and the word segments corresponding to the generalized word list are sorted according to the order in which they appear in the first sentence, thereby generating second generalized sentences corresponding to the first sentence.

[0096] Specifically, the second generalized word list can be selected in seven ways: selecting only list A, selecting only list B, selecting only list C, selecting list A and list B, selecting list A and list C, selecting list B and list C, and selecting list A, list B, and list C. By traversing these seven selection methods, the second generalized sentences corresponding to the first sentence under each selection method are obtained.

[0097] Through this embodiment, based on the first generalized word lists filled in the target file according to the required word filling method and the second generalized word lists filled in according to the optional word filling method, a variety of word combination methods are expanded, which can further improve the generalization ability of the sentence.

[0098] As an optional embodiment, after obtaining each first generalized word list filled in the target file in the mandatory word filling mode and each generalized word list filled in the optional word filling mode, the sentence generation method may further include:

[0099] Determine whether the sentence component of the target participle located at the first position of the first sentence in the first sentence is a modifier component;

[0100] When the sentence component of the target participle in the first sentence is a modifier component, adding a blank item word to the second generalization word list corresponding to the target participle;

[0101] Performing Cartesian product operations between each first generalized word list and each second generalized word list to obtain various third word matching modes corresponding to the target file;

[0102] According to each third word matching mode, extract corresponding words from the first generalized word list and the second generalized word list respectively;

[0103] The extracted words are sorted according to a target order to generate second generalized sentences corresponding to the first sentence. The target order is the order of the participles corresponding to each generalized word list in the first sentence.

[0104] In this embodiment, when the target participle at the beginning of the first sentence is a modifier component in the first sentence, it indicates that it is an optional word.

[0105] In the case where it is an optional word, an empty term is added to its corresponding second generalized word list, which means that the word may be extracted from its corresponding second generalized word list or may not be extracted from its corresponding second generalized word list.

[0106] As an example, Figure 2 As shown, a flow chart of a sentence generation method is provided. First, the server obtains each first generalized word list filled in the target file according to the mandatory word filling method and each second generalized word list filled in the optional word filling method through S201. Assume that the second generalized word list includes list A, list B and list C, and the first generalized word list includes list D and list E.

[0107] Then, the server determines whether the sentence component of the target participle at the first position of the first sentence in the first sentence is a modifier component through S202. Assuming that the generalized word list corresponding to the target participle at the first position of the first sentence is list C, that is, the sentence component of the target participle in the first sentence is a modifier component, then through S203, an empty word item is added to the list C corresponding to the target participle. Then, through S204, a Cartesian product operation is performed between each first generalized word list and each second generalized word list to obtain various word matching methods.

[0108] Assuming that the generalized word list corresponding to the target participle at the beginning of the first sentence is list D, that is, the sentence component of the target participle in the first sentence is not a modifier component, then S204 is directly used to perform a Cartesian product operation between each first generalized word list and each second generalized word list to obtain various third word matching methods.

[0109] Finally, corresponding words are extracted from the first generalized word list and the second generalized word list respectively according to various third word matching methods through S205, and the corresponding participles in the generalized word list are sorted in the order of the first sentence through S206, so as to generate the second generalized sentences corresponding to the first sentence.

[0110] According to this embodiment, when the sentence component of the first participle in the first sentence is a modifier component, an empty term is added to the corresponding second generalized word list. In this way, it is possible to avoid the presence of many non-mandatory words in the expanded generalized sentence, ensuring that the final generalized sentence is relatively concise, thereby improving the efficiency of language processing and the accuracy of language communication.

[0111] Based on the sentence generation method, accordingly, the present application also provides a specific embodiment of the sentence generation device.

[0112] like Figure 3 As shown, the sentence generation device provided in the embodiment of the present application includes a sentence acquisition module 310, a sentence segmentation module 320, a related word mining module 330, a list filling module 340 and a sentence generation module 350.

[0113] A statement acquisition module 310, used to acquire a first statement;

[0114] A sentence segmentation module 320, configured to perform a segmentation process on the first sentence to obtain at least one segmentation corresponding to the first sentence;

[0115] The associated word mining module 330 is used to mine associated words for the segmented words, and obtain a generalized word list corresponding to each segmented word, wherein the generalized word list includes the segmented words and the associated words corresponding to the segmented words;

[0116] A list filling module 340 is used to fill in the generalized word list corresponding to each of the segmented words into the target template according to the sentence components of the segmented words in the first sentence, so as to obtain a target file;

[0117] The statement generation module 350 is used to generate a second statement corresponding to the first statement according to the target file, where the second statement is a generalized statement of the first statement.

[0118] As an optional embodiment, the list filling module 340 includes the following units:

[0119] A mandatory word filling unit is used to fill in the generalized word list corresponding to the participle into the target template in a mandatory word filling manner when the sentence component of the participle in the first sentence is a predicate or an object component;

[0120] The optional word filling unit is used to fill in the generalized word list corresponding to the participle into the target template according to the optional word filling method when the sentence component of the participle in the first sentence is a modifier component.

[0121] As an optional embodiment, the sentence generating device may further include the following modules:

[0122] A word matching module is used to mine associated words for the segmented words, obtain a list of generalized words corresponding to each segmented word, and then match the segmented words with a preset semantic list to obtain a word matching result. The preset semantic list includes at least one semantic slot and a word value corresponding to the semantic slot. The semantic slot is used to represent a semantic type.

[0123] The list updating module is used to fill the word value corresponding to the target semantic slot in the preset semantic list into the generalized word list corresponding to the word segmentation when the word matching result indicates that there is a target semantic slot matching the word segmentation in the preset semantic list.

[0124] As an optional embodiment, the second statement includes the first generalized statement;

[0125] The statement generation module 350 includes the following units:

[0126] A list acquisition unit, used to acquire a list of first generalized words filled in the target file according to the mandatory word filling method;

[0127] A list operation unit, used for performing Cartesian product operation on each first generalized word list to obtain various first word matching modes corresponding to the target file;

[0128] A word extraction unit, configured to extract corresponding words from the first generalized word list according to each first word matching mode;

[0129] The sentence generating unit is used to sort the extracted words according to the target order to generate each first generalized sentence corresponding to the first sentence, and the target order is the order of the participles corresponding to each generalized word list in the first sentence.

[0130] As an optional embodiment, the second statement includes a second generalized statement;

[0131] The statement generation module 350 also includes the following units:

[0132] The list acquisition unit is further used to acquire each first generalized word list filled in the required word filling method and each second generalized word list filled in the optional word filling method in the target file;

[0133] The loop execution unit is used to loop through the following steps until various selection methods of the second generalized word list are traversed:

[0134] Performing a Cartesian product operation between each first generalized word list and at least one second generalized word list to obtain various second word matching modes corresponding to the target file;

[0135] According to each second word matching mode, extract corresponding words from the first generalized word list and the second generalized word list respectively;

[0136] The extracted words are sorted according to a target order to generate second generalized sentences corresponding to the first sentence. The target order is the order of the participles corresponding to each generalized word list in the first sentence.

[0137] Based on the sentence generation method, accordingly, the present application also provides a specific embodiment of the sentence generation device.

[0138] Figure 4 A schematic diagram of the hardware structure of a sentence generation device provided in an embodiment of the present application is shown.

[0139] The statement generating device may include a processor 401 and a memory 3402 storing computer program instructions.

[0140] Specifically, the processor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0141] The memory 3402 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 3402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 3402 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 3402 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 3402 is a non-volatile solid-state memory.

[0142] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.

[0143] The processor 401 implements any one of the sentence generation methods in the above embodiments by reading and executing computer program instructions stored in the memory 3402 .

[0144] In one example, the statement generating device may further include a communication interface 403 and a bus 410. Figure 4 As shown, the processor 401, the memory 3402, and the communication interface 403 are connected via a bus 410 and communicate with each other.

[0145] The communication interface 403 is mainly used to implement communication between each module, device, unit and / or equipment in the embodiment of the present application.

[0146] Bus 410 includes hardware, software or both, and the parts of statement generation equipment are coupled to each other.For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 410 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.

[0147] In addition, in combination with the sentence generation method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the sentence generation methods in the above embodiment is implemented.

[0148] In addition, in combination with the sentence generation method in the above-mentioned embodiment, the embodiment of the present application may provide a computer program product for implementation. When the instructions in the computer program product are executed by the processor of an electronic device, the electronic device executes the sentence generation method provided in any aspect of the above-mentioned embodiment of the present application.

[0149] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make each change, modification and addition, or change the order between the steps after understanding the spirit of the present application.

[0150] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0151] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0152] Each aspect of the present disclosure is described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0153] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of each equivalent modification or replacement within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application.

Claims

1. A sentence generation method, characterized in that: The method comprises: Get the first statement; Performing word segmentation processing on the first sentence to obtain at least one word segmentation corresponding to the first sentence; Performing associated word mining on the segmented words to obtain a generalized word list corresponding to each segmented word, wherein the generalized word list includes the segmented words and the associated words corresponding to the segmented words; According to the sentence components of the segmented words in the first sentence, filling the generalized word lists corresponding to the segmented words into the target template to obtain a target file; A second statement corresponding to the first statement is generated according to the target file, where the second statement is a generalized statement of the first statement.

2. The method according to claim 1, characterized in that The step of filling the generalized word lists corresponding to the segmented words in the target template according to the sentence components of the segmented words in the first sentence to obtain the target file includes: In the case where the sentence component of the segment word in the first sentence is a predicate or an object component, filling the generalized word list corresponding to the segment word into the target template in a mandatory word filling manner; In the case that the sentence component of the segment word in the first sentence is a modifier component, the generalized word list corresponding to the segment word is filled into the target template in an optional word filling manner.

3. The method according to claim 1, characterized in that After performing associated word mining on the segmented words to obtain a list of generalized words corresponding to each of the segmented words, the method further includes: Matching the word segmentation with a preset semantic list to obtain a word matching result, wherein the preset semantic list includes at least one semantic slot and a word value corresponding to the semantic slot, and the semantic slot is used to represent a semantic type; When the word matching result indicates that there is a target semantic slot matching the word segmentation in the preset semantic list, the word value corresponding to the target semantic slot in the preset semantic list is filled into the generalized word list corresponding to the word segmentation.

4. The method according to claim 1, characterized in that: The second sentence includes a first generalized sentence; The step of generating, according to the target file, a second statement corresponding to the first statement comprises: Obtain a list of first generalized words filled in the target file according to the mandatory word filling method; Performing a Cartesian product operation on each of the first generalized word lists to obtain various first word matching modes corresponding to the target file; According to each of the first word matching modes, extract corresponding words from the first generalized word list respectively; The extracted words are sorted according to a target order to generate the first generalized sentences corresponding to the first sentence, wherein the target order is the order of the segmented words corresponding to the generalized word lists in the first sentence.

5. The method according to claim 1, characterized in that The second sentence includes a second generalized sentence; The step of generating, according to the target file, a second statement corresponding to the first statement comprises: Obtaining each first generalized word list filled in the target file in the mandatory word filling mode and each second generalized word list filled in the optional word filling mode; The following steps are executed in a loop until various selection methods of the second generalized word list are traversed: Performing a Cartesian product operation between each of the first generalized word lists and at least one of the second generalized word lists to obtain various second word matching modes corresponding to the target file; According to each of the second word matching modes, extract corresponding words from the first generalized word list and the second generalized word list respectively; The extracted words are sorted according to a target order to generate the second generalized sentences corresponding to the first sentence, wherein the target order is the order of the segmented words corresponding to the generalized word lists in the first sentence.

6. The method according to claim 5, characterized in that After obtaining each first generalized word list filled in the target file in the mandatory word filling mode and each second generalized word list filled in the optional word filling mode, the method further includes: Determining whether the sentence component of the target participle located at the first position of the first sentence in the first sentence is a modifier component; In the case where the sentence component of the target participle in the first sentence is a modifier component, adding a blank item word to the second generalized word list corresponding to the target participle; Performing a Cartesian product operation between each of the first generalized word lists and each of the second generalized word lists to obtain various third word matching modes corresponding to the target file; According to each of the third word matching modes, extracting corresponding words from the first generalized word list and the second generalized word list respectively; The extracted words are sorted according to a target order to generate the second generalized sentences corresponding to the first sentence, wherein the target order is the order of the segmented words corresponding to the generalized word lists in the first sentence.

7. A sentence generating device, characterized in that: The device comprises: A statement acquisition module, used for acquiring a first statement; a sentence segmentation module, configured to perform a segmentation process on the first sentence to obtain at least one segmentation corresponding to the first sentence; An associated word mining module, used to mine associated words for the segmented words, and obtain a generalized word list corresponding to each segmented word, wherein the generalized word list includes the segmented words and the associated words corresponding to the segmented words; A list filling module is used to fill in the generalized word lists corresponding to the segmented words into the target template according to the sentence components of the segmented words in the first sentence to obtain a target file; The statement generation module is used to generate a second statement corresponding to the first statement according to the target file, wherein the second statement is a generalized statement of the first statement.

8. An electronic device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the statement generation method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the statement generation method according to any one of claims 1 to 6 is implemented.

10. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the sentence generation method as described in any one of claims 1 to 6.