A product recall prediction method and system based on topic model
By constructing a supervised paragraph topic model and using the improved random expectation maximization algorithm and metadata, the problem of poor fitting effect of traditional topic models on short texts is solved, effective prediction of product recalls is achieved, and companies are helped to avoid recall risks.
Patent Information
- Application Number
- CN202410756522.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-06-13
AI Technical Summary
Existing technology is difficult to effectively screen out product defects from large-scale and complex consumer complaint text data. Traditional topic models have poor fitting effects on short texts and cannot simultaneously predict product recalls.
Construct a supervised paragraph topic model based on defect complaint metadata, extract the defect topic distribution through an improved random expectation maximization algorithm, and predict the product recall probability based on the metadata to determine whether a product recall has occurred.
Effectively organize and analyze consumer complaint data, extract defect theme distribution as features, predict product recall probability, and help companies formulate recall strategies and avoid recall risks.
Smart Images

Figure CN118333637B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data mining, and in particular relates to a product recall prediction method and system based on a topic model. Background Art
[0002] Product recalls are of great strategic significance for improving product quality, but a large-scale product recall can cause huge economic and reputational losses to companies. When a product has defects that endanger consumer rights or personal safety, it will prompt companies to recall problematic products for repair. The key is that product defects cannot be fully detected during the design or manufacturing process, causing consumers to discover them during use, and even causing safety accidents. The suddenness of product recalls caused by this hidden danger is the main reason for companies to face losses. Therefore, it is necessary to study and solve the problem of timely excavation of product defects to predict whether it is necessary to initiate a product recall. Intelligent method.
[0003] With the popularity of the Internet and mobile devices, consumers have posted a large number of complaints about product failures on online platforms or social media forums. Enterprises and government regulators have also used online consumer complaint information as an important source of information for discovering product quality defects and initiating recalls. However, the first problem that needs to be solved is to filter out useful product defects from such large-scale, complex, and unstructured complaint text data.
[0004] The topic model is an effective technology for text mining, which can extract a small number of key topic features from massive texts, providing a solution for the present invention. On the basis of constructing the topic model, the present invention should consider: the complaint text is often accompanied by structured metadata related to the text content, which is important information ignored by the existing invention methods; the traditional topic model has a poor fitting effect on short texts such as complaints; most traditional topic models are unsupervised and can only extract the topics expressed in the mining corpus, and cannot simultaneously realize the prediction of product recalls. Summary of the invention
[0005] In order to make up for the deficiencies of the prior art, the present invention provides a product recall prediction method and system based on a topic model.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0007] In a first aspect, a product recall prediction method based on a topic model is provided, comprising:
[0008] Obtain complaint data and product recall data reflecting product quality defects to be analyzed;
[0009] Process the complaint text in the complaint data to obtain a corpus to be analyzed;
[0010] Each complaint in the analysis corpus is assigned a product recall label according to the brand of the complaint;
[0011] Train the corpus to be analyzed and determine the number of topics based on perplexity and topic explanatory power;
[0012] Extract metadata related to complaint text from complaint data and perform corresponding preprocessing;
[0013] Construct a supervised paragraph topic model based on defect complaint metadata and preset the prior parameters of the supervised paragraph topic model;
[0014] The improved random expectation maximization algorithm is used to infer the latent variables of the supervised paragraph topic model, obtain the defect topic distribution, and assign stable topics to all words in the corpus to be analyzed;
[0015] Predict the probability of product recall based on defect topic distribution and determine whether product recall will occur.
[0016] Furthermore, the complaint text in the complaint data is processed to obtain a corpus to be analyzed, including:
[0017] Extract Chinese text and English text from complaint text in complaint data;
[0018] Use Python's jieba library to segment Chinese text, separate words in English text with spaces, and remove meaningless punctuation marks, pronouns and adverbs of degree that are not related to the complaint topic to obtain the segmentation results;
[0019] Count the frequency of each word in the word segmentation result, and remove words whose frequency is higher than a preset maximum threshold or lower than a preset minimum threshold;
[0020] The complaint texts against the same complained brand are divided into one document to form a complaint group. The corpus to be analyzed is formed based on the complaint groups of all complained brands, and each complaint in the complaint group is regarded as a paragraph.
[0021] Furthermore, each complaint in the analysis corpus is assigned a product recall label according to the brand of the complaint, including:
[0022] Determine the complained brand corresponding to each complaint in the corpus to be analyzed, and judge whether the complained brand has ever had a product recall event. If it has not happened, the product recall label is 0; if it has happened, the product recall label is 1.
[0023] Furthermore, the prior parameters of the supervised paragraph topic model are preset, including:
[0024] Preset Prior Parameters of Supervised Paragraph Topic Model and through Extracting metadata from a normal distribution Dimensional weight coefficient matrix , is the number of topics, is the number of metadata;
[0025] Preset Prior Parameters of Supervised Paragraph Topic Model and through Draw from a Dirichlet distribution Dimensional word distribution matrix , is the number of different words in the corpus to be analyzed;
[0026] Preset Prior Parameters of Supervised Paragraph Topic Model .
[0027] Preset Prior Parameters of Supervised Paragraph Topic Model .
[0028] Furthermore, the method also includes:
[0029] In each file of the complaint group, and The exponential operation of the product is the prior parameter, and the document topic distribution vector is obtained by sampling the Dirichlet distribution , is the metadata matrix of the document;
[0030] For each paragraph in the document, The paragraph topic distribution vector is obtained by sampling the Poisson-Dirichlet process as the base distribution ,according to The topic sequence of words in the paragraph is obtained by multinomial distribution extraction ;
[0031] Statistics Subject Sequence get , combined with Generate recall variables by sampling from Bernoulli distribution .
[0032] Furthermore, the perplexity is:
[0033] , Indicates the number of documents included in the corpus to be analyzed, represents the word sequence of the i-th document, Represents the number of words in the i-th document.
[0034] Furthermore, the improved random expectation maximization (EM) algorithm is used to infer the latent variables of the supervised paragraph topic model, obtain the defect topic distribution, and assign stable topics to all words in the corpus to be analyzed, including:
[0035] Integral hidden variables to be solved ;
[0036] Introducing the Chinese restaurant process in Gibbs sampling, sampling topics for each word in turn, adding the number of tables Assisted subject sampling, It is a statistic that records the distribution of topics. After iteration, it is obtained and Stationary distribution samples of ;
[0037] statistics and The stationary distribution of each topic is inferred by point estimation :
[0038] ,
[0039] ,
[0040] ,
[0041] in, For the Paragraph in a document Theme The number of For the Paragraph in a document The total number of topics, , For the Paragraph in a document Assign to topic The number of words, For the Paragraph in a document The total number of words, , Assign topics to the corpus to be analyzed The number of words;
[0042] Optimize the solution using the default optimized L-BFGS algorithm for logistic regression .
[0043] Furthermore, the Chinese restaurant process is introduced into the Gibbs sampling process to sample topics for each word in turn, including:
[0044] According to Bayesian theory The posterior joint probability distribution formula is:
[0045] ,
[0046] ,
[0047] in, is the factorial power, is the generalized Stirling number;
[0048] The sampling time is obtained by constructing the posterior joint probability distribution formula and The conditional probability formula for the assignment is:
[0049] ,
[0050] Among them, the To remove the Paragraph in a document Location The subject of the word The topic statistics after To remove the Paragraph in a document theme Number of tables The table statistics after .
[0051] In the second aspect, a product recall prediction system based on a topic model is provided, comprising:
[0052] A data acquisition module is used to acquire complaint data and product recall data reflecting product quality defects to be analyzed;
[0053] The corpus construction module is used to process the unstructured complaint text in the complaint data to obtain the corpus to be analyzed;
[0054] The label assignment module is used to assign a product recall label to each complaint data in the analysis corpus according to the complaint brand;
[0055] The training module is used to train the corpus to be analyzed and determine the number of topics based on the perplexity and topic interpretability;
[0056] The metadata processing module is used to extract metadata related to the complaint text in the complaint data and perform corresponding preprocessing;
[0057] A model building module is used to build a supervised paragraph topic model based on defect complaint metadata and preset the prior parameters of the supervised paragraph topic model;
[0058] The topic distribution module is used to infer the latent variables of the supervised paragraph topic model using the improved random expectation maximization (EM) algorithm, obtain the defect topic distribution, and assign stable topics to all words in the corpus to be analyzed;
[0059] The product recall prediction module is used to predict the probability of product recall based on the defect topic distribution and determine whether the product recall occurs.
[0060] The beneficial effects achieved by the present invention are:
[0061] Starting from large-scale online consumer product defect complaint data, a supervised paragraph topic model based on defect complaint metadata was constructed. On the one hand, considering the structural characteristics of consumer complaints as short texts and accompanied by metadata, the complaint texts in the complaint data were organized into complaint groups for the same complaint brand to obtain the corpus to be analyzed, and the metadata was used as a covariate through exponential operation as a priori parameters for generating document topic distribution; on the other hand, the extracted defect topic distribution was used as a feature to generate a recall variable, thereby predicting the product recall probability, which is helpful for decision makers to formulate recall strategies and help companies avoid recall risks. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 It is a flowchart of the product recall prediction method based on the topic model of the present invention;
[0063] Figure 2 is a flow chart of the process of forming the corpus to be analyzed of the present invention;
[0064] Figure 3 It is a supervised paragraph topic model diagram based on defect complaint metadata of the present invention;
[0065] Figure 4 It is a structural diagram of the product recall prediction system based on the topic model of the present invention. DETAILED DESCRIPTION
[0066] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.
[0067] like Figure 1 As shown, an embodiment of the present invention provides a product recall prediction method based on a topic model, comprising:
[0068] 101. Obtain complaint data and product recall data reflecting product quality defects to be analyzed;
[0069] Among them, the complaint data reflecting product quality defects comes from the China Auto Quality Information Collection Platform, which is the largest and most authoritative automobile complaint information collection platform in China. The product recall data is obtained from the China Automobile Recall Official Website.
[0070] 102, processing the complaint text in the complaint data to obtain a corpus to be analyzed;
[0071] Among them, the complaint text is usually unstructured, and the formation process of the corpus to be analyzed is as follows: Figure 2 As shown, the specific process is:
[0072] 201, extracting Chinese text and English text from the complaint text in the complaint data;
[0073] 202, use Python's jieba library to segment the Chinese text, separate the words of the English text with spaces, and remove meaningless punctuation marks, pronouns and degree adverbs that are irrelevant to the complaint topic, to obtain the segmentation result; in this embodiment, the complaint data is Chinese text, so Python can be used to call the jieba library to segment each complaint;
[0074] 203, counting the frequency of each word in the word segmentation result, and removing words whose frequency is higher than a preset maximum threshold or lower than a preset minimum threshold; for example, in this embodiment, words whose frequency is lower than 10 times are removed;
[0075] 204, the complaint texts for the same complained brand (or the specific complained product model under the complained brand) are divided into a document to form a complaint group, and a corpus to be analyzed is formed based on the complaint groups of all complained brands, and each complaint in the complaint group is regarded as a paragraph. In this embodiment, the documents are divided based on the specific object of the complaint or recall MMY (make-model-year, complained brand-model-year).
[0076] 103, assign a product recall label to each complaint in the analysis corpus according to the brand of the complaint;
[0077] Among them, determine the complaint brand corresponding to each complaint in the corpus to be analyzed, and judge whether the complaint brand has ever had a product recall incident. If it has not happened, the product recall label is 0; if it has happened, the product recall label is 1.
[0078] 104, training the corpus to be analyzed, and determining the number of topics according to the perplexity and topic explanatory power;
[0079] The perplexity expression is:
[0080] , Indicates the number of documents included in the corpus to be analyzed, Indicates i The word sequence of a document, Indicates i The number of words in a document. In this embodiment, the number of topics is set in sequence , determine the number of topics based on the principle of selecting topics with smaller perplexity and better explanatory power .
[0081] 105, extracting metadata related to the complaint text from the complaint data and performing corresponding preprocessing;
[0082] In this embodiment, the selected metadata are divided into three types: "complaint page", "car manufacturer" and "MMY related properties", and the specific fields included are shown in Table 1 below.
[0083]
[0084] 106. Construct a supervised paragraph topic model based on defect complaint metadata, and preset prior parameters of the supervised paragraph topic model;
[0085] In this embodiment, the supervised paragraph topic model diagram based on the defect complaint metadata is as follows: Figure 3 As shown in the figure, the gray-shaded circular nodes represent observed variables, the hollow circular nodes represent prior parameters and latent variables, the arrows indicate the probability generation relationship between the previous and next variables, the rectangular blocks represent repeated sampling within the hierarchy, and the symbol in the lower right corner of the rectangle represents the number of repetitions; the model includes three sub-models: upstream, midstream, and downstream. Considering the association between consumer complaints and metadata, the metadata of consumer quality complaints is added to the upstream as a covariate, and the midstream sub-model adds a paragraph layer in the document layer to adapt to the short text characteristics of complaints. After obtaining the defect theme using the fitted model, the downstream sub-model uses product recall as the response variable, and trains feature themes with product recall discrimination capabilities under the supervised learning of recall labels;
[0086] Preset Prior Parameters of Supervised Paragraph Topic Model = 0.01, and by Extracting metadata from a normal distribution Dimensional weight coefficient matrix , is the number of topics, is the number of metadata;
[0087] Preset Prior Parameters of Supervised Paragraph Topic Model , is the identity matrix, and through Draw from a Dirichlet distribution Dimensional word distribution matrix , is the number of different words in the corpus to be analyzed;
[0088] Preset Prior Parameters of Supervised Paragraph Topic Model ;
[0089] In each file of the complaint group, and The exponential operation of the product is the prior parameter, and the document topic distribution vector is obtained by sampling the Dirichlet distribution , is the metadata matrix of the document;
[0090] For each paragraph in the document, The paragraph topic distribution vector is obtained by sampling the Poisson-Dirichlet process as the base distribution , and preset the parameters , ,according to The topic sequence of words in the paragraph is obtained by multinomial distribution extraction ;
[0091] Statistics Subject Sequence get , combined with Generate recall variables by sampling from Bernoulli distribution .
[0092] 107. The improved random expectation maximization algorithm is used to infer the latent variables of the supervised paragraph topic model, obtain the defect topic distribution, and assign stable topics to all words in the corpus to be analyzed;
[0093] The specific steps are as follows:
[0094] Step 1: Integrate the hidden variables to be solved ;
[0095] Step 2: Introduce the Chinese restaurant process in Gibbs sampling. Sample the topic for each word in turn and increase the number of tables. Assisted subject sampling, It is a statistic that records the distribution of topics. After iteration, it is obtained and Stationary distribution samples of ;
[0096] Step 3: Statistics and The stationary distribution of each topic is inferred by point estimation :
[0097] ,
[0098] ,
[0099] ,
[0100] in, For the Paragraph in a document Theme The number of For the Paragraph in a document The total number of topics, , For the Paragraph in a document Assign to topic The number of words, For the Paragraph in a document The total number of words, , Assign topics to the corpus to be analyzed The number of words;
[0101] Step 4: Use the default optimized L-BFGS algorithm of logistic regression to optimize the solution .
[0102] Furthermore, the Chinese restaurant process is introduced into the Gibbs sampling process to sample topics for each word in turn, including:
[0103] According to Bayesian theory The posterior joint probability distribution formula is:
[0104] ,
[0105] Among them, the is a factorial power, is the generalized Stirling number;
[0106] The posterior joint probability distribution formula is used to construct the sampling and stated The conditional probability formula for the assignment is:
[0107] ,
[0108] ,
[0109] Among them, the To remove the Paragraph in a document Location The subject of the word The topic statistics after To remove the Paragraph in a document theme Number of tables The table statistics after .
[0110] 108, predict the probability of product recall based on defect topic distribution and determine whether product recall occurs.
[0111] The beneficial effects of the embodiments of the present invention are:
[0112] Starting from large-scale online consumer product defect complaint data, a supervised paragraph topic model based on defect complaint metadata was constructed. On the one hand, considering the structural characteristics of consumer complaints as short texts and accompanied by metadata, the complaint texts in the complaint data were organized into complaint groups for the same complaint brand to obtain the corpus to be analyzed, and the metadata was used as a covariate through exponential operation as a priori parameters for generating document topic distribution; on the other hand, the extracted defect topic distribution was used as a feature to generate a recall variable, thereby predicting the product recall probability, which is helpful for decision makers to formulate recall strategies and help companies avoid recall risks.
[0113] In combination with the product recall prediction method based on the topic model described in the above embodiments, the product recall prediction system based on the topic model is described below through embodiments.
[0114] like Figure 4 As shown, an embodiment of the present invention provides a product recall prediction system based on a topic model, including:
[0115] The data acquisition module 401 is used to acquire complaint data and product recall data reflecting product quality defects to be analyzed;
[0116] A corpus construction module 402 is used to process the unstructured complaint text in the complaint data to obtain a corpus to be analyzed;
[0117] The label assignment module 403 is used to assign a product recall label to each complaint data in the analysis corpus according to the complaint brand;
[0118] A training module 404 is used to train the corpus to be analyzed and determine the number of topics according to the perplexity and the topic interpretability;
[0119] The metadata processing module 405 is used to extract structured metadata related to the complaint text in the complaint data and perform corresponding preprocessing;
[0120] A model building module 406 is used to build a supervised paragraph topic model based on defect complaint metadata and preset prior parameters of the supervised paragraph topic model;
[0121] The topic distribution module 407 is used to infer the latent variables of the supervised paragraph topic model using an improved random expectation maximization (EM) algorithm to obtain defect topic distribution and assign stable topics to all words in the corpus to be analyzed;
[0122] The product recall prediction module 408 is used to predict the probability of product recall according to the defect topic distribution and determine whether the product recall occurs.
[0123] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0124] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0125] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0126] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0127] The above are merely embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention are included in the scope of the claims of the present invention to be approved.
Claims
1. A product recall prediction method based on topic model, characterized in that: include: Obtain complaint data and product recall data reflecting product quality defects to be analyzed; Processing the complaint text in the complaint data to obtain a corpus to be analyzed; Assigning a product recall label to each complaint in the corpus to be analyzed according to the brand of the complaint; Training the corpus to be analyzed, and determining the number of topics according to perplexity and topic interpretability; Extracting metadata related to the complaint text from the complaint data and performing corresponding preprocessing; Constructing a supervised paragraph topic model based on defect complaint metadata, and presetting prior parameters of the supervised paragraph topic model; Using an improved random expectation maximization algorithm to infer latent variables of the supervised paragraph topic model, obtain defect topic distribution, and assign stable topics to all words in the corpus to be analyzed; Predicting the probability of a product recall based on the defect topic distribution, and determining whether the product recall occurs; The prior parameters of the supervised paragraph topic model are preset, including: Preset the prior parameters σ of the supervised paragraph topic model λ , and through σ λ Extracting a K×F-dimensional weight coefficient matrix λ of the metadata from a normal distribution, where K is the number of topics and F is the number of metadata; Presetting a priori parameter β of the supervised paragraph topic model, and extracting a K×V-dimensional word distribution matrix Φ from the Dirichlet distribution through β, wherein V is the number of different words in the corpus to be analyzed; Presetting a priori parameter η of the supervised paragraph topic model; After presetting the prior parameters of the supervised paragraph topic model, the method further includes: In each document of the corpus to be analyzed, the exponential operation of the product of λ and x is used as a priori parameter, and the document topic distribution vector μ is obtained by Dirichlet distribution sampling, where x is the metadata matrix of the document; For each paragraph in the document, the paragraph topic distribution vector v is obtained by sampling through the Poisson-Dirichlet process with the μ as the base distribution, and the topic sequence z of the words in the paragraph is obtained by sampling through the multinomial distribution according to ν; Count the subject sequence z to get Combining the η with the Bernoulli distribution sampling method, generating a recall variable y; The improved random expectation maximization algorithm is used to infer the latent variables of the supervised paragraph topic model to obtain defect topic distribution, and stable topics are assigned to all words in the corpus to be analyzed, including: Integral hidden variables to be solved {μ, v, Φ}; In the Gibbs sampling, the Chinese restaurant process is introduced to sample topics for each word in turn, and the number of tables t is added to assist in topic sampling, where t is a statistic that records the topic distribution, and it is iterated until a stable distribution sample of z and t is obtained; The stationary distribution of z and t is statistically analyzed to infer the distribution of each topic {μ, ν, Φ} through point estimation: Among them, the t i,j,k is the number of topics k in paragraph j in the i-th document, and T i,j is the total number of topics in paragraph j of the i-th document, The i,j,k is the number of words assigned to topic k in paragraph j in the i-th document, and the N i,j is the total number of words in paragraph j of the i-th document, The M k,v is the number of words assigned to topic k in the corpus to be analyzed; The default optimized L-BFGS algorithm for logistic regression is used to optimize {λ, η}.
2. The product recall prediction method based on topic model according to claim 1, characterized in that: The step of processing the complaint text in the complaint data to obtain a corpus to be analyzed includes: Extracting Chinese text and English text from the complaint text in the complaint data; The Chinese text is segmented using the Python jieba library, and the words of the English text are separated by spaces, and meaningless punctuation marks, pronouns and adverbs of degree that are not related to the complaint subject are removed to obtain the segmentation results; Counting the frequency of each word in the word segmentation result, and removing words whose frequency is higher than a preset maximum threshold or lower than a preset minimum threshold; The complaint texts against the same complained brand are divided into one document to form a complaint group, and a corpus to be analyzed is formed according to the complaint groups of all complained brands, where each complaint in the complaint group is regarded as a paragraph.
3. The product recall prediction method based on topic model according to claim 1, characterized in that: The step of assigning a product recall label to each complaint in the corpus to be analyzed according to the brand of the complaint includes: Determine the complaint brand corresponding to each complaint in the corpus to be analyzed, and judge whether the complaint brand has ever had a product recall event. If not, the product recall label is 0; if so, the product recall label is 1.
4. The product recall prediction method based on topic model according to claim 1, characterized in that: The perplexity is: The I represents the number of documents included in the corpus to be analyzed, and the w i represents the word sequence of the i-th document, the L i Represents the number of words in the i-th document.
5. The product recall prediction method based on topic model according to claim 1, characterized in that: The process of introducing Chinese restaurants in Gibbs sampling samples topics for each word in turn, including: According to Bayesian theory, {Z 1:I,1:J ,W 1:I,1:J ,t 1:I,1:J ,α 1:I, λ,y 1:I The posterior joint probability distribution formula of} is: Wherein, the (b|a)T i,j is a factorial power, is the generalized Stirling number; The conditional probability formula for the distribution of z and t during sampling is constructed using the posterior joint probability distribution formula: Among them, the To remove the topic z of the word at position l in paragraph j in the i-th document i,j,l The topic statistics after The number of tables t to remove paragraph j topic k in the i-th document i,j,k The table statistics after .
6. A product recall prediction system based on topic model, characterized in that: include: A data acquisition module is used to acquire complaint data and product recall data reflecting product quality defects to be analyzed; A corpus construction module, used for processing the complaint text in the complaint data to obtain a corpus to be analyzed; A label assignment module, used for assigning a product recall label to each complaint in the corpus to be analyzed according to the brand of the complaint; A training module, used for training the corpus to be analyzed, and determining the number of topics according to perplexity and topic explanatory power; A metadata processing module, used for extracting metadata related to the complaint text from the complaint data and performing corresponding preprocessing; A model building module, used to build a supervised paragraph topic model based on defect complaint metadata and preset prior parameters of the supervised paragraph topic model; A topic distribution module is used to infer the latent variables of the supervised paragraph topic model using an improved random expectation maximization algorithm to obtain defect topic distribution and assign stable topics to all words in the corpus to be analyzed; A product recall prediction module is used to predict the probability of product recall based on the defect theme distribution and determine whether the product recall occurs; The model building module is specifically used to preset the prior parameters σ of the supervised paragraph topic model λ , and through σ λ Extracting a K×F-dimensional weight coefficient matrix λ of the metadata from a normal distribution, where K is the number of topics and F is the number of metadata; Presetting a priori parameter β of the supervised paragraph topic model, and extracting a K×V-dimensional word distribution matrix Φ from the Dirichlet distribution through β, wherein V is the number of different words in the corpus to be analyzed; Presetting a priori parameter η of the supervised paragraph topic model; The model building module is also used to, in each document of the corpus to be analyzed, use the exponential operation of the λ and the product as a priori parameters, and extract the document topic distribution vector μ through Dirichlet distribution sampling, where x is the metadata matrix of the document; for each paragraph in the document, use the μ as the base distribution to sample the paragraph topic distribution vector ν through the Poisson-Dirichlet process, and extract the topic sequence z of the words in the paragraph through the polynomial distribution according to ν; and obtain the statistics of the topic sequence z Combining the η with the Bernoulli distribution sampling method, generating a recall variable y; The topic distribution module is specifically used to integrate the hidden variables to be solved {μ, v, Φ}; introduce the Chinese restaurant process in Gibbs sampling to sample topics for each word in turn, and add the number of tables t to assist in topic sampling, wherein t is a statistic that records the topic distribution, and iterate until a stable distribution sample of z and t is obtained; the stable distribution of z and t is counted to infer the distribution of each topic {μ, v, Φ} through point estimation: Among them, the t i,j,k is the number of topics k in paragraph j in the i-th document, and T i,j is the total number of topics in paragraph j of the i-th document, The i,j,k is the number of words assigned to topic k in paragraph j in the i-th document, and the N i,j is the total number of words in paragraph j of the i-th document, The M k,v is the number of words assigned to topic k in the corpus to be analyzed; The default optimized L-BFGS algorithm for logistic regression is used to optimize {λ, η}.
