Data processing method, device, equipment and storage medium

By converting the query data in the data set into a pattern, obtaining the first pattern and obtaining the first type of data from the query data, the repetitive semantic problem of training samples caused by random sampling is solved, and more efficient training sample acquisition and model training effects are achieved.

CN114860872BActive Publication Date: 2025-04-29BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210387642.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-13
Publication Date
2025-04-29
Estimated Expiration
2042-04-13

AI Technical Summary

Technical Problem

In the case where supplementary training samples are needed, random sampling may obtain a large number of training samples with repeated semantics, resulting in poor results in supplementary training samples.

Method used

By converting the query data in the data set into a pattern, a first pattern is obtained, and a first type of data is obtained from the query data according to the pattern, flexible acquisition of the required data is achieved.

Benefits of technology

This method can effectively reduce repeated semantic training samples, improve the diversity and quality of training samples, and thus improve the training effect of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114860872B_ABST
    Figure CN114860872B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data processing method, device, equipment and storage medium. The present disclosure relates to the fields of artificial intelligence technology such as knowledge graphs and natural language processing. The specific implementation scheme is: converting query data in a data set into a pattern; obtaining a first pattern according to the pattern corresponding to the query data; obtaining a first type of data from the query data according to the first pattern. In an embodiment of the present disclosure, the first pattern is obtained according to the pattern corresponding to the query data in the data set, and the required data can be flexibly obtained from the query data according to the first pattern.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of artificial intelligence technologies such as knowledge graphs and natural language processing. Background Art

[0002] When additional training samples are needed, the samples are usually randomly sampled and added directly to the training set. However, random sampling may obtain a large number of training samples with repeated semantics, and the effect of supplementing training samples is not good. Summary of the invention

[0003] The present disclosure provides a data processing method, apparatus, device and storage medium.

[0004] According to one aspect of the present disclosure, there is provided a data processing method, comprising:

[0005] Convert query data in a data set into a schema;

[0006] According to the mode corresponding to the query data, a first mode is obtained;

[0007] A first category of data is obtained from the query data according to the first mode.

[0008] According to another aspect of the present disclosure, there is provided a data processing method, comprising:

[0009] A conversion module, used for converting query data in a data set into a pattern;

[0010] A first acquisition module, used to acquire a first pattern according to a pattern corresponding to the query data;

[0011] The second acquisition module is used to acquire the first category of data from the query data according to the first mode.

[0012] According to another aspect of the present disclosure, there is provided an electronic device, comprising:

[0013] at least one processor; and

[0014] a memory communicatively connected to the at least one processor; wherein,

[0015] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of any embodiment of the present disclosure.

[0016] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method according to any embodiment of the present disclosure.

[0017] According to another aspect of the present disclosure, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the method according to any one of the embodiments of the present disclosure is implemented.

[0018] In the embodiment of the present disclosure, the first pattern is obtained according to the pattern corresponding to the query data in the data set, and the required data can be flexibly obtained from the query data according to the first pattern.

[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0021] Figure 1 is a flowchart of a data processing method according to an embodiment of the present disclosure;

[0022] Figure 2 is a flowchart of a data processing method according to another embodiment of the present disclosure;

[0023] Figure 3 is a flowchart of a data processing method according to another embodiment of the present disclosure;

[0024] Figure 4 is a flowchart of a data processing method according to another embodiment of the present disclosure;

[0025] Figure 5 is a flowchart of a data processing method according to another embodiment of the present disclosure;

[0026] Figure 6 is a flowchart of a data processing method according to another embodiment of the present disclosure;

[0027] Figure 7 is a flowchart of a data processing method according to another embodiment of the present disclosure;

[0028] Figure 8 is a structural schematic diagram of a data processing device according to an embodiment of the present disclosure;

[0029] Fig. 9 is a structural schematic diagram of a data processing device according to another embodiment of the present disclosure;

[0030] Fig.10 is a schematic diagram of an application example of the data processing method according to an embodiment of the present disclosure;

[0031] Fig.11It is a block diagram of an electronic device used to implement the data processing method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0032] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0033] Figure 1 is a flow chart of a data processing method according to an embodiment of the present disclosure. The method may include:

[0034] S101, converting query data in a data set into a pattern;

[0035] S102, acquiring a first mode according to a mode corresponding to the query data;

[0036] S103: Acquire first category data from the query data according to the first mode.

[0037] In the disclosed embodiment, the data set may include a set of data to be processed. The data set to be processed can be obtained from a larger set, such as a target set of 10 million data, according to the category organization, or the full target set can be used as the data set to be processed. For example, the data set may include a set of 10,000 query data of a certain category. The data set can be classified and organized according to subject categories, intent categories, etc. Subject categories may include various categories with certain themes such as games, music, TV series, and movies. Intent categories may include various categories that can reflect user intentions such as navigation, positioning, entertainment, resources, and commodities. Query data may be referred to as query, and may include one or more of query items, query statements, query requests, search items, search statements, search requests, keywords, etc. Query data may include a certain sentence structure, and the query data may be converted into a pattern according to the sentence structure of the query data. Multiple query data may be converted into the same pattern or different patterns.

[0038] In the embodiment of the present disclosure, in the process of converting the query data into a pattern, different patterns can be counted to obtain statistical results of different patterns. The statistical results may include but are not limited to at least one of the number of occurrences, page views (PV), frequency, etc. According to the statistical results of the pattern corresponding to the query data, a first pattern can be obtained. For example, from the various patterns obtained by conversion, the one with better statistical results can be selected as the first pattern. Specifically, a pattern with a large number of occurrences, a high PV, or a high frequency can be selected as the first pattern. For example, there are 10,000 query data in the data set, and after conversion to a pattern, there are 2,000 patterns. Among them, there are 200 patterns with more than 100 occurrences, and these 200 patterns can be screened out as the first pattern. For another example, there are 20,000 query data in the data set, and after conversion to a pattern, there are 3,000 patterns. Among them, there are 500 patterns with PV higher than 1000, and these 500 patterns can be screened out as the first pattern. For another example, there are 100,000 query data in the data set, and after conversion to a pattern, there are 8,000 patterns. Among them, there are 2,000 modes with frequencies higher than 2,000, and these 2,000 modes can be screened out as the first mode.

[0039] In an embodiment of the present disclosure, a first pattern is obtained according to a pattern corresponding to query data in a data set, and required data can be flexibly obtained from the query data according to the first pattern, meeting the needs of various application scenarios such as sample construction, supplementation, knowledge mining and the like.

[0040] Figure 2 1 is a flow chart of a data processing method according to another embodiment of the present disclosure. The method of this embodiment includes one or more features of the above data processing method embodiment. In a possible implementation, the statistical result of the pattern corresponding to the query data includes the frequency of the pattern corresponding to the query data.

[0041] In a possible implementation, the pattern corresponding to the query data includes a semantic pattern. In S102, obtaining a first pattern according to a statistical result of the pattern corresponding to the query data includes:

[0042] S201. Take a semantic pattern whose frequency is greater than or equal to a first threshold as a first semantic pattern.

[0043] In the disclosed embodiments, a semantic pattern may represent an abstract format of a semantic relationship between sentence components in query data. A semantic pattern may also be referred to as a semantic template. Semantic patterns of sentences with different contents may be different. For example, the semantic pattern of a sentence includes a combination of "entity-action-entity". For another example, the semantic pattern of a sentence includes a combination of "game entity-role-skill".

[0044] In an embodiment of the present disclosure, the statistical results may include information such as the frequency of the pattern corresponding to the query data in the data set, and the high-frequency pattern or the medium-high frequency pattern can be used as the core pattern. The frequency threshold is set in advance, and the threshold can be used to control the range of the filtered pattern. For example, if the value of the first threshold is large, high-frequency semantic patterns can be filtered out; if the value of the first threshold is in the middle, medium-high frequency semantic patterns can be filtered out. For example, there are 30,000 query data in the data set, and after conversion to patterns, there are 5,000 patterns. If the frequency threshold is 3000, high-frequency patterns with a frequency greater than or equal to 3000 can be filtered out as the first pattern. If the frequency threshold is 500, medium-high frequency patterns with a frequency greater than or equal to 500 can be filtered out as the first pattern.

[0045] In a possible implementation manner, the query data includes sample data, and in S103, obtaining first-category data from the query data according to the first mode includes:

[0046] S202: Screening the sample data to obtain a first type of sample according to the screening quantity corresponding to the first mode;

[0047] S203: Add the first category of samples to a training sample set.

[0048] In the embodiment of the present disclosure, in the application scenario of constructing and / or supplementing a training sample set, the data set may be a sample set to be screened. The sample set may include a number of sample data. According to the first mode screened out above, a certain number of samples may be screened out from the sample data of the sample set and supplemented to the training sample set.

[0049] In the disclosed embodiment, the number of screenings can be set to a uniform value, or different values ​​can be set for different modes. For example, the number of screenings is uniformly set to 20. If there are 1,000 first modes, 20,000 first-class samples can be screened out. For another example, the number of screenings can be decreased according to the frequency. The number of screenings for a frequency greater than or equal to 1,000 is 200, the number of screenings for a frequency between 999 and 900 is 150, the number of screenings for a frequency between 899 and 7,900 is 100, and so on.

[0050] In the disclosed embodiment, the first type of samples obtained by screening according to the first mode and the screening quantity are added to the training sample set, which is conducive to enriching the core samples in the training sample set, such as medium and high frequency samples, and providing more samples for subsequent model training. If the sample set includes sample data of a certain set category, the training samples of this category can be supplemented in the training sample set to improve the pattern coverage of samples of this category. Furthermore, by training the model with the supplemented training sample set, a model that can more accurately complete tasks such as classification tasks can be obtained.

[0051] Figure 3 1 is a flow chart of a data processing method according to another embodiment of the present disclosure. The method of this embodiment includes one or more features of the above data processing method embodiment. In a possible implementation, the method further includes:

[0052] S301, acquiring a second mode according to a mode corresponding to the query data;

[0053] S302: Acquire second category data from the query data according to the second mode.

[0054] In the disclosed embodiments, some query data belong to mid-to-long tail queries, which appear in the data set at a low frequency, but this type of query data may be large in number. The first mode may not be able to cover mid-to-long tail query data. For example, if the first mode "game entity-role-skill" is used for full sentence matching, the searched query data only includes the game name, character name and skill name, and cannot include other information such as skins and weapons. Among the multiple low-frequency modes obtained by converting multiple query data in the data set, the second mode can be obtained first, and then the second mode can be used to obtain the second type of data, such as mid-to-long tail data, thereby improving the diversity of the obtained data.

[0055] Figure 4 is a flow chart of a data processing method according to another embodiment of the present disclosure. The method of this embodiment includes one or more features of the above data processing method embodiment. In a possible implementation, in S301, according to the statistical result, a second mode is obtained, including at least one of the following:

[0056] Method 1: A second semantic pattern is obtained by sampling from the semantic patterns whose frequency is less than or equal to the first threshold, wherein the frequency of the second semantic pattern is lower than the frequency of the first semantic pattern.

[0057] In an embodiment of the present disclosure, if a semantic pattern higher than a first threshold is a high-frequency semantic pattern, then a semantic pattern less than or equal to the first threshold may be a medium-low frequency semantic pattern. If a semantic pattern higher than the first threshold is a medium-high frequency semantic pattern, then a semantic pattern less than or equal to the first threshold may be a low-frequency semantic pattern. In low-frequency or medium-low frequency semantic patterns, sampling can be performed based on clustering, similarity, randomness, etc. to obtain a second pattern. For example, there are 8,000 low-frequency or medium-low frequency semantic patterns, and there are 1,000 second patterns after sampling.

[0058] Method 2: Sampling the second semantic pattern from the semantic pattern organized based on word fragments.

[0059] In the embodiments of the present disclosure, semantic patterns can also be organized based on word fragments (Term). For example, a certain word fragment term = skill name, and all semantic patterns with the skill name in the data set can be reorganized into a pattern subset. Then, in this pattern subset, sampling is performed based on clustering, similarity, randomness, etc. to obtain a second pattern. The second pattern may include a second semantic pattern of the middle and long tail. The query data filtered out using the second semantic pattern may include multi-fragment query data. The number and content of the specific word fragments used can be flexibly selected according to the actual application scenario, and are not limited in the embodiments of the present disclosure. Word fragments may also include vocabulary, words, etc.

[0060] By sampling the medium-to-long-tail second semantic patterns from low-frequency, medium-low-frequency, and word fragment-organized semantic patterns, more query data with multiple fragments can be screened out, thereby improving the diversity of query data.

[0061] In a possible implementation manner, the query data includes sample data, and in S302, obtaining the second type of data from the query data according to the second mode includes:

[0062] S401, according to the second mode, screening the sample data to obtain the second type of samples;

[0063] S402: Add the second type of samples to a training sample set.

[0064] In the embodiment of the present disclosure, the second category of samples can be screened out according to the second mode and added to the training sample set, which is conducive to adding samples with multiple fragments to the training sample set, making the samples more diversified and providing more diverse samples for subsequent model training.

[0065] Figure 5 1 is a flow chart of a data processing method according to another embodiment of the present disclosure. The method of this embodiment includes one or more features of the above data processing method embodiment. In a possible implementation, the method further includes:

[0066] S501. Correct errors of samples in a training sample set according to the first mode and / or the second mode.

[0067] In the embodiments of the present disclosure, some information of the samples in the training sample set may be inaccurate. By correcting the errors of the samples in the training sample set, more accurate training samples can be provided, thereby improving the accuracy of model training.

[0068] In a possible implementation, according to the first mode and / or the second mode, error correction is performed on samples in the training sample set, including: checking the training sample set according to the first mode and / or the second mode to obtain correct samples and samples to be corrected; and modifying error information in the samples to be corrected according to the correct samples. For example, if a training sample set for games includes 1,000 training samples. Among them, the category of 800 training samples (such as correct samples) screened by the first mode is games, and the category of the other 200 samples is not games, then the category of these 200 samples (such as samples to be corrected) may be wrong, and correction can be performed to change the category of these 200 samples to games. For another example, if a training sample set for games includes 1,000 training samples. Among them, the category of 300 training samples (such as correct samples) screened by the first mode is game, the category of 400 training samples (such as correct samples) screened by the second mode is also game, and the category of the other 300 samples is not game. It is possible that the category of these 300 samples (such as samples to be corrected) is wrong, and correction can be performed to change the category of these 300 samples to game. There are many ways to correct errors. For example, the category of samples to be corrected can be modified one by one, or the category of samples to be corrected can be modified in batches. According to the first mode and / or the second mode, the samples to be corrected in the training sample set can be corrected quickly, and more accurate training samples can be provided, thereby improving the accuracy of model training.

[0069] Figure 6 is a flow chart of a data processing method according to another embodiment of the present disclosure. The method of this embodiment includes one or more features of the above data processing method embodiment. In a possible implementation, the query data includes knowledge data, the first category of data includes knowledge items, and in S103, obtaining the first category of data from the query data according to the first mode includes:

[0070] S601. Mining new knowledge items from the knowledge data according to the slots and the first mode.

[0071] In the disclosed embodiment, the first mode may include a high-frequency mode or a medium-high-frequency mode, which may be flexibly selected according to the actual application through a threshold. The slot may represent the information that needs to be collected, and the knowledge data in the first mode may be obtained by mining in a data set such as a knowledge data set using the slot and the first mode. If new knowledge items such as new entities, actions, roles, skills, etc. are mined in the knowledge data, the new knowledge items may be added to systems such as knowledge graphs and databases to obtain richer knowledge items. For example, if a first mode includes [game entity] [role] [skill], where the game entity, role, and skill correspond to a slot respectively. It is found that slot slot = [game entity] = a new game name appears, and a new game name may be mined. It is found that slot slot = [role] = a new role name appears, and a new role name may be mined. It is found that slot slot = [skill] = a new skill name appears, and a new skill name may be mined.

[0072] Figure 7 1 is a flow chart of a data processing method according to another embodiment of the present disclosure. The method of this embodiment includes one or more features of the above data processing method embodiment. In a possible implementation, S101 converts query data in a data set into a pattern, including:

[0073] S701, segmenting the query data into at least one word segment;

[0074] S702, marking the word fragments obtained by segmentation to obtain word parts;

[0075] S703 . According to the hypernymous word classes corresponding to the word classes of the word fragments, the word fragment sequence of the query data is converted into a hypernymous word class sequence to obtain a pattern corresponding to the query data.

[0076] In the disclosed embodiments, the hypernymy relationship between word classes can be represented by a word class system or a word class tree. Taking the word class tree as an example, each node can represent a word class, and the word class of the upper node of a node N can represent the hypernymy of the node N. If a query data includes multiple word fragments, the hypernymy word classes corresponding to the word classes of these multiple word fragments can be obtained, and then these hypernymy word classes are arranged in the order of the word fragments to obtain the pattern corresponding to the query data. For example: the query data includes movie X1 and actor Y1. Among them, the word class of movie X1 is movie, and the hypernymy word class corresponding to movie is work. The word class of actor Y1 is cast and crew, and the hypernymy word class corresponding to cast and crew is person. In this way, the word fragment sequence "movie X1", "actor Y1" of the query data can be converted into the hypernymy word sequence [work][person], and the pattern corresponding to the query data is [work][person].

[0077] By converting the query data into a pattern through the hypernym part of speech corresponding to the part of speech of the word fragment, it is helpful to obtain a suitable semantic pattern according to the more hypernym semantics of the query data.

[0078] Figure 8 1 is a schematic diagram of the structure of a data processing device according to an embodiment of the present disclosure. The device may include:

[0079] The conversion module 801 is used to convert the query data in the data set into a pattern.

[0080] The first acquisition module 802 is configured to acquire a first pattern according to the pattern corresponding to the query data, for example, according to the statistical result of the pattern corresponding to the query data.

[0081] The second acquisition module 803 is used to acquire first-category data from the query data according to the first mode.

[0082] In a possible implementation, the statistical result includes the frequency of the pattern corresponding to the query data.

[0083] In a possible implementation, the pattern corresponding to the query data includes a semantic pattern, and the first acquisition module is used to take the semantic pattern whose frequency is greater than or equal to a first threshold as the first semantic pattern.

[0084] In a possible implementation, the query data includes sample data, and the second acquisition module is used to filter out first-category samples from the sample data according to the screening quantity corresponding to the first mode; and add the first-category samples to a training sample set.

[0085] Fig. 9 1 is a schematic diagram of the structure of a data processing device according to another embodiment of the present disclosure. The device of this embodiment includes one or more features of the above data processing device embodiment. In a possible implementation, the device also includes:

[0086] The third acquisition module 901 is used to acquire the second mode according to the mode corresponding to the query data, for example, according to the statistical result.

[0087] The fourth acquisition module 902 is used to acquire second-category data from the query data according to the second mode.

[0088] In a possible implementation manner, the third acquisition module 901 is configured to perform at least one of the following:

[0089] Sampling a second semantic pattern from the semantic pattern whose frequency is less than or equal to the first threshold, wherein the frequency of the second semantic pattern is lower than the frequency of the first semantic pattern;

[0090] The second semantic pattern is sampled from the semantic pattern organized based on word fragments.

[0091] In a possible implementation, the query data includes sample data, and the fourth acquisition module 902 is used to filter the second category of samples from the sample data according to the second mode; and add the second category of samples to the training sample set.

[0092] In a possible implementation, the device further includes:

[0093] The error correction module 903 is used to correct errors of samples in the training sample set according to the first mode and / or the second mode.

[0094] In a possible implementation, the error correction module 903 is used to check the training sample set according to the first mode and / or the second mode to obtain correct samples and samples to be corrected; and modify error information in the samples to be corrected according to the correct samples.

[0095] In a possible implementation, the query data includes knowledge data, the first category of data includes knowledge items, and the second acquisition module 803 is used to mine new knowledge items from the knowledge data according to the slot and the first pattern.

[0096] In a possible implementation, the conversion module 801 is used to segment the query data into at least one word fragment; mark the segmented word fragments to obtain word classes; and convert the word fragment sequence of the query data into a superordinate word class sequence according to the superordinate word class corresponding to the word class of the word fragment to obtain a pattern corresponding to the query data.

[0097] For the description of specific functions and examples of each module and submodule of the device in the embodiment of the present disclosure, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.

[0098] The data processing method of the disclosed embodiment can be a method for describing sample pattern coverage. The method can be used to construct and / or optimize model samples for various tasks, thereby improving the model effect. For example, for classification tasks, the classification effect of all categories can be very good under many, for example, 500+ classification systems. In addition, the method can also be used for knowledge mining to improve the collection of graph knowledge.

[0099] If the P / R / F1 (precision / recall / F-measure) indicators of certain categories do not perform well, the use of random sampling as a supplement may add more duplicate samples, but it cannot solve the problem. For example, in the subject classification - weather, most people may search for similar patterns such as q=Shanghai weather, q=Beijing weather, etc. Random sampling under this set may obtain a large number of training samples with repeated semantics. Using the solution of the embodiment of the present disclosure, the pattern coverage of the samples can be analyzed, so similar to the sample pattern in the above example, it may be sufficient to screen 10 to 20 samples, without adding 1w (ten thousand) samples of such repeated semantics under the category.

[0100] The data processing method of the embodiment of the present disclosure may include a method for describing sample pattern coverage, which may analyze the sample pattern coverage of a target set and then be used for at least one of the following:

[0101] (1) Construct and / or supplement training samples to improve model performance. For example, filter out high-frequency samples in a category and add them to the training set to improve the sample pattern coverage of this category. For another example, generate multi-segment samples based on word fragments (terms), filter out long-tail diversity samples in the term dimension and add them to the training set to improve the diversity sample pattern coverage of a single term.

[0102] (2) Optimize and / or correct training samples to improve model performance: If errors are found in a certain sample type based on the sample pattern, batch corrections can be performed directly.

[0103] (3) Auxiliary knowledge mining: data mining to improve the collection of graph knowledge.

[0104] In one example, the target set includes 100 million queries. Suppose a topic classification model with 500+ categories is required to accurately classify these 100 million queries.

[0105] See also Fig.10 In the method for describing sample pattern coverage proposed in the embodiment of the present disclosure, a semantic pattern description can be used. For example, if the above target set task needs to be accurately executed, assuming that the theme classification = game, there are more than 10,000 samples in this category, but the classification effect of this category is not good, the following method can be used to supplement the samples.

[0106] The first one: semantic pattern description method.

[0107] Organize by medium and high frequency semantic patterns under a certain category to improve the pattern coverage of medium and high frequency core samples under the category. For example, if the model predicts a target set of 100 million queries, filter out all queries with "theme classification = game" from the target set, and then convert the filtered queries into semantic patterns.

[0108] Example 1:

[0109] If query = game A1 character B1 skill combo, query = game A2 character B2 skill combo, etc. are described as semantic patterns, they can become pattern = [game entity] [character] skill combo. And all query sets under "theme classification = game" may include a large part of such semantic patterns. Therefore, such semantic patterns can represent a class of queries. This can be understood as sample pattern coverage. There is no need to extract 10,000 queries with such semantic repetitions and add them to the training sample set (which can be referred to as the training set). Such patterns may only need 20 (the specific number can be flexibly configured).

[0110] Using the first description method, all queries under the subject classification in the target set can be converted into semantic patterns, and then the medium and high frequency semantic patterns can be calculated as the core patterns under the category to achieve core sample pattern coverage under the category. Among them, the range of the medium and high frequency semantic patterns can be determined by frequency, etc. The frequency can be determined based on PV, count, etc.

[0111] The first description method can solve the problem of including medium and high frequency semantic patterns and achieve sample pattern coverage of queries corresponding to medium and high frequency patterns.

[0112] Supplementation of multi-segment samples based on single term: If a single term appears, such as the new movie entity = CrossFire, multi-segment samples can be automatically generated based on the core semantic pattern under the category.

[0113] However, the pattern coverage of long-tail queries in the first method is scattered. The following second method can solve the long-tail coverage problem.

[0114] The second method: semantic pattern description method.

[0115] In the embodiment of the present disclosure, examples of single-segment samples and multi-segment samples are as follows:

[0116] Single-clip sample: sample = entity name, e.g. sample = movie D1 is a single clip

[0117] Multi-segment sample: Sample = not limited to entity name, such as: Sample = Movie D1 Watch Online, which is multi-segment.

[0118] Organizing semantic patterns by term improves the diversity coverage of long-tail sample patterns in a single term, thus supplementing the high-frequency semantic patterns of the first description method.

[0119] Example 2:

[0120] For example, if entity = game A1 and discussion query = game A1 skin category queries, there may be more than 1 million queries. Therefore, for such a long-tail query set, it is necessary to select appropriate samples to add to the training set.

[0121] For example, query = how much does skin C2 of character B1 in game A1 cost; query - is skin C1 of character B3 in game A1 good?

[0122] The second method can also be described by semantic patterns, which can be organized by term. Assuming term = game A1, organize all semantic pattern sets under this term, complement the first method, sample the mid- and long-tail semantic patterns, and supplement the diversity at the term level. Among them, the mid- and long-tail semantic patterns can also include low-frequency semantic patterns.

[0123] Sampling examples may include: sampling diverse semantic patterns based on clustering, similarity, randomness, etc., selecting appropriate semantic patterns, and constructing samples to add to the training set.

[0124] The second method can supplement the long-tail queries of the included terms and improve the sample diversity coverage. Using the above method to describe sample pattern coverage, we can analyze the query sample pattern coverage of the target set, select appropriate samples, add them to the training set, and then perform model tasks such as classification tasks better.

[0125] The following is an example of building a semantic pattern:

[0126] Do "word class" sequence annotation, that is, do sequence annotation for the query, split the term, and mark the term category (word class) for each term. Then select a node at a certain level through the superordinate concept system of word classes, such as: TV series -> film and television animation -> works, etc. Convert the term vocabulary sequence into a higher-level superordinate word class sequence pattern, and convert each term into a slot, representing a superordinate node of a certain level of word class.

[0127] Among them, word classes can be understood as term categories. The term vocabulary is infinite, but the term vocabulary categories are limited and can be enumerated. For example, the superordinate concept system is similar to "TV series -> film and television animation -> works".

[0128] In one application scenario, the method of the disclosed embodiment can assist in knowledge mining. For example, under the theme category = game, the core high-frequency semantic pattern = [game entity] character B1 combo is mined. If a new game name appears in slot = [game entity] =, this new entity can be included, i.e., knowledge mining.

[0129] The method for describing sample pattern coverage in the embodiment of the present disclosure can help model sample construction and / or optimization and improve model effect. Further, it can supplement the medium and high frequency sample patterns under the category; supplement the term dimension diversity sample pattern coverage. Further, it can perform sample error correction on the training set; and realize the automatic generation of single-term multi-segment samples. Further, it can assist knowledge mining and improve the collection of graph knowledge.

[0130] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0131] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0132] Fig.11 A schematic block diagram of an example electronic device 1100 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0133] like Fig.11As shown, the device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1102 or a computer program loaded from a storage unit 1108 into a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the device 1100 can also be stored. The computing unit 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.

[0134] A number of components in the device 1100 are connected to the I / O interface 1105, including: an input unit 1106, such as a keyboard, a mouse, etc.; an output unit 1107, such as various types of displays, speakers, etc.; a storage unit 1108, such as a disk, an optical disk, etc.; and a communication unit 1109, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1109 allows the device 1100 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0135] The computing unit 1101 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1101 performs the various methods and processes described above, such as data processing methods. For example, in some embodiments, the data processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1108. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1100 via ROM 1102 and / or communication unit 1109. When the computer program is loaded into RAM 1103 and executed by the computing unit 1101, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, the computing unit 1101 may be configured to perform the data processing method in any other appropriate manner (e.g., by means of firmware).

[0136] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0137] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0138] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0139] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0140] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0141] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0142] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0143] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A data processing method, comprising: Convert query data in a data set into a schema; According to the pattern corresponding to the query data, a first pattern is obtained; wherein the first pattern includes a semantic pattern whose statistical result is greater than or equal to a threshold; Acquire first category data from the query data according to the first mode; According to the pattern corresponding to the query data, a second pattern is obtained; wherein the second pattern is sampled from a semantic pattern whose statistical result is less than or equal to a threshold or a semantic pattern organized based on word fragments; acquiring second category data from the query data according to the second mode; Among them, converting the query data in the data set into a pattern includes: segmenting the query data to obtain at least one word fragment; marking the segmented word fragments to obtain word classes; according to the hypernymous word classes corresponding to the word classes of the word fragments, converting the word fragment sequence of the query data into a hypernymous word class sequence to obtain a pattern corresponding to the query data.

2. The method according to claim 1, wherein: The mode corresponding to the query data includes a semantic mode, and acquiring a first mode according to the mode corresponding to the query data includes: A semantic pattern whose frequency is greater than or equal to the first threshold is taken as the first semantic pattern.

3. The method according to claim 2, wherein: The query data includes sample data, and obtaining first-category data from the query data according to the first mode includes: According to the screening quantity corresponding to the first mode, screening the sample data to obtain a first type of samples; The first type of samples are added to the training sample set.

4. The method according to claim 1, wherein: Acquiring a second mode according to the mode corresponding to the query data includes at least one of the following: Sampling a second semantic pattern from a semantic pattern whose frequency is less than or equal to the first threshold, wherein the frequency of the second semantic pattern is lower than the frequency of the first semantic pattern; The second semantic pattern is sampled from the semantic pattern organized based on word fragments.

5. The method according to any one of claims 1 to 4, wherein: The query data includes sample data, and obtaining second-category data from the query data according to the second mode includes: According to the second mode, a second type of samples is obtained by screening the sample data; The second type of samples are added to the training sample set.

6. The method according to any one of claims 1 to 4, further comprising: According to the first mode and / or the second mode, performing error correction on samples in the training sample set; Among them, according to the first mode and / or the second mode, the samples in the training sample set are corrected, including: checking the training sample set according to the first mode and / or the second mode to obtain correct samples and samples to be corrected; modifying the error information in the samples to be corrected according to the correct samples.

7. The method according to claim 2, wherein the query data includes knowledge data, the first category of data includes knowledge items, and obtaining the first category of data from the query data according to the first mode comprises: New knowledge items are mined from the knowledge data according to the slots and the first mode.

8. A data processing device, comprising: A conversion module is used to convert the query data in the data set into a pattern; wherein the conversion module is used to segment the query data into at least one word segment; annotate the segmented word segment to obtain a word class; and convert the word segment sequence of the query data into a hypernymous word class sequence according to the hypernymous word class corresponding to the word class of the word segment to obtain a pattern corresponding to the query data; A first acquisition module, configured to acquire a first pattern according to the pattern corresponding to the query data; wherein the first pattern includes a semantic pattern whose statistical result is greater than or equal to a threshold; A second acquisition module, configured to acquire first-category data from the query data according to the first mode; A third acquisition module is used to acquire a second pattern according to the pattern corresponding to the query data; wherein the second pattern is sampled from a semantic pattern whose statistical result is less than or equal to a threshold or a semantic pattern organized based on word fragments; A fourth acquisition module is used to acquire second-category data from the query data according to the second mode.

9. The device according to claim 8, wherein: The pattern corresponding to the query data includes a semantic pattern, and the first acquisition module is used to take a semantic pattern whose frequency is greater than or equal to a first threshold as a first semantic pattern.

10. The device according to claim 9, wherein: The query data includes sample data, and the second acquisition module is used to filter and obtain first-category samples from the sample data according to the screening quantity corresponding to the first mode; and add the first-category samples to a training sample set.

11. The device according to claim 8, wherein: The third acquisition module is used to perform at least one of the following: Sampling a second semantic pattern from a semantic pattern whose frequency is less than or equal to the first threshold, wherein the frequency of the second semantic pattern is lower than the frequency of the first semantic pattern; The second semantic pattern is sampled from the semantic pattern organized based on word fragments.

12. The device according to any one of claims 8 to 11, wherein: The query data includes sample data, and the fourth acquisition module is used to filter and obtain second-category samples from the sample data according to the second mode; and add the second-category samples to the training sample set.

13. The device according to any one of claims 8 to 11, further comprising: An error correction module is used to correct samples in a training sample set according to the first mode and / or the second mode; wherein the error correction module is used to check the training sample set according to the first mode and / or the second mode to obtain correct samples and samples to be corrected; and to modify error information in the samples to be corrected according to the correct samples.

14. The device according to claim 9, wherein the query data includes knowledge data, the first category data includes knowledge items, and the second acquisition module is used to mine new knowledge items from the knowledge data according to the slot and the first pattern.

15. An electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.

17. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Relation extraction method and system for medical health field knowledge graph

    CN110059196A

  • Training method and device of sequence labeling model, electronic equipment and storage medium

    CN113220836A