Corpus selection method and device, electronic equipment and storage medium
Generating grids and assigning relevant word segments through metacellular automata solves the problem of low efficiency of neural network generation models, improves the efficiency of corpus generation and generalization, and ensures the relevance and efficiency of corpus.
Patent Information
- Application Number
- CN202410784735.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-06-17
AI Technical Summary
Existing neural network generation models are inefficient for generating corpus and cannot effectively meet the needs of electronic devices for understanding user commands.
Through the spatial state grid changes of the metacellular automaton, the grid to be processed is generated according to the preset rules, and the relevant word segments are assigned to determine the corpus to be proofread, thereby selecting the target corpus related to the corpus to be processed and avoiding the generation based on neural networks. The model improves the corpus generation speed and generalization efficiency.
It achieves improved corpus generation efficiency and generalization efficiency, ensures the correlation between the target corpus and the corpus to be processed, and simplifies the corpus expansion process.
Smart Images

Figure CN118839698A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information technology, and more specifically, to a corpus selection method, device, electronic device, and computer-readable storage medium. Background Art
[0002] In the field of human-computer interaction technology, the command language sent by users to electronic devices varies due to the different speaking styles and habits of the users. Therefore, in order for the electronic devices to fully understand the user's commands, sufficient corpus needs to be prepared.
[0003] Currently, a generative model constructed by a neural network can be used to generate corpus, thereby achieving the purpose of selecting enough corpus for electronic devices. However, the efficiency of generating corpus using this method is low. Summary of the invention
[0004] The present application proposes a corpus selection method, device, electronic device and computer-readable storage medium to improve the above-mentioned defects.
[0005] In a first aspect, an embodiment of the present application provides a method for selecting corpus, the method comprising:
[0006] Generate a grid to be processed according to multiple segmented words after the segmentation of the corpus to be processed and preset rules; a unit grid with a target value in the grid to be processed corresponds to one segmented word;
[0007] In the process that the space state grid of the meta-cellular automaton changes according to the preset rule, determining a first space state grid matching the grid to be processed from the changed space state grid;
[0008] Assigning a corresponding related participle to each unit grid of the target value in the first spatial state grid; the related participle is a participle related to the participle;
[0009] According to the relevant participles assigned to the unit grids of the target values in each target grid intercepted from the first spatial state grid, the to-be-proofread corpus corresponding to each target grid is determined;
[0010] Select the target corpus corresponding to the corpus to be processed from each corpus to be proofread.
[0011] In a second aspect, the embodiment of the present application further provides a corpus selection device, the device comprising:
[0012] A generation module is used to generate a grid to be processed according to multiple segmented words after the segmentation of the corpus to be processed and preset rules; a unit grid with a target value in the grid to be processed corresponds to one segmented word;
[0013] A first determination module is used to determine a first spatial state grid matching the grid to be processed from the changed spatial state grid when the spatial state grid of the meta-cellular automaton changes according to a preset rule;
[0014] An allocation module is used to allocate a corresponding related participle to each unit grid of the target value in the first spatial state grid; the related participle is a participle related to the participle;
[0015] The second determination module is used to determine the corpus to be proofread corresponding to each target grid according to the relevant segmentation words assigned to the unit grids with target values in each target grid intercepted from the first spatial state grid;
[0016] The selection module is used to select the target corpus corresponding to the corpus to be processed from the corpus to be proofread.
[0017] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the above method.
[0018] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the above method.
[0019] The present application provides a corpus selection method, device, electronic device and computer-readable storage medium. In the present application, a grid to be processed is generated according to multiple word segments after the word segmentation of the corpus to be processed and preset rules; then, a first spatial state grid matching the grid to be processed is determined from the spatial state grid of the meta-cellular automaton that changes with time; then, a corresponding related word segmentation is assigned to each unit grid of the target value in the first spatial state grid; and according to the related word segmentation assigned to the unit grid of the target value in each target grid intercepted from the first spatial state grid, the corpus to be proofread corresponding to each target grid is determined; then, the target corpus corresponding to the corpus to be processed is selected from each corpus to be proofread, and the selected The target corpus is used as the corpus generated based on the corpus to be processed. Since the meta-cellular automaton changes according to preset rules, and the grid to be processed is generated according to preset rules, at this time, the determined first space state grid is related to the corpus to be processed, so that the expectation to be proofread constructed according to the target grid selected in the first space state grid is also related to the corpus to be processed, ensuring that the target corpus is also an expectation related to the corpus to be processed, thereby achieving the purpose of expanding the corpus according to the corpus to be processed, and does not need to generate the corpus based on the generation model constructed by the neural network, which saves the time of training the neural network model and greatly improves the corpus generation speed, thereby improving the corpus generation efficiency and corpus generalization efficiency.
[0020] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and partly become apparent from the description, or can be understood by practicing the embodiments of the present application. The purposes and other advantages of the embodiments of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 A flow chart of a corpus selection method proposed according to an embodiment of the present application is shown.
[0023] Figure 2 A schematic diagram of a grid to be processed in an embodiment of the present application is shown.
[0024] Figure 3 Shows Figure 1 The corresponding step S105 of the embodiment is a flowchart in an embodiment.
[0025] Figure 4A schematic diagram of a corpus selection process in an embodiment of the present application is shown.
[0026] Figure 5 A schematic diagram showing a processing process of a phrase splitting module in an embodiment of the present application is shown.
[0027] Figure 6 A schematic diagram showing a processing process of a meta-cellular automaton processing module in an embodiment of the present application is shown.
[0028] Figure 7 A structural block diagram of a corpus selection device proposed in an embodiment of the present application is shown.
[0029] Figure 8 A structural block diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0030] In order to make those skilled in the art better understand the present application scheme, the technical scheme in the present application embodiment will be clearly and completely described below in conjunction with the drawings in the present application embodiment. Obviously, the described embodiment is only a part of the present application embodiment, rather than all the embodiments. The components of the present application embodiment usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application for protection, but merely represents the selected embodiment of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0031] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0032] See also Figure 1 , Figure 1 A flow chart of a corpus selection method proposed in an embodiment of the present application is shown, which is used in an electronic device. The method includes:
[0033] S101, generating a grid to be processed according to multiple word segments after word segmentation of the corpus to be processed and preset rules.
[0034] Among them, the unit grid with the target value in the grid to be processed corresponds to one word segmentation.
[0035] In this application, electronic devices can be vehicles, mobile terminals, servers, etc. The corpus to be processed can refer to any semantically complete sentence. For example, in the field of vehicle-machine interaction technology, the corpus to be processed can be a text instruction for any function of the vehicle (or a text instruction after the voice instruction is textualized). For another example, in the field of document management, the corpus to be processed can be any sentence in an electronic document. For another example, in the field of information search technology, the corpus to be processed can be any search sentence typed by the user.
[0036] After obtaining the corpus to be processed, the corpus to be processed can be divided into words to obtain multiple participles, wherein the division rule can be to divide the corpus to be processed into words according to "subject, predicate, object, attributive, adverbial, complement". For example, the corpus to be processed is "open the car window", and according to the part of speech of "subject, predicate, object, attributive, adverbial, complement", "open" is the predicate and "car window" is the object. At this time, the corpus to be processed is "open the car window" and is divided into two participles, "open" and "car window".
[0037] In the present application, an initial grid of a target size can be set, and then a grid to be processed is generated according to preset rules and the segmentation after the corpus to be processed is divided, wherein a unit grid with a target value in the grid to be processed corresponds to a segmentation, and a unit grid refers to the smallest unit constituting the grid. The target size can be set based on demand, for example, the target size can be 3*3 or 5*5, etc., and the target value can be 1. In the target grid, the value of the unit grid that does not correspond to a segmentation can be 0, or the unit grid that does not correspond to a segmentation can also be empty.
[0038] The preset rule includes that the parity of the sum of the values of the grids around the central unit grid located at the center of the grid of the target size is the same as the parity of the value of the central unit grid, and when the sum of the values of the grids around the central unit grid is an odd number, the value of the central unit grid is the target value. Based on the preset rule, if the generated target grid can meet the preset rule, the size of the initial grid used to generate the target grid should not be less than 3*3. Because, when the size of the initial grid is less than 3*3, there is no central unit grid or there will be no unit grids around the central unit grid. For example, when the size of the initial grid is 2*2, there is no central unit grid, and the four grids are all edge unit grids.
[0039] For example, when the target size is 3*3 and the target value is 1, if the number of word segments after different corpora to be processed is different, the grid to be processed is as follows: Figure 2 As shown, in Figure 2a in is the to-be-processed grid corresponding to the two segmented words, and the unit grid with a value of 1 corresponds to one of the two segmented words. It can be understood that, based on the aforementioned preset rules, the grid with a value of 1 around the central grid unit in the center can also be located in any of the other three grid units adjacent to the central grid unit; Figure 2 The b in the figure is the grid to be processed corresponding to the four segmented words, and the unit grid with a value of 1 corresponds to one of the four segmented words.
[0040] It is understandable that the target values corresponding to the multiple word segments after the same corpus is divided are not fixed. For example, when the target size is 3*3 and the target value is 1, and the number of word segments after the corpus is divided is 2, the grid to be processed is as follows: Figure 2 As shown in a in , the grid cell with the center of the target value can correspond to any one of the two segmentations.
[0041] S102 . When the space state grid of the meta-cellular automaton changes according to a preset rule, determine a first space state grid that matches the grid to be processed from the changed space state grids.
[0042] According to the requirements, a state-initialized space state grid can be set for the meta-cellular automaton, the size of which is larger than the aforementioned target size, and the value of each unit grid in the state-initialized space state grid can be 0. For example, the state-initialized space state grid is a 200*200 grid.
[0043] Then, the value of any one or more unit grids in the state-initialized space state grid can be randomly changed, and the space state grid of the meta-cellular automaton can be controlled to change based on the changed value according to the aforementioned preset rules, and each change complies with the aforementioned preset rules. For example, the state-initialized space state grid is a 200*200 grid, and the values of the unit grids are all 0, and then the value of the most central unit grid (the most central unit grid is actually four, and any unit grid can be selected) is controlled to change to 1, and then the meta-cellular automaton controls the space state grid changes according to the preset.
[0044] In the process that the space state grid of the space state grid element cellular automaton changes according to the preset rules, after each change moment, a space state grid is obtained, and the space state grid is matched with the grid to be processed to determine the space state grid that matches the grid to be processed as the first space state grid.
[0045] As an implementation method, a space state grid including the grid to be processed may be selected as the first space state grid. That is, after a certain change moment, if the space state grid after the change moment has the same area as the grid to be processed, then the space state grid is used as the first space state grid.
[0046] As an implementation method, S102 may include: in the process that the spatial state grid of the meta-cellular automaton changes according to a preset rule, determining a second spatial state grid including a grid to be processed from the changing spatial state grid; and obtaining a spatial state grid whose appearance time is after the appearance time of the second spatial state grid as the first spatial state grid.
[0047] That is to say, after a certain change moment, if there is an area in the spatial state grid after the change moment that is the same as the grid to be processed, then the spatial state grid is used as the second spatial state grid, and then the spatial state grid whose appearance moment is after the appearance moment of the second spatial state grid is obtained as the first spatial state grid. For example, the spatial state grid obtained after the first change of the second spatial state grid is obtained as the first spatial state grid, and for another example, the two spatial state grids obtained after the first and third changes of the second spatial state grid are obtained as the first spatial state grid.
[0048] Based on the above, it can be known that when the spatial state grid includes the same area as the grid to be processed, the corpus represented by the area is used as the basic corpus corresponding to the corpus to be processed. Therefore, the first spatial state grid determined by the spatial state grid including the same area as the grid to be processed is evolved from the area corresponding to the basic corpus, and it must be a spatial state grid related to the corpus to be processed. Therefore, when the subsequent corpus construction process is carried out with this first spatial state grid, the corpus to be corrected constructed is also a corpus related to the corpus to be processed.
[0049] S103 , assigning a corresponding relevant word segment to each unit grid of the target value in the first spatial state grid.
[0050] Among them, the related segmentation words are segmentations related to the segmentation words. Generally speaking, the corpus to be processed will include subject words, which are segmentations indicating the subject of the target scene in the corpus to be processed. The subject of the target scene is the subject of the scene targeted by the corpus to be processed. The synonyms or words with the same part of speech of the other segmentations except the subject words in the multiple segmentations can be used as the related segmentations corresponding to the multiple segmentations.
[0051] The scene subject can be a key object in the scene, and the target scene subject is the scene subject targeted by the corpus to be processed. For example, if the corpus to be processed is targeted at the window control scene in the vehicle-machine interaction, and the key object is the window, then the target scene subject is the window. For another example, if the corpus to be processed is targeted at the entertainment news scene, and the key object is the entertainment object, then the target scene subject is the name of the entertainment object. Generally speaking, the participle that serves as the subject or object in the corpus to be processed can be obtained as the main word indicating the target scene subject in the corpus to be processed.
[0052] In specific applications, for a participle other than a predicate, a synonym of the participle can be obtained as a related participle; for a participle that is not a predicate, a word with the same part of speech and similar or opposite meaning as the participle can be obtained as a related participle.
[0053] After determining the relevant participles, if the number of relevant participles does not exceed the number of unit grids with target values in the first spatial state grid, a unit grid with the target value is randomly selected to be assigned a relevant participle, ensuring that each relevant participle is assigned a unit grid with the target value, and different unit grids are assigned different relevant participles, and the remaining unit grids with the target value may not be assigned relevant participles; if the number of relevant participles exceeds the number of unit grids with target values in the first spatial state grid, each unit grid with the target value is randomly assigned a relevant participle, ensuring that each unit grid with the target value is assigned a relevant participle, and different unit grids are assigned different relevant participles, and the remaining relevant participles may not be processed.
[0054] S104: Determine the corpus to be proofread corresponding to each target grid according to the relevant segmentations assigned to the unit grids with target values in each target grid intercepted from the first spatial state grid.
[0055] A grid having the same size as the grid to be processed may be intercepted from the first spatial state grid as the target grid.
[0056] In the present application, a grid with the same size as the grid to be processed can be intercepted from the first spatial state grid each time as a target grid. Multiple target grids can be intercepted through multiple interceptions, and the target grid intercepted each time is different.
[0057] In order to make full use of the first spatial state grid, the intercepted target grid can traverse each grid in the first spatial state grid. The first spatial state grid can be directly divided according to the size of the grid to be processed, and each grid with the same size as the grid to be processed after division is used as a target grid. Alternatively, the size of the grid to be processed can be constructed into a sliding window, and the grid to be traversed in the first spatial state grid according to the set step size is used as the target grid each time.
[0058] For example, the size of the to-be-processed player is 3*3, and the size of the first spatial state grid is 200*200. The first spatial state grid can be divided into 3*3 size to obtain 66*66 target grids. For another example, the size of the to-be-processed player is 3*3, and the size of the first spatial state grid is 200*200. Based on a 3*3 sliding window, a step size of 1 is set for traversal. At this time, 198*198 target grids are obtained through traversal.
[0059] It is worth mentioning that, when multiple first space state grids are selected, each first space state grid can intercept at least one target grid in the aforementioned manner to obtain multiple target grids.
[0060] For each target grid, the relevant participles assigned to the unit grids of the target value in the target grid can be determined, and then the relevant participles assigned to the unit grids of the target value in the target grid can be combined to obtain the combined result as the expected proofreading corresponding to the target grid.
[0061] Generally speaking, there are multiple unit grids with target values in the target grid. At this time, there are also multiple related segmentation words assigned to the unit grids with target values in the target grid. The multiple related segmentation words can be randomly combined to obtain multiple combination results, and each combination result can be used as the expected proofreading corresponding to a target grid. For example, there are 4 unit grids with target values in the target grid, and the 4 unit grids are assigned 4 related segmentation words. The 4 related segmentation words are combined, and the combination results can be 4*3*2*1=24 at most. The 24 combination results can all be used as the expected proofreading, that is, 24 expected proofreading are obtained.
[0062] In this way, all target grids are traversed to obtain all predictions to be proofread. It can be understood that since the prediction to be proofread is obtained by combining related segmented words, the prediction to be proofread may not be a complete sentence, and may include multiple predicates or multiple subjects.
[0063] S105: Select a target corpus corresponding to the corpus to be processed from each corpus to be proofread.
[0064] In this embodiment, after obtaining the predictions to be proofread, the sentence similarity between the corpus to be proofread and the corpus to be processed can be calculated, and the first number of predictions to be proofread are selected as the target corpus according to the sentence similarity from high to low, or the predictions to be proofread whose sentence similarity reaches the sentence similarity threshold are selected as the target corpus. Among them, the first number and the sentence similarity threshold can be set based on demand, and this application does not limit it.
[0065] In the present application, the edit distance, Jaccard coefficient, TF coefficient, TFIDF coefficient, etc. between the to-be-processed corpus and the target corpus may be calculated as the sentence similarity between the to-be-processed corpus and the target corpus.
[0066] In some embodiments, after S105, the method may further include: if the target corpus does not exist in the corpus, adding the target corpus to the corpus to update the corpus. The corpus may be a database pre-installed in an electronic device and storing a certain amount of corpus. If it is determined that the corpus does not contain the target corpus, adding the target corpus to the corpus achieves the purpose of updating the corpus and improves the generalization of the corpus.
[0067] In this embodiment, a grid to be processed is generated according to multiple word segments after the word segmentation of the corpus to be processed and preset rules; then, a first spatial state grid matching the grid to be processed is determined from the spatial state grid of the meta-cellular automaton that changes with time; then, a corresponding related word segmentation is assigned to each unit grid of the target value in the first spatial state grid; and according to the related word segmentation assigned to the unit grid of the target value in each target grid intercepted from the first spatial state grid, the corpus to be proofread corresponding to each target grid is determined; then, the target corpus corresponding to the corpus to be processed is selected from each corpus to be proofread, and the selected target corpus is used as the generated corpus based on the corpus to be processed. corpus, since the meta-cellular automaton changes according to the preset rules, and the grid to be processed is generated according to the preset rules, at this time, the determined first space state grid is related to the corpus to be processed, so that the expectation to be proofread constructed according to the target grid selected in the first space state grid is also related to the corpus to be processed, ensuring that the target corpus is also an expectation related to the corpus to be processed, thereby achieving the purpose of expanding the corpus according to the corpus to be processed, and does not need to generate the corpus based on the generation model constructed by the neural network, saving the time of training the neural network model, greatly improving the corpus generation speed, thereby improving the corpus generation efficiency and corpus generalization efficiency.
[0068] In one embodiment, if Figure 3 As shown, S105 may include:
[0069] S201, obtaining a first part-of-speech order and a first word meaning association value corresponding to a corpus to be processed.
[0070] The first part-of-speech order is used to indicate the order of parts-of-speech between the parts of speech to which the multiple participles belong, and the first word meaning association value is used to indicate the association degree between the multiple participles and the main word; the main word is a participle indicating the target scene subject in the corpus to be processed, and the target scene subject is the scene subject targeted by the corpus to be processed. The first word meaning association value may include the association degree corresponding to each participle.
[0071] After the corpus to be processed is divided, multiple participles are obtained. According to the position of each participle in the corpus to be processed, the arrangement order between the parts of speech to which the multiple participles belong is determined as the part of speech arrangement order. For example, the corpus to be processed is "open the car window", and the participles after division are "open" and "car window". The part of speech of "open" is the predicate, and the part of speech of "car window" is the object. At this time, the first part of speech order is "predicate before object.
[0072] Generally speaking, the correlation between multiple segmentations and the main word can be indicated by numerical values. The larger the numerical value corresponding to the segmentation, the higher the correlation between the segmentation and the main word, and the smaller the numerical value corresponding to the segmentation, the lower the correlation between the segmentation and the main word. The main word has the highest correlation with itself, and the correlation between other segmentations and the main word is less than the correlation between the main word and itself. For example, when the correlation between the main word and itself is 1, the correlation between the main word and other segmentations does not exceed 1.
[0073] It is worth mentioning that when the correlation between the main word and itself is 1, the first word meaning correlation value may include the correlation corresponding to each other participle, and the correlation of the main word may not be included in the first word meaning correlation value. Since its correlation with itself is 1 by default, when processing, it is sufficient to directly determine the correlation of the main word to be 1.
[0074] In this embodiment, the correlation between the participles can be determined according to the rationality of the collocation between the different participles. For example, if "open the window" is a reasonable expression, the correlation between "open" and "window" can be relatively large. For example, if "driving window" is an unreasonable expression, the correlation between "driving" and "window" can be relatively low.
[0075] After determining the association degrees corresponding to the multiple word segments after the corpus to be processed is divided, the association degrees corresponding to the word segments can be summarized to obtain the first word meaning association value.
[0076] S202: Obtain a second part-of-speech sequence and a second word meaning association value corresponding to the corpus to be proofread.
[0077] Among them, as can be seen from the aforementioned embodiments, the corpus to be proofread is expected to be obtained by combining related participles. Therefore, the second part-of-speech order is used to indicate the part-of-speech arrangement order between the parts of speech to which multiple related participles in the corpus to be proofread belong, and the second word meaning association value is used to indicate the association degree between multiple related participles and the main word in the corpus to be proofread. Exemplarily, the second word meaning association value may include the association degree between multiple related participles and the main word in the corpus to be proofread.
[0078] It can be understood that each corpus to be proofread corresponds to a second part-of-speech order and a second word meaning association value.
[0079] The process of determining the second part-of-speech order and the second word meaning association value is similar to the process of determining the first part-of-speech order and the first word meaning association value, and will not be repeated herein.
[0080] S203: Select a target corpus corresponding to the corpus to be processed from each corpus to be proofread according to the first part-of-speech sequence, the first word meaning association value, and the second part-of-speech sequence and the second word meaning association value corresponding to each corpus to be proofread.
[0081] After obtaining the first part-of-speech order, the first word meaning association value, the second part-of-speech order and the second word meaning association value corresponding to each corpus to be proofread, the target corpus can be selected based on the first part-of-speech order, the first word meaning association value, the second part-of-speech order and the second word meaning association value corresponding to each corpus to be proofread.
[0082] As an implementation mode, for each corpus to be proofread, the matching degree between the corpus to be proofread and the corpus to be processed can be determined according to the first part-of-speech order, the first word meaning association value, the second part-of-speech order corresponding to the corpus to be proofread, and the second word meaning association value, and then, according to the matching degree from high to low, a second number of expected corpus to be proofread is selected as the target corpus, or the expected corpus to be proofread whose matching degree reaches the matching degree threshold is selected as the target corpus. Among them, the first number and the matching degree threshold can be set based on demand, and this application does not limit it.
[0083] Exemplarily, the association values of each word in the first word sense association value can be averaged or weighted summed to obtain a first operation result, the association values of each related word in the second word sense association value corresponding to the proofreading corpus can be averaged or weighted summed to obtain a second operation result, and the fluency can be determined based on the difference between the second part-of-speech order and the first part-of-speech order corresponding to the proofreading corpus, and then the first operation result, the second operation result and the fluency can be weighted summed or averaged to obtain a matching degree.
[0084] Optionally, the closer the second part-of-speech order is to the first part-of-speech order, the higher the fluency, and the less similar the second part-of-speech order is to the first part-of-speech order, the lower the fluency. When the second part-of-speech order is the same as the first part-of-speech order, the fluency is maximum. Generally speaking, when the second part-of-speech order is different from the first part-of-speech order, the closer the second part-of-speech order is to the part-of-speech at the corresponding position in the first part-of-speech order, the higher the fluency. For example, the first part-of-speech order is predicate before object, and the second part-of-speech order is predicate before subject. In this case, the fluency is determined to be high. For another example, the first part-of-speech order is predicate before object, and the second part-of-speech order is predicate after predicate. In this case, the fluency is determined to be low.
[0085] As another implementation, S203 may include: determining the word similarity corresponding to the corpus to be proofread according to the first word sense association value and the second word sense association value corresponding to the corpus to be proofread; determining the fluency of each corpus to be proofread according to the first part-of-speech order and the second part-of-speech order corresponding to the corpus to be proofread; and selecting a target corpus whose word similarity reaches a similarity threshold and whose fluency reaches a fluency threshold from each corpus to be proofread. The similarity threshold and fluency can be set based on demand, for example, the similarity threshold is 0.75 and the fluency threshold is 0.8.
[0086] The association values of each word segment in the first word meaning association value can be averaged or weighted summed to obtain the first operation result, and the association values of each related word segment in the second word meaning association value corresponding to the corpus to be proofread can be averaged or weighted summed to obtain the second operation result, and then the first operation result and the second operation result can be averaged or weighted summed to obtain the word similarity. All the corpus to be proofread are traversed to obtain the word similarity of all the corpus to be proofread. At the same time, the fluency corresponding to each corpus to be proofread can be determined according to the difference between the second part of speech order corresponding to the corpus to be proofread and the first part of speech order. Afterwards, the corpus to be proofread whose word similarity reaches the similarity threshold and whose fluency reaches the fluency threshold is selected from each corpus to be proofread as the target corpus.
[0087] In some implementations, after obtaining the word similarities of all the corpora to be proofread, the expected corpora to be proofread whose word similarities reach the similarity threshold are selected as the first intermediate corpora. Afterwards, the fluency can be determined based on the difference between the second part-of-speech order corresponding to the first intermediate corpus (since the first intermediate corpus is the selected expected corpus to be proofread, it must also correspond to the second part-of-speech order) and the first part-of-speech order, and the first intermediate corpus whose fluency reaches the fluency threshold is selected as the target corpus.
[0088] In another embodiment, after obtaining the fluency of all the corpora to be proofread, the expected corpora to be proofread whose fluency reaches the fluency threshold are selected as the second intermediate corpora. Afterwards, the word similarity can be determined according to the second word sense association value corresponding to the second intermediate corpus (since the second intermediate corpus is the selected expected corpus to be proofread, it must also correspond to the second part-of-speech order) and the first word sense association value, and the second intermediate corpus whose word similarity reaches the similarity threshold is selected as the target corpus.
[0089] Of course, the corpus to be proofread that meets both conditions of the similarity of the words selected in the corpus to be proofread reaching the similarity threshold and the fluency reaching the fluency threshold may also be directly determined as the target corpus.
[0090] In this embodiment, based on the first part-of-speech order, the first word meaning association value, the second part-of-speech order and the second word meaning association value corresponding to each corpus to be proofread, the degree of correlation between the corpus to be proofread and the corpus to be processed, as well as the rationality of the corpus to be proofread can be accurately determined, so that the target corpus selected based on the first part-of-speech order, the first word meaning association value, the second part-of-speech order and the second word meaning association value corresponding to each corpus to be proofread is more rational and more relevant to the corpus to be processed, thereby improving the accuracy of the target corpus selection.
[0091] In order to more accurately understand the method of the present application, the corpus selection method of the present application is explained in conjunction with an example. In this example, the corpus is a voice command for vehicle-computer interaction, that is, the electronic device is a vehicle.
[0092] like Figure 4 As shown, when the vehicle is used for the first time, the vehicle determines whether to turn on the corpus update function (the corpus update function is a vehicle function that implements the corpus selection scheme of the present application). If so, the corpus update function is disabled (and after being disabled, the user can manually turn on the function later). If not, the voice command input by the user is obtained.
[0093] Then, the voice instructions are filtered according to the filtering rules to obtain filtered voice instructions to be processed, wherein the filtering rules may include filtering voice instructions including specific tones and voice instructions including dialects, wherein the specific tones may include anger and sadness, etc.
[0094] Afterwards, the voice instruction to be processed is converted into text information to obtain the corpus to be processed, which is processed by the phrase splitting module. Afterwards, the processing result of the phrase splitting module is processed by the meta-cellular automaton processing module to realize the update of the corpus of the corpus.
[0095] Among them, the phrase splitting module processing process is as follows Figure 5 The phrase splitting module divides the corpus to be processed into words, obtains multiple word segments, and determines the first word meaning association value and the first part-of-speech order corresponding to the corpus to be processed.
[0096] Then, the processing result of the phrase splitting module is processed by the meta-cellular automaton processing module. The processing process of the meta-cellular automaton processing module is shown in Figure 6.
[0097] According to the word segmentation after the corpus to be processed is divided, the grid to be processed is constructed through the word allocation submodule in the meta-cellular automaton processing module, and a second spatial state grid is determined for the grid to be processed as the basic corpus. Through the corpus inversion submodule, it is evolved based on the basic corpus to obtain the first spatial state grid. Then, through the corpus prediction submodule, according to the target grid intercepted by the first spatial state grid and the relevant word segmentations assigned to the unit grid with the target value in the target grid, the expectation to be proofread is constructed. After that, through the expectation analysis submodule, the word similarity and fluency corresponding to the expectation to be proofread are determined, so as to screen the target corpus by determining the word similarity and fluency corresponding to the expectation to be proofread. Finally, through the corpus proofreading submodule, it is determined whether the vehicle corpus stores the target corpus. If not, the target corpus is added to the corpus. If so, the target corpus is deleted.
[0098] It can be understood that after determining the first spatial state grid, a target grid can be selected each time, and then a subsequent step is selected from the corpus to be corrected generated based on the target grid to determine whether the selected corpus to be processed is the target corpus. If the corpus to be processed is not the target corpus, a new corpus to be processed is selected from the corpus to be corrected determined in the target grid, and the execution is repeated. If the corpus to be processed is the target corpus, it is determined whether to add the corpus. After determining whether to add the corpus (add the corpus, or not add the corpus, delete the target corpus), a new corpus to be processed is also selected from the corpus to be corrected determined in the target grid, and the execution is repeated. After traversing all the corpuses to be processed in the target grid, a target grid can be intercepted from the first spatial state grid again, and the above process is repeated until all the target grids are traversed. In other words, only one corpus to be proofread can be determined each time as the target corpus and whether to add the corpus.
[0099] In this example, the corpus update function will eventually be applied in the human-computer interaction of the vehicle. Therefore, this corpus generalization process can also be integrated into the vehicle computer backend (a server connected to the vehicle communication) to perform online corpus updates. If the vehicle computer can normally recognize, understand and execute voice commands other than the existing corpus, the vehicle computer backend can perform the above processing on the text information of the voice command text processing to obtain the target corpus and add the target corpus to the corpus.
[0100] It is understandable that when this corpus update function is integrated into the vehicle backend, the privacy of the driver and passengers is taken into consideration. Therefore, the owner is informed of the existence of this function when using the vehicle for the first time, and it is up to the owner to decide whether to turn on this function. It needs to be integrated as an independent function. After the owner chooses to turn on this function, he still has the right to turn off this corpus update function in the settings. Once this corpus update function is turned off, the corpus collection stops, and the corpus update function can be manually turned on during the use of the vehicle.
[0101] It is worth mentioning that when this corpus generalization process is integrated into the vehicle computer backend, taking into account the experience of the driver and passengers, when the owner chooses to turn on this function, the vehicle computer backend will calculate the corpus contribution of the driver and passengers in the corpus. When the corpus contribution of the driver and passengers exceeds 50% of the total corpus in the corpus, subsequent voice commands of the driver and passengers will give priority to retrieving the corpus content contributed by the driver and passengers in the vehicle computer backend.
[0102] See attached Figure 7 , Figure 7 The structure block diagram of a corpus selection device proposed in one embodiment of the present application is shown. The device 1200 includes:
[0103] A generating module 1210 is used to generate a grid to be processed according to multiple segmented words after the segmentation of the corpus to be processed and preset rules; a unit grid with a target value in the grid to be processed corresponds to one segmented word;
[0104] A first determining module 1220 is used to determine a first spatial state grid matching the grid to be processed from the changed spatial state grids when the spatial state grids of the meta-cellular automaton change according to a preset rule;
[0105] The allocation module 1230 is used to allocate a corresponding related word to each unit grid of the target value in the first spatial state grid; the related word is a word related to the word;
[0106] The second determination module 1240 is used to determine the to-be-proofread corpus corresponding to each target grid according to the relevant segmentation words assigned to the unit grids with target values in each target grid intercepted from the first spatial state grid;
[0107] The selection module 1250 is used to select the target corpus corresponding to the corpus to be processed from the corpus to be proofread.
[0108] Optionally, the first determination module 1220 is further used to determine, when the spatial state grid of the meta-cellular automaton changes according to preset rules, a second spatial state grid including a grid to be processed from the changing spatial state grid; and obtain a spatial state grid whose appearance time is after the appearance time of the second spatial state grid as the first spatial state grid.
[0109] Optionally, the second determining module 1240 is further configured to combine, for each target grid, relevant word segments assigned to unit grids with target values in the target grid to obtain the corpus to be proofread corresponding to the target grid area.
[0110] Optionally, the selection module 1250 is also used to obtain a first part-of-speech order and a first word meaning association value corresponding to the corpus to be processed; the first part-of-speech order is used to indicate the order of parts of speech to which multiple participles belong, and the first word meaning association value is used to indicate the degree of association between multiple participles and a main word; the main word is a participle indicating a target scene subject in the corpus to be processed, and the target scene subject is a scene subject targeted by the corpus to be processed; obtain a second part-of-speech order and a second word meaning association value corresponding to the corpus to be proofread; the second part-of-speech order is used to indicate the order of parts of speech to which multiple related participles belong in the corpus to be proofread, and the second word meaning association value is used to indicate the degree of association between multiple related participles and the main word in the corpus to be proofread; according to the first part-of-speech order, the first word meaning association value, the second part-of-speech order and the second word meaning association value corresponding to each corpus to be proofread, select the target corpus corresponding to the corpus to be processed from each corpus to be proofread.
[0111] Optionally, the selection module 1250 is also used to determine the word similarity corresponding to the corpus to be proofread based on the first word sense association value and the second word sense association value corresponding to the corpus to be proofread; determine the fluency of each corpus to be proofread based on the first part-of-speech order and the second part-of-speech order corresponding to the corpus to be proofread; and select a target corpus whose word similarity reaches a similarity threshold and whose fluency reaches a fluency threshold from each corpus to be proofread.
[0112] Optionally, the selection module 1250 is further configured to add the target corpus to the corpus if the target corpus does not exist in the corpus, so as to update the corpus.
[0113] See also Figure 8 , which shows a structural block diagram of an electronic device 900 provided in an embodiment of the present application. The electronic device 900 may be a vehicle, a mobile terminal, a server, and some modules thereof for implementing the corpus selection method in an embodiment of the present application, etc. The electronic device 900 in the present application may include one or more of the following components: a processor 910, a memory 920, and one or more application programs, wherein the one or more application programs may be stored in the memory 920 and configured to be executed by one or more processors 910, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.
[0114] The processor 910 may include one or more processing cores. The processor 910 uses various interfaces and lines to connect various parts of the entire electronic device 900, and executes various functions of the electronic device 900 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 920, and calling data stored in the memory 920. Optionally, the processor 910 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 910 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed; and the modem is used to process wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor 910, but may be implemented separately through a communication chip.
[0115] The memory 920 may include a random access memory (RAM) or a read-only memory (ROM). The memory 920 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 920 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 900 during use.
[0116] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0117] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0118] On the other hand, the present application also provides a computer-readable storage medium, in which program code is stored. The program code can be called by a processor to execute the method described in the above method embodiment.
[0119] The computer readable storage medium can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a cluster of ROMs. Alternatively, the computer readable storage medium includes a non-transitory computer-readable storage medium. The computer readable storage medium has a storage space for the program code of any method step in the above method. These program codes can be read from or written into one or more computer program products. The program code can be compressed, for example, in an appropriate form.
[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A corpus selection method, characterized in that: The method comprises: Generate a grid to be processed according to multiple segmented words after the segmentation of the corpus to be processed and preset rules; a unit grid with a target value in the grid to be processed corresponds to one segmented word; In the process that the space state grid of the meta-cellular automaton changes according to the preset rule, determining a first space state grid matching the grid to be processed from the changed space state grid; Assigning a corresponding related participle to each unit grid of the target value in the first spatial state grid; the related participle is a participle related to the participle; Determine the corpus to be proofread corresponding to each target grid according to the related segmentation words assigned to the unit grid of the target value in each target grid intercepted from the first spatial state grid; A target corpus corresponding to the corpus to be processed is selected from each of the corpus to be proofread.
2. The method according to claim 1, characterized in that The step of determining a first spatial state grid matching the grid to be processed from the changed spatial state grid during the process in which the spatial state grid of the meta-cellular automaton changes according to the preset rule includes: In the process that the space state grid of the meta-cellular automaton changes according to the preset rule, determining a second space state grid including the grid to be processed from the changed space state grid; A space state grid whose appearance time is after the appearance time of the second space state grid is acquired as the first space state grid.
3. The method according to claim 1, characterized in that The step of determining the corpus to be proofread corresponding to each target grid according to the relevant segmented words assigned to the unit grid of the target value in each target grid intercepted from the first spatial state grid comprises: For each target grid, relevant participles assigned to unit grids with target values in the target grid are combined to obtain the corpus to be proofread corresponding to the target grid area.
4. The method according to claim 3, characterized in that The step of selecting a target corpus corresponding to the corpus to be processed from each of the corpus to be proofread includes: Acquire a first part-of-speech order and a first word sense association value corresponding to the corpus to be processed; the first part-of-speech order is used to indicate the order of part-of-speech arrangement between the parts of speech to which the multiple participles belong, and the first word sense association value is used to indicate the degree of association between the multiple participles and a main word; the main word is a participle indicating a target scene subject in the corpus to be processed, and the target scene subject is a scene subject targeted by the corpus to be processed; Acquire a second part-of-speech order and a second word meaning association value corresponding to the corpus to be proofread; the second part-of-speech order is used to indicate the order of parts-of-speech arrangement between the parts of speech to which multiple related participles in the corpus to be proofread belong, and the second word meaning association value is used to indicate the degree of association between the multiple related participles in the corpus to be proofread and the main word; According to the first part-of-speech sequence, the first word meaning association value, the second part-of-speech sequence and the second word meaning association value corresponding to each of the corpora to be proofread, a target corpus corresponding to the corpus to be processed is selected from each of the corpora to be proofread.
5. The method according to claim 4, characterized in that The step of selecting a target corpus corresponding to the corpus to be processed from each of the corpus to be proofread according to the first part-of-speech order, the first word meaning association value, and the second part-of-speech order and the second word meaning association value corresponding to each of the corpus to be proofread includes: Determining the word similarity corresponding to the corpus to be proofread according to the first word meaning association value and the second word meaning association value corresponding to the corpus to be proofread; Determining the fluency of each of the corpora to be proofread according to the first part-of-speech order and the second part-of-speech order corresponding to the corpora to be proofread; A target corpus whose word similarity reaches a similarity threshold and whose fluency reaches a fluency threshold is selected from each of the corpus to be proofread.
6. The method according to claim 1, characterized in that After selecting the target corpus corresponding to the corpus to be processed from each of the corpus to be proofread, the method further includes: If the target corpus does not exist in the corpus, the target corpus is added to the corpus to update the corpus.
7. The method according to any of claims 1 to 6, characterized in that: The preset rule includes that the parity of the sum of the values of the grids surrounding the central unit grid located at the center of the grid of the target size is the same as the parity of the value of the central unit grid, and when the sum of the values of the grids surrounding the central unit grid is an odd number, the value of the central unit grid is the target value.
8. A corpus selection device, characterized in that: The device comprises: A generation module, used for generating a grid to be processed according to a plurality of segmented words after the segmentation of the corpus to be processed and preset rules; a unit grid with a target value in the grid to be processed corresponds to one segmented word; A first determination module is used to determine a first spatial state grid matching the grid to be processed from the changed spatial state grid when the spatial state grid of the meta-cellular automaton changes according to the preset rule; An allocation module, configured to allocate a corresponding related participle to each unit grid of the target value in the first spatial state grid; the related participle is a participle related to the participle; A second determination module is used to determine the corpus to be proofread corresponding to each target grid according to the relevant participles assigned to the unit grid of the target value in each target grid intercepted from the first spatial state grid; The selection module is used to select the target corpus corresponding to the corpus to be processed from the corpus to be proofread.
9. An electronic device, characterized in that: include: one or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Corpus analysis method and device, electronic equipment and storage medium
CN112183089A
Word segmentation method and device, electronic equipment and readable storage medium
CN114692630A
