A task processing method, apparatus, device, and storage medium
By decoupling features and discovering causal relationships in unstructured data, and selecting and concatenating unit features with strong causal relationships, the accuracy and stability issues of unstructured data task processing are solved, achieving high efficiency and accuracy in task processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TELECOM CORP LTD
- Filing Date
- 2022-08-08
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies are inadequate for effectively handling various types of unstructured data tasks, and there is a lack of accurate task processing solutions.
By extracting features from unstructured data, performing feature decoupling, discovering causal relationships, selecting unit features with strong causal relationships as second features, and concatenating them with the original features for task processing.
By preserving the original characteristics of unstructured data and combining them with unit features that have strong causal relationships, we can improve the accuracy and stability of task processing, adapt to task changes, and enhance the interpretability and representativeness of features.
Smart Images

Figure CN117574120B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a task processing method, apparatus, device, and storage medium. Background Technology
[0002] With the advent of the data age, people's work and lives are filled with all kinds of data. In order to meet the business needs of different scenarios, various tasks need to be completed based on various types of data. For example, image classification tasks need to be completed based on images, and speech recognition tasks need to be completed based on audio, and so on. Among these, the types of tasks mentioned above are related to the content of the tasks and the data to be processed. In addition, different types of tasks have different characteristics when being processed.
[0003] In view of the above, a task processing solution is needed to accurately complete various tasks. Summary of the Invention
[0004] The purpose of this invention is to provide a task processing method, apparatus, device, and storage medium to accurately complete various tasks. The specific technical solution is as follows:
[0005] According to one aspect of the present invention, a task processing method is provided, the method comprising:
[0006] Obtain unstructured data to complete the task;
[0007] Extract the first feature from the unstructured data;
[0008] Perform feature decoupling processing on the first feature to obtain the unit feature corresponding to the first feature;
[0009] Based on the causal discovery algorithm, the causal relationship between the unstructured data and the obtained unit features is discovered;
[0010] Based on the causal relationship, a second feature for task processing is selected from the unit features;
[0011] The task is processed based on the first feature and the second feature.
[0012] In one embodiment of the present invention, selecting a second feature for task processing from unit features based on the causal relationship includes:
[0013] Based on the causal relationship, a causal effect value is obtained that characterizes the strength of the causal relationship between each unit feature and the unstructured data, and a causal effect value that characterizes the strength of the causal relationship between each unit feature is obtained.
[0014] The unit feature whose obtained causal effect value is higher than the preset causal effect value is selected as the second feature.
[0015] In one embodiment of the present invention, the step of discovering the causal relationship between the unstructured data and the obtained unit features based on the causal discovery algorithm includes:
[0016] The unstructured data and each obtained unit feature are vectorized to obtain a first representation vector corresponding to the unstructured data and a second representation vector corresponding to each obtained unit feature.
[0017] Based on the causal discovery algorithm, the first representation vector and each of the second representation vectors are processed to discover the causal relationship between the unstructured data and the obtained unit features.
[0018] In one embodiment of the present invention, the step of performing feature decoupling processing on the first feature to obtain the unit feature corresponding to the first feature includes:
[0019] The first feature is matched with each feature in the preset unit feature library to obtain the unit feature that matches the first feature.
[0020] Based on the obtained unit features, the unit features corresponding to the first feature are obtained.
[0021] In one embodiment of the present invention, processing the task according to the first feature and the second feature includes:
[0022] The first feature and the second feature are concatenated to obtain the concatenated feature;
[0023] The task is processed using the splicing feature.
[0024] In one embodiment of the present invention, extracting the first feature of the unstructured data includes:
[0025] Extract the discretized features of the unstructured data as the first feature, wherein the discretized features include at least one of entity features, entity attribute features, relationship features between entities, and event features of entity occurrences.
[0026] In one embodiment of the present invention, before extracting the discretized features of the unstructured data as the first feature, the method further includes:
[0027] Based on the format type of the unstructured data, determine the feature type to be extracted for discretization;
[0028] The extraction of discretized features from the unstructured data, as the first feature, includes:
[0029] According to the determined feature type, the discretized features of the unstructured data are extracted as the first feature.
[0030] According to another aspect of the present invention, a task processing apparatus is provided, the apparatus comprising:
[0031] The data acquisition module is used to acquire unstructured data for completing the task;
[0032] The feature extraction module is used to extract the first feature of the unstructured data;
[0033] The feature decoupling module is used to perform feature decoupling processing on the first feature to obtain the unit feature corresponding to the first feature;
[0034] The relationship discovery module is used to discover the causal relationship between the unstructured data and the obtained unit features based on the causal discovery algorithm;
[0035] The feature selection module is used to select a second feature for task processing from the unit features based on the causal relationship;
[0036] The task processing module is used to process the task based on the first feature and the second feature.
[0037] In one embodiment of the present invention, the feature selection module is specifically used for:
[0038] Based on the causal relationship, a causal effect value is obtained that characterizes the strength of the causal relationship between each unit feature and the unstructured data, and a causal effect value is obtained that characterizes the strength of the causal relationship between each unit feature; the unit feature whose obtained causal effect value is higher than the preset causal effect value is selected as the second feature.
[0039] In one embodiment of the present invention, the relationship discovery module is specifically used for:
[0040] The unstructured data and each obtained unit feature are vectorized to obtain a first representation vector corresponding to the unstructured data and a second representation vector corresponding to each obtained unit feature. Based on the causal discovery algorithm, the first representation vector and each second representation vector are processed to discover the causal relationship between the unstructured data and the obtained unit features.
[0041] In one embodiment of the present invention, the feature decoupling module is specifically used for:
[0042] The first feature is matched with each feature in a preset unit feature library to obtain a unit feature that matches the first feature; based on the obtained unit feature, the unit feature corresponding to the first feature is obtained.
[0043] In one embodiment of the present invention, the task processing module is specifically used for:
[0044] The first feature and the second feature are concatenated to obtain the concatenated feature; the concatenated feature is then used to process the task.
[0045] In one embodiment of the present invention, the feature extraction module includes:
[0046] The discrete feature extraction unit is used to extract the discrete features of the unstructured data as the first feature, wherein the discrete features include at least one of entity features, entity attribute features, relationship features between entities, and event features of entity occurrence.
[0047] In one embodiment of the present invention, the feature extraction module further includes:
[0048] The feature type determination unit is used to determine the feature type of the discretized features to be extracted based on the format type of the unstructured data.
[0049] The discrete feature extraction unit is specifically used for:
[0050] According to the determined feature type, the discretized features of the unstructured data are extracted as the first feature.
[0051] According to another aspect of the present invention, an electronic device is provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0052] Memory, used to store computer programs;
[0053] When the processor executes a program stored in memory, it implements any of the task processing method steps in the above embodiments.
[0054] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements any of the task processing method steps in the above embodiments.
[0055] As can be seen from the above, when using the solution provided in the embodiments of the present invention for task processing, the features used include a first feature and a second feature. The first feature is obtained by feature extraction from unstructured data, allowing reference to the original characteristics of the unstructured data during task processing. The second feature is a unit feature selected based on the causal relationship between unit features and unstructured data. Therefore, the second feature has a strong causal relationship with the unstructured data and a strong representation of the unstructured data. By using the first and second features to process tasks, the characteristics of unstructured data can be preserved while incorporating its prominent features, thus enabling accurate completion of various tasks.
[0056] Of course, implementing any product or method of the present invention does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0058] Figure 1 A flowchart illustrating a task processing method provided in an embodiment of the present invention;
[0059] Figure 2 A probability distribution diagram provided for an embodiment of the present invention;
[0060] Figure 3 This is a schematic diagram illustrating the result of feature decoupling provided in an embodiment of the present invention;
[0061] Figure 4 A flowchart illustrating another task processing method provided in an embodiment of the present invention;
[0062] Figure 5 This is a schematic diagram of the structure of a task processing device provided in an embodiment of the present invention;
[0063] Figure 6 This is a schematic diagram of an electronic device structure provided in an embodiment of the present invention. Detailed Implementation
[0064] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of the present invention.
[0065] To accurately complete different tasks, embodiments of the present invention provide a task processing method, apparatus, device, and storage medium. The task processing method will be described in detail below.
[0066] See Figure 1 A flowchart of a task processing method is provided, which includes the following steps S101-S106.
[0067] Step S101: Obtain unstructured data for completing the task.
[0068] Unstructured data refers to data with irregular or incomplete structures, lacking a predefined data model, and inconvenient to represent using a two-dimensional logical table in a database. Specifically, unstructured data can be data in formats such as images, videos, audio, and text. This invention does not limit the format type of unstructured data; any unstructured data is applicable to the solutions provided in this invention.
[0069] The tasks mentioned above are generally set according to specific application scenarios. Different tasks require different unstructured data to complete them.
[0070] For example, for object recognition tasks involving vehicles, pedestrians, etc., the unstructured data used can be images or videos;
[0071] For semantic understanding tasks, the unstructured data used can be text;
[0072] For voice control tasks, the unstructured data used can be audio.
[0073] Step S102: Extract the first feature of the above unstructured data.
[0074] Specifically, when extracting the first feature of unstructured data, one first feature can be extracted, or multiple first features can be provided.
[0075] The method for extracting the first feature is explained below.
[0076] In one implementation, since unstructured data can be data of different format types, and data of different format types have different characteristics, a feature extraction algorithm can be determined first based on the format type of the unstructured data, and then the determined feature extraction algorithm can be used to extract features from the unstructured data to obtain the first feature.
[0077] For example, when the unstructured data is an image, the above feature extraction algorithms can be identified as: HOG (Histogram of Oriented Gradient) feature extraction algorithm, LBP (Local Binary Pattern) feature extraction algorithm, etc.
[0078] When the unstructured data is audio, the aforementioned feature extraction algorithms can be identified as: MFCC (Mel Frequency Cepstrum Coefficient) algorithm, logfBank feature extraction algorithm, etc.
[0079] In another implementation, the discretized features of the unstructured data can be extracted as the first feature mentioned above. The specific process can be found in subsequent embodiments, and will not be detailed here.
[0080] For example, the discretization features mentioned above can be various features involved in graph structure data, such as entity features, entity attribute features, relationship features between entities, and so on.
[0081] Step S103: Perform feature decoupling processing on the first feature to obtain the unit feature corresponding to the first feature.
[0082] In this context, a unit feature can be understood as the feature that characterizes the basic unit of data. Based on this, the first feature can be considered as a feature obtained by coupling multiple unit features, or in other words, the first feature can be decomposed into multiple unit features. In different application scenarios, unit features can be manually defined. For example, for the object data of a horse in an image, in one case, unit features might include: the horse and its color; in another case, unit features might include: the horse's ears, eyes, hooves, tail, and other more detailed features.
[0083] Therefore, a unit feature library can be pre-defined, and then the first feature can be decoupled based on the unit feature library. Specific implementation details can be found in subsequent embodiments, and will not be elaborated here.
[0084] Step S104: Based on the causal discovery algorithm, discover the causal relationship between the above unstructured data and the obtained unit features.
[0085] The causal discovery algorithm can be a pre-defined algorithm, such as a causal discovery algorithm based on the do operator, or a causal discovery algorithm based on conditional intervention, etc.
[0086] For a given set of unstructured data, there can be multiple unit features. When processing a task, these unit features play different roles in that task; that is, they contribute differently to the processing of the task. Therefore, for that task, each unit feature has a different causal relationship with the unstructured data.
[0087] Furthermore, for the same unit feature, its role may differ when processing different tasks. That is, the unit feature contributes differently to different tasks, thus the unit feature has different causal relationships with unstructured data for different tasks.
[0088] In summary, the above causal relationships reflect the contribution of unit features when using unstructured data for task processing, or in other words, the representativeness of the unit features to unstructured data when using unstructured data for task processing.
[0089] For example, consider unstructured data such as images containing two unit features: horses and grasslands. For object recognition tasks, the horse unit feature clearly contributes more and has stronger representational power, while the grassland unit feature contributes less and has weaker representational power. However, for scene recognition tasks, the grassland unit feature clearly contributes more and has stronger representational power, while the horse unit feature contributes less and has weaker representational power. Therefore, for both object and scene recognition tasks, the horse and grassland unit features have different causal relationships with the unstructured data (images).
[0090] Furthermore, for the horse feature, it has a strong representation of the object category but a weaker representation of the scene category. In other words, the horse contributes more to the object recognition task but less to the scene recognition task. Therefore, the causal relationship between the horse feature and the unstructured data of the image is different for the object recognition task and the scene recognition task.
[0091] The aforementioned causal relationship can be represented based on a graph structure, where the two parties with a causal relationship correspond to two nodes in the graph structure, and the line connecting the two nodes represents the aforementioned causal relationship.
[0092] Specifically, the above causal relationships can be discovered based on causal discovery algorithms. The specific implementation process can be found in subsequent embodiments, which will not be detailed here.
[0093] Step S105: Based on the above causal relationship, select a second feature from the unit features for task processing.
[0094] In different causal relationships, the strength of the causal relationship between the two parties is not necessarily the same. The stronger the relationship, the higher the correlation between the two parties. Therefore, when selecting the second feature for task processing from the unit features, the unit feature with the stronger relationship can be selected as the second feature based on the relationship strength corresponding to each causal relationship.
[0095] For details on how to select the second feature, please refer to the following embodiments, which will not be described in detail here.
[0096] Thus, through the above steps S102-S105, the selection of features for task processing has been completed, that is, the selection of the second feature has been completed.
[0097] Step S106: Process the above task according to the first feature and the second feature.
[0098] The specific processing procedure for a task depends on its content. For example, if the task is object recognition, object recognition is performed based on the first and second features; if the task is text recognition, text recognition is performed based on the first and second features.
[0099] The following explains how to process tasks based on the first and second features.
[0100] In one implementation, the first feature and the second feature can be concatenated to obtain a concatenated feature, which is then used to process the aforementioned task. When concatenating features, the second feature can be appended to the end of the first feature's data, or the first feature can be appended to the end of the second feature's data.
[0101] By treating the first and second features as a whole for task processing, this overall feature retains both the original features of the unstructured data and the unit features that have a strong causal relationship with the unstructured data. This enhances the interpretability and stability of the overall feature, i.e., the spliced feature. Using the spliced feature for task processing can improve the accuracy of task processing.
[0102] In another implementation, the task can be processed using the first feature and the second feature separately to obtain the first processing result and the second processing result. Then, the final processing result can be obtained based on the first processing result and the second processing result. This avoids interference between the first feature and the second feature during task processing and improves the stability of the task processing process.
[0103] As can be seen from the above, when using the solution provided in the embodiments of the present invention for task processing, the features used include a first feature and a second feature. The first feature is obtained by feature extraction from unstructured data, allowing reference to the original characteristics of the unstructured data during task processing. The second feature is a unit feature selected based on the causal relationship between unit features and unstructured data. Therefore, the second feature has a strong causal relationship with the unstructured data and a strong representation of the unstructured data. By using the first and second features to process tasks, the characteristics of unstructured data can be preserved while incorporating its prominent features, thus enabling accurate completion of various tasks.
[0104] In addition, the second feature mentioned above is a feature that has a causal relationship with unstructured data, and further, a feature that has a strong causal relationship. This can greatly expand the support capability for feature extraction of unstructured data. The second feature can more stably represent unstructured data, and the second feature also has strong interpretability.
[0105] Furthermore, as can be seen from the foregoing description, in the solution provided by the embodiments of the present invention, feature selection is performed before processing the task. A second feature with a strong causal relationship with the unstructured data is selected when the task is completed. This ensures that the second feature can adapt to changes as the task and the unstructured data change, so that the feature used for task processing is not static but changes with the actual situation. This can effectively improve the accuracy of task processing.
[0106] The application scenarios of the solutions provided in the embodiments of the present invention will be described below.
[0107] In one scenario, the task processing procedure provided in this embodiment of the invention can be applied to a neural network model. That is, the neural network model completes the task processing. After receiving unstructured data, before completing task processing, the neural network model can perform feature selection according to the methods shown in steps S102-S105 above to obtain a second feature, and then complete subsequent task processing based on the second feature. Since the second feature reflects the causal relationship between unit features and unstructured data in task processing, the neural network model performs task processing based on the second feature, and therefore, the neural network model will also be trained based on the second feature. This can improve the model's stability, generalization, and interpretability. Furthermore, experiments have shown that training the neural network model based on the second feature can effectively reduce the distribution difference between the training data and the model output results.
[0108] In another scenario, the electronic device can perform feature selection according to the aforementioned steps S102-S105, select the second feature, and then input the first and second features into the neural network model for task processing.
[0109] In another scenario, the electronic device can directly execute the steps S101-S106 above to complete the task processing.
[0110] The following explains the implementation method of extracting the first feature mentioned in step S102 above.
[0111] In one implementation, the discretized features of the aforementioned unstructured data can be extracted as the first feature.
[0112] The discretization features mentioned above include at least one of entity features, entity attribute features, entity relationship features, and event features that occur to entities.
[0113] Because different formats of unstructured data have different characteristics, the meanings of the various features included in the discretization features mentioned above also differ. Examples are given below for each case.
[0114] Scenario 1: Unstructured data consists of static images or videos.
[0115] Since a single video frame can also be considered a still image, both still images and video frames are referred to as images here.
[0116] Entity features can be objects in an image, such as animals, people, vehicles, etc.; entity attribute features can be attributes of objects in an image, such as the fur color of an animal, its ears, limbs, etc., accessories such as glasses worn by a person, skin color, hair color, license plate number, license plate background color, etc.; entity relationship features can be the relationships between objects in an image, such as whether two animals in an image belong to the same family, or whether two people are friends or family members; entity event features can be descriptions of events that occur to the objects in an image, such as an animal eating at time X, a person drawing, or a vehicle passing through location Y at time Y.
[0117] In this case, entity features and attribute features can be obtained by object segmentation and feature decomposition of the image or video. Relationship features between entities and event features occurring within entities can be obtained through image or video frame analysis, or through analysis of subtitles in the image or video.
[0118] Scenario 2: Unstructured data is text or audio.
[0119] Since audio processing can be performed by first performing speech recognition to obtain text, the text and audio will be explained together here.
[0120] Entity features can be objects described in the text, such as names like Xiaohong or Xiaoming; entity attribute features can be attributes of objects, such as hobbies or interests of objects described in the text; entity relationship features can be relationships between objects described in the text, such as whether two people described in the text are friends or family; and entity event features can be events that occur to objects described in the text, such as an overview of the events described in the text.
[0121] In this case, entity features, entity attribute features, inter-entity relationship features, and event features of entities can all be obtained through semantic analysis of the text.
[0122] It should be noted that the embodiments of the present invention are only illustrated by the above example. The discretization characteristics of other unstructured data formats can be obtained in a similar way, and will not be described one by one here.
[0123] As can be seen from the above, the solution adopted in this embodiment obtains the features of unstructured data from multiple perspectives, including entities, entity attributes, relationships between entities, and events that occur in entities. This makes the obtained first features more comprehensive and diverse, providing more usable information for the selection of subsequent second features, improving the accuracy and diversity of the selected second features, and further improving the accuracy of task processing.
[0124] In another implementation, as can be seen from the preceding description, unstructured data of different formats have different characteristics. Therefore, in this implementation, based on the above implementation, before extracting the discretization features of unstructured data, the feature type of the discretization features to be extracted can be determined according to the format type of the unstructured data. In this way, when extracting the discretization features of unstructured data, the discretization features of unstructured data can be extracted according to the determined feature type.
[0125] Specifically, developers can pre-define the correspondence between different format types and feature types. After determining the format type of unstructured data, the feature type to be extracted for discretization can be determined based on the above correspondence.
[0126] For example, when the format type is image or video, the corresponding feature types can include: entity features, entity attribute features, and feature types corresponding to the relationship features between entities;
[0127] When the format type is text or audio, the corresponding feature types can include: entity features, entity attribute features, and feature types corresponding to the events that occur to the entity.
[0128] This allows for feature extraction based on feature types tailored to different formats of unstructured data, making the extracted first feature more targeted and improving its accuracy.
[0129] The implementation method of the feature decoupling process mentioned in step S103 above is explained below.
[0130] Specifically, the first feature can be matched with each feature in a preset unit feature library to obtain unit features that match the first feature. Then, based on the obtained unit features, the unit features corresponding to the first feature can be obtained.
[0131] The following explains feature matching and the method for obtaining the unit features corresponding to the first feature.
[0132] In one implementation, the similarity between each unit feature in the unit feature library and the first feature can be calculated separately, and the unit feature with a similarity greater than the similarity threshold can be selected as the unit feature corresponding to the first feature.
[0133] In another implementation, algorithms such as VAE (Variational AutoEncoder) or VQVAE (Vector Quantised-Variational AutoEncoder) can be used to obtain the matching probability of the first feature with each feature in the unit feature library, and the unit feature with the matching probability greater than the preset probability threshold is selected as the unit feature corresponding to the first feature.
[0134] The probability of agreement can be represented by discrete values or a probability distribution. For example... Figure 2 As shown, a schematic diagram of a probability distribution is provided. Figure 2 In the diagram, the left side represents the probability of agreement as discrete values, and the right side represents the probability of agreement as a probability distribution. The closer the probability of agreement is to 1, the more closely the first feature matches the unit features in the unit feature library; conversely, the closer the probability of agreement is to -1, the less closely the first feature matches the unit features in the unit feature library.
[0135] For example, the unit feature library includes multiple features such as horse features, stripe features, grassland features, sheep features, and wheat field features. Algorithms such as VAE or VQVAE are used to obtain the probability of a first feature matching the features in the unit feature library. The probability distributions of the sheep feature and the wheat field feature will be similar. Figure 2The probability distribution shown in the first row indicates that the characteristics of a horse, its stripes, and the grassland will be similar. Figure 2 The probability distribution shown in the third or fourth row, if the preset probability threshold is set to zero for discrete values, or if the preset probability threshold is set to zero at the highest point of the normal distribution, then the features of the horse, the stripes, and the grassland are selected as the unit features corresponding to the first feature. The decoupling results can be found in [reference needed]. Figure 3 , Figure 3 A schematic diagram of the result of feature decoupling is provided. Figure 3 The left side shows the unstructured data image 301 corresponding to the first feature, and the right side shows three images, images 302-304, which are the images corresponding to the unit features of the first feature. Among them, image 302 corresponds to the horse feature, image 303 corresponds to the stripe feature, and image 304 corresponds to the grassland feature.
[0136] As can be seen from the above, in the solution provided by the above embodiments, when performing feature decoupling processing, matching the first feature with each feature in the preset unit feature library can obtain more accurate unit features, making the unit features more correlated with the first feature, thereby improving the accuracy of feature decoupling.
[0137] The following explains how the discovery of causal relationships mentioned in step S104 above is achieved.
[0138] In one implementation, the causal relationship between the unstructured data and the obtained unit features can be discovered through conditional intervention.
[0139] Specifically, a predictive model can be established. This model is used to infer predictive features using unit features. Ideally, the predictive features obtained by inferring from the unit features obtained in step S103 should be the same as the first feature. Based on this, intervention conditions are added to the predictive model, such as removing unit feature A, removing unit feature B, or removing both unit features A and B. In case one, if the predicted features obtained by the predictive model after removing unit feature A differ significantly from the first feature, then unit feature A is considered to have a causal relationship with the unstructured data; otherwise, unit feature A is considered not to have a causal relationship with the unstructured data. In case two, if unit feature B is removed, the process is similar to removing unit feature A in case one, the only difference being the units A and B; therefore, it will not be detailed here. Scenario 3: If, after removing unit features A and B, the predicted feature obtained through the prediction model is similar to unit feature A, then unit feature A is considered to have a causal relationship with the remaining unit features other than unit features A and B. If the predicted feature obtained through the prediction model is similar to unit feature B, then unit feature B is considered to have a causal relationship with the remaining unit features other than unit features A and B. By traversing all unit feature combinations in the unit feature library, intervention conditions containing all unit feature combinations are obtained. These intervention conditions are then sequentially added to the prediction model for feature prediction. The causal relationship between the unstructured data and each unit feature in the unit feature library is obtained based on the similarity between the predicted feature and the first feature.
[0140] In another implementation, see Figure 4 It provides a flowchart of another task processing method, which is similar to the one described above. Figure 1 Compared to the illustrated embodiment, in this embodiment, the above step S104 can be implemented by the following steps S104A-S104B.
[0141] Step S104A: Vectorize the unstructured data and each obtained unit feature to obtain the first representation vector corresponding to the unstructured data and the second representation vector corresponding to each obtained unit feature.
[0142] In one implementation, a pre-trained vectorization model can be used to vectorize the unstructured data. Vectorizing the unstructured data can reduce its dimensionality.
[0143] For example, the vectorization model described above can be a multimodal vectorization model or a unimodal vectorization model. In the case where the vectorization model is a unimodal vectorization model, multiple unimodal vectorization models can be used together to complete the vectorization.
[0144] In another implementation, a pre-trained vector extraction and embedding algorithm can be used to vectorize the features of each obtained unit.
[0145] Step S104B: Based on the causal discovery algorithm, process the first representation vector and each of the second representation vectors to discover the causal relationship between the unstructured data and the obtained unit features.
[0146] The aforementioned causal discovery algorithm can be any causal discovery algorithm in the prior art, and the embodiments of the present invention do not limit the specific causal discovery algorithm.
[0147] As can be seen from the above, the solution adopted in this embodiment uses vectorization to represent unstructured data and the features of each obtained unit, which reduces the dimensionality of the data, simplifies the complexity of the data, unifies the form of the data, and thus improves the speed of task processing.
[0148] The second feature selection method mentioned in step S105 above will be explained below.
[0149] In one implementation, a unit feature that makes the similarity between the predicted feature and the first feature greater than a similarity threshold can be selected as the second feature.
[0150] In another implementation, based on the above causal relationship, a causal effect value representing the strength of the causal relationship between each unit feature and the above unstructured data, and a causal effect value representing the strength of the causal relationship between each unit feature can be obtained. The unit feature whose obtained causal effect value is higher than the preset causal effect value is selected as the above second feature.
[0151] The following explains how to obtain causal effect values.
[0152] In one approach, similar to the conditional intervention method described above, a predictive model is established. This model is used to infer predictive features from unit features. The predictive features obtained by inferring from the unit features obtained in step S103 are called standard predictive features. Under each intervention condition, the difference between the predictive features obtained through the above predictive model and the standard predictive features is calculated. This yields the intervention value of the intervention condition on the predictive features, i.e., the causal effect value between the unit features and the unstructured data. The larger the intervention value, the higher the causal effect value, indicating a stronger causal relationship between the unit features removed by the intervention condition and the unstructured data.
[0153] If, under various intervention conditions, the predicted features obtained by the prediction model have a high similarity to the unit features removed from the intervention conditions, then the similarity value between the predicted features and the unit features removed from the intervention conditions is calculated, which is the causal effect value between each unit feature. The larger the similarity value, the higher the causal effect value, indicating a stronger causal relationship between the unit features used to obtain the predicted feature and the removed unit features. This is based on the causal effect value of each unit feature.
[0154] In another approach, building upon the methods described above, a causal graph can be constructed based on the causal relationships obtained in step S104. Unstructured data and individual unit features are used as nodes in the graph. Nodes with causal relationships are connected based on the causal connections between the unstructured data and the individual unit features. Each node represents a factor. In this case, a factor might simultaneously influence both the causal factor X and the outcome factor Y, which are causally related; this factor is called the confounding factor Z. The do operator is used to classify and discuss the confounding factor Z with the causal factor X and the outcome factor Y, adjusting the causal effect values of the causal factor X and the outcome factor Y to make the causal effect values more accurate.
[0155] As can be seen from the above, in this embodiment, the causal relationship strength of each unit feature is determined by the specific causal effect value. This allows for a more accurate selection of the second feature required for task processing, enabling the task to be completed more accurately.
[0156] The task processing scheme provided by the embodiments of the present invention will be illustrated below through two specific examples.
[0157] Example 1
[0158] The unstructured data consists of images, which can be single still images or video frames from a video. The task is object classification.
[0159] After obtaining the image, the objects in the image are segmented, and features are extracted from the segmented objects to obtain three types of features: objects, object attributes, and relationships between objects.
[0160] The above three types of features are decoupled to obtain the corresponding unit features.
[0161] The image is vectorized to obtain the first representation vector, and the features of each unit are vectorized to obtain the second representation vector.
[0162] Using a causal discovery algorithm, the first and second representation vectors are analyzed and processed to discover the causal relationship between the image and the features of each unit.
[0163] Based on the above causal relationships, causal effect values are obtained to characterize the strength of the causal relationship between each unit feature and the image, as well as causal effect values to characterize the strength of the causal relationship between each unit feature and each unit feature.
[0164] The unit feature whose obtained causal effect value is higher than the preset causal effect value is selected as the second feature.
[0165] The aforementioned three types of features are concatenated with the second feature, and the concatenation result is used to classify objects in the image.
[0166] Example 2
[0167] The unstructured data is text, which can originate from documents or be obtained through speech recognition of audio. The task is intent recognition.
[0168] After obtaining the text, the objects in the text are identified, and the text features are extracted based on the identified objects to obtain four types of features: objects, object attributes, relationships between objects, and events that occur to the objects.
[0169] The above four types of features are decoupled to obtain the corresponding unit features.
[0170] The text is vectorized to obtain the first representation vector, and the features of each unit are vectorized to obtain the second representation vector.
[0171] Using a causal discovery algorithm, the first and second representation vectors are analyzed and processed to discover the causal relationships between the text and the features of each unit.
[0172] Based on the above causal relationships, we obtain causal effect values that characterize the strength of the causal relationship between each unit feature and the text, as well as causal effect values that characterize the strength of the causal relationship between each unit feature and each unit feature.
[0173] The unit feature whose obtained causal effect value is higher than the preset causal effect value is selected as the second feature.
[0174] The aforementioned four types of features are concatenated with the second feature, and the concatenation result is used to perform intent recognition on the text.
[0175] Corresponding to the above-described task processing method, this embodiment of the invention also provides a task processing device.
[0176] In one embodiment of the present invention, see Figure 5 , Figure 5 A schematic diagram of a task processing device is provided, the device comprising:
[0177] Data acquisition module 501 is used to acquire unstructured data for completing the task.
[0178] The feature extraction module 502 is used to extract the first feature of the unstructured data mentioned above.
[0179] The feature decoupling module 503 is used to perform feature decoupling processing on the first feature to obtain the unit feature corresponding to the first feature.
[0180] The relationship discovery module 504 is used to discover the causal relationship between the above unstructured data and the obtained unit features based on the causal discovery algorithm.
[0181] The feature selection module 505 is used to select a second feature for task processing from the unit features based on the above causal relationship.
[0182] The task processing module 506 is used to process the task according to the first feature and the second feature.
[0183] As can be seen from the above, when using the solution provided in the embodiments of the present invention for task processing, the features used include a first feature and a second feature. The first feature is obtained by feature extraction from unstructured data, allowing reference to the original characteristics of the unstructured data during task processing. The second feature is a unit feature selected based on the causal relationship between unit features and unstructured data. Therefore, the second feature has a strong causal relationship with the unstructured data and a strong representation of the unstructured data. By using the first and second features to process tasks, the characteristics of unstructured data can be preserved while incorporating its prominent features, thus enabling accurate completion of various tasks.
[0184] In one embodiment of the present invention, the feature selection module 505 is specifically used for:
[0185] Based on the above causal relationship, a causal effect value is obtained to characterize the strength of the causal relationship between each unit feature and the above unstructured data, and a causal effect value is obtained to characterize the strength of the causal relationship between each unit feature. The unit feature whose obtained causal effect value is higher than the preset causal effect value is selected as the above second feature.
[0186] As can be seen from the above, in this embodiment, the causal relationship strength of each unit feature is determined by the specific causal effect value. This allows for a more accurate selection of the second feature required for task processing, enabling the task to be completed more accurately.
[0187] In one embodiment of the present invention, the relationship discovery module 504 is specifically used for:
[0188] The unstructured data and each obtained unit feature are vectorized to obtain a first representation vector corresponding to the unstructured data and a second representation vector corresponding to each obtained unit feature. Based on the causal discovery algorithm, the first representation vector and each second representation vector are processed to discover the causal relationship between the unstructured data and the obtained unit features.
[0189] As can be seen from the above, the solution adopted in this embodiment uses vectorization to represent unstructured data and the features of each obtained unit, which reduces the dimensionality of the data, simplifies the complexity of the data, unifies the form of the data, and thus improves the speed of task processing.
[0190] In one embodiment of the present invention, the feature decoupling module 503 is specifically used for:
[0191] The first feature is matched with each feature in the preset unit feature library to obtain the unit feature that matches the first feature. Based on the obtained unit feature, the unit feature corresponding to the first feature is obtained.
[0192] As can be seen from the above, in the solution provided by the above embodiments, when performing feature decoupling processing, matching the first feature with each feature in the preset unit feature library can obtain more accurate unit features, making the unit features more correlated with the first feature, thereby improving the accuracy of feature decoupling.
[0193] In one embodiment of the present invention, the task processing module 506 is specifically used for:
[0194] The first feature and the second feature are concatenated to obtain the concatenated feature, which is then used to process the task.
[0195] By treating the first and second features as a whole for task processing, this overall feature retains both the original features of the unstructured data and the unit features that have a strong causal relationship with the unstructured data. This enhances the interpretability and stability of the overall feature, i.e., the spliced feature. Using the spliced feature for task processing can improve the accuracy of task processing.
[0196] In one embodiment of the present invention, the feature extraction module 502 includes:
[0197] The discrete feature extraction unit is used to extract the discrete features of the unstructured data mentioned above as the first feature, wherein the discrete features include at least one of entity features, entity attribute features, relationship features between entities, and event features of entity occurrence.
[0198] By treating the first and second features as a whole for task processing, this overall feature retains both the original features of the unstructured data and the unit features that have a strong causal relationship with the unstructured data. This enhances the interpretability and stability of the overall feature, i.e., the spliced feature. Using the spliced feature for task processing can improve the accuracy of task processing.
[0199] In one embodiment of the present invention, the feature extraction module 502 further includes:
[0200] The feature type determination unit is used to determine the feature type of the discretized features to be extracted based on the format type of the unstructured data mentioned above.
[0201] The aforementioned discrete feature extraction unit is specifically used for:
[0202] Based on the determined feature type, the discretized features of the aforementioned unstructured data are extracted and used as the first feature.
[0203] This allows for feature extraction based on feature types tailored to different formats of unstructured data, making the extracted first feature more targeted and improving its accuracy.
[0204] This invention also provides an electronic device, such as... Figure 6 As shown, it includes a processor 601, a communication interface 602, a memory 603, and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.
[0205] Memory 603 is used to store computer programs;
[0206] When the processor 601 executes the program stored in the memory 603, it implements any of the task processing methods in the above method embodiments.
[0207] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0208] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0209] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0210] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0211] In another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements the steps of any of the above-described task processing methods.
[0212] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the task processing methods described in the above embodiments.
[0213] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0214] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0215] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, electronic devices, and storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0216] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A task processing method characterized by, The method includes: Obtain unstructured data for completing a task; the task includes image recognition, speech recognition, semantic understanding, or voice control; wherein for semantic understanding, the unstructured data used is text; and for voice control, the unstructured data used is audio. Extract the first feature from the unstructured data; perform feature decoupling processing on the first feature to obtain the unit feature corresponding to the first feature; Based on the causal discovery algorithm, the causal relationship between the unstructured data and the obtained unit features is discovered; Based on the causal relationship, a second feature for task processing is selected from the unit features; The task is processed based on the first feature and the second feature.
2. The method of claim 1, wherein, The step of selecting a second feature for task processing from the unit features based on the causal relationship includes: Based on the causal relationship, a causal effect value is obtained that characterizes the strength of the causal relationship between each unit feature and the unstructured data, and a causal effect value that characterizes the strength of the causal relationship between each unit feature is obtained. The unit feature whose obtained causal effect value is higher than the preset causal effect value is selected as the second feature.
3. The method of claim 1, wherein, The causal discovery algorithm, which discovers the causal relationship between the unstructured data and the obtained unit features, includes: The unstructured data and each obtained unit feature are vectorized to obtain a first representation vector corresponding to the unstructured data and a second representation vector corresponding to each obtained unit feature. Based on the causal discovery algorithm, the first representation vector and each of the second representation vectors are processed to discover the causal relationship between the unstructured data and the obtained unit features.
4. The method of claim 1, wherein, The step of performing feature decoupling processing on the first feature to obtain the unit feature corresponding to the first feature includes: The first feature is matched with each feature in the preset unit feature library to obtain the unit feature that matches the first feature. Based on the obtained unit features, the unit features corresponding to the first feature are obtained.
5. The method of claim 1, wherein, The process of processing the task based on the first feature and the second feature includes: The first feature and the second feature are concatenated to obtain the concatenated feature; The task is processed using the splicing feature.
6. The method according to any one of claims 1-5, characterized in that, The extraction of the first feature from the unstructured data includes: Extract the discretized features of the unstructured data as the first feature, wherein the discretized features include at least one of entity features, entity attribute features, relationship features between entities, and event features of entity occurrences.
7. The method of claim 6, wherein, Before extracting the discretized features of the unstructured data as the first feature, the method further includes: Based on the format type of the unstructured data, determine the feature type to be extracted for discretization; The extraction of discretized features from the unstructured data, as the first feature, includes: According to the determined feature type, the discretized features of the unstructured data are extracted as the first feature.
8. A task processing apparatus characterized by comprising: The device includes: The data acquisition module is used to acquire unstructured data for completing tasks; the tasks include image recognition tasks, speech recognition tasks, semantic understanding tasks, or voice control tasks; wherein for semantic understanding tasks, the unstructured data used is text; and for voice control tasks, the unstructured data used is audio. The feature extraction module is used to extract the first feature of the unstructured data; The feature decoupling module is used to perform feature decoupling processing on the first feature to obtain the unit feature corresponding to the first feature; The relationship discovery module is used to discover the causal relationship between the unstructured data and the obtained unit features based on the causal discovery algorithm; The feature selection module is used to select a second feature for task processing from the unit features based on the causal relationship; The task processing module is used to process the task based on the first feature and the second feature.
9. The apparatus according to claim 8, characterized in that, The feature selection module is specifically used to obtain, based on the causal relationship, a causal effect value that characterizes the strength of the causal relationship between each unit feature and the unstructured data, and a causal effect value that characterizes the strength of the causal relationship between each unit feature; and to select the unit feature whose obtained causal effect value is higher than the preset causal effect value as the second feature.
10. The apparatus according to claim 8, characterized in that, The relationship discovery module is specifically used to vectorize the unstructured data and each obtained unit feature to obtain a first representation vector corresponding to the unstructured data and a second representation vector corresponding to each obtained unit feature; based on the causal discovery algorithm, the first representation vector and each second representation vector are processed to discover the causal relationship between the unstructured data and the obtained unit features.
11. The apparatus according to claim 8, characterized in that, The feature decoupling module is specifically used to match the first feature with each feature in a preset unit feature library to obtain a unit feature that matches the first feature; and to obtain the unit feature corresponding to the first feature based on the obtained unit feature.
12. The apparatus according to claim 8, characterized in that, The task processing module is specifically used to concatenate the first feature and the second feature to obtain a concatenated feature; and to process the task using the concatenated feature.
13. The apparatus of any one of claims 8-12, wherein, The feature extraction module includes: The discrete feature extraction unit is used to extract the discrete features of the unstructured data as the first feature, wherein the discrete features include at least one of entity features, entity attribute features, relationship features between entities, and event features of entity occurrence.
14. The apparatus of claim 13, wherein, The feature extraction module further includes: The feature type determination unit is used to determine the feature type of the discretized features to be extracted based on the format type of the unstructured data. The discrete feature extraction unit is specifically used to extract the discrete features of the unstructured data according to the determined feature type, as the first feature.
15. An electronic device, comprising: It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-7.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-7.