Data analysis methods, apparatus, computer equipment, readable storage media, and program products

By sorting the weight values ​​of expert networks in a hybrid expert model and calculating cumulative probabilities, the number of expert networks and the target expert network are dynamically adjusted. This solves the problems of poor flexibility, resource waste, or insufficient accuracy caused by the pre-setting of K values ​​in traditional hybrid expert models, and improves decision accuracy.

CN119670742BActive Publication Date: 2025-10-31CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411778691.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-10-31
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

The pre-setting of the K value in traditional hybrid expert models leads to poor flexibility, resulting in wasted computing resources or insufficient decision accuracy.

Method used

By sorting the weight values ​​of each expert network in the hybrid expert model and calculating the cumulative probability, the number of expert networks and the target expert network are dynamically adjusted to determine the analysis and decision results of the word segmentation data.

Benefits of technology

It improves the decision-making accuracy of hybrid expert models, avoiding the waste of computing resources when the number of expert networks is too large and the insufficient decision-making accuracy when the number of experts is too small.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119670742B_ABST
    Figure CN119670742B_ABST
Patent Text Reader

Abstract

This application relates to a data analysis method, apparatus, computer device, computer-readable storage medium, and computer program product. The method includes: acquiring a text to be processed and performing word segmentation on the text to obtain a word segmentation dataset; analyzing the word segmentation data in the word segmentation dataset using a hybrid expert model, and determining the weight values ​​corresponding to each expert network in the hybrid expert model based on the analysis results and a gating network; sorting and calculating the cumulative probability of the weight values ​​corresponding to each expert network, and determining the number of expert networks and the target expert network based on the cumulative probability calculation results; determining the analysis decision result of the word segmentation data based on the number of expert networks, the target expert network, and the weight value corresponding to the target expert network, until the analysis decision result of all word segmentation data in the word segmentation dataset is obtained, thus determining the data analysis result of the text to be processed. This method improves the overall decision accuracy of the hybrid expert model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of computer science and artificial intelligence, and in particular to a data analysis method, apparatus, computer device, computer-readable storage medium, and computer program product. Background Technology

[0002] Mixture of Experts (MoE) is a deep learning framework that addresses complex data analysis problems by integrating the decisions of multiple "experts." In MoE, the gating network plays a crucial role, allocating weights based on the current input to determine the influence of each expert network in the final decision.

[0003] In traditional techniques, hybrid expert models are typically used to perform sentiment analysis or semantic analysis on text data. Taking semantic analysis of text data as an example, a pre-set number of experts participating in the decision-making process, i.e., K (K is an integer greater than 1), is used. Then, based on the weights assigned to the gating networks in the hybrid expert model and the pre-set number of experts (K), target expert networks are determined in the hybrid expert model to participate in the text data decision-making process. Finally, semantic analysis decisions are made on the text data based on K target expert networks, resulting in the semantic analysis results of the text data.

[0004] However, in traditional techniques, the pre-set K value results in poor flexibility in hybrid expert model processing. When the K value is too large, it can easily lead to a waste of computing resources, while when the K value is too small, the accuracy of the model's analysis and decision-making results is poor. Therefore, a data analysis method with a reasonable K value is needed. Summary of the Invention

[0005] Therefore, it is necessary to provide a data analysis method, apparatus, computer equipment, computer-readable storage medium, and computer program product to address the aforementioned technical problems.

[0006] Firstly, this application provides a data analysis method, including:

[0007] Obtain the text to be processed, and perform word segmentation on the text to be processed to obtain a word segmentation dataset;

[0008] For each segmented data in the segmented dataset, the segmented data is analyzed and processed by a hybrid expert model, and the weight values ​​of each expert network in the hybrid expert model are determined based on the analysis and processing results and the gating network.

[0009] The weight values ​​corresponding to each expert network are sorted and their cumulative probabilities are calculated. Based on the cumulative probability calculation results, the number of expert networks and the target expert network are determined.

[0010] Based on the number of expert networks and the corresponding weight values ​​of the target expert networks, the analysis decision results of the word segmentation data are determined until the analysis decision results of all word segmentation data in the word segmentation dataset are obtained, and the data analysis results of the text to be processed are determined.

[0011] In one embodiment, for each segmented data in the segmentation dataset, the segmented data is analyzed and processed using a hybrid expert model, and based on the analysis and processing results and the gating network, the weight values ​​corresponding to each expert network in the hybrid expert model are determined, including:

[0012] For each segmented data in the segmented dataset, the segmented data is analyzed and processed using a hybrid expert model to obtain the analysis and processing results;

[0013] Based on the analysis and processing results and the gating network in the hybrid expert model, the weight values ​​corresponding to each expert network in the hybrid expert model are calculated; the weight values ​​corresponding to the expert networks are used to characterize the decision-making efficiency of the expert networks on the word segmentation data.

[0014] In one embodiment, the step of sorting and calculating the cumulative probability of the weight values ​​corresponding to each of the expert networks, and determining the number of expert networks and the target expert network based on the cumulative probability calculation results, includes:

[0015] The weight values ​​corresponding to each expert network are normalized to obtain the probability weight values ​​corresponding to each expert network.

[0016] The probability weight values ​​of each expert network are sorted in descending order to obtain a weight value sequence.

[0017] The cumulative probability of the probability weight values ​​in the weight value sequence is calculated, and the cumulative probability calculation result after accumulating each probability weight value is verified based on the cumulative probability threshold.

[0018] If the current cumulative probability calculation result is greater than or equal to the cumulative probability threshold, determine the number of expert networks and the target expert network.

[0019] In one embodiment, determining the number of expert networks and the target expert network when the current cumulative probability calculation result is greater than or equal to the cumulative probability threshold includes:

[0020] If the current cumulative probability calculation result is greater than or equal to the cumulative probability threshold, the number of probability weight values ​​contained in the current cumulative probability calculation result is determined as the number of expert networks.

[0021] The expert network corresponding to the probability weight values ​​contained in the current cumulative probability calculation result is determined as the target expert network.

[0022] In one embodiment, the method further includes:

[0023] If the cumulative probability calculation result of all probability weights in the weight value sequence is less than the cumulative probability threshold, the number of expert networks in the hybrid expert model is determined as the number of expert networks, and each expert network in the hybrid expert model is determined as the target expert network.

[0024] In one embodiment, determining the analysis decision result of the word segmentation data based on the number of expert networks and the weight values ​​corresponding to the target expert networks includes:

[0025] The word segmentation data is analyzed and decided by the target expert network in the hybrid expert model to obtain the initial analysis and decision results.

[0026] Based on the initial analysis and decision results of each target expert network and the corresponding weight values ​​of the target expert networks, the analysis and decision results of the word segmentation data are determined.

[0027] Secondly, this application also provides a data analysis apparatus, comprising:

[0028] The acquisition module is used to acquire the text to be processed and perform word segmentation on the text to be processed to obtain a word segmentation dataset;

[0029] The first determining module is used to analyze and process each segmented data in the segmented data dataset using a hybrid expert model, and determine the weight value of each expert network in the hybrid expert model based on the analysis and processing results and the gating network.

[0030] The second determining module is used to sort the weight values ​​corresponding to each expert network and calculate the cumulative probability, and determine the number of expert networks and the target expert network based on the cumulative probability calculation results.

[0031] The third determining module is used to determine the analysis decision result of the word segmentation data based on the number of expert networks and the weight value corresponding to the target expert network, until the analysis decision result of all word segmentation data in the word segmentation dataset is obtained, and to determine the data analysis result of the text to be processed.

[0032] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0033] Obtain the text to be processed, and perform word segmentation on the text to be processed to obtain a word segmentation dataset;

[0034] For each segmented data in the segmented dataset, the segmented data is analyzed and processed by a hybrid expert model, and the weight values ​​of each expert network in the hybrid expert model are determined based on the analysis and processing results and the gating network.

[0035] The weight values ​​corresponding to each expert network are sorted and their cumulative probabilities are calculated. Based on the cumulative probability calculation results, the number of expert networks and the target expert network are determined.

[0036] Based on the number of expert networks and the corresponding weight values ​​of the target expert networks, the analysis decision results of the word segmentation data are determined until the analysis decision results of all word segmentation data in the word segmentation dataset are obtained, and the data analysis results of the text to be processed are determined.

[0037] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0038] Obtain the text to be processed, and perform word segmentation on the text to be processed to obtain a word segmentation dataset;

[0039] For each segmented data in the segmented dataset, the segmented data is analyzed and processed by a hybrid expert model, and the weight values ​​of each expert network in the hybrid expert model are determined based on the analysis and processing results and the gating network.

[0040] The weight values ​​corresponding to each expert network are sorted and their cumulative probabilities are calculated. Based on the cumulative probability calculation results, the number of expert networks and the target expert network are determined.

[0041] Based on the number of expert networks and the corresponding weight values ​​of the target expert networks, the analysis decision results of the word segmentation data are determined until the analysis decision results of all word segmentation data in the word segmentation dataset are obtained, and the data analysis results of the text to be processed are determined.

[0042] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0043] Obtain the text to be processed, and perform word segmentation on the text to be processed to obtain a word segmentation dataset;

[0044] For each segmented data in the segmented dataset, the segmented data is analyzed and processed by a hybrid expert model, and the weight values ​​of each expert network in the hybrid expert model are determined based on the analysis and processing results and the gating network.

[0045] The weight values ​​corresponding to each expert network are sorted and their cumulative probabilities are calculated. Based on the cumulative probability calculation results, the number of expert networks and the target expert network are determined.

[0046] Based on the number of expert networks and the corresponding weight values ​​of the target expert networks, the analysis decision results of the word segmentation data are determined until the analysis decision results of all word segmentation data in the word segmentation dataset are obtained, and the data analysis results of the text to be processed are determined.

[0047] The aforementioned data analysis method, apparatus, computer equipment, computer-readable storage medium, and computer program product acquire the text to be processed and perform word segmentation on the text to be processed to obtain a word segmentation dataset. For each word segmentation data in the word segmentation dataset, a hybrid expert model is used to analyze and process the word segmentation data, and based on the analysis and processing results and a gating network, the weight values ​​corresponding to each expert network in the hybrid expert model are determined. The weight values ​​corresponding to each expert network are sorted and cumulative probability is calculated, and based on the cumulative probability calculation results, the number of expert networks and the target expert network are determined. Based on the target expert network and the weight values ​​corresponding to the target expert network, the analysis decision result of the word segmentation data is determined, until the analysis decision result of all word segmentation data in the word segmentation dataset is obtained, and the data analysis result of the text to be processed is determined. This method refines the granularity of text processing by processing the segmented data in the text to be processed. By calculating the cumulative probability of the weight values ​​of each expert network, the number of expert networks and the target expert network corresponding to each segmented data are dynamically adjusted. This avoids the waste of computing resources when the number of expert networks is too large, and also avoids the poor decision accuracy when the number of expert networks is too small. In this way, the overall decision accuracy of the hybrid expert model is improved. Attached Figure Description

[0048] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0049] Figure 1 This is a flowchart illustrating a data analysis method in one embodiment;

[0050] Figure 2 This is a flowchart illustrating the steps for calculating the weight values ​​of each expert network in one embodiment.

[0051] Figure 3 This is a flowchart illustrating the steps for determining the number of expert networks and the target expert network in one embodiment.

[0052] Figure 4 This is a flowchart illustrating the steps for obtaining expert network data and the target expert network in one embodiment.

[0053] Figure 5 This is a flowchart illustrating the steps for determining the target expert network under special circumstances in one embodiment.

[0054] Figure 6 This is a flowchart illustrating the steps for determining the analysis and decision-making results of word segmentation data in one embodiment.

[0055] Figure 7 This is a schematic flowchart illustrating a specific example of a process for determining the number of expert networks and the target expert network in one embodiment.

[0056] Figure 8 This is a schematic diagram illustrating the specific process of a data analysis task for text to be processed based on a hybrid expert model in one embodiment.

[0057] Figure 9 This is a structural block diagram of a data analysis device in one embodiment;

[0058] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0059] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0060] In one embodiment, the traditional hybrid expert model (MoE) employs a Top-K strategy to select experts, choosing the top K experts with the highest weights based on the weights assigned by the gating network to participate in the final decision-making process. However, traditional MoE models apply the same K value to the entire text data analysis task. For example, if K is predefined as 4 in the model's configuration file, K=4 is read from the configuration file before starting the MoE model, and once started, the K value cannot be modified during the entire text data analysis process. Thus, when the K value is set too high, for example, if three expert models are sufficient to determine the accurate decision analysis result, using four expert models for decision analysis can easily lead to a waste of computational resources. Conversely, when the K value is set too low, for example, if six expert models are needed for decision analysis, using only four expert networks for decision analysis results in poor accuracy. Therefore, a data analysis method that reasonably sets the K value is needed. Figure 1 As shown, this application provides a data analysis method. This embodiment illustrates the method applied to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0061] Step 102: Obtain the text to be processed and perform word segmentation on the text to obtain the word segmentation dataset.

[0062] In implementation, a hybrid expert model is pre-integrated into the terminal. This model can be used to perform data analysis on the text data to be processed. Specific data analysis tasks can include semantic analysis or sentiment analysis. This embodiment does not limit the data analysis tasks that the hybrid expert model can perform. Thus, when the terminal performs a data analysis task on a specific piece of text data to be processed, it first obtains the text to be processed. Then, based on the pre-model layer of the hybrid expert model, or based on other text processing models, it performs word segmentation on the text to be processed, obtaining a word segmentation dataset corresponding to the text to be processed. This word segmentation dataset contains multiple word segmentation data tokens after text segmentation.

[0063] Step 104: For each segmented data in the segmented data dataset, the segmented data is analyzed and processed using a hybrid expert model, and the weight values ​​of each expert network in the hybrid expert model are determined based on the analysis and processing results and the gating network.

[0064] In implementation, for each segmented data token in the segmented dataset, the terminal performs initial analysis on the segmented data through the expert networks included in the hybrid expert model, obtaining preliminary analysis results from each expert network. For example, this analysis result could be the semantic analysis probability or the sentiment discrimination probability for that segmented data. Then, the gating network in the hybrid expert model calculates the weight values ​​corresponding to each expert network's output analysis results. Each weight value reflects the decision-making effectiveness of that expert network for the input segmented data.

[0065] Step 106: Sort the weight values ​​of each expert network and calculate the cumulative probability. Based on the cumulative probability calculation results, determine the number of expert networks and the target expert network.

[0066] In implementation, for the determined weight values ​​of each expert network, the terminal sorts the weight values ​​and calculates the cumulative probability. Then, based on a preset cumulative probability threshold (e.g., 90% or other user-defined values) and the calculated cumulative probability results, the terminal selects the top N expert networks to participate in the analysis and decision-making of this round of word segmentation data. In other words, the terminal determines the number of expert networks and the target expert networks for the analysis and decision-making of this word segmentation data. It is understandable that the determined cumulative probability results will differ for different word segmentation data, and the number N of expert networks corresponding to that word segmentation data can be different.

[0067] Step 108: Based on the number of expert networks and the corresponding weight values ​​of the target expert network, determine the analysis decision results of the word segmentation data until the analysis decision results of all word segmentation data in the word segmentation dataset are obtained, and determine the data analysis results of the text to be processed.

[0068] In implementation, the terminal analyzes and makes decisions on the segmented data based on a determined number of target expert networks. The analysis and decision results output by each target expert network are weighted according to their respective weight values ​​to obtain the analysis and decision results for the segmented data. Thus, the hybrid expert model executes steps 104 to 106 for each segmented data in the segmented dataset until the analysis and decision results for all segmented data in the dataset are obtained. During the process of obtaining the analysis and decision results for all segmented data, after each segmented data analysis and decision is executed, the hybrid expert model learns the corresponding analysis and decision results. Once the analysis and decision results for all segmented data are obtained, the hybrid expert model has learned the relationships between the analysis and decision results for all segmented data. The terminal then performs a comprehensive analysis of the analysis and decision results for all segmented data to determine the data analysis results for the text to be processed.

[0069] In the above data analysis method, the text to be processed is acquired and segmented into words to obtain a segmented dataset. For each segmented data in the dataset, a hybrid expert model is used to analyze and process the segmented data. Based on the analysis results and the gating network, the weight values ​​of each expert network in the hybrid expert model are determined. The weight values ​​of each expert network are sorted and cumulatively probable. Based on the cumulative probability calculation results, the number of expert networks and the target expert network are determined. Based on the number of expert networks, the target expert network, and the weight values ​​of the target expert network, the analysis decision results of the segmented data are determined until the analysis decision results of all segmented data in the segmented dataset are obtained, thus determining the data analysis results of the text to be processed. By processing the segmented data in the text to be processed, the granularity of text processing is refined. By calculating the cumulative probability of the weight values ​​of each expert network, the number of expert networks and the target expert network corresponding to each segmented data are dynamically adjusted. This avoids the waste of computational resources when the number of expert networks is too large, and also avoids the poor decision accuracy when the number of expert networks is too small. Therefore, the overall decision accuracy of the hybrid expert model is improved.

[0070] In one exemplary embodiment, such as Figure 2 As shown, the specific processing procedure of step 104 includes steps 202 to 204. Wherein:

[0071] Step 202: For each segmented data in the segmented data dataset, the segmented data is analyzed and processed using a hybrid expert model to obtain the analysis and processing results.

[0072] In implementation, for each segmented data token in the segmented dataset, the terminal analyzes and processes the segmented data token using a hybrid expert model, obtaining the analysis and processing results of each expert network in the hybrid expert model for that segmented data. The meaning of the analysis and processing results may differ depending on the data analysis task. For example, for a sentiment discrimination task on text data, the analysis and processing result could be the sentiment discrimination result of each expert network for that segmented data token, such as sad, happy, positive, negative, etc. If it is a semantic analysis task on text data, the analysis and processing result could be the semantic analysis result of each expert network for that segmented data token; for example, the semantic analysis result could determine whether A (person's name) performed event B, etc. This application does not limit the data analysis tasks that the hybrid expert model can perform on natural language text data.

[0073] Step 204: Based on the analysis and processing results and the gating network in the hybrid expert model, calculate the weight values ​​corresponding to each expert network in the hybrid expert model.

[0074] The weight values ​​corresponding to the expert network are used to characterize the decision-making efficiency of the expert network on the word segmentation data.

[0075] In implementation, the hybrid expert model includes not only individual expert networks but also a gating network. This gating network is a crucial component, enabling the model to learn to select the type of subtask for a given input and to choose trusted expert networks for strong predictions. Therefore, the gating network filters expert networks by setting their weights. The terminal processes the features of the current segmented data based on the hybrid expert model, calculating the weights of each expert network. These weights reflect the relative efficiency (decision effectiveness) of different experts on the input tokens.

[0076] In this embodiment, the weight values ​​of each expert network in the hybrid expert model are calculated through a gated network. Then, based on the weight values ​​of each expert network and the preset cumulative probability calculation method, the number of expert networks corresponding to the current word segmentation data and the corresponding target expert network can be determined. This enables dynamic adjustment of the number of expert networks in the data analysis task of the text to be processed, improves the flexibility of data analysis task processing, and improves the quality of data analysis decision-making.

[0077] In one exemplary embodiment, such as Figure 3 As shown, step 106 includes steps 302 to 306. Wherein:

[0078] Step 302: Normalize the weight values ​​corresponding to each expert network to obtain the probability weight values ​​corresponding to each expert network.

[0079] In implementation, for the weight values ​​of each expert network determined by the gating network, the terminal performs a normalization process on each weight value. Specifically, the terminal can use a single softmax function or multiple softmax functions (multiple softmax functions can further distinguish the degree of sharing among experts) to normalize the weight values ​​corresponding to each expert network, obtaining the probability weight values ​​corresponding to each expert network. The weights corresponding to all expert networks are then transformed into a probability distribution, ensuring that the sum of the probability weight values ​​corresponding to all expert networks is 1.

[0080] Step 304: Sort the probability weight values ​​of each expert network in descending order to obtain a weight value sequence.

[0081] In implementation, the terminal sorts the normalized probability weight values ​​in descending order to obtain a weight value sequence containing the probability weight values ​​corresponding to each expert network. For example, the hybrid expert model contains 5 expert networks, and the probability weight values ​​corresponding to these 5 expert networks are sorted from high to low as [0.4, 0.3, 0.2, 0.05, 0.05], thus obtaining the weight value sequence corresponding to these 5 expert networks.

[0082] Step 306: Calculate the cumulative probability of the probability weights in the weight value sequence, and verify the cumulative probability calculation result after accumulating each probability weight value based on the cumulative probability threshold.

[0083] In implementation, the terminal performs cumulative probability calculations on the probability weight values ​​in the weight value sequence. This involves accumulating each probability weight value in descending order of magnitude, resulting in a new cumulative probability calculation result after each addition. This cumulative probability calculation result then needs to be verified by comparing it with a cumulative probability threshold to determine whether to continue accumulating probability weight values. For example, when processing a segmented data token, the probability weights of 5 experts, from high to low, are [0.4, 0.3, 0.2, 0.05, 0.05]. A cumulative probability threshold P is preset, which is P=0.6. When calculating the cumulative probability of the 5 experts according to the order of probability weights from high to low in the weight value sequence, if the first probability weight is 0.4 and 0.4 < 0.6, the accumulation of probability weights continues. When the second probability weight is accumulated, (0.4 + 0.3) > 0.6, the accumulation of probability weights stops.

[0084] Step 308: If the current cumulative probability calculation result is greater than or equal to the cumulative probability threshold, determine the number of expert networks and the target expert network.

[0085] In implementation, if the current cumulative probability calculation result is greater than or equal to the cumulative probability threshold, the terminal determines the number of expert networks and the target expert network for the current segmented data token. Specifically, as in the specific processing procedure in step 306 above, during the cumulative probability calculation of the probability weight values, each time a probability weight value is accumulated, a verification of the probability weight value is performed based on the cumulative probability threshold. If the current cumulative probability calculation result is greater than or equal to the cumulative probability threshold, for example, (0.4+0.3)>0.6 in the above example, the terminal stops accumulating the probability weight values, that is, stops selecting expert networks, takes the number of expert networks currently accumulated as expert network data, and takes the expert network corresponding to the currently accumulated probability weight value as the target expert network. The cumulative probability threshold (e.g., 0.6) is used to determine the selection of the top N experts (N is different for different tokens; for example, N=2 in this example), ensuring that their cumulative weights at least reach this cumulative probability threshold. This ensures that the selected expert set can represent the vast majority of the "opinions" of the entire expert pool regarding the current input data.

[0086] In this embodiment, by calculating the cumulative probability of the probability weight values ​​corresponding to each expert network and verifying the preset cumulative probability threshold, the number of expert networks corresponding to the current word segmentation data and the corresponding target expert network are dynamically determined, thereby improving the decision quality.

[0087] In one exemplary embodiment, such as Figure 4 As shown, the specific processing steps of step 308 include:

[0088] Step 401: If the current cumulative probability calculation result is greater than or equal to the cumulative probability threshold, the number of probability weight values ​​contained in the current cumulative probability calculation result is determined as the number of expert networks.

[0089] In implementation, if the current cumulative probability calculation result is greater than or equal to the cumulative probability threshold, the terminal determines the number of probability weight values ​​included in the current cumulative probability calculation result as the number of expert networks. For example, during the accumulation of probability weight values, if the current cumulative probability calculation result is the sum of the first three probability weight values ​​in the weight value sequence, and the current cumulative probability calculation result is greater than or equal to the cumulative probability threshold, then the terminal determines the number of probability weight values ​​included in the cumulative probability calculation result, i.e., three, as the number of expert networks selected in the hybrid expert model.

[0090] Step 402: Determine the expert network corresponding to the probability weight values ​​contained in the current cumulative probability calculation result as the target expert network.

[0091] In implementation, since the probability weights are sorted from largest to smallest in the weight value sequence, and these probability weights also reflect the decision-making effectiveness of the expert network on the segmented data, the order of probability weights from largest to smallest in the weight value sequence also reflects the decision-making effectiveness of the expert network on the segmented data from largest to smallest. Expert networks with higher decision-making effectiveness have a greater influence on the decision-making analysis of the segmented data, while expert networks with lower decision-making effectiveness have a smaller influence. Therefore, after determining the number N of expert networks to be selected in the hybrid expert model, for example, N=3, the expert networks corresponding to the first three probability weight values ​​are the target expert networks selected to participate in the decision-making of the segmented data.

[0092] In this embodiment, a target expert network is selected in the hybrid expert model based on the cumulative probability calculation results and a preset cumulative probability threshold. This allows the target expert network to participate in decision-making. By verifying the cumulative probability threshold, the decision opinions given by the selected target expert network can represent the decision opinions of all expert networks in the hybrid expert model. Furthermore, the verification of the cumulative probability threshold is performed during the process of accumulating the probability weight values ​​one by one. This ensures that the number of selected target expert networks is not redundant and avoids wasting computing resources.

[0093] In one exemplary embodiment, the handling of a particular case, such as Figure 5 As shown, the method also includes:

[0094] Step 501: If the cumulative probability calculation result of all probability weights in the weight value sequence is less than the cumulative probability threshold, the number of expert networks in the hybrid expert model is determined as the number of expert networks, and each expert network in the hybrid expert model is determined as the target expert network.

[0095] In implementation, during the accumulation of probability weights for each expert network in the hybrid expert model, if the cumulative probability calculated after accumulating all probability weights in the weight value sequence is still less than the preset cumulative probability threshold (e.g., a large threshold P=0.9), it may be necessary to select all expert networks in the hybrid expert model to meet the threshold condition. That is, the terminal determines the number of expert networks in the hybrid expert model as the number of expert networks. The terminal then determines each expert network in the hybrid expert model as the target expert network.

[0096] In this embodiment, when the cumulative probability calculation result after adding up all the probability weights in the weight value sequence is still less than the preset cumulative probability threshold, all expert networks are selected to participate in the decision-making of the word segmentation data to ensure the accuracy of the decision corresponding to the word segmentation data.

[0097] In one exemplary embodiment, such as Figure 6As shown, the specific processing steps for determining the analysis and decision results of the word segmentation data based on the number of expert networks, the target expert network, and the corresponding weight values ​​of the target expert network in step 108 include:

[0098] Step 602: Analyze and make decisions on the segmented data using the target expert network in the hybrid expert model to obtain the initial analysis and decision results.

[0099] In implementation, based on the determination of the number of expert networks and target expert networks for each segmented data in the hybrid expert model in the above embodiments, the corresponding number of target expert networks in the hybrid expert model analyze and make decisions for each segmented data, and obtain the initial analysis and decision results of each target expert network for the segmented data.

[0100] Step 604: Based on the initial analysis and decision results of each target expert network and the corresponding weight values ​​of the target expert networks, determine the analysis and decision results of the word segmentation data.

[0101] In implementation, the terminal determines the analysis decision result of the segmented data based on the initial analysis decision results of each target expert network and the corresponding weight values ​​of the target expert networks. Specifically, the initial analysis decision results of the segmented data given by each target expert network and the corresponding weight values ​​of the target expert networks are weighted and calculated to obtain the final analysis decision result of the segmented data.

[0102] Optionally, during the data analysis task of the text to be processed by the hybrid expert model, the model uses an attention mechanism to analyze which parts of the text are more important. This attention mechanism interacts with a gating network to assign different weights to different parts of the text. When making the final decision, the hybrid expert model also uses this attention mechanism to strengthen the weights of each word segment in the text. Thus, after obtaining the analysis and decision results corresponding to each word segment of the text, the final decision on the text can be completed based on the attention mechanism in the hybrid expert model, resulting in the data analysis results of the text.

[0103] In this embodiment, the number of expert networks and the target expert network are dynamically selected based on the word segmentation data in the text to be processed by the hybrid expert model. The selected target expert network is used to analyze and make decisions on each word segmentation data in the text to be processed, which improves the decision quality of the hybrid expert model and ensures the accuracy of the decision corresponding to each word segmentation data.

[0104] In an optional embodiment, the final predicted output is integrated based on the selected target expert network output and its corresponding weights. Depending on the performance of the hybrid expert model in the application, the weights of the gating network are adjusted to optimize the cumulative probability threshold setting, or the gating mechanism is adaptively adjusted through feedback and learning processes.

[0105] In an optional embodiment, such as Figure 7 As shown, a specific example flow is provided for determining the number of expert networks and the target expert network. This example flow includes:

[0106] Step 701: The gated network calculates the weight values ​​of each expert network in the hybrid expert model;

[0107] Step 702: Normalize the weight values ​​corresponding to each expert network to obtain the probability weight values ​​corresponding to each expert network.

[0108] Step 703: Sort the probability weight values ​​of each expert network in descending order (i.e., in descending order) to obtain the weight value sequence;

[0109] Step 704: Calculate the cumulative probability result after summing the probability weights in the weight value sequence;

[0110] Step 705: Verify the cumulative probability calculation result after accumulating each probability weight value. If the current cumulative probability calculation result is greater than or equal to the cumulative probability threshold, proceed to step 707. If the current cumulative probability calculation result is less than the cumulative probability threshold, proceed to step 706.

[0111] Step 706: Determine whether all probability weight values ​​in the weight sequence have been accumulated, i.e., whether the entire expert network has been considered. If yes, proceed to step 707; otherwise, accumulate the next probability weight value and proceed to step 704.

[0112] Step 707: Stop selecting the expert network;

[0113] Step 708: Determine the number of probability weight values ​​contained in the current cumulative probability calculation result as the number of expert networks, and determine the expert networks corresponding to the probability weight values ​​contained in the current cumulative probability calculation result as the target expert networks.

[0114] Step 709: Based on the target expert network and the corresponding weight values ​​of the target expert network, determine the analysis and decision results of the word segmentation data.

[0115] In an optional embodiment, such as Figure 8 As shown, a specific example workflow for data analysis tasks on text to be processed based on a hybrid expert model is provided. This example workflow includes:

[0116] Step 801: Perform word segmentation on the text to be processed, and input the resulting word segmentation dataset into the hybrid expert model;

[0117] Step 802: Strengthen the weight of each word segmentation data in the text to be processed through an attention mechanism;

[0118] Step 803: The weighted word segmentation data is then passed to the gating network, which calculates the weight values ​​of each expert network in the hybrid expert model.

[0119] Step 804: Normalize the weight values ​​corresponding to each expert network to obtain the probability weight values ​​corresponding to each expert network.

[0120] Step 805: Sort the probability weight values ​​corresponding to each expert network in descending order (i.e., in descending order) to obtain the weight value sequence;

[0121] Step 806: Calculate the cumulative probability result after summing the probability weights in the weight value sequence;

[0122] Step 807: Verify the cumulative probability calculation result after accumulating each probability weight value. If the current cumulative probability calculation result is greater than or equal to the cumulative probability threshold, proceed to step 809. If the current cumulative probability calculation result is less than the cumulative probability threshold, proceed to step 808.

[0123] Step 808: Determine whether all probability weight values ​​in the weight sequence have been accumulated, i.e., whether the entire expert network has been considered. If yes, proceed to step 809; otherwise, accumulate the next probability weight value and proceed to step 806.

[0124] Step 809: Determine the number of expert networks and the target expert network based on the cumulative probability calculation results and the cumulative probability threshold;

[0125] Step 810: Based on the target expert network and the corresponding weight values ​​of the target expert network, determine the analysis and decision results of the word segmentation data;

[0126] Step 811 continues until the analysis and decision results of all word segmentation data in the word segmentation dataset are obtained, and the data analysis results of the text to be processed are output.

[0127] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0128] Based on the same inventive concept, this application also provides a data analysis apparatus for implementing the data analysis method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more data analysis apparatus embodiments provided below can be found in the limitations of the data analysis method described above, and will not be repeated here.

[0129] In one exemplary embodiment, such as Figure 9 As shown, a data analysis device is provided, including: an acquisition module 901, a first determination module 902, a second determination module 903, and a third determination module 904, wherein:

[0130] The acquisition module 901 is used to acquire the text to be processed and perform word segmentation on the text to be processed to obtain the word segmentation dataset;

[0131] The first determining module 902 is used to analyze and process each segmented data in the segmented data dataset using a hybrid expert model, and determine the weight values ​​of each expert network in the hybrid expert model based on the analysis and processing results and the gating network.

[0132] The second determining module 903 is used to sort the weight values ​​corresponding to each expert network and calculate the cumulative probability, and determine the number of expert networks and the target expert network based on the cumulative probability calculation results.

[0133] The third determining module 904 is used to determine the analysis decision results of the word segmentation data based on the number of expert networks and the weight values ​​corresponding to the target expert networks, until the analysis decision results of all word segmentation data in the word segmentation dataset are obtained, and to determine the data analysis results of the text to be processed.

[0134] In one embodiment, the first determining module 902 is specifically used to analyze and process each segmented data in the segmented data dataset using a hybrid expert model to obtain the analysis and processing results;

[0135] Based on the analysis and processing results and the gating network in the hybrid expert model, the weight values ​​of each expert network in the hybrid expert model are calculated; the weight values ​​of the expert networks are used to characterize the decision-making efficiency of the expert networks on the word segmentation data.

[0136] In one embodiment, the second determining module 903 is specifically used to normalize the weight values ​​corresponding to each expert network to obtain the probability weight values ​​corresponding to each expert network.

[0137] The probability weight values ​​of each expert network are sorted in descending order to obtain a weight value sequence.

[0138] The cumulative probability is calculated for the probability weights in the weight value sequence, and the cumulative probability calculation result after accumulating each probability weight value is verified based on the cumulative probability threshold.

[0139] If the current cumulative probability calculation result is greater than or equal to the cumulative probability threshold, determine the number of expert networks and the target expert network.

[0140] In one embodiment, the second determining module 903 is specifically used to determine the number of expert networks and the target expert network if the current cumulative probability calculation result is greater than or equal to the cumulative probability threshold, including:

[0141] If the current cumulative probability calculation result is greater than or equal to the cumulative probability threshold, the number of probability weight values ​​contained in the current cumulative probability calculation result is determined as the number of expert networks.

[0142] The expert network corresponding to the probability weight values ​​included in the current cumulative probability calculation result is determined as the target expert network.

[0143] In one embodiment, the device further includes:

[0144] If the cumulative probability calculation result of all probability weights in the weight value sequence is less than the cumulative probability threshold, the number of expert networks in the hybrid expert model is determined as the number of expert networks, and each expert network in the hybrid expert model is determined as the target expert network.

[0145] In one embodiment, the third determining module 904 is specifically used to analyze and make decisions on the word segmentation data through the target expert network in the hybrid expert model to obtain an initial analysis and decision result.

[0146] Based on the initial analysis and decision results of each target expert network and the corresponding weight values ​​of the target expert networks, the analysis and decision results of the word segmentation data are determined.

[0147] Each module in the aforementioned data analysis device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0148] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 10 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a data analysis method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0149] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0150] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0151] Obtain the text to be processed and perform word segmentation on the text to obtain the word segmentation dataset;

[0152] For each segmented data in the segmentation dataset, a hybrid expert model is used to analyze and process the segmented data, and based on the analysis and processing results and the gating network, the weight values ​​of each expert network in the hybrid expert model are determined.

[0153] The weight values ​​corresponding to each expert network are sorted and their cumulative probabilities are calculated. Based on the cumulative probability calculation results, the number of expert networks and the target expert network are determined.

[0154] Based on the number of expert networks and the corresponding weight values ​​of the target expert network, the analysis decision results of the word segmentation data are determined until the analysis decision results of all word segmentation data in the word segmentation dataset are obtained, and the data analysis results of the text to be processed are determined.

[0155] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0156] For each segmented data in the segmentation dataset, a hybrid expert model is used to analyze and process the segmented data to obtain the analysis and processing results;

[0157] Based on the analysis and processing results and the gating network in the hybrid expert model, the weight values ​​of each expert network in the hybrid expert model are calculated; the weight values ​​of the expert networks are used to characterize the decision-making efficiency of the expert networks on the word segmentation data.

[0158] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0159] The weight values ​​of each expert network are normalized to obtain the probability weight values ​​of each expert network.

[0160] The probability weight values ​​of each expert network are sorted in descending order to obtain a weight value sequence.

[0161] The cumulative probability is calculated for the probability weights in the weight value sequence, and the cumulative probability calculation result after accumulating each probability weight value is verified based on the cumulative probability threshold.

[0162] If the current cumulative probability calculation result is greater than or equal to the cumulative probability threshold, determine the number of expert networks and the target expert network.

[0163] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0164] If the current cumulative probability calculation result is greater than or equal to the cumulative probability threshold, the number of probability weight values ​​contained in the current cumulative probability calculation result is determined as the number of expert networks.

[0165] The expert network corresponding to the probability weight values ​​included in the current cumulative probability calculation result is determined as the target expert network.

[0166] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0167] If the cumulative probability calculation result of all probability weights in the weight value sequence is less than the cumulative probability threshold, the number of expert networks in the hybrid expert model is determined as the number of expert networks, and each expert network in the hybrid expert model is determined as the target expert network.

[0168] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0169] The target expert network in the hybrid expert model is used to analyze and make decisions on the segmented data to obtain the initial analysis and decision results.

[0170] Based on the initial analysis and decision results of each target expert network and the corresponding weight values ​​of the target expert networks, the analysis and decision results of the word segmentation data are determined.

[0171] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0172] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0173] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0174] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0175] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0176] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A data analysis method, characterized in that, The method includes: Obtain the text to be processed, and perform word segmentation on the text to be processed to obtain a word segmentation dataset; For each segmented data in the segmented dataset, the segmented data is analyzed and processed by a hybrid expert model, and the weight values ​​of each expert network in the hybrid expert model are determined based on the analysis and processing results and the gating network. The weight values ​​corresponding to each expert network are sorted and their cumulative probabilities are calculated. Based on the cumulative probability calculation results, the number of expert networks and the target expert network are determined. Based on the number of expert networks and the weight values ​​corresponding to the target expert networks, the analysis decision results of the word segmentation data are determined until the analysis decision results of all word segmentation data in the word segmentation dataset are obtained, and the data analysis results of the text to be processed are determined. The step of sorting and calculating the cumulative probability of the weight values ​​corresponding to each expert network, and determining the number of expert networks and the target expert network based on the cumulative probability calculation results, includes: The weight values ​​corresponding to each expert network are normalized to obtain the probability weight values ​​corresponding to each expert network. The probability weight values ​​of each expert network are sorted in descending order to obtain a weight value sequence. The cumulative probability of the probability weight values ​​in the weight value sequence is calculated, and the cumulative probability calculation result after accumulating each probability weight value is verified based on the cumulative probability threshold. If the current cumulative probability calculation result is greater than or equal to the cumulative probability threshold, the number of probability weight values ​​contained in the current cumulative probability calculation result is determined as the number of expert networks. The expert network corresponding to the probability weight values ​​contained in the current cumulative probability calculation result is determined as the target expert network.

2. The method according to claim 1, characterized in that, For each segmented data point in the segmented dataset, a hybrid expert model is used to analyze and process the segmented data. Based on the analysis and processing results and the gating network, the weight values ​​corresponding to each expert network in the hybrid expert model are determined, including: For each segmented data in the segmented dataset, the segmented data is analyzed and processed using a hybrid expert model to obtain the analysis and processing results; Based on the analysis and processing results and the gating network in the hybrid expert model, the weight values ​​corresponding to each expert network in the hybrid expert model are calculated; the weight values ​​corresponding to the expert networks are used to characterize the decision-making efficiency of the expert networks on the word segmentation data.

3. The method according to claim 1, characterized in that, The method further includes: If the cumulative probability calculation result of all probability weights in the weight value sequence is less than the cumulative probability threshold, the number of expert networks in the hybrid expert model is determined as the number of expert networks, and each expert network in the hybrid expert model is determined as the target expert network.

4. The method according to claim 1, characterized in that, The analysis and decision results for the word segmentation data are determined based on the number of expert networks and the corresponding weight values ​​of the target expert networks, including: The word segmentation data is analyzed and decided by the target expert network in the hybrid expert model to obtain the initial analysis and decision results. Based on the initial analysis and decision results of each target expert network and the corresponding weight values ​​of the target expert networks, the analysis and decision results of the word segmentation data are determined.

5. A data analysis device, characterized in that, The device includes: The acquisition module is used to acquire the text to be processed and perform word segmentation on the text to be processed to obtain a word segmentation dataset; The first determining module is used to analyze and process each segmented data in the segmented data dataset using a hybrid expert model, and determine the weight value of each expert network in the hybrid expert model based on the analysis and processing results and the gating network. The second determining module is used to sort the weight values ​​corresponding to each expert network and calculate the cumulative probability, and determine the number of expert networks and the target expert network based on the cumulative probability calculation results. The third determining module is used to determine the analysis decision result of the word segmentation data based on the number of expert networks and the weight value corresponding to the target expert network, until the analysis decision result of all word segmentation data in the word segmentation dataset is obtained, and to determine the data analysis result of the text to be processed. The second determining module is specifically used to normalize the weight values ​​corresponding to each expert network to obtain the probability weight values ​​corresponding to each expert network. The probability weight values ​​of each expert network are sorted in descending order to obtain a weight value sequence. The cumulative probability of the probability weight values ​​in the weight value sequence is calculated, and the cumulative probability calculation result after accumulating each probability weight value is verified based on the cumulative probability threshold. If the current cumulative probability calculation result is greater than or equal to the cumulative probability threshold, the number of probability weight values ​​contained in the current cumulative probability calculation result is determined as the number of expert networks. The expert network corresponding to the probability weight values ​​contained in the current cumulative probability calculation result is determined as the target expert network.

6. The apparatus according to claim 5, characterized in that, The first determining module is specifically used for: For each segmented data in the segmented dataset, the segmented data is analyzed and processed using a hybrid expert model to obtain the analysis and processing results; Based on the analysis and processing results and the gating network in the hybrid expert model, the weight values ​​corresponding to each expert network in the hybrid expert model are calculated; the weight values ​​corresponding to the expert networks are used to characterize the decision-making efficiency of the expert networks on the word segmentation data.

7. The apparatus according to claim 5, characterized in that, The third determining module is specifically used for: The word segmentation data is analyzed and decided by the target expert network in the hybrid expert model to obtain the initial analysis and decision results. Based on the initial analysis and decision results of each target expert network and the corresponding weight values ​​of the target expert networks, the analysis and decision results of the word segmentation data are determined.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Neural network model processing method and device, equipment and storage medium

    CN118468929A

  • Data processing method and device based on hybrid expert model

    CN118520903A