A text classification method and device based on an intelligent marketing scenario

CN115617998BActive Publication Date: 2026-11-03BAIRONG ZHIXIN (BEIJING) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211288897.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-20
Publication Date
2026-11-03
Estimated Expiration
2042-10-20

AI Technical Summary

Technical Problem

BERT, as a classification model, has a low accuracy rate in classifying conversational texts containing a lot of colloquial vocabulary in intelligent marketing scenarios, which leads to a low accuracy rate in identifying user intent.

Method used

A pre-defined classification model is constructed, including feature extraction and feature calculation functions. The model uses the BERT feature extractor and the FP-NET network structure to obtain basic features and calculates discriminative target features through feature mapping and orthogonal projection layers of the FP-Net network structure for text classification.

Benefits of technology

It improved the accuracy of text classification in intelligent marketing scenarios, thereby improving the accuracy of user intent judgment by 3%-5%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115617998B_ABST
    Figure CN115617998B_ABST
Patent Text Reader

Abstract

The application discloses a text classification method and device based on an intelligent marketing scene, relates to the field of data processing, and mainly aims to improve the text classification accuracy of the intelligent marketing scene and then improve the intention accuracy of discriminating users in the intelligent marketing scene. The main technical scheme of the application is as follows: obtaining the text of the intelligent marketing scene; putting the text of the intelligent marketing scene into a preset classification model for text classification, wherein the preset classification model at least comprises feature extraction function and feature calculation function; obtaining basic features by using the feature extraction function of the preset classification model; obtaining target features by using the feature calculation function of the preset classification model based on the basic features, wherein the target features are features with discriminative power; and performing text classification according to the target features. The application is used for text classification in the intelligent marketing scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a text classification method and apparatus based on intelligent marketing scenarios. Background Technology

[0002] In intelligent marketing scenarios, it is necessary to use communication and dialogue between robots and humans to determine the user's intent and make marketing recommendations.

[0003] Currently, BERT (Bidirectional Encoder Representation from Transformers, a pre-trained language representation model) is used as a classification model for machine learning or deep learning. By constructing corpora, training the model, deploying the model, and finally predicting the user's intent in real time on the cloud based on all the dialogue text between the robot and the human.

[0004] However, although BERT, as a classification model, contains a self-attention mechanism that can effectively focus on valid features, its accuracy in classifying dialogue texts containing a lot of colloquial vocabulary generated in intelligent marketing scenarios is relatively low, resulting in a low accuracy in judging user intent in intelligent marketing scenarios. Summary of the Invention

[0005] In view of the above problems, the present invention provides a text classification method and apparatus based on intelligent marketing scenarios. The main purpose is to improve the accuracy of text classification in intelligent marketing scenarios, thereby improving the accuracy of identifying user intent in intelligent marketing scenarios.

[0006] To solve the above-mentioned technical problems, the present invention proposes the following solution:

[0007] In a first aspect, the present invention provides a text classification method based on intelligent marketing scenarios, the method comprising:

[0008] Obtain the text of the intelligent marketing scenario;

[0009] The text of the intelligent marketing scenario is placed into a preset classification model for text classification. The preset classification model includes at least feature extraction and feature calculation functions.

[0010] Basic features are obtained using the feature extraction function of the preset classification model;

[0011] Based on the aforementioned basic features, the target features are obtained using the feature calculation function of the preset classification model, wherein the target features are features with discriminative power.

[0012] Text classification is performed based on the target features.

[0013] Preferably, the preset classification model includes at least a feature extractor, an orthogonal projection layer, and a gradient inversion layer;

[0014] The step of obtaining basic features using the feature extraction function of the preset classification model includes:

[0015] Basic features are obtained from the preprocessed data using the feature extractor of the preset classification model.

[0016] Preferably, the step of obtaining target features based on the basic features using the feature calculation function of the preset classification model includes:

[0017] Based on the basic features, the gradient inversion layer of the preset classification model is used to calculate the indistinguishable features;

[0018] The target features are calculated using the orthogonal projection layer of the preset classification model based on the basic features and the indistinguishable features.

[0019] Preferably, the orthogonal projection layer has the functions of acquiring discriminative features and acquiring target features;

[0020] The step of calculating the target features based on the basic features and the non-discriminating features using the orthogonal projection layer of the preset classification model includes:

[0021] Based on the aforementioned basic features, the discriminative features are obtained using the discriminative feature acquisition function of the orthogonal projection layer;

[0022] The target features are obtained using the orthogonal projection layer's function of acquiring target features based on the distinguishable features and the non-distinguishing features.

[0023] Preferably, the method further includes:

[0024] The preset classification model is constructed based on the BERT feature extractor and the FP-NET network structure;

[0025] The preset classification model is trained using a preset training set, a preset test set, and a preset validation set to obtain the target parameters of the preset classification model.

[0026] Preferably, before training the preset classification model based on a preset training set, a preset test set, and a preset validation set to obtain the target parameters of the preset classification model, the method further includes:

[0027] Obtain raw data, which is the dialogue text of a preset intelligent marketing scenario;

[0028] The target original data is obtained by deleting preset words from the original data, where the preset words are meaningless words;

[0029] The target raw data is classified and labeled according to the preset labeling categories to obtain labeled data. The preset labeling categories include at least strong affirmative intent, weak affirmative intent, processed intent, busy status intent, telephone assistant intent, explicit rejection intent, and user abusive intent.

[0030] The labeled data is allocated into a preset training set, a preset test set, and a preset validation set according to a preset ratio.

[0031] Preferably, the step of training the preset classification model based on a preset training set, a preset test set, and a preset validation set to obtain the target parameters of the preset classification model includes:

[0032] Monitor whether the number of steps to train the preset classification model based on the preset training set has reached the preset number of steps;

[0033] When the number of steps for training the preset classification model based on the preset training set reaches the preset number of steps, the classification result of the preset classification model is verified based on the preset verification set to obtain the verification result;

[0034] Determine whether the test result meets the preset conditions;

[0035] If the test result reaches the preset condition, then the training of the preset classification model is stopped, and the preset classification model is tested based on the preset test set to calculate the accuracy and recall of the preset classification model.

[0036] Determine whether the accuracy and recall rates meet preset conditions;

[0037] If the accuracy and recall meet the preset conditions, the parameters obtained by training the preset classification model will be determined as the target parameters.

[0038] Secondly, the present invention provides a text classification device based on intelligent marketing scenarios, the device comprising:

[0039] The first acquisition unit is used to acquire the text of the intelligent marketing scenario;

[0040] The input unit is used to input the text of the intelligent marketing scenario into a preset classification model for text classification. The preset classification model includes at least feature extraction and feature calculation functions.

[0041] The second acquisition unit is used to acquire basic features using the feature extraction function of the preset classification model;

[0042] The third acquisition unit is used to acquire target features based on the basic features using the feature calculation function of the preset classification model, wherein the target features are features with discriminative power.

[0043] A classification unit is used to classify text based on the target features.

[0044] Preferably, the preset classification model includes at least a feature extractor, an orthogonal projection layer, and a gradient inversion layer; the second acquisition unit includes:

[0045] The feature extractor is used to extract basic features from the preprocessed data using the preset classification model.

[0046] Preferably, the third acquisition unit includes:

[0047] The first calculation module is used to calculate the indistinguishable features based on the basic features using the gradient inversion layer of the preset classification model;

[0048] The second calculation module is used to calculate the target features based on the basic features and the indistinguishable features using the orthogonal projection layer of the preset classification model.

[0049] Preferably, the orthogonal projection layer has the functions of acquiring discriminative features and acquiring target features; the second calculation module includes:

[0050] The first acquisition submodule is used to obtain the distinguishable features based on the basic features using the function of the orthogonal projection layer to obtain distinguishable features;

[0051] The second acquisition submodule is used to obtain the target features based on the distinguishable features and the non-distinguishing features using the target feature acquisition function of the orthogonal projection layer.

[0052] Preferably, the device further includes:

[0053] The construction unit is used to construct the preset classification model based on the BERT feature extractor and the FP-NET network structure;

[0054] The training unit is used to train the preset classification model based on a preset training set, a preset test set, and a preset validation set to obtain the target parameters of the preset classification model.

[0055] Preferably, the device further includes:

[0056] The fourth acquisition unit is used to acquire raw data, which is the dialogue text of a preset intelligent marketing scenario;

[0057] A deletion unit is used to delete preset words from the original data to obtain the target original data, wherein the preset words are meaningless words;

[0058] The annotation unit is used to classify and annotate the target raw data according to a preset annotation category to obtain annotated data. The preset annotation category includes at least strong affirmative intent, weak affirmative intent, processed intent, busy status intent, telephone assistant intent, explicit rejection intent, and user abusive intent.

[0059] The allocation unit is used to allocate the labeled data into a preset training set, a preset test set, and a preset validation set according to a preset ratio.

[0060] Preferably, the training unit includes:

[0061] The monitoring module is used to monitor whether the number of steps to train the preset classification model based on the preset training set has reached the preset number of steps;

[0062] The verification module is used to verify the classification result of the preset classification model based on the preset verification set when the number of steps of training the preset classification model based on the preset training set reaches the preset number of steps, and obtain the verification result.

[0063] The first judgment module is used to determine whether the test result meets the preset conditions;

[0064] The testing module is used to stop training the preset classification model if the test result reaches the preset condition, and to test the preset classification model based on the preset test set, and calculate the accuracy and recall of the preset classification model.

[0065] The second judgment module is used to determine whether the accuracy and recall rate have reached preset conditions;

[0066] The determination module is used to determine the parameters obtained by training the preset classification model as the target parameters if the accuracy and recall meet the preset conditions.

[0067] To achieve the above objectives, according to a third aspect of the present invention, a storage medium is provided, the storage medium including a stored program, wherein, when the program is executed, the device where the storage medium is located is controlled to perform the text classification method based on the intelligent marketing scenario described in the first aspect.

[0068] To achieve the above objectives, according to a fourth aspect of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements all or part of the steps of the text classification device for a smart marketing scenario as described in the second aspect.

[0069] By employing the above technical solution, the text classification method and apparatus based on intelligent marketing scenarios provided by this invention address the issue that while BERT, as a classification model, inherently possesses a self-attention mechanism and can effectively focus on valid features, its accuracy in classifying conversational texts containing numerous colloquial words generated in intelligent marketing scenarios remains low. Therefore, this invention acquires the text from the intelligent marketing scenario; places the text into a preset classification model for text classification, the preset classification model including at least feature extraction and feature calculation functions; uses the feature extraction function of the preset classification model to obtain basic features; uses the feature calculation function of the preset classification model based on the basic features to obtain target features, the target features being discriminative features; and performs text classification based on the target features. This invention, through the construction of a preset classification model including feature extraction and feature calculation functions, can improve the accuracy of text classification in intelligent marketing scenarios, thereby improving the accuracy of discriminating user intent in intelligent marketing scenarios.

[0070] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0071] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0072] Figure 1 A flowchart of a text classification method based on an intelligent marketing scenario provided by an embodiment of the present invention is shown;

[0073] Figure 2 A flowchart of another text classification method based on an intelligent marketing scenario provided by an embodiment of the present invention is shown;

[0074] Figure 3 This diagram illustrates the composition of a text classification device based on an intelligent marketing scenario, as provided in an embodiment of the present invention.

[0075] Figure 4 This invention provides a block diagram illustrating another text classification device based on an intelligent marketing scenario.

[0076] Figure 5A schematic diagram of the structure of the preset classification model provided in an embodiment of the present invention is shown. Detailed Implementation

[0077] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0078] Currently, while BERT, as a classification model, incorporates a self-attention mechanism that effectively focuses on relevant features, its accuracy in classifying conversational texts containing a lot of colloquial vocabulary generated in intelligent marketing scenarios remains low. To address this issue, the inventors devised a classification model that combines the BERT model with the FP-NET network structure. This model possesses both feature extraction and feature computation capabilities. Feature extraction extracts basic features from the raw data, and feature computation yields discriminative features. Classifying text based on these discriminative features improves the accuracy of text classification in intelligent marketing scenarios, thereby enhancing the accuracy of user intent identification within these scenarios.

[0079] To address this, this invention provides a text classification method based on intelligent marketing scenarios. This method improves the accuracy of text classification in intelligent marketing scenarios, thereby increasing the accuracy of identifying user intent within those scenarios. The specific execution steps are as follows: Figure 1 As shown, it includes:

[0080] 101. Obtain the text of intelligent marketing scenarios.

[0081] In intelligent marketing scenarios, robots communicate and converse with humans, and the ASR system converts the communication and dialogue content of intelligent marketing scenarios into text of intelligent marketing scenarios, thereby obtaining the text of intelligent marketing scenarios.

[0082] 102. Classify the text in the intelligent marketing scenario by putting it into the preset classification model.

[0083] The preset classification model includes at least feature extraction and feature calculation functions; the feature extraction function can be implemented by the TextCNN feature extractor or the BERT feature extractor; the feature calculation function can be implemented by the FP-Net network structure through the feature projection method, and this embodiment does not make specific limitations.

[0084] 103. Use the feature extraction function of the preset classification model to obtain basic features.

[0085] As can be seen from step 102, the feature extraction function can be implemented by the TextCNN feature extractor or the BERT feature extractor. The TextCNN feature extractor or the BERT feature extractor with a preset classification model extracts features from the text of the intelligent marketing scenario. These features are defined as basic features.

[0086] 104. Obtain target features based on basic features using the feature calculation function of a preset classification model.

[0087] As can be seen from step 102, the feature calculation function can be implemented by the FP-Net network structure through the feature projection method. The target feature is a discriminative feature calculated from the basic features by the FP-Net network structure of the preset classification model through the feature projection method.

[0088] 105. Classify the text based on the target features.

[0089] As indicated in step 104, the target feature is a discriminative feature; for example, disliking product A, hating product A, etc., but this embodiment does not impose specific limitations. The text in the intelligent marketing scenario is then classified based on the target feature.

[0090] Based on the above Figure 1 As can be seen from the implementation of the embodiments, this invention provides a text classification method based on intelligent marketing scenarios. While BERT, as a classification model, incorporates a self-attention mechanism and can effectively focus on valid features, its accuracy in classifying conversational texts containing a large amount of colloquial vocabulary generated in intelligent marketing scenarios is relatively low. Therefore, this invention acquires the text of the intelligent marketing scenario; places the text into a preset classification model for text classification, the preset classification model including at least feature extraction and feature calculation functions; uses the feature extraction function of the preset classification model to obtain basic features; uses the feature calculation function of the preset classification model based on the basic features to obtain target features, the target features being discriminative features; and performs text classification based on the target features. This invention, by constructing a preset classification model including feature extraction and feature calculation functions, can improve the accuracy of text classification in intelligent marketing scenarios, thereby improving the accuracy of identifying user intent in intelligent marketing scenarios.

[0091] Furthermore, as a response to Figure 1Further refinement and extension of the illustrated embodiments, this invention also provides another text classification method based on intelligent marketing scenarios, such as... Figure 2 As shown, the specific steps are as follows:

[0092] 201. Construct a pre-defined classification model based on the BERT feature extractor and the FP-NET network structure.

[0093] like Figure 5 As shown, a preset classification model is constructed based on the BERT feature extractor and the FP-NET network structure. The model includes a text embedding layer for intelligent marketing scenarios, BERT feature extractor 1, BERT feature extractor 2, OPL layer, GRL layer, classifier 1, and classifier 2.

[0094] The text embedding layer of the intelligent marketing scenario is used to put the obtained text of the intelligent marketing scenario into the preset classification model; the BERT feature extractor 1 and the BERT feature extractor 2 respectively extract basic features from the text of the intelligent marketing scenario in the text embedding layer of the intelligent marketing scenario, and respectively provide the extracted basic features to the GRL layer and the OPL layer.

[0095] The GRL (gradient reverse layer) processes the basic features by keeping the gradient unchanged during forward propagation and reversing its direction during backward propagation. The features obtained after processing the basic features by the GRL layer are unimportant features (common features), i.e., undiscriminative features, denoted by f. c This indicates that the indistinguishable feature f will be used in the final expression. c The output is fed into classifier 2 for classification processing. Since the classification is of unimportant features, it has no practical significance for text classification in intelligent marketing scenarios. The classification processing method is not specifically limited in this embodiment.

[0096] The OPL (Orthogonal Projection Layer) processes the basic features by obtaining the projection features through formulas (1) and (2), where, For projection features, f p For the distinctive features after processing by the OPL layer, f c It is an indistinguishable feature; according to f p and The target features are obtained through formula (3). That is, features with discriminative power; then the target features calculated by the OPL layer. The output is sent to classifier 1, which is based on the target features. The classification result Y is obtained by performing classification prediction using formula (4). OPL .

[0097] Formula (1): f p* =Proj(f p f c ),

[0098] Formula (2):

[0099] Formula (3):

[0100] Formula (4):

[0101] 202. Train the preset classification model using the preset training set, preset test set, and preset validation set to obtain the target parameters of the preset classification model.

[0102] The preset training set, preset test set, and preset validation set are obtained by allocating labeled data according to a preset ratio, which can be 8:1:1, but this embodiment does not specify a particular ratio. The labeled data is obtained by classifying and labeling the target raw data according to preset labeling categories. The preset labeling categories include at least strong affirmative intent, weak affirmative intent, processed intent, busy status intent, telephone assistant intent, explicit rejection intent, and user abusive intent. The target raw data is obtained by deleting preset words from the raw data. The preset words are meaningless words, such as "hello," "where," etc., and this embodiment does not specify a particular word. The raw data is the dialogue text of a preset intelligent marketing scenario. The preset intelligent marketing scenario can be a product marketing scenario, a service marketing scenario, etc., and this embodiment does not specify a particular scenario.

[0103] Furthermore, the step of training the preset classification model based on a preset training set, a preset test set, and a preset validation set to obtain the target parameters of the preset classification model includes:

[0104] The system monitors whether the number of steps in training the preset classification model based on the preset training set has reached a preset number of steps. The preset number of steps can be 100 steps or 200 steps, and this embodiment does not specify a particular number. When the number of steps in training the preset classification model based on the preset training set reaches the preset number of steps, the classification result of the preset classification model is verified based on the preset validation set to obtain a verification result. When the number of steps in training the preset classification model based on the preset training set has not reached the preset number of steps, the system continues to train the preset classification model based on the preset training set until the number of steps reaches the preset number of steps.

[0105] Further, it is determined whether the test result reaches the preset condition. The preset condition can be that the classification prediction accuracy of the preset classification model based on the validation set tends to be stable. Stability can be represented by a preset threshold, such as 95%, 98%, etc. This embodiment does not make specific limitations.

[0106] If the test result reaches a preset condition, training of the preset classification model is stopped, and the preset classification model is tested based on the preset test set to calculate its accuracy and recall. It is then determined whether the accuracy and recall meet a preset condition, which can be a preset threshold, such as 90% or 95%, etc., which is not specifically limited in this embodiment. If the accuracy and recall meet the preset condition, the parameters obtained from the above training of the preset classification model are determined as the target parameters. The preset classification model with the target parameters can be deployed online for text classification in intelligent marketing scenarios. If the test result does not meet the preset condition, training of the preset classification model continues until the test result meets the preset condition.

[0107] 203. Obtain the text of intelligent marketing scenarios.

[0108] This step combines the description of step 101 in the above method, and the same content will not be repeated here.

[0109] For example:

[0110] The text obtained from a financial product marketing scenario could include something like: "Robot: Hello, this is AA Asset Management Center. Our company mainly helps clients configure fixed-income wealth management products. Client A (ID: 123456): No thanks!"

[0111] The content could include: "Robot: Hello, this is AA Asset Management Center. Our company mainly provides fixed-income wealth management products for our clients. Client B (ID: 123457): What types are available? Robot: We currently have a short-term wealth management product with an annualized return of 12% and a one-year term. Are you interested? Client B (ID: 123457): Could you please provide more details? I'm very interested."

[0112] 204. Classify the text in the intelligent marketing scenario by putting it into the preset classification model.

[0113] This step combines the description of step 102 in the above method, and the same content will not be repeated here.

[0114] like Figure 5The preset classification model shown includes at least a feature extractor, an orthogonal projection layer, and a gradient inversion layer. As indicated in step 202, the preset classification model also includes a text embedding layer for intelligent marketing scenarios. The text of the intelligent marketing scenario obtained in step 203 is placed into the text embedding layer of the preset classification model for subsequent text classification.

[0115] 205. Use the feature extraction function of the preset classification model to obtain basic features.

[0116] This step combines the description of step 103 in the above method, and the same content will not be repeated here.

[0117] The feature extraction function is implemented by a feature extractor; the feature extractor of the preset classification model obtains basic features from the preprocessed data. The feature extractor is the BERT feature extractor.

[0118] For example:

[0119] Assume the text embedded in the text embedding layer of the intelligent marketing scenario in the preset classification model is: "Robot: Hello, this is AA Asset Management Center. Our company mainly configures fixed-income wealth management products for clients. Client A (ID: 123456): No need!"; Figure 5 The BERT feature extractor 1 and BERT feature extractor 2 of the preset classification model shown above perform basic feature extraction on the text of the intelligent marketing scenario. The extracted features can be "AA Asset Management Center", "Fixed Income Financial Products", "Customer A (ID: 123456)" and "Not Used".

[0120] 206. Obtain target features based on basic features using the feature calculation function of a preset classification model.

[0121] This step combines the description of step 104 in the above method, and the same content will not be repeated here.

[0122] The target feature is a discriminative feature; the feature calculation function is jointly implemented by the orthogonal projection layer and the gradient inversion layer.

[0123] First, based on the basic features, the gradient inversion layer of the preset classification model is used to calculate the indistinguishable features. For the specific calculation method, see step 202. Then, based on the basic features and the indistinguishable features, the orthogonal projection layer of the preset classification model is used to calculate the target features. For the specific calculation method, see step 202.

[0124] Furthermore, the orthogonal projection layer has the functions of acquiring discriminative features and acquiring target features; the step of calculating the target features using the orthogonal projection layer of the preset classification model based on the basic features and the non-discriminative features includes: obtaining the discriminative features based on the basic features using the function of acquiring discriminative features of the orthogonal projection layer, and the specific calculation method is described in step 202; obtaining the target features based on the discriminative features and the non-discriminative features using the function of acquiring target features of the orthogonal projection layer, and the specific calculation method is described in step 202.

[0125] 207. Classify the text based on the target features.

[0126] This step combines the description of step 105 in the above method, and the same content will not be repeated here.

[0127] Based on target characteristics, customer feedback regarding a specific product in the intelligent marketing scenario can be categorized according to different levels of intent. These categories include strong intent customers, weak intent customers, customers whose requests have been processed, busy customers, telephone assistant customers, customers who have explicitly rejected the product, and abusive customers. Based on the categorized text, customers with similar levels of intent regarding a specific product can be identified, and targeted marketing strategies can be pushed to them. For example, information related to product A can be pushed to customers with strong intent regarding product A.

[0128] Based on the above Figure 2 As can be seen from the implementation method, the present invention provides a text classification method based on intelligent marketing scenarios. By performing feature processing on the text of intelligent marketing scenarios according to the BERT feature extractor, OPL layer and GRL layer, discriminative features are obtained. Then, the text of intelligent marketing scenarios is classified based on the discriminative features. This can avoid interference from unimportant features and improve the accuracy of text classification by 3%-5%, thereby improving the accuracy of judging user intent in intelligent marketing scenarios.

[0129] Furthermore, as a response to the above Figure 1 In addition to the implementation of the method shown, this embodiment of the invention also provides a text classification device based on intelligent marketing scenarios, used for classifying the above-mentioned text. Figure 1 The method shown is implemented accordingly. This device embodiment corresponds to the foregoing method embodiment. For ease of reading, this device embodiment will not repeat the details of the foregoing method embodiment, but it should be clear that the device in this embodiment can implement all the contents of the foregoing method embodiment. Figure 3 As shown, the device includes:

[0130] The first acquisition unit 31 is used to acquire the text of the intelligent marketing scenario;

[0131] The text to be placed into the intelligent marketing scenario obtained from the first acquisition unit 31 is placed into a preset classification model for text classification. The preset classification model includes at least feature extraction and feature calculation functions.

[0132] The second acquisition unit 33 is used to acquire basic features using the feature extraction function of the preset classification model obtained from the input unit 32;

[0133] The third acquisition unit 34 is used to acquire target features based on the basic features obtained from the second acquisition unit 33 using the feature calculation function of the preset classification model, wherein the target features are features with discriminative power.

[0134] The classification unit 35 is used to classify text based on the target features obtained from the third acquisition unit 34.

[0135] Furthermore, as a response to the above Figure 2 In addition to the implementation of the method shown, this embodiment of the invention also provides another text classification device based on intelligent marketing scenarios, used for the above-mentioned... Figure 2 The method shown is implemented accordingly. This device embodiment corresponds to the foregoing method embodiment. For ease of reading, this device embodiment will not repeat the details of the foregoing method embodiment, but it should be clear that the device in this embodiment can implement all the contents of the foregoing method embodiment. Figure 4 As shown, the device includes:

[0136] The fourth acquisition unit 38 is used to acquire raw data, which is the dialogue text of a preset intelligent marketing scenario;

[0137] Deletion unit 39 is used to delete preset words from the original data obtained from the fourth acquisition unit 38 to obtain target original data, wherein the preset words are meaningless words;

[0138] The annotation unit 40 is used to classify and annotate the target raw data obtained from the deletion unit 39 according to a preset annotation category to obtain annotated data. The preset annotation category includes at least strong affirmative intent, weak affirmative intent, processed intent, busy status intent, telephone assistant intent, explicit rejection intent, and user abusive intent.

[0139] The allocation unit 41 is used to allocate the annotation data obtained from the annotation unit 40 into a preset training set, a preset test set, and a preset validation set according to a preset ratio.

[0140] Construction unit 36 ​​is used to construct the preset classification model based on the BERT feature extractor and FP-NET network structure;

[0141] Training unit 37 is used to train the preset classification model obtained from construction unit 36 ​​based on the preset training set, preset test set and preset verification set obtained from the allocation unit 41, so as to obtain the target parameters of the preset classification model.

[0142] The first acquisition unit 31 is used to acquire the text of the intelligent marketing scenario;

[0143] The text to be placed into the intelligent marketing scenario obtained from the first acquisition unit 31 is placed into a preset classification model for text classification. The preset classification model includes at least feature extraction and feature calculation functions.

[0144] The second acquisition unit 33 is used to acquire basic features by utilizing the feature extraction function of the preset classification model obtained from the training unit 37 and obtained from the input unit 32;

[0145] The third acquisition unit 34 is used to acquire target features based on the basic features obtained from the second acquisition unit 33 using the feature calculation function of the preset classification model, wherein the target features are features with discriminative power.

[0146] The classification unit 35 is used to classify text based on the target features obtained from the third acquisition unit 34.

[0147] Furthermore, the preset classification model includes at least a feature extractor, an orthogonal projection layer, and a gradient inversion layer; the second acquisition unit 33 includes:

[0148] It is also used to obtain basic features from the preprocessed data using the feature extractor of the preset classification model.

[0149] Furthermore, the third acquisition unit 34 includes:

[0150] The first calculation module 341 is used to calculate the undiscriminating features based on the basic features using the gradient inversion layer of the preset classification model;

[0151] The second calculation module 342 is used to calculate the target features based on the basic features and the indistinguishable features obtained from the first calculation module 341 using the orthogonal projection layer of the preset classification model.

[0152] Furthermore, the orthogonal projection layer has the functions of acquiring discriminative features and acquiring target features; the second calculation module 342 includes:

[0153] The first acquisition submodule 3421 is used to obtain the distinguishable features based on the basic features using the function of the orthogonal projection layer to obtain distinguishable features;

[0154] The second acquisition submodule 3422 is used to obtain the target feature based on the distinguishable feature and the non-distinguishing feature obtained from the first acquisition submodule 3421 using the target feature acquisition function of the orthogonal projection layer.

[0155] Furthermore, the training unit 37 includes:

[0156] Monitoring module 371 is used to monitor whether the number of steps in training the preset classification model based on the preset training set has reached the preset number of steps.

[0157] The verification module 372 is used to verify the classification result of the preset classification model based on the preset verification set when the number of steps of training the preset classification model based on the preset training set, as obtained from the monitoring module 371, reaches the preset number of steps, and obtain the verification result.

[0158] The first judgment module 373 is used to determine whether the inspection result obtained from the inspection module 372 meets the preset conditions;

[0159] The testing module 374 is used to stop training the preset classification model if the test result obtained from the first judgment module 373 reaches the preset condition, and to test the preset classification model based on the preset test set, and calculate the accuracy and recall of the preset classification model.

[0160] The second judgment module 375 is used to determine whether the accuracy and recall obtained from the test module 374 meet the preset conditions.

[0161] The determination module 376 is used to determine the parameters obtained by training the preset classification model as the target parameters if the accuracy and recall obtained from the second judgment module 375 meet the preset conditions.

[0162] Furthermore, embodiments of the present invention also provide a processor for running a program, wherein the program executes the above-described... Figure 1-2 The text classification method based on intelligent marketing scenarios described in the article.

[0163] Furthermore, embodiments of the present invention also provide a storage medium for storing a computer program, wherein the computer program, when running, controls the device where the storage medium is located to execute the above-described... Figure 1-2 The text classification method based on intelligent marketing scenarios described in the article.

[0164] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0165] It is understood that the relevant features in the above methods and apparatus can be referenced interchangeably. Furthermore, the terms "first," "second," etc., in the above embodiments are used to distinguish between embodiments and do not represent the superiority or inferiority of any particular embodiment.

[0166] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0167] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of the invention.

[0168] In addition, the memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0169] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied 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.

[0170] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0171] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0172] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0173] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0174] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0175] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0176] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0177] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied 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.

[0178] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A text classification method based on intelligent marketing scenarios, characterized in that, The method includes: Obtain the text of the intelligent marketing scenario; The text of the intelligent marketing scenario is placed into a preset classification model for text classification. The preset classification model includes at least feature extraction and feature calculation functions, and includes at least a feature extractor, an orthogonal projection layer, and a gradient inversion layer. Basic features are obtained using the feature extraction function of the preset classification model; Based on the aforementioned basic features, the target features are obtained using the feature calculation function of the preset classification model, wherein the target features are features with discriminative power. Text classification is performed based on the target features; The step of obtaining basic features using the feature extraction function of the preset classification model includes: Basic features are obtained from preprocessed data using the feature extractor of the preset classification model; The step of obtaining target features based on the basic features using the feature calculation function of the preset classification model includes: Based on the basic features, the gradient inversion layer of the preset classification model is used to calculate the non-discriminative features, wherein the gradient remains unchanged during forward propagation and the direction is opposite to the direction before passing through the gradient inversion layer during backward propagation. The target features are calculated using the orthogonal projection layer of the preset classification model based on the basic features and the indistinguishable features. The orthogonal projection layer processes the basic features in the following way: according to and Obtain target features ,in, , For projection features, These are the distinctive features after processing by the orthogonal projection layer. These are features that are not distinctive.

2. The method according to claim 1, characterized in that, The orthogonal projection layer has the functions of acquiring discriminative features and acquiring target features; The step of calculating the target features based on the basic features and the non-discriminating features using the orthogonal projection layer of the preset classification model includes: Based on the aforementioned basic features, the discriminative features are obtained using the discriminative feature acquisition function of the orthogonal projection layer; The target features are obtained using the orthogonal projection layer's function of acquiring target features based on the distinguishable features and the non-distinguishing features.

3. The method according to any one of claims 1-2, characterized in that, The method further includes: The preset classification model is constructed based on the BERT feature extractor and the FP-NET network structure; The preset classification model is trained using a preset training set, a preset test set, and a preset validation set to obtain the target parameters of the preset classification model.

4. The method according to claim 3, characterized in that, Before training the preset classification model based on a preset training set, a preset test set, and a preset validation set to obtain the target parameters of the preset classification model, the method further includes: Obtain raw data, which is the dialogue text of a preset intelligent marketing scenario; The target original data is obtained by deleting preset words from the original data, where the preset words are meaningless words; The target raw data is classified and labeled according to the preset labeling categories to obtain labeled data. The preset labeling categories include at least strong affirmative intent, weak affirmative intent, processed intent, busy status intent, telephone assistant intent, explicit rejection intent, and user abusive intent. The labeled data is allocated into a preset training set, a preset test set, and a preset validation set according to a preset ratio.

5. The method according to claim 4, characterized in that, The step of training the preset classification model based on a preset training set, a preset test set, and a preset validation set to obtain the target parameters of the preset classification model includes: Monitor whether the number of steps to train the preset classification model based on the preset training set has reached the preset number of steps; When the number of steps for training the preset classification model based on the preset training set reaches the preset number of steps, the classification result of the preset classification model is verified based on the preset verification set to obtain the verification result; Determine whether the test result meets the preset conditions; If the test result reaches the preset condition, then the training of the preset classification model is stopped, and the preset classification model is tested based on the preset test set to calculate the accuracy and recall of the preset classification model. Determine whether the accuracy and recall rates meet preset conditions; If the accuracy and recall meet the preset conditions, the parameters obtained by training the preset classification model will be determined as the target parameters.

6. A text classification device for intelligent marketing scenarios, characterized in that, include: The first acquisition unit is used to acquire the text of the intelligent marketing scenario; The input unit is used to input the text of the intelligent marketing scenario into a preset classification model for text classification. The preset classification model includes at least feature extraction function and feature calculation function, and includes at least a feature extractor, an orthogonal projection layer and a gradient inversion layer. The second acquisition unit is used to acquire basic features using the feature extraction function of the preset classification model; The third acquisition unit is used to acquire target features based on the basic features using the feature calculation function of the preset classification model, wherein the target features are features with discriminative power. A classification unit is used to classify text based on the target features; The second acquisition unit is specifically used to acquire basic features from the preprocessed data using the feature extractor of the preset classification model; The third acquisition unit is specifically used to calculate the indistinguishable features based on the basic features using the gradient reversal layer of the preset classification model. The gradient remains unchanged during forward propagation and is opposite to the direction before passing through the gradient reversal layer during backward propagation. The target features are calculated based on the basic features and the indistinguishable features using the orthogonal projection layer of the preset classification model. The orthogonal projection layer processes the basic features in the following way: according to and Obtain target features ,in, , For projection features, These are the distinctive features after processing by the orthogonal projection layer. These are features that are not distinctive.

7. A storage medium comprising a stored program, characterized in that, When the program is running, it controls the device where the storage medium is located to execute the text classification method based on intelligent marketing scenarios as described in any one of claims 1 to 5.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the text classification method based on intelligent marketing scenarios as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data modeling method and system based on intelligent marketing scene

    CN114022192A

  • Emotion feature extraction method of BI-LSTM-CNN based on orthogonal projection

    CN114528407A