Depth learning MOOC post classification model interpretation method

By combining LIME and SHAP methods, perturbation samples are generated for the deep learning MOOC post classification model, feature selection and quantification of linear proxy models, the problem of opacity in the deep learning model is solved, more accurate word interpretation and model transparency are achieved, and user trust is enhanced.

CN120493016APending Publication Date: 2025-08-15GUANGXI NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510660886.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

The "black box" opacity caused by the classification model of deep learning MOOC posts is caused by excessive parameters. Users cannot understand the basis for model decision-making, which affects trust and practical applications.

Method used

Combining LIME and SHAP methods, perturbation samples are generated for the original MOOC posts, and feature selection and quantization of linear proxy models are trained to feature selection and quantization of linear proxy models, reveal the model decision process, and provide more accurate word interpretation.

Benefits of technology

By integrating LIME and SHAP values, the accuracy and transparency of model interpretation are improved, the user's trust is enhanced, and a more comprehensive model interpretability framework is built.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120493016A_ABST
    Figure CN120493016A_ABST
Patent Text Reader

Abstract

The invention discloses an explanation method for a deep learning MOOC post classification model, which can provide accurate explanation for prediction of the model and aims to solve the problem of opaqueness of a black box caused by excessive parameters of the deep learning model. Firstly, random word deletion is carried out on an original post, a disturbance sample set is generated, and then a feature selection linear proxy model is trained through a least square method. Secondly, comprehensively considering an LIME value and an SHAP value, finding out the positions of k most important words in an original MOOC post for a disturbance sample, selecting new elements from word bag vectors corresponding to the disturbance sample according to the positions, arranging the new elements into a new word bag vector sequence, training a feature quantization linear agent model by using the new word bag vector sequence, and obtaining a feature quantization linear agent model; and finally, calculating the new bag-of-word vector sequence by adopting the weight of the trained feature quantization linear proxy model to obtain the explanation of the original MoOC post classification model on the original MoOC post and the LIME value of the original MoOC post.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the intersection of artificial intelligence and smart education, and specifically provides an interpretation method for a deep learning MOOC post classification model, which can be applied to interpret various MOOC post classification models. Background Art

[0002] With the rapid development of internet technology, Massive Open Online Courses (MOOCs) are becoming increasingly popular among learners due to their significantly greater convenience compared to traditional offline courses. Furthermore, the discussion forums built into MOOC platforms serve as interactive platforms, establishing stable communication channels between teachers and students. While the volume of student posts in these forums is enormous, thanks to the rapid development of deep learning technology, researchers have proposed numerous models for MOOC post classification. These models can help teachers automatically and accurately identify urgent posts, saving teachers time and effort. However, the large number of parameters and complexity of these deep learning models render them "black-box" in nature, obscuring the basis for their decisions. This often results in their acceptance and use in real-world applications. Therefore, using interpretability methods to reveal the model's decision-making process and make the model's internal structure transparent can increase trust in the model and is crucial for its widespread adoption.

[0003] In interpretability research in areas such as education, healthcare, and financial risk assessment, the classic interpretability technique SHAP, based on contribution allocation calculations in cooperative game theory, can assign contribution values to each word based on changes in the model's input and output, thereby comparing the importance of different words. The proxy model interpretation technique LIME first generates a large number of perturbation samples near the input text and uses these samples to train a simple and interpretable model to fit the complex model. The original model is then explained by explaining the simple model. To provide better model explanations, this paper proposes an interpretation method for a deep learning MOOC post classification model. By combining the characteristics of SHAP and LIME values, more accurate words are selected for the model, further improving the interpretation effect. Summary of the Invention

[0004] The present invention discloses an interpretation method for a deep learning MOOC post classification model, aiming to solve the "black box" opacity problem caused by too many parameters in the deep learning model. The method is characterized by comprising the following steps:

[0005] S1. Generate m perturbation samples for the original MOOC post to be interpreted using the LIME method, obtain the bag-of-words vector representation corresponding to each perturbation sample, and then use the original deep learning MOOC post classification model to predict the perturbation sample to obtain the prediction vector of the perturbation sample;

[0006] S2. Use the bag-of-words vector to calculate the similarity between the perturbed sample and the original MOOC post;

[0007] S3. Define a feature selection linear proxy model for the perturbed sample, then train the feature selection linear proxy model using the least squares method. Finally, comprehensively consider the LIME value and SHAP value, and use the trained feature selection linear proxy model to find the positions of the k most important words in the original MOOC post for the perturbed sample, thereby obtaining a feature selection vector sequence for the perturbed sample. The LIME value is the weight value corresponding to the word in the original MOOC post obtained using the LIME method, and the SHAP value is the contribution value corresponding to the word in the original MOOC post obtained using the SHAP method.

[0008] S4. New elements are selected from the bag-of-words vectors corresponding to the perturbed samples based on the positions of the k most important features. These elements are arranged into a new bag-of-words vector sequence, which is then used to train a feature-quantized linear surrogate model to best approximate the local behavior of the original deep learning MOOC post classification model near the original MOOC post. Finally, the weights of the trained feature-quantized linear surrogate model are used to calculate the new bag-of-words vector sequence to obtain the original deep learning MOOC post classification model's interpretation of the original MOOC post and its LIME value.

[0009] The LIME method refers to the Local Interpretable Model-agnostic Explanations (LIME) technique proposed by Ribeiro et al. in the paper “Ribeiro MT, Singh S, Guestrin C." "Why should I trust you?" "Explaining the predictions of any classifier[C] / / Proceedings of the 22nd ACM SIGKDD international conference on knowledgediscovery and data mining.2016:1135-1144”.

[0010] The SHAP method refers to the SHapley Additive exPlanations method proposed by Lundberg et al. in the paper “Lundberg S, Lee S, A unified approach to interpreting model predictions[J].arxiv preprint arxiv:1705.07874,2017.”

[0011] Furthermore, the step S1 specifically includes:

[0012] S1.1 generates m perturbation samples for the original MOOC post by randomly deleting words, and generates the bag-of-words vector sequence z′ corresponding to the perturbation samples. The calculation process is as follows;

[0013] z=Disturbed(p)={z1,z2,…,z m}#(1)

[0014] z′=Bagword(z)={z′1,z′2,…,z′ m ∈{0,1} d}#(2)

[0015] Disturbed(·) represents the operation of generating m perturbation samples for the original MOOC post by randomly deleting words, p represents the text of the original MOOC post, z is the perturbation sample set, m is the number of perturbation samples, and z is the number of perturbation samples. m Represents the text of the mth perturbation sample; z′ m ∈{0,1} d represents the bag-of-words vector corresponding to the mth perturbation sample, d is the dimension of the bag-of-words vector, and d is equal to the length of the MOOC post p; {0,1} d Indicates that the values of the vector elements are composed of 0 and 1 and the dimension is d, z′∈{0,1} m×d Represents the bag-of-words vector sequence of the perturbation sample set z, {0,1} m×d Indicates that the values of the matrix elements are composed of 0 and 1 and the dimension is m×d. Bagword(z) represents the sequence of bag-of-words vectors generated for the perturbation sample set z.

[0016] S1.2 calculates the prediction vector of the perturbation sample in the original deep learning MOOC post classification model. The calculation process is:

[0017] f i =F(z i ) (3)

[0018] f={f i |i=1,2,…,m}∈R m (4)

[0019] Where F(·) represents the original deep learning MOOC post classification model, f i represents the predicted label of the i-th perturbation sample in the original deep learning MOOC post classification model, z irepresents the text of the i-th perturbation sample calculated according to formula (1), f represents the prediction vector of m perturbation samples in the original deep learning MOOC post classification model; R represents a set of real numbers;

[0020] Furthermore, the step S2 specifically includes:

[0021] S2.1 uses the bag-of-words vector to calculate the similarity between the i-th perturbation sample and the original MOOC post. The calculation process is:

[0022]

[0023] Where D(·) is the cosine similarity calculation, σ is a fixed value of 25, and σ is used to adjust the weight distribution of the perturbation samples, p′∈{1} d is the bag-of-words vector representation of the original MOOC post p, with all elements being 1, π i is the similarity between the ith perturbation sample and the original MOOC post, exp(·) represents the exponential function with the natural constant e as the base, z′ i ∈{0,1} d Represents the bag-of-words vector representation corresponding to the i-th perturbation sample;

[0024] S2.2 Let i = 1, 2, ..., m, repeat step S2.1, calculate the similarity between the m perturbation samples and the original MOOC post, and obtain the similarity vector π∈R between the perturbation sample set z and the original MOOC post m :

[0025] π={π i |i=1,2,…,m}∈R m #(7)

[0026] Furthermore, the step S3 specifically includes:

[0027] S3.1 defines a feature selection linear surrogate model g(·) for the perturbed samples, such that for all i = 1, 2, …, m, we have;

[0028]

[0029] Among them, g(·) is the feature selection linear proxy model, w∈R d Parameters of the linear surrogate model g(·) for feature selection; Represents the LIME value of the word at position d of the i-th perturbation sample, which is equal to the weight value of the position;

[0030] S3.2 uses the least squares method to train the feature selection linear agent model, and the objective function ξ is calculated as follows:

[0031]

[0032] Where L(·) is the difference measure between the original deep learning MOOC post classification model F(·) and the feature selection linear proxy model g(·), Ω(·) is the complexity penalty term of the linear proxy model based on L2 regularization, whose output increases with the complexity of the model to ensure the interpretability of the model, and λ is a learnable regularization parameter. Formula (11) expresses the parameter w of the feature selection linear proxy model that minimizes [L(F, g, π) + Ω(g)]. The calculation formula of w is as follows:

[0033] w=[X T OX+λI] -1 X T Of (12)

[0034] Where X = z′∈R m×d ; O∈R d×d Is a diagonal weight matrix, wherein the diagonal weight matrix means that all elements except the diagonal are 0, and its diagonal elements are equal to the similarity vector π; I∈R d×d is the identity matrix; the superscript "T" of the parameter indicates the transpose operation of the matrix; [·] -1 Represents matrix inversion operation;

[0035] S3.3 comprehensively considers the LIME value and SHAP value to find the positions of the k most important words in the original MOOC post for the perturbation sample, and obtains the feature selection vector sequence s of the perturbation sample:

[0036] s={s i |i=1,2,…,m}∈R m×k (13)

[0037]

[0038] Among them, s i represents the feature selection vector of the i-th perturbation sample in s, Indicates s i The jth element in The position of the perturbed word in the original MOOC post; It represents the weight of the word at the specified position of the combined perturbation sample in g(·) and its SHAP value. Its calculation formula is as follows:

[0039]

[0040] Among them, β is a learnable fusion parameter, Indicates that the i-th disturbance sample calculated by formula (8) is at position The LIME value of the word, abs(·) represents the absolute value function; Indicates that the i-th disturbance sample is at position The SHAP value of the word is calculated as follows:

[0041]

[0042] Among them, |·| means finding the basis of a set, that is, the number of elements in the set; the symbol "!" represents the factorial operation; represents the i-th perturbation sample z i In position The words on Represents words in the text set C The subset masked by the mask "[MASK]", is a subset of C, Indicates that Middle position The mask on the word is restored to the original word C is the text set after some words in the original MOOC post text P are replaced by the mask "[MASK]". The calculation formula is:

[0043]

[0044] Among them, MaskDo(P,u) represents the text set after the original MOOC post text P is replaced with u masks "[MASK]", and u represents the number of masks "[MASK]" used;

[0045] Furthermore, the step S4 specifically includes:

[0046] S4.1 selects the positions of the k most important features of the vector sequence s according to the characteristics of the perturbed sample, selects new elements from the bag-of-words vector corresponding to the perturbed sample, and obtains a new bag-of-words vector sequence

[0047]

[0048] in, Indicates that the i-th perturbation sample is The bag-of-words vector in ElementSelection(z′ i ,s i ) indicates that according to s i The position in the bag-of-words vector z′ i Select k elements from the word bag to form a new word bag vector. Represents bag-of-words vector The kth element in ;

[0049] S4.2 Using Bag-of-Words Vector Sequences Train a feature quantized linear surrogate model to best approximate the local behavior of the original deep learning MOOC post classification model F near the original MOOC post p:

[0050]

[0051]

[0052] in, is a feature quantized linear proxy model, For its parameters; It's training Objective function; is a learnable regularization parameter, is the identity matrix, The diagonal elements are equal to The diagonal weight matrix of is calculated in step S1.2 The similarity between the text corresponding to the bag-of-words vector and the original MOOC post, express The predicted value of the text corresponding to the bag-of-words vector in the original model F(·), express The predicted vector of the text corresponding to the bag-of-words vector sequence in the original model F(·)

[0053] S4.3 uses the trained feature quantization linear proxy model The weights in the bag-of-words vector sequence Calculate and obtain the explanation e and LIME value of the original deep learning MOOC post classification model for the original MOOC post. The calculation process is as follows:

[0054]

[0055] in, Represents bag-of-words vector The elements, Representation feature quantization linear surrogate model The weight vector The elements, express and Corresponding element subscripts, formula (23) means finding The value is the largest Bag-of-words vector as explanation e ie is the number of the perturbation sample corresponding to explanation e, Indicates the LIME value corresponding to each word of interpretation e; Indicates based on With s ie Find the position of the word that explains e in the original MOOC post, and then combine it with the ieth perturbation sample text z ie Find the word that explains e, s ie Represents the feature selection vector corresponding to the ie-th perturbation sample in s, express The bag-of-words vector corresponding to the ie-th perturbation sample in .

[0056] The present invention has the following advantages:

[0057] (1) The SHAP value of each word is calculated using the SHAP method to preliminarily reveal the positive or negative impact of each word on the model prediction, as well as the degree of contribution.

[0058] (2) The LIME method is used to train the linear proxy model, and the classification vector of the model is used to calculate the similarity of the perturbation samples to obtain the perturbation sample similarity that is more consistent with the model decision, so as to train a better linear proxy model and obtain a better LIME value.

[0059] (3) The LIME value and SHAP value are combined. The combined parameters can not only consider the contribution of each word from a global perspective, but also alleviate the locality of LIME's focus on the neighborhood behavior of the sample to be explained, so as to select better words. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 An explanation method for the deep learning MOOC post classification model in the embodiment;

[0061] Figure 2 This is an explanatory example in the embodiment. DETAILED DESCRIPTION

[0062] The present invention is further described below with reference to specific embodiments, but the scope of protection of the present invention is not limited to the following embodiments. The present invention discloses a method for interpreting a deep learning MOOC post classification model, which is characterized by comprising the following steps:

[0063] S1. Generate m perturbation samples for the original MOOC post to be interpreted using the LIME method, obtain the bag-of-words vector representation corresponding to each perturbation sample, and then use the original deep learning MOOC post classification model to predict the perturbation sample to obtain the prediction vector of the perturbation sample;

[0064] S2. Use the bag-of-words vector to calculate the similarity between the perturbed sample and the original MOOC post;

[0065] S3. Define a feature selection linear proxy model for the perturbed sample, then train the feature selection linear proxy model using the least squares method. Finally, comprehensively consider the LIME value and SHAP value, and use the trained feature selection linear proxy model to find the positions of the k most important words in the original MOOC post for the perturbed sample, thereby obtaining a feature selection vector sequence for the perturbed sample. The LIME value is the weight value corresponding to the word in the original MOOC post obtained using the LIME method, and the SHAP value is the contribution value corresponding to the word in the original MOOC post obtained using the SHAP method.

[0066] S4. New elements are selected from the bag-of-words vectors corresponding to the perturbed samples based on the positions of the k most important features. These elements are arranged into a new bag-of-words vector sequence, which is then used to train a feature-quantized linear surrogate model to best approximate the local behavior of the original deep learning MOOC post classification model near the original MOOC post. Finally, the weights of the trained feature-quantized linear surrogate model are used to calculate the new bag-of-words vector sequence to obtain the original deep learning MOOC post classification model's interpretation of the original MOOC post and its LIME value.

[0067] The LIME method refers to the Local Interpretable Model-agnostic Explanations (LIME) technique proposed by Ribeiro et al. in the paper “Ribeiro MT, Singh S, Guestrin C." "Why should I trust you?" "Explaining the predictions of any classifier[C] / / Proceedings of the 22nd ACM SIGKDD international conference on knowledgediscovery and data mining.2016:1135-1144”.

[0068] The SHAP method refers to the SHapley Additive exPlanations method proposed by Lundberg et al. in the paper “Lundberg S, Lee S, A unified approach to interpreting model predictions[J].arxiv preprint arxiv:1705.07874,2017.”

[0069] Furthermore, the step S1 specifically includes:

[0070] S1.1 generates m perturbation samples for the original MOOC post by randomly deleting words, and generates the bag-of-words vector sequence z′ corresponding to the perturbation samples. The calculation process is as follows;

[0071] z=Disturbed(p)={z1,z2,…,z m}#(1)

[0072] z′=Bagword(z)={z′1,z′2,…,z′ m ∈{0,1} d}#(2)

[0073] Disturbed(·) represents the operation of generating m perturbation samples for the original MOOC post by randomly deleting words, p represents the text of the original MOOC post, z is the perturbation sample set, m is the number of perturbation samples, and z is the number of perturbation samples. m Represents the text of the mth perturbation sample; z′ m ∈{0,1} d represents the bag-of-words vector corresponding to the mth perturbation sample, d is the dimension of the bag-of-words vector, and d is equal to the length of the MOOC post p; {0,1} d Indicates that the values of the vector elements are composed of 0 and 1 and the dimension is d, z′∈{0,1} m×d Represents the bag-of-words vector sequence of the perturbation sample set z, {0,1} m×d Indicates that the values of the matrix elements are composed of 0 and 1 and the dimension is m×d. Bagword(z) represents the sequence of bag-of-words vectors generated for the perturbation sample set z.

[0074] S1.2 calculates the prediction vector of the perturbation sample in the original model. The calculation process is:

[0075] f i =F(z i ) (3)

[0076] f={f i |i=1,2,…,m}∈R m (4)

[0077] Where F(·) represents the original deep learning MOOC post classification model, f i represents the predicted label of the i-th perturbation sample in the original deep learning MOOC post classification model, z i represents the text of the i-th perturbation sample calculated according to formula (1), f represents the prediction vector of m perturbation samples in the original deep learning MOOC post classification model; R represents a set of real numbers;

[0078] Furthermore, the step S2 specifically includes:

[0079] S2.1 uses the bag-of-words vector to calculate the similarity between the i-th perturbation sample and the original MOOC post. The calculation process is:

[0080]

[0081] Where D(·) is the cosine similarity calculation, σ is a fixed value of 25, and σ is used to adjust the weight distribution of the perturbation samples, p′∈{1} d is the bag-of-words vector representation of the original MOOC post p, with all elements being 1, π i is the similarity between the ith perturbation sample and the original MOOC post, exp(·) represents the exponential function with the natural constant e as the base, z′ i ∈{0,1} d Represents the bag-of-words vector representation corresponding to the i-th perturbation sample;

[0082] S2.2 Let i = 1, 2, ..., m, repeat step S2.1, calculate the similarity between the m perturbation samples and the original MOOC post, and obtain the similarity vector π∈R between the perturbation sample set z and the original MOOC post m :

[0083] π={π i |i=1,2,…,m}∈R m #(7)

[0084] Furthermore, the step S3 specifically includes:

[0085] S3.1 defines a feature selection linear surrogate model g(·) for the perturbed samples, such that for all i = 1, 2, …, m, we have;

[0086]

[0087] Among them, g(·) is the feature selection linear proxy model, w∈R d Parameters of the linear surrogate model g(·) for feature selection; Represents the LIME value of the word at position d of the i-th perturbation sample, which is equal to the weight value of the position;

[0088] S3.2 uses the least squares method to train the feature selection linear agent model, and the objective function ξ is calculated as follows:

[0089]

[0090] Where L(·) is the difference measure between the original deep learning MOOC post classification model F(·) and the feature selection linear proxy model g(·), Ω(·) is the complexity penalty term of the linear proxy model based on L2 regularization, whose output increases with the complexity of the model to ensure the interpretability of the model, and λ is a learnable regularization parameter. Formula (11) expresses the parameter w of the feature selection linear proxy model that minimizes [L(F, g, π) + Ω(g)]. The calculation formula of w is as follows:

[0091] w=[X T OX+λI] -1 X T Of (12)

[0092] Where X = z′∈R m×d ; O∈R d×d Is a diagonal weight matrix, wherein the diagonal weight matrix means that all elements except the diagonal are 0, and its diagonal elements are equal to the similarity vector π; I∈R d×d is the identity matrix; the superscript "T" of the parameter indicates the transpose operation of the matrix; [·] -1 Represents matrix inversion operation;

[0093] S3.3 comprehensively considers the LIME value and SHAP value to find the positions of the k most important words in the original MOOC post for the perturbation sample, and obtains the feature selection vector sequence s of the perturbation sample:

[0094] s={s i |i=1,2,…,m}∈R m×k (13)

[0095]

[0096] Among them, s i represents the feature selection vector of the i-th perturbation sample in s, Indicates s i The jth element in The position of the perturbed word in the original MOOC post; It represents the weight of the word at the specified position of the combined perturbation sample in g(·) and its SHAP value. Its calculation formula is as follows:

[0097]

[0098] Among them, β is a learnable fusion parameter, Indicates that the i-th disturbance sample calculated by formula (8) is at position The LIME value of the word, abs(·) represents the absolute value function; Indicates that the i-th disturbance sample is at position The SHAP value of the word is calculated as follows:

[0099]

[0100] Among them, |·| means finding the basis of a set, that is, the number of elements in the set; the symbol "!" represents the factorial operation; represents the i-th perturbation sample z i In position The words on Represents words in the text set C The subset masked by the mask "[MASK]", is a subset of C, Indicates that Middle position The mask on the word is restored to the original word C is the text set after some words in the original MOOC post text P are replaced by the mask "[MASK]". The calculation formula is:

[0101]

[0102] Among them, MaskDo(P,u) represents the text set after the original MOOC post text P is replaced with u masks "[MASK]", and u represents the number of masks "[MASK]" used;

[0103] The step S4 specifically includes:

[0104] S4.1 selects the positions of the k most important features of the vector sequence s according to the characteristics of the perturbed sample, selects new elements from the bag-of-words vector corresponding to the perturbed sample, and obtains a new bag-of-words vector sequence

[0105]

[0106] in, Indicates that the i-th perturbation sample is The bag-of-words vector in ElementSelection(z′ i ,s i ) indicates that according to s i The position in the bag-of-words vector z′ i Select k elements from the word bag to form a new word bag vector. Represents bag-of-words vector The kth element in ;

[0107] S4.2 Using Bag-of-Words Vector Sequences Train a feature quantized linear surrogate model to best approximate the local behavior of the original deep learning MOOC post classification model F near the original MOOC post p:

[0108]

[0109] in, is a feature quantized linear proxy model, For its parameters; It's training Objective function; is a learnable regularization parameter, is the identity matrix, The diagonal elements are equal to The diagonal weight matrix of is calculated in step S1.2 The similarity between the text corresponding to the bag-of-words vector and the original MOOC post, express The predicted value of the text corresponding to the bag-of-words vector in the original model F(·), express The predicted vector of the text corresponding to the bag-of-words vector sequence in the original model F(·)

[0110] S4.3 uses the trained feature quantization linear proxy model The weights in the bag-of-words vector sequence Calculate and obtain the explanation e and LIME value of the original deep learning MOOC post classification model for the original MOOC post. The calculation process is as follows:

[0111]

[0112] in, Represents bag-of-words vector The elements, Representation feature quantization linear surrogate model The weight vector The elements, express and Corresponding element subscripts, formula (23) means finding The value is the largest Bag-of-words vector as explanation e ie is the number of the perturbation sample corresponding to explanation e, Indicates the LIME value corresponding to each word of interpretation e; Indicates based on With s ieFind the position of the word that explains e in the original MOOC post, and then combine it with the ieth perturbation sample text z ie Find the word that explains e, s ie Represents the feature selection vector corresponding to the ie-th perturbation sample in s, express The bag-of-words vector corresponding to the ie-th perturbation sample in .

[0113] Application Examples

[0114] 1. Instance environment

[0115] In the formula, the number of perturbation samples is set to m = 100, and the number of feature selection is set to k = 9. This experiment uses model fidelity to evaluate different interpretability techniques. The fidelity is quantified by comparing the difference in model predictions before and after the dataset is perturbed. Finally, the Proportion of Area Above the Curve (PAAC) is calculated to compare the model fidelity of different interpretability methods.

[0116] 2. Dataset

[0117] The dataset used in this experiment is the Stanford MOOC Post dataset proposed by Agrawal et al., which can be downloaded from: http: / / datastage.stanford.edu / StanfordMoocPosts. This dataset contains 29,604 forum posts collected from 11 public online courses at Stanford University. BERT-GLSP is also used. [3] , BERT-CNN [4] and Bi-GRU [5] Three MOOC post classification models with similar performance were selected as the models to be analyzed. For each sample in the test set, different interpretability techniques were then applied to generate corresponding word importances. Based on these importances, each sample in the test set was perturbed. Finally, the perturbed test set was fed into the MOOC post classification model to compare and analyze the performance changes under different interpretation methods.

[0118] 3. Comparison Method

[0119] Rondom performs feature selection using random numbers and serves as a baseline for “effective methods”.

[0120] SHAP [1] The contribution of the features of the posts is distributed based on the cooperative game theory framework, and the influence of different words on the classification decision is fairly evaluated.

[0121] LIME [2]By constructing a local proxy model to explain the prediction behavior of the black box model, an interpretable model such as linear regression is used to fit the relationship between the perturbed samples and the corresponding prediction results. Finally, the weight parameters of the proxy model are used as the local feature importance of the original black box model at the sample point.

[0122] C-LIME is a method in this invention that changes the perturbation sample similarity calculation in the original LIME method from using bag-of-words vectors to using the model's classification vectors to train a better proxy model.

[0123] References:

[0124] [1]Lundberg S,Lee SA unified approach to interpreting modelpredictions[J].arxiv preprintarxiv:1705.07874,2017.

[0125] [2]Ribeiro MT, Singh S, Guestrin C. "Why should i trust you?"Explaining the predictions of any classifier[C] / / Proceedings of the 22nd ACM SIGKDDinternational conference on knowledge discovery and data mining.2016:1135-1144.

[0126] [3] Zhang Z, Zhu X, He Q, Zhang L. BERT-Based Global Semantic Refinement and LocalSemantic Extraction for Distinguishing Urgent Posts in MOOC Forums[J]. IEEE Access, 2024.

[0127] [4]El-Rashidy MA, Farouk A, El-Fishawy NA, et al.New weighted BERTfeatures andmulti-CNN models to enhance the performance of MOOC postsclassification[J].NeuralComputing and Applications, 2023,35(24):18019-18033

[0128] [5]Khodeir N A.Bi-GRU urgent classification for MOOC discussionforums based on BERT[J].IEEE Access,2021,9:58243-58255.

[0129] 4. Example comparison results

[0130] Table 1: Comparison of different interpretability methods (PAAC%)

[0131]

[0132] The results in Table 1 show that the method proposed in this example achieves the optimal value in the loyalty indicators of most models, indicating that by integrating the interpretation advantages of SHAP and LIME, a more comprehensive model interpretability framework can be constructed, which fully demonstrates the feasibility of the interpretation method of the deep learning MOOC post classification model proposed in this invention.

Claims

1. A method for interpreting deep learning MOOC post classification models, aiming to solve the "black box" opacity problem caused by too many parameters in deep learning models. The following steps are involved: S1. Generate m perturbation samples for the original MOOC post to be interpreted using the LIME method, obtain the bag-of-words vector representation corresponding to each perturbation sample, and then use the original deep learning MOOC post classification model to predict the perturbation sample to obtain the prediction vector of the perturbation sample; S2. Use the bag-of-words vector to calculate the similarity between the perturbed sample and the original MOOC post; S3. Define a feature selection linear proxy model for the perturbed sample, then train this feature selection linear proxy model using the least squares method. Finally, comprehensively consider the LIME value and SHAP value, and use the trained feature selection linear proxy model to find the positions of the k most important words in the original MOOC post for the perturbed sample, thereby obtaining a feature selection vector sequence for the perturbed sample. The LIME value is the weight value corresponding to the word in the original MOOC post obtained using the LIME method, and the SHAP value is the contribution value corresponding to the word in the original MOOC post obtained using the SHAP method. S4. Select new elements from the bag-of-words vector corresponding to the perturbed sample based on the positions of the k most important features, arrange them into a new bag-of-words vector sequence, and then use it to train a feature-quantized linear surrogate model to best approximate the local behavior of the original deep learning MOOC post classification model near the original MOOC post. Finally, use the weights of the trained feature-quantized linear surrogate model to calculate the new bag-of-words vector sequence to obtain the original deep learning MOOC post classification model's interpretation of the original MOOC post and its LIME value. The LIME method refers to the Local Interpretable Model-agnostic Explanations (LIME) technique proposed by Ribeiro et al. in the paper "Ribeiro MT, Singh S, Guestrin C." "Why should I trust you?" "Explaining the predictions of any classifier[C] / / Proceedings of the 22nd ACM SIGKDD international conference on knowledgediscovery and data mining.2016:1135-1144"; The SHAP method refers to the SHapley Additive exPlanations method proposed by Lundberg et al. in the paper "Lundberg S, Lee S, A unified approach to interpreting model predictions[J].arxiv preprint arxiv:1705.07874,2017." The step S1 specifically includes: S1.1 generates m perturbation samples for the original MOOC post by randomly deleting words, and generates the bag-of-words vector sequence z′ corresponding to the perturbation samples. The calculation process is as follows; z=Disturbed(p)={z1,z2,…,z m }#(1) z′=Bagword(z)={z1′,z2′,…,z′ m ∈{0,1} d }#(2) Disturbed(·) represents the operation of generating m perturbation samples for the original MOOC post by randomly deleting words, p represents the text of the original MOOC post, z is the perturbation sample set, m is the number of perturbation samples, and z is the number of perturbation samples. m Represents the text of the mth perturbation sample; z′ m ∈{0,1} d represents the bag-of-words vector corresponding to the mth perturbation sample, d is the dimension of the bag-of-words vector, and d is equal to the length of the MOOC post p, where the perturbation sample z m The words that are not deleted in z′ m The corresponding position in z′ is 1, otherwise m The corresponding position in {0,1} is 0; d Indicates that the values of the vector elements are composed of 0 and 1 and the dimension is d, z′∈{0,1} m×d Represents the bag-of-words vector sequence of the perturbation sample set z, {0,1} m×d The values of the elements of the vector sequence are composed of 0 and 1 and the vector sequence dimension is m×d. Bagword(z) represents the word bag vector sequence generated for the perturbation sample set z; S1.2 calculates the prediction vector of the perturbation sample in the original deep learning MOOC post classification model. The calculation process is: f i =F(z i ) (3) f={f i |i=1,2,…,m}∈R m (4) Where F(·) represents the original deep learning MOOC post classification model, f i represents the predicted label of the i-th perturbation sample in the original deep learning MOOC post classification model, z i represents the text of the i-th perturbation sample calculated according to formula (1), f represents the prediction vector of m perturbation samples in the original deep learning MOOC post classification model; R represents a set of real numbers; The step S2 specifically includes: S2.1 uses the bag-of-words vector to calculate the similarity between the i-th perturbation sample and the original MOOC post. The calculation process is: Where D(·) is the cosine similarity calculation, σ is a fixed value of 25, and σ is used to adjust the weight distribution of the perturbation samples, p′∈{1} d is the bag-of-words vector representation of the original MOOC post p, with all elements being 1, π i is the similarity between the ith perturbation sample and the original MOOC post, exp(·) represents the exponential function with the natural constant e as the base, z′ i ∈{0,1} d Represents the bag-of-words vector representation corresponding to the i-th perturbation sample; S2.2 Let i = 1, 2, ..., m, repeat step S2.1, calculate the similarity between the m perturbation samples and the original MOOC post, and obtain the similarity vector π∈R between the perturbation sample set z and the original MOOC post m : π={π i |i=1,2,…,m}∈R m #(7) The step S3 specifically includes: S3.1 defines a feature selection linear surrogate model g(·) for the perturbed samples, such that for all i = 1, 2, …, m, we have; Among them, g(·) is the feature selection linear proxy model, w∈R d Parameters of the linear surrogate model g(·) for feature selection; Represents the LIME value of the word at position d of the i-th perturbation sample, which is equal to the weight value of the position; S3.2 uses the least squares method to train the feature selection linear agent model, and the objective function ξ is calculated as follows: Where L(·) is the difference measure between the original deep learning MOOC post classification model F(·) and the feature selection linear proxy model g(·), Ω(·) is the complexity penalty term of the linear proxy model based on L2 regularization, whose output increases with the complexity of the model to ensure the interpretability of the model, and λ is a learnable regularization parameter. Formula (11) expresses the parameter w of the feature selection linear proxy model that minimizes [L(F, g, π) + Ω(g)]. The calculation formula of w is as follows: w=[X T OX+λI] -1 X T Of (12) Where X = z′∈R m×d ; O∈R d×d Is a diagonal weight matrix, wherein the diagonal weight matrix means that all elements except the diagonal are 0, and its diagonal elements are equal to the similarity vector π; I∈R d×d is the identity matrix with all diagonal elements set to 1; the superscript "T" on the parameter indicates the transpose of the matrix; [·] -1 Represents matrix inversion operation; S3.3 comprehensively considers the LIME value and SHAP value to find the positions of the k most important words in the original MOOC post for the perturbation sample, and obtains the feature selection vector sequence s of the perturbation sample: s={s i |i=1,2,…,m}∈R m×k (13) Among them, s i represents the feature selection vector of the i-th perturbation sample in s, Indicates s i The jth element in The position of the perturbed word in the original MOOC post; It represents the weight of the word at the specified position of the combined perturbation sample in g(·) and its SHAP value. Its calculation formula is as follows: Among them, β is a learnable fusion parameter, Indicates that the i-th disturbance sample calculated by formula (8) is at position The LIME value of the word, abs(·) represents the absolute value function; Indicates that the i-th disturbance sample is at position The SHAP value of the word is calculated as follows: Among them, |·| means finding the basis of a set, that is, the number of elements in the set; the symbol "!" represents the factorial operation; represents the i-th perturbation sample z i In position The words on Represents words in the text set C The subset masked by the mask "[MASK]", is a subset of C, Indicates that Middle position The mask on the word is restored to the original word C is the text set after some words in the original MOOC post P are replaced by the mask "[MASK]". The calculation formula is: Among them, MaskDo(P,u) represents the text set after the original MOOC post text P is replaced with u masks "[MASK]", and u represents the number of masks "[MASK]" used; The step S4 specifically includes: S4.1 selects the positions of the k most important features of the vector sequence s according to the characteristics of the perturbed sample, selects new elements from the bag-of-words vector corresponding to the perturbed sample, and obtains a new bag-of-words vector sequence in, Indicates that the i-th perturbation sample is The bag-of-words vector in ElementSelection(z′ i ,s i ) indicates that according to s i The position in the bag-of-words vector z′ i Select k elements from the word bag to form a new word bag vector. Represents bag-of-words vector The kth element in ; S4.2 Using Bag-of-Words Vector Sequences Train a feature quantized linear surrogate model to best approximate the local behavior of the original deep learning MOOC post classification model F near the original MOOC post p: in, is a feature quantized linear proxy model, For its parameters; It's training Objective function; is a learnable regularization parameter, is the identity matrix, The diagonal elements are equal to The diagonal weight matrix of is calculated in step S1.2 The similarity between the text corresponding to the bag-of-words vector and the original MOOC post, express The predicted value of the text corresponding to the bag-of-words vector in the original model F(·), express The predicted vector of the text corresponding to the bag-of-words vector sequence in the original model F(·) S4.3 uses the trained feature quantization linear proxy model The weights in the bag-of-words vector sequence Calculate and obtain the explanation e and LIME value of the original deep learning MOOC post classification model for the original MOOC post. The calculation process is as follows: in, Represents bag-of-words vector The elements, Representation feature quantization linear proxy model The weight vector The elements, express and Corresponding element subscripts, formula (23) means finding The value is the largest Bag-of-words vector as explanation e ie is the number of the perturbation sample corresponding to explanation e, Indicates the LIME value corresponding to each word of interpretation e; Indicates based on With s ie Find the position of the word that explains e in the original MOOC post, and then combine it with the ieth perturbation sample text z ie Find the word that explains e, s ie Represents the feature selection vector corresponding to the ie-th perturbation sample in s, express The bag-of-words vector corresponding to the ie-th perturbation sample in .