A multi-domain sentiment classification method and system based on knowledge transfer

Through a multi-domain emotion classification method based on knowledge transfer, the global knowledge base is used to correct the target domain text data and federal learning transmission, which solves the sample selectivity bias and data privacy problems in multi-domain emotion classification, and achieves efficient and secure Emotional classification prediction.

CN118606480BActive Publication Date: 2024-11-05ZHEJIANG LAB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411084396.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-11-05
Estimated Expiration
2044-08-08

AI Technical Summary

Technical Problem

The existing emotion classification model performs poorly when applied in multiple fields, with sample selectivity bias, domain common emotions and domain specific emotions problems, and data privacy and security are difficult to guarantee.

Method used

Using a multi-domain emotion classification method based on knowledge transfer, the target domain text data is corrected through a multi-domain dictionary in the global knowledge base, and using federated learning to transmit and store word-level emotional knowledge, build a robust emotion classification model to ensure data privacy Sex and safety.

Benefits of technology

It improves the accuracy and security of multi-field emotion classification, reduces model complexity and training costs, realizes efficient emotion classification prediction, and ensures data privacy and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606480B_ABST
    Figure CN118606480B_ABST
Patent Text Reader

Abstract

The present invention provides a multi-domain sentiment classification method and system based on knowledge transfer. The present invention mines prior frequencies from each domain as domain knowledge, and saves the mined knowledge in a knowledge base based on a local dictionary, and then uses the knowledge stored in the knowledge base to correct the model parameters of the target domain, and finally obtains the sentiment classification prediction results for the target domain based on the correction results using the trained sentiment classifier model. The present invention fully considers the common sentiment knowledge contained in multi-domain comment data, and uses the knowledge of other domains to assist the classification task of the target domain in a federated learning manner, thereby improving the sentiment classification performance of the target domain, avoiding the access and use of the original data of the domain, and can effectively deal with problems such as sample selection bias, domain sentiment specificity, and data privacy, ensuring the privacy and security of data in various fields, and has the advantages of low complexity, high efficiency, high accuracy, strong security, and strong feasibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of text sentiment analysis, opinion mining and machine learning, and in particular to a multi-domain sentiment classification method and system based on knowledge transfer. Background Art

[0002] Sentiment analysis or opinion mining is a natural language processing technique used to determine the emotional tendencies or opinions expressed in text. These techniques can help analyze the emotions and opinions expressed by people in texts such as social media, product reviews, and news articles. They can help companies understand user satisfaction with products or services, monitor brand reputation, discover market trends, or be used for sentiment-driven recommendation systems.

[0003] Sentiment classification is one of the main tasks in the field of sentiment analysis, which divides text reviews into sentiment categories such as positive, negative or neutral. This classification can be based on word sentiment polarity, such as identifying positive words (such as "like", "satisfied") and negative words (such as "hate", "disappointed"), or using machine learning methods to train classifiers for classification. Sentiment classification models include methods based on sentiment dictionaries, Naïve Bayes, Support Vector Machines (SVM), Topic Models, and deep learning. Traditional sentiment classification models are usually trained on specific fields or data sets, so the model performance is often poor when applied to other fields. This is due to the problem of sample selection bias, which causes the training data in each field to not fully reflect the overall distribution of the entire field. This problem is more serious when the training data is relatively small. For example, the word "beautiful" expresses positive emotions, but in the training data of a specific field, it only appears once and appears in negative comments. Because in a negative comment, the reviewer may still have positive emotions about some aspects of the product. In addition, positive or negative sentiment words in a certain field may not appear in the training data, but appear in the test data of the field. In these cases, knowledge from other fields may be helpful. This is because many sentiment words express the same sentiment in different fields, which is called domain-common sentiment. However, some sentiment words show specific sentiment polarity in certain fields, which is called domain-specific sentiment. For example, the word "sharp" has a positive sentiment in the field of knives, but a negative sentiment in the field of computer cases.

[0004] Multi-domain sentiment classification refers to the task of classifying the sentiment of text in multiple domains or industries. Multi-domain sentiment classification aims to develop a sentiment classification model that can work effectively in multiple domains by leveraging domain common knowledge. However, multi-domain sentiment classification is a challenging task because there may be large differences in text features and sentiment distribution between different domains. Therefore, suitable domain adaptation methods and large-scale multi-domain datasets are needed to train robust sentiment classification models. In addition, data privacy and data security issues make the multi-domain sentiment classification task even more challenging. Summary of the invention

[0005] The purpose of the present invention is to provide a multi-domain sentiment classification method and system based on knowledge transfer, to solve the problems of sample selection bias, domain common sentiment, domain specific sentiment, data privacy and data security, and to improve the accuracy and security of multi-domain sentiment classification.

[0006] The technical solution of the present invention is as follows:

[0007] A multi-domain sentiment classification method based on knowledge transfer, including:

[0008] Obtain the text review corpus data to be classified in the target domain, and count the frequency of each word in the text review corpus data to be classified in the text review corpus data with positive and negative sentiment labels based on the local dictionary of the target domain in the global knowledge base;

[0009] Based on the local dictionary of other fields in the global knowledge base, the frequency of occurrence of each word in the text comment corpus data to be classified in the text comment corpus data with positive and negative sentiment labels is corrected to obtain a corrected result; wherein, if the sentiment polarity of the words in the text comment corpus data to be classified is consistent in the local dictionary of other fields, the frequency of occurrence of the corresponding words in the local dictionary of other fields in the text comment corpus data with positive and negative sentiment labels is used for weight correction; if the words in the text comment corpus data to be classified have a ratio of the positive class probability to the negative class probability and a ratio of the negative class probability in the target field, and the positive class probability is greater than or equal to the first threshold, the corresponding word is not corrected; if the sentiment polarity of the words of the text comment corpus data to be classified in the local dictionary of other fields is inconsistent or the ratio of the positive class probability to the negative class probability and the ratio of the negative class probability to the positive class probability of the words of the text comment corpus data to be classified in the target field is less than the first threshold, then the frequency of the corresponding words in the local dictionary of other fields in the text comment corpus data with positive and negative sentiment labeling labels and the frequency of the corresponding words in the text comment corpus data with positive and negative sentiment labeling labels in the target field are added as the correction result;

[0010] Based on the correction results, the trained sentiment classifier model is used to obtain sentiment classification prediction results;

[0011] The global knowledge base includes local dictionaries of several fields, and the local dictionaries include each word in the text comment corpus data of the corresponding field, and the frequency data of each word appearing in the text comment corpus data with positive and negative sentiment annotation labels;

[0012] The sentiment classifier model is obtained by training with a training data set collected from a target domain; the training data set in the target domain includes a text review corpus of the corresponding domain and corresponding sentiment annotation tags and a local dictionary.

[0013] Domain-local dictionary construction and word-level sentiment knowledge mining methods have the advantages of simplicity, efficiency and strong versatility.

[0014] Furthermore, the sentiment polarity of the words in the text review corpus data to be classified in the local dictionary of other fields is determined by the following method:

[0015] If the words of the text review corpus data to be classified are at least If the ratio of the positive class probability to the negative class probability and the ratio of the negative class probability to the positive class probability in other fields (third threshold) are greater than or equal to the second threshold, it is considered that the sentiment polarity of the words in the local dictionary of the other fields is consistent.

[0016] Furthermore, the weight of the weight correction is: the ratio of the number of times the words of the text comment corpus data to be classified appear in other fields where the ratio of the positive class probability to the negative class probability is greater than or equal to the second threshold to the number of times the words of the text comment corpus data to be classified appear in other fields where the ratio of the positive class probability to the negative class probability is greater than or equal to the second threshold and the sum of the number of times the words of the text comment corpus data to be classified appear in other fields where the ratio of the negative class probability to the positive class probability is greater than or equal to the second threshold.

[0017] Furthermore, the text comment corpus data to be classified is obtained by preprocessing the collected text comment data, and the preprocessing methods include case conversion, punctuation removal, stop word removal, common word removal, rare word removal, spelling proofreading, word segmentation, stem extraction and part-of-speech restoration methods.

[0018] Furthermore, a method for sentiment annotation of a text comment corpus: the sentiment polarity (positive / negative) of each comment is annotated to obtain a sentiment label; preferably, the method for sentiment annotation of a text comment corpus includes manual annotation based on user recommendation scoring or crowdsourcing.

[0019] Furthermore, the local dictionary only includes words whose frequency of occurrence in the text comment corpus data with positive and negative sentiment labels is greater than a fourth threshold (frequency threshold). Preferably, the frequency of occurrence of each word in the dictionary in the positive and negative training data is counted from each field, and the knowledge below the threshold is filtered out by introducing a frequency threshold, i.e., a fourth threshold (e.g., 5 times), so as to alleviate the problem of knowledge noise and field-specific sentiment.

[0020] Furthermore, the global knowledge base uses key-value pair indexing for data storage, where the index value of the field is the sequential number for storing data into the global knowledge base. Based on federated learning, the word-level sentiment knowledge of each field is transmitted to the global server without the need to know the real field information, thus ensuring the privacy and security of the data; the indexing technology is used to perform key-value indexing on each field, and the word-level sentiment knowledge of each field is further indexed based on the field index value to obtain the global knowledge base.

[0021] Furthermore, the sentiment classifier model adopts a naive Bayes probability model, a support vector machine, a topic model, a convolutional neural network or a recurrent neural network, etc.

[0022] A multi-domain sentiment classification system based on knowledge transfer is used to implement the multi-domain sentiment classification method based on knowledge transfer; the system includes a data preprocessing module, a knowledge mining module, a knowledge base module, a knowledge transfer module and a sentiment classification module; wherein the data preprocessing module is used to preprocess the collected text comment data to obtain text comment corpus data; the knowledge mining module is used to build a local dictionary and count the frequency of each word appearing in the text comment corpus data with positive and negative sentiment annotation labels; the knowledge base module is used to receive local dictionaries in various fields and store them in a global knowledge base; the knowledge transfer module is used to transfer the knowledge in the global knowledge base to a target domain client; the sentiment classification module is used to correct the frequency of each word appearing in the text comment corpus data to be classified in the text comment corpus data with positive and negative sentiment annotation labels based on local dictionaries in other fields of the global knowledge base to obtain a corrected result; based on the corrected result, a trained sentiment classifier model is used to obtain a sentiment classification prediction result.

[0023] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the multi-domain sentiment classification method based on knowledge transfer when executing the computer program.

[0024] A storage medium containing computer executable instructions, which, when executed by a computer processor, can implement a multi-domain sentiment classification method based on knowledge transfer.

[0025] The method and system provided in the example of the present invention have the advantages of low complexity, high efficiency, high accuracy, strong security and strong feasibility as a whole; the specific technical effects include: the sentiment classifier modeling method has the advantages of low complexity and strong adaptability; the sentiment classification model training and tuning method makes full use of the common sentiment knowledge in the field and can ensure the privacy of the data, and has the advantages of small error, high accuracy and strong security; the sentiment classifier model deployment method has the advantages of low complexity and strong feasibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] A more complete understanding of exemplary embodiments of the present invention may be obtained by referring to the following drawings:

[0027] Figure 1 A flowchart of a multi-domain sentiment classification method based on knowledge transfer provided in an embodiment of the present invention;

[0028] Figure 2 A schematic diagram of a multi-domain knowledge federation migration mechanism provided in an embodiment of the present invention;

[0029] Figure 3 An example diagram of the deployment of a target domain-oriented sentiment classification algorithm provided in an embodiment of the present invention;

[0030] Figure 4 A structural diagram of a multi-domain sentiment classification system based on knowledge transfer provided in an embodiment of the present invention;

[0031] Figure 5 This is an architecture diagram of a multi-domain sentiment classification system based on knowledge transfer provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0032] The technical solution of the present invention is described in detail below through the accompanying drawings and specific embodiments; at the same time, it should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations of the technical solution of the present invention. Based on the embodiments of the present invention, other embodiments obtained by those skilled in the art without making creative work are all within the scope of protection of the present invention.

[0033] It should be noted that the terms used in the description of the embodiments of the present invention are only for describing specific implementations and are not intended to limit the implementations of the embodiments of the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.

[0034] The present invention provides a multi-domain sentiment classification method based on knowledge transfer. The present invention fully considers the common sentiment knowledge contained in multi-domain comment data, and uses the knowledge of other fields to help the classification task of the target field in the form of federated learning, thereby improving the sentiment classification performance of the target field, avoiding the access and use of the original data of the field, and can effectively deal with problems such as sample selection bias, field sentiment specificity, and data privacy, and ensure the privacy and security of data in various fields. It has the advantages of low complexity, high efficiency, high accuracy, strong security, and strong feasibility. It includes the following steps:

[0035] Step 1: Obtain the text review corpus data to be classified in the target domain, and count the frequency of each word in the text review corpus data to be classified in the text review corpus data with positive and negative sentiment labels based on the local dictionary of the target domain in the global knowledge base;

[0036] Step 2: Based on the local dictionary of other fields in the global knowledge base, the frequency of each word in the text comment corpus data to be classified in the text comment corpus data with positive and negative sentiment labels is corrected to obtain the corrected result; wherein, if the sentiment polarity of the words in the text comment corpus data to be classified is consistent in the local dictionary of other fields, the frequency of the corresponding words in the local dictionary of other fields in the text comment corpus data with positive and negative sentiment labels is used for weight correction; if the ratio of the probability of the words in the text comment corpus data to be classified in the target field is the ratio of the probability of the positive class to the probability of the negative class and the ratio of the probability of the words in the negative class If the ratio of the probability of the negative class to the probability of the positive class is greater than or equal to the first threshold, the corresponding word is not corrected; if the sentiment polarity of the words of the text comment corpus data to be classified in the local dictionary of other fields is inconsistent or the ratio of the positive class probability to the negative class probability and the ratio of the negative class probability to the positive class probability of the words of the text comment corpus data to be classified in the target field is less than the first threshold, then the frequency of the corresponding words in the local dictionary of other fields in the text comment corpus data with positive and negative sentiment annotation labels and the frequency of the corresponding words in the text comment corpus data with positive and negative sentiment annotation labels in the target field are added as the correction result;

[0037] Step 3: Based on the correction results, use the trained sentiment classifier model to obtain the sentiment classification prediction results.

[0038] The global knowledge base includes local dictionaries of several fields, and the local dictionaries include each word in the text comment corpus data of the corresponding field, and the frequency data of each word appearing in the text comment corpus data with positive and negative sentiment annotation labels;

[0039] The sentiment classifier model is obtained by training with a training data set collected from a target domain; the training data set in the target domain includes a text review corpus of the corresponding domain and corresponding sentiment annotation tags and a local dictionary.

[0040] To facilitate the understanding of the technical solution of the present invention, a multi-domain sentiment classification method based on knowledge transfer disclosed in an embodiment of the present invention is introduced in detail, taking the sentiment classification of multi-domain product review data of e-commerce (for example, Amazon Product Review Data) as an application scenario.

[0041] Embodiment 1:

[0042] A multi-domain sentiment classification method based on knowledge transfer, which mainly includes two parts. First, the construction of the initial global knowledge base: mining the prior frequency from each field as the domain knowledge, and saving the mined knowledge in the global knowledge base in the form of key-value pairs; second, using the global knowledge base to transfer the knowledge of sentiment classification in the target field: building and training the sentiment classifier model of the target field, obtaining the text comment corpus data to be classified in the target field, using the knowledge stored in the global knowledge base to correct the parameters of the target field, and finally using the trained sentiment classifier model based on the correction result to obtain the sentiment classification prediction result. The flowchart is as follows Figure 1 As shown, specifically including:

[0043] S101, collect text review data from multiple fields, preprocess the review corpus, and label the sentiment polarity (positive / negative) of each review to determine the training data for each field.

[0044] Optionally, in an embodiment of the present invention, review data in various fields are provided by customers, that is, e-commerce multi-field product review data; the text review corpus preprocessing methods include case conversion, punctuation removal, stop word removal, common word removal, rare word removal, spelling proofreading, word segmentation, stem extraction and part-of-speech restoration methods; the text review corpus sentiment annotation methods include manual annotation based on user recommendation scoring or crowdsourcing.

[0045] S102, constructing a local dictionary for each field based on the training data of each field, and counting the number of times each word in the dictionary appears in the positive and negative training data of the field, respectively, to form word-level knowledge of each field.

[0046] In the embodiment of the present invention, by traversing the training data of each field, a key-value pair set in an ordered or unordered form is constructed locally in each field to obtain a local dictionary of vocabulary in each field. For example:

[0047] Dictionary fragment, {1: a, 2: based on, 3: knowledge transfer, 4: of, 5: multi-domain, 6: sentiment, 7: classification, 8: method}.

[0048] Based on the local dictionary of each field, the frequency (number of times) of each word in the dictionary appearing in the text review corpus with positive and negative sentiment labels in the training data is counted from each field as the word-level sentiment knowledge of each field. Specifically, the following types of knowledge are mined from the training data of each field:

[0049] Word level knowledge: ,in, , , and Respectively represent Words In the field Zhongzheng Class ( ) Text review corpus data, namely positive documents and negative documents ( ) The text review corpus data is the number of times negative documents appear.

[0050] Optionally, in an embodiment of the present invention, a frequency threshold, i.e., a fourth threshold (e.g., 5 times) is introduced to filter out knowledge below the threshold, thereby alleviating the problems of noise knowledge and domain-specific emotions.

[0051] S103, federation transmits multi-domain knowledge to the central server, and stores each domain knowledge in the global knowledge base KB using the “key-value” pair indexing technology.

[0052] In an embodiment of the present invention, a schematic diagram of a multi-domain knowledge federation migration mechanism is shown in FIG. Figure 2 As shown; in the uplink stage, the federation transmits the multi-domain knowledge of the terminal, i.e. the local client, to the central server; in the downlink stage, the federation transmits the knowledge in the global knowledge base of the central server to the local client.

[0053] In an embodiment of the present invention, the construction of the global knowledge base KB first uses indexing technology to perform key-value indexing on each field (for example, DOMAIN_ID: DOMAIN_NAME), and further constructs an index for the word-level sentiment knowledge of each field based on the field index value (for example, WORD_ID: VALUES) to obtain the global knowledge base.

[0054] As an option, a data storage structure of the global knowledge base is as follows:

[0055] <KNOWLEDGE_DB>

[0056] DOMAIN_ID: DOMAIN_NAME

[0057] {WORD_ID: VALUES; ...} ...

[0059] < / KNOWLEDGE_DB>

[0060] The global knowledge base described in the present invention uses key-value pair indexing for data storage, wherein the value data of a domain may be a non-real domain name. For example, in combination with the mode of federally transmitting the multi-domain knowledge of the local client to the central server, the sequential numbering (e.g., 1, 2, 3...) of the storage entering the global knowledge base is adopted, which effectively protects the privacy and security of the data while effectively utilizing the data in each domain. In addition, at this time, the "domain" refers to the batch domain of the federally transmitted multi-domain knowledge of the local client to the central server, and the real domain names of different batch domains may be different or the same.

[0061] Optionally, after the initial global knowledge base is built, it continues to receive multi-domain knowledge from local clients of the federated transmission in real time for continuous updating and improvement.

[0062] S104, training the sentiment classifier using the knowledge stored in the global knowledge base and the training data of the target domain.

[0063] This embodiment is divided into two stages. Specifically, in stage one, the sentiment classifier model of the target domain is trained using the training data of the target domain to obtain a trained sentiment classifier model; in stage two, the frequency of occurrence of words in the text comment corpus data to be classified in the text comment corpus data with positive and negative sentiment labels is corrected through federated migration and integration of domain knowledge in the global knowledge base, and the sentiment classification prediction result is obtained based on the correction result using the trained sentiment classifier model. Among them, the target domain can be a domain that has been stored in the global knowledge base in advance, or it can be a new domain. At this time, the federal server also transfers the data of the new domain to the global knowledge base at the same time. Taking the second situation as an example, specifically:

[0064] Phase 1: Collect text comment corpus data in the target domain to build a local dictionary and store it in the global knowledge base; build and train a sentiment classifier model, which can adopt a naive Bayes probability model, a support vector machine, a topic model, a convolutional neural network or a recurrent neural network, etc. In an embodiment of the present invention, a sentiment classifier model for the target domain is constructed based on a naive Bayes probability model, including modeling methods of prior probability distribution, conditional probability distribution and posterior probability distribution. The naive Bayes probability model is a generative model in which each document, i.e., text comment corpus data, is assumed to be generated by a mixed multinomial distribution. In the training phase, naive Bayes models the multinomial distribution. Given a document and any word in the document , the model parameters based on the multinomial distribution are defined as follows:

[0065]

[0066] in All represent sentiment polarity categories, among which, is positive (+), is a negative class (-), is the number of all categories (in this embodiment, ), Represents the number of words in the document, i.e., the text review corpus data, is Under the conditions The probability of multinomial distribution parameters The modeling is as follows:

[0067]

[0068] in It's a word In the training data category The number of times it appears in Is a local dictionary The size of is the smoothing factor. Preferably, the smoothing factor Set to (Lidstone smoothing) or (Laplacian smoothing).

[0069] In the embodiment of the present invention, the key parameter of the naive Bayes classifier is the word frequency in the conditional probability distribution. . Category prior probability distribution , by calculating the target domain Zhongzheng Class ( ) training documents and negative classes ( ) is obtained by the ratio of the number of training documents to the total number of training documents. In addition, the word frequency of each field is mined in step S102 and stored in the global knowledge base as field knowledge in step S103.

[0070] Phase 2: Through federated migration and integration of domain knowledge in the knowledge base, the frequency of words in the text comment corpus to be classified in the text comment corpus with positive and negative sentiment labels is corrected, and the sentiment classification prediction results are obtained based on the correction results using the trained sentiment classifier model. Specifically: First, the knowledge in the global knowledge base of the federated transmission center server is sent to the local client in the target domain; then three high-level knowledge is extracted from the knowledge stored in the global knowledge base, as follows:

[0071] Knowledge Base Knowledge and :represent words respectively In the knowledge base KB, all positive classes except the target domain are ) training documents and negative classes ( ) The number of times the training document appears, defined as and ;

[0072] Target domain dependent knowledge and :Represent the target areas Chinese words The ratio of the probability of the positive class (negative class) to the probability of the negative class (positive class), that is, , ;

[0073] Non-target domain knowledge and :represent the non-target areas and The number of occurrences, is a threshold - the second threshold, which is used to adjust the reliability of knowledge.

[0074] The knowledge-based learner KBL integrates the above knowledge to correct the and . and They are the positive categories of words in the target domain ( ) training documents and negative classes ( ) The number of times the training document appears. The corrected results are recorded as and , divided into three situations:

[0075] (1) KBL should trust the knowledge in the non-target domain in the knowledge base. In this embodiment, if the sentiment polarity of a word in most (third threshold) non-target domains is consistent, then KBL should use the knowledge about this word in the database. Specifically, this embodiment defines a knowledge base reliable word set, denoted as For a word , if the 5 non-target areas (i.e. or , i.e. the third threshold) considers this word reliable, then KBL will take this word as a reliable word in the knowledge base and use weight correction. This method is similar to the voting method, and the correction result is , ,in is the voting weight, .

[0076] (2) If a word It can distinguish the categories more clearly in the target domain, while KBL uses the basic knowledge of the target domain about the word (i.e. and ), that is, no correction is made at this time. This embodiment defines a target domain dependent word set, denoted as If a word satisfy or ,in is a threshold parameter - the first threshold, then the word belongs to the set .

[0077] (3) When a word Neither belongs to the reliable word set of the knowledge base , and does not belong to the target domain dependent word set , KBL integrates the knowledge in the knowledge base and the knowledge in the target domain, and takes the sum of the frequency of the corresponding words in the local dictionary of other domains in the text comment corpus data with positive and negative sentiment labels and the frequency of the corresponding words in the text comment corpus data with positive and negative sentiment labels in the target domain as the correction result, expressed as: .

[0078] S105, applying the trained sentiment classifier to the target domain to determine the sentiment classification result of the data to be detected, as follows:

[0079] Given the text review corpus data to be classified And the target domain sentiment classification model constructed through the above steps, such as Figure 3 As mentioned above, by executing Calculate the sentiment polarity (positive or negative) of the review data to be detected.

[0080] Embodiment 2:

[0081] Figure 4 and Figure 5 They are respectively a model structure diagram and a system architecture diagram of an embodiment of the present invention. The system includes:

[0082] The data preprocessing module is used to execute the text comment corpus preprocessing algorithm; the collected text comment data is preprocessed to obtain the text comment corpus data. This module is independently calculated by the domain local client.

[0083] The knowledge mining module is used to execute the knowledge mining algorithm; complete the construction of the local dictionary, and mine the word-level knowledge of the domain from each domain based on the domain local dictionary: the frequency of each word in the text comment corpus data with positive and negative sentiment labels. This module is independently calculated by the local client.

[0084] The knowledge base module is used to execute the knowledge storage algorithm; it receives knowledge from various fields, namely the local dictionary, and stores the knowledge in the global knowledge base based on the key-value pair indexing technology. This module is completed by the global central server in collaborative calculation.

[0085] The knowledge migration module is used to execute the knowledge migration algorithm and migrate the knowledge in the global knowledge base to the target domain client. This module is completed by the collaborative calculation of the global central server and the local client.

[0086] The sentiment classification module is used to execute the sentiment classification algorithm; it uses the training data of the target domain and the knowledge in the knowledge base to train and modify the model, and deploys the model in the target domain. This module is calculated by the local client.

[0087] The above-mentioned scheme of the embodiment of the present invention is a multi-domain sentiment classification method and system based on knowledge transfer, which makes full use of the common knowledge of multi-domain review data and ensures the privacy and security of the original data in each field. It has the characteristics of low complexity, high efficiency, strong security and strong feasibility.

[0088] Those skilled in the art should understand that the embodiments of the present invention can be provided as methods, systems, or computer program products. If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0089] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modification, equivalent substitution or improvement made within the basic creative concept and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A multi-domain sentiment classification method based on knowledge transfer, characterized in that: include: Obtain the text review corpus data to be classified in the target domain, and count the frequency of each word in the text review corpus data to be classified in the text review corpus data with positive and negative sentiment labels based on the local dictionary of the target domain; Based on the local dictionary of other fields in the global knowledge base, the frequency of occurrence of each word in the text comment corpus data to be classified in the text comment corpus data with positive and negative sentiment labels is corrected to obtain a corrected result; wherein, if the sentiment polarity of the words in the text comment corpus data to be classified is consistent in the local dictionary of other fields, the frequency of occurrence of the corresponding words in the local dictionary of other fields in the text comment corpus data with positive and negative sentiment labels is used for weight correction; if the words in the text comment corpus data to be classified have a ratio of the positive class probability to the negative class probability and a ratio of the negative class probability in the target field, and the positive class probability is greater than or equal to the first threshold, the corresponding word is not corrected; if the sentiment polarity of the words of the text comment corpus data to be classified in the local dictionary of other fields is inconsistent or the ratio of the positive class probability to the negative class probability and the ratio of the negative class probability to the positive class probability of the words of the text comment corpus data to be classified in the target field is less than the first threshold, then the frequency of the corresponding words in the local dictionary of other fields in the text comment corpus data with positive and negative sentiment labeling labels and the frequency of the corresponding words in the text comment corpus data with positive and negative sentiment labeling labels in the target field are added as the correction result; Based on the correction results, the trained sentiment classifier model is used to obtain sentiment classification prediction results; The global knowledge base includes local dictionaries of several fields, and the local dictionaries include each word in the text comment corpus data of the corresponding field, and the frequency data of each word appearing in the text comment corpus data with positive and negative sentiment annotation labels; The sentiment classifier model is obtained by training with a training data set collected from a target domain; the training data set in the target domain includes a text review corpus of the corresponding domain and corresponding sentiment annotation tags and a local dictionary.

2. The method according to claim 1, characterized in that The sentiment polarity of the words in the text review corpus data to be classified in the local dictionary of other fields is determined by the following method: If the ratio of the positive class probability to the negative class probability and the ratio of the negative class probability to the positive class probability of the words in the text comment corpus data to be classified in other fields greater than the third threshold number are greater than or equal to the second threshold, it is considered that the sentiment polarity of the words in the text comment corpus data to be classified in the local dictionary of other fields is consistent.

3. The method according to claim 1, characterized in that The weight of the weight correction is: the ratio of the number of times the ratio of the positive class probability to the negative class probability of the words in the text comment corpus data to be classified in other fields is greater than or equal to the second threshold to the number of times the ratio of the positive class probability to the negative class probability of the words in the text comment corpus data to be classified in other fields is greater than or equal to the second threshold and the sum of the number of times the ratio of the negative class probability to the positive class probability of the words in the text comment corpus data to be classified in other fields is greater than or equal to the second threshold.

4. The method according to claim 1, characterized in that: The text review corpus data to be classified is obtained by preprocessing the collected text review data, and the preprocessing methods include case conversion, punctuation removal, stop word removal, common word removal, rare word removal, spelling proofreading, word segmentation, stem extraction and part-of-speech restoration methods.

5. The method according to claim 1, characterized in that The local dictionary only includes words whose frequencies appearing in the text review corpus data with positive and negative sentiment annotation labels are greater than a fourth threshold.

6. The method according to claim 1, characterized in that The global knowledge base uses key-value pair indexing to store data, wherein the index value of a field is a sequential number stored into the global knowledge base.

7. The method according to claim 1, characterized in that The sentiment classifier model adopts a naive Bayes probability model, a support vector machine, a topic model, a convolutional neural network or a recurrent neural network.

8. A multi-domain sentiment classification system based on knowledge transfer, characterized in that: Used to implement a multi-domain sentiment classification method based on knowledge transfer as described in any one of claims 1-7; the system includes a data preprocessing module, a knowledge mining module, a knowledge base module, a knowledge transfer module and a sentiment classification module; wherein the data preprocessing module is used to preprocess the collected text comment data to obtain text comment corpus data; the knowledge mining module is used to build a local dictionary and count the frequency of each word in the text comment corpus data with positive and negative sentiment annotation labels; the knowledge base module is used to receive local dictionaries in various fields and store them in a global knowledge base; the knowledge transfer module is used to transfer the knowledge in the global knowledge base to the target domain client; the sentiment classification module is used to correct the frequency of each word in the text comment corpus data to be classified in the text comment corpus data with positive and negative sentiment annotation labels based on local dictionaries in other fields of the global knowledge base to obtain a corrected result; based on the corrected result, the trained sentiment classifier model is used to obtain a sentiment classification prediction result.

9. 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 computer program, the multi-domain sentiment classification method based on knowledge transfer as described in any one of claims 1-7 is implemented.

10. A storage medium comprising computer executable instructions, which, when executed by a computer processor, implement a multi-domain sentiment classification method based on knowledge transfer as described in any one of claims 1 to 7.