Text processing, devices, storage media and equipment
By implementing bidirectional feature information transfer between aspect word extraction, opinion word extraction and aspect-level sentiment classification tasks in text processing, combined with the effective use of document-level information, the problems of low extraction accuracy and sentiment polarity prediction accuracy in text sentiment analysis are solved, and better sentiment analysis results are achieved.
Patent Information
- Application Number
- CN202010129518.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-28
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2040-02-28
AI Technical Summary
In text sentiment analysis, the existing technology has low accuracy in aspect word extraction and sentiment polarity prediction, which affects the effect of sentiment analysis.
By implementing bidirectional feature information transmission between aspect word extraction, opinion word extraction and aspect-level sentiment classification tasks in the text processing process, combined with the effective use of document-level information, information sharing and aggregation are achieved, thereby improving the extraction accuracy and sentiment polarity prediction accuracy.
The accuracy of aspect word extraction and aspect-level sentiment polarity prediction has been significantly improved, improving the overall effect of sentiment analysis.
Smart Images

Figure CN111444338B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a text processing device, storage medium and equipment. Background Art
[0002] Sentiment Analysis (SA) of text is a typical natural language processing (NLP) task in the field of artificial intelligence technology and currently has a wide range of application scenarios.
[0003] Sentiment analysis, also known as opinion mining or tendency analysis, is used to analyze people's opinions or emotions to assess their emotional tendencies or attitudes toward entities such as products or services. For example, after a user posts a text review of a specific product, sentiment analysis can be performed on the review to determine its sentiment polarity (including but not limited to positive, negative, or neutral), thereby determining the user's emotional tendencies toward the specific product, such as whether the user likes the specific product.
[0004] When performing sentiment analysis on text, accuracy—for example, whether aspect words are accurately extracted and sentiment polarity is accurately predicted—is crucial and a key metric for evaluating a sentiment analysis solution. Therefore, how to perform sentiment analysis on text has become a pressing issue for those skilled in the art. Summary of the Invention
[0005] The embodiments of the present application provide a text processing apparatus, storage medium, and device that can improve the accuracy of aspect word extraction and the accuracy of aspect-level sentiment polarity prediction, significantly improving the effect of sentiment analysis. The technical solution is as follows:
[0006] In one aspect, a text processing method is provided, the method comprising:
[0007] Obtaining a text to be processed, and performing vectorization processing on the text to be processed to obtain a shared feature vector;
[0008] Performing a first encoding process corresponding to the aspect word extraction task, a second encoding process corresponding to the opinion word extraction task, and a third encoding process corresponding to the aspect-level sentiment classification task on the shared feature vector, respectively, to obtain a first feature vector, a second feature vector, and a third feature vector in sequence;
[0009] performing information transfer processing based on the first feature vector, the second feature vector, and the third feature vector, wherein the information transfer processing refers to bidirectional feature information transfer between any two tasks among the aspect word extraction task, the opinion word extraction task, and the aspect-level sentiment classification task;
[0010] Based on the feature vector obtained after the information transfer processing, aspect words are extracted and aspect-level sentiment polarity classification is performed on the text to be processed.
[0011] In another aspect, a text processing device is provided, comprising:
[0012] Acquisition module, used to obtain the text to be processed;
[0013] A shared encoding module, configured to perform vectorization processing on the text to be processed to obtain a shared feature vector;
[0014] a task-oriented module, configured to perform a first encoding process corresponding to an aspect word extraction task, a second encoding process corresponding to an opinion word extraction task, and a third encoding process corresponding to an aspect-level sentiment classification task on the shared feature vector, to sequentially obtain a first feature vector, a second feature vector, and a third feature vector;
[0015] a routing module, configured to perform information transfer processing based on the first feature vector, the second feature vector, and the third feature vector, wherein the information transfer processing refers to bidirectional feature information transfer between any two tasks among the aspect word extraction task, the opinion word extraction task, and the aspect-level sentiment classification task;
[0016] The aggregation module is used to extract aspect words and classify aspect-level sentiment polarity of the text to be processed based on the feature vector obtained after the information transfer processing.
[0017] In one possible implementation, the task-oriented module is further configured to perform a fourth encoding process corresponding to a document-level domain classification task and a fifth encoding process corresponding to a document-level sentiment classification task on the shared feature vector, thereby sequentially obtaining a fourth feature vector and a fifth feature vector.
[0018] The aggregation module is also used to perform information aggregation processing based on the fourth eigenvector, the fifth eigenvector and the eigenvector obtained after the information transfer processing; wherein, the fourth eigenvector is unidirectionally transferred to the aspect word extraction task and the opinion word extraction task, and the fifth eigenvector is unidirectionally transferred to the aspect-level sentiment classification task; based on the obtained aggregation information, aspect word extraction and aspect-level sentiment polarity classification are performed on the text to be processed.
[0019] In a possible implementation, the routing module is further used to obtain, for the aspect-level sentiment classification task, the first feature information passed from the aspect word extraction task to the aspect-level sentiment classification task based on the first feature vector; obtain the second feature information passed from the opinion word extraction task to the aspect-level sentiment classification task based on the second feature vector; and perform feature connection processing based on the third feature vector, the first feature information and the second feature information.
[0020] In a possible implementation, the routing module is further used to obtain, for the opinion word extraction task, the third feature information passed from the aspect word extraction task to the opinion word extraction task based on the first feature vector; obtain the fourth feature information passed from the aspect-level sentiment classification task to the opinion word extraction task based on the third feature vector; and perform feature connection processing based on the second feature vector, the third feature information and the fourth feature information.
[0021] In a possible implementation, the routing module is further used to obtain, for the aspect word extraction task, the fifth feature information passed from the opinion word extraction task to the aspect word extraction task based on the second feature vector; obtain the sixth feature information passed from the aspect-level sentiment classification task to the aspect word extraction task based on the third feature vector; and perform feature connection processing based on the first feature vector, the fifth feature information and the sixth feature information.
[0022] In a possible implementation, the text processing includes T iterations, where T and t are positive integers, 0≤t≤T;
[0023] The aggregation module is also used to perform information aggregation processing based on the fourth eigenvector and the sixth eigenvector for the t+1th round of iteration, return the obtained first aggregation information and perform the first encoding processing, and the sixth eigenvector is the eigenvector corresponding to the aspect word extraction task after the t-round information transmission processing; for the t+1th round of iteration, perform information aggregation processing based on the fourth eigenvector and the seventh eigenvector, return the obtained second aggregation information and perform the second encoding processing, and the seventh eigenvector is the eigenvector corresponding to the opinion word extraction task after the t-round information transmission processing; for the t+1th round of iteration, perform information aggregation processing based on the fifth eigenvector and the eighth eigenvector, return the obtained third aggregation information and perform the third encoding processing, and the eighth eigenvector is the eigenvector corresponding to the aspect-level sentiment classification task after the t-round information transmission processing.
[0024] In one possible implementation, the aggregation module is further used to obtain, after T rounds of iterations, the final hidden layer representation vector of each word in the text to be processed based on the aggregation information obtained in the T-th round of iterations; perform full connection processing on the final hidden layer representation vector of each word in the text to be processed to obtain the aspect words and aspect-level sentiment polarity classification results of the text to be processed.
[0025] In a possible implementation, the routing module is further configured to obtain an adjacency matrix of the text to be processed, wherein the element A in the adjacency matrix is j|i The first value indicates that there is no syntactic relationship between the i-th word and the j-th word in the text to be processed, and the second value indicates that there is a syntactic relationship between the i-th word and the j-th word; according to the second feature vector and the adjacency matrix of the text to be processed, the second feature information transferred from the opinion word extraction task to the aspect-level sentiment classification task is obtained; wherein, the values of i and j are both positive integers, 1≤i, j≤n, and n is the total number of words included in the text to be processed.
[0026] In a possible implementation, the routing module is further configured to obtain the hidden layer representation vector of the i-th word in the second feature vector; and obtain W ij , the W ij Refers to the weight matrix between the i-th word and the j-th word; Get b i and b j|i , the b i Refers to the probability that the hidden layer representation vector of the i-th word in the second feature vector is transferred to the hidden layer representation vector of each word in the third feature vector, and the b j|i Refers to the probability of the hidden layer representation vector of the i-th word in the second feature vector being transferred to the hidden layer representation vector of the j-th word in the third feature vector; according to the adjacency matrix, the W ij , the hidden layer representation vector of the i-th word in the second feature vector, the b i and the b j|i Sure Among them, the Refers to the feature information of the hidden layer representation vector of the j-th word transferred from the second feature vector to the third feature vector.
[0027] In a possible implementation, the aggregation module is further configured to and Perform the first full connection process and obtain Returning to the task-oriented module;
[0028] The task-oriented module is also used to obtain performing the first encoding process;
[0029] in, refers to the hidden layer representation vector of the i-th word in the sixth eigenvector, Refers to the hidden layer representation vector of the i-th word corresponding to the aspect word extraction task after t+1 iterations, and respectively refer to the prediction results of the aspect word extraction task, the opinion word extraction task, and the aspect-level sentiment classification task after t iterations, Refers to the attention mechanism weight of the document-level domain classification task after t iterations, is obtained based on the fourth eigenvector.
[0030] In a possible implementation, the aggregation module is further configured to and Perform the first full connection process and obtain Returning to the task-oriented module;
[0031] The task-oriented module is also used to obtain performing the second encoding process;
[0032] in, refers to the hidden layer representation vector of the i-th word in the seventh eigenvector, Refers to the hidden layer representation vector of the i-th word corresponding to the opinion word extraction task after t+1 iterations, and respectively refer to the prediction results of the aspect word extraction task, the opinion word extraction task, and the aspect-level sentiment classification task after t iterations, Refers to the attention mechanism weight of the document-level domain classification task after t iterations, is obtained based on the fourth eigenvector.
[0033] In a possible implementation, the aggregation module is further configured to and Perform the second full connection process and obtain Returning to the task-oriented module;
[0034] The task-oriented module is also used to obtain performing the first encoding process;
[0035] in, refers to the hidden layer representation vector of the i-th word in the eighth feature vector, refers to the hidden layer representation vector of the i-th word corresponding to the aspect-level sentiment classification task after t+1 iterations, and respectively refer to the prediction results of the aspect word extraction task, the opinion word extraction task, and the aspect-level sentiment classification task after t iterations, Refers to the prediction result of the document-level sentiment classification task after t iterations, Refers to the attention mechanism weight of the document-level sentiment classification task after t iterations, is obtained based on the fifth eigenvector.
[0036] On the other hand, a storage medium is provided, in which at least one instruction is stored. The at least one instruction is loaded and executed by a processor to implement the above-mentioned text processing method.
[0037] On the other hand, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the above-mentioned text processing method.
[0038] The beneficial effects of the technical solution provided by the embodiments of the present application are:
[0039] When performing sentiment analysis on a text, the embodiment of the present application realizes bidirectional feature information transmission between any two tasks among the aspect word extraction task, the opinion word extraction task and the aspect-level sentiment classification task, that is, it realizes information sharing between tasks and fully utilizes the mutual correlation and mutual influence relationship between the three tasks, thereby improving the accuracy of aspect word extraction and the accuracy of aspect-level sentiment polarity prediction. That is, the sentiment analysis solution provided by the embodiment of the present application can show better aspect word extraction and aspect-level sentiment polarity prediction effects, significantly improving the sentiment analysis effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0041] Figure 1 Schematic diagram of the implementation environment involved in the sentiment analysis solution provided in the embodiment of the present application;
[0042] Figure 2This is a schematic diagram of the relationship between tasks provided in an embodiment of the present application;
[0043] Figure 3 This is a schematic diagram of the structure of a sentiment analysis system provided in an embodiment of the present application;
[0044] Figure 4 This is a schematic diagram of the structure of a sentiment analysis system provided in an embodiment of the present application;
[0045] Figure 5 This is a flowchart of a text processing method provided by an embodiment of the present application;
[0046] Figure 6 This is a diagram of the internal structure of a routing module provided in an embodiment of the present application;
[0047] Figure 7 This is a pseudo code diagram of a routing algorithm provided in an embodiment of the present application;
[0048] Figure 8 is a schematic diagram of a dependency syntax tree provided in an embodiment of the present application;
[0049] Figure 9 The F1 index and accuracy index of the sentiment analysis solution provided in the embodiment of the present application on different data sets;
[0050] Figure 10 is a structural diagram of a text processing device provided in an embodiment of the present application;
[0051] Figure 11 This is a structural diagram of a sentiment analysis system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0053] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also involves studying the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.
[0054] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0055] Natural language processing (NLP) is a key area of research in computer science and artificial intelligence. It studies the theories and methods that enable effective communication between humans and computers using natural language. Natural language processing (NLP) integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language—the language we use in everyday life—and is closely linked to the study of linguistics. Natural language processing technologies typically include text processing, semantic understanding, machine translation, robotic question answering, and knowledge graphs.
[0056] Machine Learning (ML) is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers can simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is at the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of AI.
[0057] Deep learning is the core of machine learning and generally includes technologies such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning by demonstration. Deep learning is a new research direction in the field of machine learning.
[0058] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, autonomous driving, drones, robots, smart medical care, smart customer service, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0059] The solutions provided in the embodiments of this application involve technologies such as natural language processing and deep learning of artificial intelligence, which are now illustrated through the following embodiments.
[0060] First, some key terms or abbreviations involved in the embodiments of this application are introduced.
[0061] Sentiment analysis: It is the process of analyzing, processing, summarizing and reasoning about subjective texts with emotional connotations.
[0062] Sentiment analysis is a subtask of natural language processing, also known as opinion mining or sentiment analysis. It computationally studies people's opinions, sentiments, emotions, evaluations, and attitudes toward products, services, organizations, individuals, issues, events, topics, and their attributes. Sentiment analysis is used to assess users' emotional tendencies or attitudes toward products or services. This means that sentiment analysis carries a strong subjective element. The goal of sentiment analysis is to analyze, from text, people's emotional tendencies and opinions expressed toward entities and their attributes.
[0063] Aspect: refers to the object to which the emotional polarity belongs. That is, the emotional attribute corresponds to an object, and this object is the aspect.
[0064] The aspects extracted from the text are entities that appear in the text, such as nouns, and multiple aspects may be extracted from a text. For example, sentiment polarity includes but is not limited to positive, negative, and neutral.
[0065] In addition, aspect-based sentiment analysis is a fine-grained sentiment analysis task that aims to identify the sentiment polarity of aspects in a text. A text may contain multiple different aspects, and the sentiment polarity of each aspect may be different.
[0066] Aspect-based sentiment analysis has many practical applications. For example, aspect-based sentiment analysis of product reviews can extract users' evaluations of different parts or aspects of a product, thereby providing manufacturers with more fine-grained references for further product improvement.
[0067] ATE (Aspect Term Extraction): Aspect terms refer to objects in a text that have sentiment polarity. Aspect terms are entities that appear in a text (such as a word or phrase). ATE refers to extracting aspect terms from a text.
[0068] Correspondingly, the aspect word extraction task is to extract aspect words from the text to be processed.
[0069] Opinion Term Extraction (OTE): Opinion terms are words in a text that express the sentiment polarity of an aspect term. An opinion term is a word or phrase that appears in a text, and OTE refers to extracting opinion terms from the text.
[0070] Correspondingly, the task of extracting opinion words is to extract opinion words used to express the sentiment polarity of aspect words from the text to be processed.
[0071] As an example, taking the text "ABC fast food's food quality is average, but the service is very thoughtful", the extraction results of aspect words are "food quality" and "service", and the extraction results of opinion words are "average" and "thoughtful", that is, "food quality" and "service" are aspect words from two different angles. The opinion word corresponding to the aspect word "food quality" from the former angle is "average", and the sentiment polarity is negative (negative), and the opinion word corresponding to the aspect word "service" from the latter angle is "thoughtful", and the sentiment polarity is positive (positive).
[0072] ASC (Aspect-level Sentiment Classification): This function analyzes the sentiment polarity of entities appearing in a text at the aspect level. Specifically, ASC is used to infer the sentiment polarity or emotional orientation of the text based on extracted aspect terms based on opinion terms.
[0073] Correspondingly, the aspect-level sentiment classification task is to determine the sentiment polarity of the extracted aspect words based on the extracted opinion words.
[0074] Currently, sentiment analysis is primarily studied at the following levels of granularity: document-level, sentence-level, and aspect-level. Compared to document-level and sentence-level sentiment analysis, aspect-level sentiment analysis, or aspect-based sentiment analysis, is more fine-grained, targeting the word level.
[0075] Its task is to extract and summarize people’s opinions and characteristics about entities. For example, in a product review, aspect-level sentiment analysis aims to summarize positive, neutral, or negative opinions about different aspects of the product, even though the overall sentiment towards the product may be positive or negative.
[0076] Typically, aspect-based sentiment analysis consists of multiple subtasks, such as aspect word extraction, opinion word extraction, and aspect-level sentiment classification. For example, aspect word extraction for the text "The voice quality of an iPhone is great, but its battery sucks" requires identifying "voice quality" and "battery" as two different aspect words. "great" and "sucks" are opinion words corresponding to these two aspect words.
[0077] DDC (Document-level Domain Classification): refers to the domain classification of text at the document level. The domains include but are not limited to electronic products, books, restaurants, and many other fields.
[0078] DSC (Document-level Sentiment Classification): refers to the sentiment classification of text at the document level. The sentiment classification of DSC also includes positive, negative, and neutral.
[0079] The following is an introduction to the implementation environment of the sentiment analysis solution provided in the embodiment of the present application.
[0080] The sentiment analysis method for text provided in the embodiment of the present application can be applied to an online sentiment analysis system. The sentiment analysis system can be represented as a server. For example, see Figure 1 , the implementation environment may include: a terminal 101 and a sentiment analysis system 102.
[0081] In one possible implementation, the text used by sentiment analysis system 102 for sentiment analysis can come from an information sharing platform. The information sharing platform can be a social platform, an e-commerce platform, or a review website, etc., and this application does not limit this. A user can perform a text input operation on terminal 101. For example, the text can be a user's evaluation of a product or service provided by the information sharing platform. The user can then provide a review on the review page provided by the information sharing platform for the product or service.
[0082] Among them, the sentiment analysis system 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, which is not specifically limited in the embodiment of the present application.
[0083] In the embodiments of the present application, the types of terminal 101 include, but are not limited to, mobile terminals and fixed terminals. As an example, mobile terminals include, but are not limited to, smartphones, tablet computers, laptop computers, e-readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 players (Moving Picture Experts Group Audio Layer IV), etc.; fixed terminals include, but are not limited to, desktop computers.
[0084] In addition, the terminal 101 and the sentiment analysis system 102 can be connected directly or indirectly via wired or wireless communication, which is not limited in this application.
[0085] Application scenarios of the sentiment analysis method for text provided in the embodiments of the present application include but are not limited to:
[0086] Scenario 1: In the retail sector, user reviews are crucial feedback for both retailers and manufacturers. By analyzing sentiment across massive user reviews, we can quantify the degree to which users favor and criticize products and their competitors, thereby understanding user preferences for products and comparing the strengths and weaknesses of our own products against those of competitors. In short, we can identify sentimental information about product attributes from massive user reviews, providing decision support for retailers and manufacturers.
[0087] Scenario 2: In public opinion monitoring, sentiment analysis can be used to promptly understand public attitudes towards emergencies and social phenomena, guiding public opinion trends. For example, in the field of social public opinion, analyzing public sentiment regarding hot topics can effectively grasp the direction of public opinion. Another example is corporate public opinion, where sentiment analysis can quickly understand public opinion about a company, providing a basis for strategic planning and decision-making, thereby enhancing a company's core competitiveness in the market.
[0088] Scenario 3: Sentiment analysis can also be applied to other natural language processing tasks. For example, in question-answering systems, sentiment analysis can be used to select the most relevant answers to the questions, making the answers more likely to be adopted by users.
[0089] Scenario 4: In the field of automatic translation, judging the sentiment of the input text helps to more accurately select synonyms with positive or negative connotations for translation, thereby improving the accuracy of the translation system.
[0090] Scenario 5: In the field of financial transactions, sentiment analysis can be used to analyze traders' attitudes toward stocks and other financial derivatives, thereby providing auxiliary basis for market transactions.
[0091] The above only lists several possible application scenarios of sentiment analysis. In fact, the application scenarios are not limited to these. For example, sentiment analysis can be applied in more scenarios than the above examples. The embodiments of this application do not specifically limit this.
[0092] Based on the above implementation environment, the present application proposes a knowledge transfer-based method for aspect term extraction, opinion term extraction, and aspect-level sentiment analysis. The technical architecture proposed in this application includes a new knowledge transfer network that enables information sharing between tasks. It also proposes a mechanism for more effectively utilizing document-level information, which can improve the effectiveness of aspect term extraction, opinion term extraction, and sentiment polarity prediction.
[0093] like Figure 2 As shown, the embodiment of the present application can make full use of the mutual influence between the aspect word extraction task 201, the opinion word extraction task 202 and the aspect level sentiment classification task 203, and realize the two-way information sharing between any two tasks in the three tasks. In addition, in order to more effectively utilize the document level information, the embodiment of the present application will distinguish and transmit the document level information, thereby giving full play to the role of the document level information. Figure 2 , the information of the document-level domain classification task 204 will only be passed to the aspect word extraction task 201 and the opinion word extraction task 202, and the information of the document-level sentiment classification task 205 will also only be passed to the aspect-level sentiment classification task 203.
[0094] Figure 3 1 is a structural diagram of a sentiment analysis system 102 provided in an embodiment of the present application.
[0095] See also Figure 3 The sentiment analysis system 102 includes: a shared encoder (Shared Encoder) 1021, a task-specific layer (Task-specific Layer) 1022, a routing layer (Routing Layer) 1023 and an aggregation layer 1024 (Aggregation Layer).
[0096] The shared encoder 1021 is used to obtain the text to be processed, that is, the shared encoder 1021 is responsible for reading the source language sequence (such as a word sequence). Figure 4 As shown, the source language sequence (w1, w2, ...w n ,) T w1, w2, ... w n , taking English text as an example, the source language sequence (w1, w2, ...w n ,) T After each word in the embedding layer is converted into a word vector, it will be further extracted through the CNNs (Convolutional Neural Networks) module to obtain the hidden layer representation vector of each word, that is, the corresponding Figure 4The output of the shared encoder 1021 is also referred to as a shared feature vector in this article.
[0097] The task-oriented layer 1022 includes five different encoding modules, namely: the first encoding module for the aspect word extraction task, namely CNN ate , the second encoding module of the opinion word extraction task, namely CNN ote , the third encoding module for aspect-level sentiment classification task, namely CNN asc , the fourth encoding module for document-level domain classification tasks, namely CNN ddc , the fifth encoding module for the document-level sentiment classification task, namely CNN dsc .
[0098] The first point to note is that the above CNN ate , CNN ote , CNN asc , CNN ddc and CNN dsc For different convolutional neural networks, i.e., network parameter settings are different. As an example, the five encoding modules can be trained based on the same data set, different label data, and different optimization objectives; or, the five encoding modules can be trained based on different data sets, different label data, and different optimization objectives. This embodiment of the application does not specifically limit this.
[0099] The second point that needs to be explained is that the shared feature vectors output by the shared encoder 1021 will be input into the five encoding modules of the task-oriented layer 1022 respectively, and will be re-encoded for different tasks to generate five sets of hidden layer representation vectors.
[0100] For the routing layer 1023, the hidden layer representation vector of the aspect word extraction task, the hidden layer representation vector of the opinion word extraction task and the hidden layer representation vector of the aspect-level sentiment classification task will be read in, and two-way information transmission will be performed between any two tasks in the aspect word extraction task, the opinion word extraction task and the face-level sentiment classification task, thereby realizing information sharing among the above three tasks.
[0101] For the aggregation layer 1024, task-oriented information representation, document-level information representation, and prediction information of aspect word extraction tasks, opinion word extraction tasks, and face-level sentiment classification tasks are aggregated.
[0102] like Figure 4 As shown, the information from the document-level domain classification task is CNN ddc The output of will only be passed to the aspect word extraction task and the opinion word extraction task, and the information from the document level sentiment classification is CNN dscThe output of is only passed to the aspect-level sentiment analysis task.
[0103] Also, see Figure 4 The sentiment analysis solution provided in the embodiment of the present application includes multiple rounds of iterative processes. After multiple rounds of iterations of the above steps, the purpose of utilizing the information representation of all tasks to improve the accuracy of aspect word and opinion word extraction and the accuracy of sentiment polarity prediction can be achieved, which significantly improves the sentiment analysis effect.
[0104] Based on the above description, the implementation process of the text processing method provided in the embodiment of the present application is introduced in detail below.
[0105] Figure 5 This is a flowchart of a text processing method provided by an embodiment of the present application. The execution subject of this method is Figure 1 The sentiment analysis system 102 shown in FIG. Figure 5 , the method process provided in the embodiment of the present application includes:
[0106] 501. Obtain a text to be processed, and perform vectorization processing on the text to be processed to obtain a shared feature vector.
[0107] This step is performed by Figure 3 and Figure 4 The shared encoder 1021 is shown as complete.
[0108] As an example, the text to be processed can be English text, that is, input Figure 4 The source language sequence of the shared encoder 1021 can be in English, and the corresponding sequence (w1, w2, ... w n ,) T w1, w2, ...w in n , refers to English words one by one; in addition, the text to be processed can also be Chinese text, that is, input Figure 4 The source language sequence of the shared encoder 1021 can be in Chinese, and the corresponding sequence (w1, w2, ... w n ,) T w1, w2, ... w in n , refers to individual Chinese characters, and the embodiment of the present application does not specifically limit the language form of the text to be processed.
[0109] With the sequence (w1, w2, ...w n ,) T Taking the word sequence as an example, the sequence (w1, w2, ...w n ,) T After each word in the shared encoder 1021 is converted into a word vector, it will be further extracted by the CNNs module to obtain the hidden layer representation vector of each word, that is, the corresponding Figure 4The output of the shared encoder 1021 is also referred to as a shared feature vector in this article.
[0110] That is, vectorization of the text to be processed can be divided into two steps: one is to embed w1, w2, ...w n Convert it into word vector; the other step is to further extract features from the word vector obtained by CNNs module, and then obtain the hidden layer representation vector of each word to form a shared feature vector (h1, h2, ...h n ,) T .
[0111] 502. Perform the first encoding process corresponding to the aspect word extraction task, the second encoding process corresponding to the opinion word extraction task, the third encoding process corresponding to the aspect-level sentiment classification task, the fourth encoding process corresponding to the document-level domain classification task, and the fifth encoding process corresponding to the document-level sentiment classification task on the shared feature vector, and obtain the first feature vector, the second feature vector, the third feature vector, the fourth feature vector and the fifth feature vector in sequence.
[0112] This step is performed by Figure 3 and Figure 4 The task-oriented layer 1022 is shown complete.
[0113] The task-oriented layer 1022 includes five different encoding modules, namely: the first encoding module for the aspect word extraction task, namely CNN ate , the second encoding module of the opinion word extraction task, namely CNN ote , the third encoding module for aspect-level sentiment classification task, namely CNN asc , the fourth encoding module for document-level domain classification tasks, namely CNN ddc , the fifth encoding module for the document-level sentiment classification task, namely CNN dsc .
[0114] The first point to note is that the above CNN ate , CNN ote , CNN asc , CNN ddc and CNN dsc For different convolutional neural networks, i.e., network parameter settings are different. As an example, the five encoding modules can be trained based on the same data set, different label data, and different optimization objectives; or, the five encoding modules can be trained based on different data sets, different label data, and different optimization objectives. This embodiment of the application does not specifically limit this.
[0115] The second point to be made is that, see Figure 4The shared feature vectors output by the shared encoder 1021 are respectively input into the five encoding modules of the task-oriented layer 1022 for re-encoding for different tasks, generating five sets of hidden layer representation vectors. Accordingly, in this paper, the first encoding module is responsible for performing a first encoding process on the shared feature vector to obtain a first feature vector; the second encoding module is responsible for performing a second encoding process on the shared feature vector to obtain a second feature vector; the third encoding module is responsible for performing a third encoding process on the shared feature vector to obtain a third feature vector; the fourth encoding module is responsible for performing a fourth encoding process on the shared feature vector to obtain a fourth feature vector; and the fifth encoding module is responsible for performing a fifth encoding process on the shared feature vector to obtain a fifth feature vector.
[0116] The third point to note is that the first eigenvector corresponding to the aspect word extraction task, the second eigenvector corresponding to the opinion word extraction task, and the third eigenvector corresponding to the aspect-level sentiment classification task will be input into Figure 4 The routing layer 1023 shown here transfers information between tasks, thereby achieving information sharing.
[0117] 503. Perform information transfer processing based on the first eigenvector, the second eigenvector, and the third eigenvector, wherein the information transfer processing refers to bidirectional feature information transfer between any two tasks in the aspect word extraction task, the opinion word extraction task, and the aspect-level sentiment classification task.
[0118] This step is performed by Figure 3 and Figure 4 The routing layer 1023 is shown complete.
[0119] like Figure 2 As shown, the embodiments of the present application can fully utilize the mutual influence between the aspect word extraction task, the opinion word extraction task, and the aspect-level sentiment classification task, and realize the bidirectional feature information transmission between any two of the three tasks. For example, opinion words not only limit the sentiment polarity of aspect-level sentiment classification, but also have an impact on aspect words.
[0120] For example, the opinion word "delicious" will have an impact on the aspect word, that is, through the opinion word "delicious", we can know that the aspect word should be a word related to food, and has nothing to do with electronic products. In addition, the opinion word "delicious" can also make it clear that the sentiment polarity of the sentiment classification is positive. For aspect words and aspect-level sentiment classification, the same as the above example, that is, the three tasks are interrelated and influence each other. To this end, the embodiment of the present application will perform two-way feature information transmission between any two tasks in the aspect word extraction task, the opinion word extraction task and the aspect-level sentiment classification task to obtain better sentiment analysis results.
[0121] 504. Based on the fourth eigenvector, the fifth eigenvector and the eigenvector obtained after the information transfer processing, perform information aggregation processing; wherein, the fourth eigenvector is unidirectionally transferred to the aspect word extraction task and the opinion word extraction task, and the fifth eigenvector is unidirectionally transferred to the aspect-level sentiment classification task.
[0122] This step is performed by Figure 3 and Figure 4 The polymeric layer 1024 is shown completed.
[0123] In order to more effectively utilize document-level information, the present embodiment will transmit document-level information differently, thereby giving full play to the role of document-level information. Figure 2 , the information of the document-level domain classification task is only passed to the aspect word extraction task and the opinion word extraction task, and the information of the document-level sentiment classification task is also only passed to the aspect-level sentiment classification task. That is, since aspect words and opinion words are domain-specific, for example, the aspect word "mobile phone" belongs to the electronic product category and cannot belong to the food category; the opinion word "delicious" belongs to the food category and cannot belong to the electronic product category, and the document-level domain classification task is also related to domain classification, so this paper will distinguish and pass document-level information, so that the document-level domain classification task only performs one-way information transmission to the aspect word extraction task and the opinion word extraction task, and the document-level sentiment classification task only performs one-way information transmission to the aspect-level sentiment classification task.
[0124] 505. Based on the obtained aggregated information, the text to be processed is classified into aspect words and aspect-level sentiment polarity.
[0125] Among them, the sentiment classification of the processed text at the aspect level also needs to be based on opinion words. Therefore, in addition to extracting aspect words, this step will also extract opinion words, and then perform aspect-level sentiment polarity classification on the processed text based on the extracted opinion words.
[0126] In the implementation of this application, see Figure 4 , text processing includes T iterations. That is, the task-oriented layer 1022 outputs multiple rounds of information representations corresponding to the aspect word extraction task, opinion word extraction task, and aspect-level sentiment classification task to the routing layer 1023. The routing layer 1022 also performs multiple information transfer processes based on the multiple rounds of information representations output by the task-oriented layer 1022. Correspondingly, the aggregation layer 1024 also performs multiple information aggregation processes. Wherein, the value of T is a positive integer.
[0127] Specifically, this paper introduces a knowledge transfer mechanism. For each iteration, after completing the information transfer and aggregation process, the resulting aggregated information is returned to the task-oriented layer 1022 as the shared information representation for the next iteration. In other words, this embodiment of the application returns useful information from different tasks as a shared information representation for use in subsequent iterations. To put it another way, this knowledge transfer process is iterative until the target number of iterations, T, is reached.
[0128] The first point that needs to be explained is that when the routing layer 1023 performs information transmission processing for the first time, the input of the task-oriented layer 1022 is the shared feature vector output by the shared encoder 1021, and when the information transmission processing is not performed for the first time, the input of the task-oriented layer 1022 is the aggregated feature representation returned by the aggregation layer 1024.
[0129] After T rounds of iteration, the sentiment analysis system 102 obtains the final hidden layer representation vector of each word in the text to be processed based on the aggregated information obtained in the T-th round of iteration; then, it performs full connection processing on the final hidden layer representation vector of each word in the text to be processed to obtain the aspect words, opinion words and aspect-level sentiment polarity classification results of the text to be processed.
[0130] In one possible implementation, after performing the above-mentioned full connection processing, the probability of each word belonging to an aspect word and an opinion word, as well as the predicted probability of the sentiment polarity of each word (for example, the probability of each word belonging to positive, neutral and negative respectively) will be obtained, and then the aspect words, opinion words, and aspect-level sentiment polarity classification of the text to be processed can be determined based on this.
[0131] For example, for aspect term extraction, we perform sequence annotation on each word, assigning the probability of each word to 'B', 'I', 'E', 'S', and 'O'. Then, we group 'B', 'I', 'E', and 'S' into corresponding aspect terms. For example, "The battery is very longer" would be annotated as 'O', 'B', 'O', 'O', 'O', thus concluding that 'battery' is an aspect term.
[0132] The second point that needs to be explained is that, when determining the sentiment polarity of aspect-level sentiment classification, the embodiment of the present application only considers the sentiment polarity of the determined aspect words, and does not consider the sentiment polarity of other words except the determined aspect words.
[0133] For example, taking "The battery is very longer" as an example, assuming that a three-category output belonging to each category of sentiment polarity is obtained for each word, then since the determined aspect word is "battery", the embodiment of the present application will only consider the sentiment polarity on "battery" and will not consider the sentiment polarity on other words except "battery", that is, the probability of the aspect word "battery" in the three categories of positive, negative, and neutral sentiment polarity is obtained. Since the opinion word corresponding to the aspect word "battery" is "longer", the probability of the aspect word "battery" in the positive sentiment polarity category should be the largest.
[0134] The method provided in the embodiment of the present application realizes the two-way feature information transmission between any two tasks in the aspect word extraction task, the opinion word extraction task and the aspect-level sentiment classification task, that is, it realizes full information sharing between the three tasks; in addition, the embodiment of the present application also transmits document-level information differently, that is, the document-level domain classification task only performs one-way information transmission to the aspect word extraction task and the opinion word extraction task related to the domain classification, and the document-level sentiment classification task only performs one-way information transmission to the aspect-level sentiment classification task related to the sentiment classification, which gives full play to the role of document-level information and improves the accuracy of aspect word extraction, opinion word extraction, and aspect-level sentiment classification. That is, the sentiment analysis scheme provided in the embodiment of the present application can show better aspect word extraction, opinion word extraction, and sentiment polarity prediction effects, is more practical, and significantly improves user experience.
[0135] In another embodiment, the information transfer processing performed by the routing layer 1023 is described below.
[0136] For the routing layer 1023, the hidden layer representation vector output by the first encoding module in the task-oriented layer 1022, that is, the hidden layer representation vector of the aspect word extraction task; the hidden layer representation vector output by the second encoding module in the task-oriented layer 1022, that is, the hidden layer representation vector of the opinion word extraction task; and the hidden layer representation vector output by the third encoding module in the task-oriented layer 1022, that is, the hidden layer representation vector of the aspect-level sentiment classification task, will be read in. Then, the routing layer 1023 will perform two-way information transmission between any two tasks in the aspect word extraction task, the opinion word extraction task and the aspect-level sentiment classification task, thereby realizing information sharing among the above three tasks.
[0137] like Figure 4As shown in Figure 1, the routing layer includes three routing modules: routing module #ATE for aspect word extraction, routing module #OTE for opinion word extraction, and routing module #ASC for aspect-level sentiment classification. Each routing module is used to execute either a syntax-aware or non-syntax-aware routing algorithm.
[0138] It should be noted that during each iteration, the three sets of hidden layer representation vectors output by the first, second, and third encoding modules for task layer 1022 are input to routing module #ATE, routing module #OTE, and routing module #ASC. In other words, routing module #ATE, routing module #OTE, and routing module #AS all read in three sets of hidden layer representation vectors.
[0139] Figure 6 Shows the internal structure of a routing module. Figure 6 In (h1 ote , h2 ote , h3 ote , h4 ote ,h5 ote ) T Represents the hidden layer representation vector corresponding to the opinion word extraction task, (h1 ate , h2 ate , h3 ate , h4 ate ,h5 ate ) T Represents the hidden layer representation vector corresponding to the aspect word extraction task, (h1 asc , h2 asc , h3 asc , h4 asc ,h5 asc ) T Represents the hidden layer representation vector corresponding to the aspect-level sentiment classification task.
[0140] in, Figure 6 The direction of the arrow in the upper middle section indicates that the information corresponding to the opinion word extraction task is transferred to the aspect-level sentiment classification task. Figure 6 The direction of the arrow in the middle and lower part indicates that the information corresponding to the aspect word extraction task is transferred to the aspect level sentiment classification task. Figure 6 It can be seen that both information transfer processes are iterative, that is, the information sharing process is iteratively executed T times.
[0141] It should be noted that (h1 o , h2 o , h3 o , h4 o ,h5 o )T The element h in k o Refers to the hidden layer representation vector of the kth word in the text to be processed, where 1≤k≤n, k is a positive integer, n is the length of the sentence, and o∈{ate,ote,asc}.
[0142] When the routing layer 1023 performs information transmission processing for the first time, assuming that the hidden layer feature vector corresponding to the aspect word extraction task is the first feature vector, the hidden layer feature vector corresponding to the opinion word extraction task is the second feature vector, and the hidden layer feature vector corresponding to the aspect-level sentiment classification task is the third feature vector, then the above step 503 includes:
[0143] 5031. For the aspect-level sentiment classification task, the routing module #ASC obtains the first feature information passed from the aspect word extraction task to the aspect-level sentiment classification task based on the first feature vector; obtains the second feature information passed from the opinion word extraction task to the aspect-level sentiment classification task based on the second feature vector; and performs feature connection processing based on the third feature vector, the first feature information and the second feature information.
[0144] It should be noted that, since the embodiment of the present application is an aspect-level sentiment analysis, information transmission is usually performed in units of words.
[0145] That is, in this step, for the aspect word extraction task and the aspect-level sentiment classification task, the information representation corresponding to the aspect word extraction task will be transferred to the aspect-level sentiment classification task on a per-word basis; and for the opinion word extraction task and the aspect-level sentiment classification task, the information representation corresponding to the opinion word extraction task will also be transferred to the aspect-level sentiment classification task on a per-word basis; accordingly, when performing feature connection processing, it can also be performed on a word basis, and the embodiments of the present application do not specifically limit this.
[0146] Corresponding to Figure 6 , that is, the hidden representation vector of each word in the middle-view word extraction task (above) is connected by an arrow to the hidden representation vector of each word in the middle-aspect-level sentiment classification task; the hidden representation vector of each word in the middle-aspect word extraction task (below) is connected by an arrow to the hidden representation vector of each word in the middle-aspect-level sentiment classification task. The direction of the arrow indicates the direction of information transmission.
[0147] 5032. For the opinion word extraction task, the routing module #OTE obtains the third feature information passed from the aspect word extraction task to the opinion word extraction task based on the first feature vector; obtains the fourth feature information passed from the aspect-level sentiment classification task to the opinion word extraction task based on the third feature vector; and performs feature connection processing based on the second feature vector, the third feature information and the fourth feature information.
[0148] 5033. For the aspect word extraction task, the routing module #ATE obtains the fifth feature information passed from the opinion word extraction task to the aspect word extraction task based on the second feature vector; obtains the sixth feature information passed from the aspect-level sentiment classification task to the aspect word extraction task based on the third feature vector; and performs feature connection processing based on the first feature vector, the fifth feature information and the sixth feature information.
[0149] In one possible implementation, taking the information representation of the opinion word extraction task to the aspect-level sentiment classification task as an example, the syntax-aware routing algorithm is as follows. In addition, Figure 7 The pseudo code of the syntax-aware routing algorithm is shown, and the meaning expressed by the pseudo code is consistent with the following text description:
[0150] Among them, H ote Refers to the hidden layer representation vector corresponding to the opinion word extraction task, which is called the second eigenvector here; H asc Refers to the hidden layer representation vector corresponding to the aspect-level sentiment classification task, which is called the third eigenvector here; the values of i and j are both positive integers, 1≤i, j≤N, and n is the total number of words included in the text to be processed. In addition, W ij Refers to the weight matrix between the i-th word and the j-th word; b i Refers to H ote The hidden layer representation vector of the i-th word in is passed to H asc The probability or weight of the hidden layer representation vector of each word in Figure 6 The thickness of the arrow segment in the middle, the thicker the line, the more knowledge is transferred), b j|i Refers to H ote The hidden layer representation vector of the i-th word in is passed to H asc The probability of the hidden layer representation vector of the jth word in b j|i The initial value of is 0.
[0151] W ij The shared but position-aware weight matrix is achieved by introducing sin and cos functions:
[0152]
[0153]
[0154] Among them, pos refers to the position of the word in the sentence, p refers to the dimension index, and d model Refers to the dimension of the input matrix, which refers to the representation vector of the word in the sentence, PE (pos,2p) and PE (pos,2p+1) refer to odd and even functions respectively.
[0155] In the embodiment of the present application, A refers to the adjacency matrix of the text to be processed. j|i The first value of indicates that there is no syntactic relationship between the i-th word and the j-th word in the text to be processed, and the second value of indicates that there is a syntactic relationship between the i-th word and the j-th word. For example, the first value is usually 0, and the second value is usually 1.
[0156] Among them, the adjacency matrix A is obtained through the dependency syntax tree. Figure 8 The dependency syntax tree of "The battery is very long" is shown. It analyzes the sentence into a dependency syntax tree, describing the dependency relationship between each word. In other words, it points out the syntactic collocation relationship between words, which is related to semantics. Figure 8 As can be seen from the sentence, "battery" is the noun subject of the root "is", and "longer" is the adjective complement of the verb "is". Therefore, the root "is" can connect the two words "battery" and "longer" that are far apart, and there is a syntactic collocation relationship between the two.
[0157] The size of the adjacency matrix is related to the total number of words in the text to be processed. Assuming the total number of words is n, the size of the corresponding adjacency matrix is n*n. Each element in the adjacency matrix is used to describe whether there is a syntactic relationship between two words. Figure 8 For example, the size of the corresponding adjacency matrix is 5*5. Since there is no syntactic relationship between the and is, the value of the element at the corresponding position in the adjacency matrix is 0; since there is no syntactic relationship between the and battery, the value of the element at the corresponding position in the adjacency matrix is 1.
[0158] like Figure 7 As shown, They refer to any word i corresponding to the OTE task and any word j corresponding to the ASC task respectively.
[0159] Before the iteration begins, H ote The hidden representation vector of the i-th word in and W ij The product of
[0160] In each iteration, the following steps are performed:
[0161] Step a, change the current b j|i and A j|i Assign a new value to b j|i ;
[0162] Step b: traverse all the words in the text to be processed for the OTE task, and i Perform normalization and get c i ;
[0163] Step c: traverse all the words in the text to be processed for the ASC task and obtain c j|i and The product of s j , about to Assigned to s j ; Among them, s j Refers to the knowledge transferred from the opinion word extraction task to the hidden layer representation vector of the i-th word corresponding to the aspect-level sentiment classification task. j|i It is the weight after normalization by the softmax(*) function, that is, the contribution value transferred to the ASC task.
[0164] Step d, for s j Scaling is performed to obtain
[0165] in, squash() is the scaling function,
[0166] Refers to the information of the hidden layer representation vector of each word corresponding to the opinion word extraction task being transferred to the hidden layer representation vector of the j-th word corresponding to the aspect-level sentiment classification task;
[0167] Step e: traverse all the words in the text to be processed for the ASC task and obtain and The product value of b j|i The sum of b again j|i Assignment.
[0168] Repeat the above iterative process until the target number of iterations T is reached and the final
[0169] It should be noted that the above process obtains the information representation of the opinion word extraction task transferred to the aspect level sentiment analysis task. In addition, we can also obtain the information representation transferred from the aspect word extraction task to the aspect level sentiment analysis task. Afterwards, and Features are connected as follows:
[0170] in, Refers to the hidden representation vector of the j-th word in the aspect-level sentiment classification task.
[0171] The embodiment of the present application realizes the two-way feature information transmission between any two tasks in the aspect word extraction task, the opinion word extraction task and the aspect-level sentiment classification task, that is, it realizes full information sharing between the three tasks, ensures the sentiment analysis effect, and improves the accuracy of aspect word extraction, opinion word extraction, and aspect-level sentiment classification.
[0172] In another embodiment, the information aggregation process performed by the aggregation layer 1024 is described below.
[0173] like Figure 4 As shown in Figure 1, the aggregation layer includes three aggregation modules, namely the aggregation module ATE corresponding to the aspect word extraction task, the aggregation module OTE corresponding to the opinion word extraction task, and the aggregation module ASC corresponding to the aspect-level sentiment classification task.
[0174] In a possible implementation, step 504 includes:
[0175] 5041. For the t+1th round of iteration, for the aspect word extraction task, the aggregation module ATE will perform information aggregation processing based on the fourth eigenvector and the sixth eigenvector; thereafter, the first aggregated information obtained is returned and the first encoding processing is performed, wherein the sixth eigenvector is the eigenvector corresponding to the aspect word extraction task after the t-round information transmission processing, that is, the output of the routing module #ATE.
[0176] It should be noted that, since the embodiment of the present application is an aspect-level sentiment analysis, information aggregation is usually performed on a word-by-word basis.
[0177] As an example, performing information aggregation processing based on the fourth eigenvector and the sixth eigenvector, returning the obtained first aggregated information and performing a first encoding process, includes:
[0178] right and Perform the first full connection process and obtain Return and execute the first encoding process;
[0179] in, Refers to the hidden layer representation vector of the i-th word in the sixth eigenvector, that is, the hidden layer representation vector of the i-th word corresponding to the aspect word extraction task after t iterations, Refers to the hidden layer representation vector of the i-th word corresponding to the aspect word extraction task after t+1 iterations, and They refer to the prediction results of the aspect word extraction task, opinion word extraction task, and aspect-level sentiment classification task after t iterations, respectively. Refers to the attention mechanism weight of the document-level domain classification task after t iterations. It is obtained based on the fourth eigenvector.
[0180] It should be noted that before information aggregation, the feature vector output by the routing layer will be fully connected, that is, the prediction and These prediction information will be used later when information is aggregated.
[0181] 5042. For the t+1th round of iteration, for the opinion word extraction task, the aggregation module OTE performs information aggregation processing based on the fourth eigenvector and the seventh eigenvector, returns the obtained second aggregated information and performs a second encoding process, wherein the seventh eigenvector is the eigenvector corresponding to the opinion word extraction task after the t-round information transmission processing, that is, the output of the routing module #OTE.
[0182] As an example, performing information aggregation processing based on the fourth eigenvector and the seventh eigenvector, returning the obtained second aggregated information and performing a second encoding process, includes:
[0183] right and Perform the first full connection process and obtain Return and perform the second encoding process; that is, due to It is for the opinion word extraction task, so after being sent back, it is also encoded by the second encoding module corresponding to the opinion word extraction task.
[0184] in, Refers to the hidden layer representation vector of the i-th word in the seventh eigenvector, that is, the hidden layer representation vector of the i-th word corresponding to the opinion word extraction task after t iterations, Refers to the hidden layer representation vector of the i-th word corresponding to the opinion word extraction task after t+1 iterations.
[0185] Based on the above steps 5041 and 5042, it can be seen that the information aggregation method for the aspect word extraction task and the opinion word extraction task can be expressed by the following formula:
[0186]
[0187] Among them, q∈{ate,ote}, f1 represents the first fully connected layer.
[0188] 5043. For the t+1th round of iteration, for the aspect-level sentiment classification task, the aggregation module ASC performs information aggregation processing based on the fifth eigenvector and the eighth eigenvector, returns the obtained third aggregated information and performs a third encoding process, wherein the eighth eigenvector is the eigenvector corresponding to the aspect-level sentiment classification task after the t-round information transmission processing, that is, the output of the routing module #ASC.
[0189] As an example, performing information aggregation processing based on the fifth eigenvector and the eighth eigenvector, returning the obtained third aggregate information and performing a third encoding processing, includes:
[0190] right and Perform the second full connection process and obtain Return and execute the first encoding process; that is, due to It is aimed at the aspect-level sentiment classification task, so after being sent back, it is also encoded by the third encoding module corresponding to the aspect-level sentiment classification task.
[0191] in, Refers to the hidden layer representation vector of the i-th word in the eighth eigenvector, that is, the hidden layer representation vector of the i-th word corresponding to the aspect-level sentiment classification task after t iterations, Refers to the hidden layer representation vector of the i-th word corresponding to the aspect-level sentiment classification task after t+1 iterations, Refers to the prediction result of the document-level sentiment classification task after t iterations, used in t+1 iterations, Refers to the attention mechanism weight of the document-level sentiment classification task after t iterations, where is obtained based on the fifth eigenvector. The corresponding formula is as follows:
[0192]
[0193] Where f2 represents the second fully connected layer. For example, the calculation formula of the attention mechanism weight is as follows:
[0194]
[0195] Among them, W s is the parameter to be learned, n refers to the total number of words in the text to be processed, and k is a positive integer. In addition, s∈{ddc,dsc}.
[0196] The embodiment of the present application transmits document-level information in a differentiated manner, that is, the document-level domain classification task only performs one-way information transmission to the aspect word extraction task and opinion word extraction task related to the domain classification, and the document-level sentiment classification task only performs one-way information transmission to the aspect-level sentiment classification task related to the sentiment classification, which gives full play to the role of document-level information and ensures the effect of sentiment analysis, that is, improves the accuracy of aspect word extraction, opinion word extraction, and aspect-level sentiment classification.
[0197] The first point that needs to be explained is that the technical architecture proposed in the embodiment of the present application realizes the mutual knowledge transfer between aspect word extraction tasks, opinion word extraction tasks and aspect-level sentiment classification tasks. At the same time, it also proposes a method of differentially transmitting document-level instructions to enhance the corresponding aspect-level tasks to achieve information sharing between different tasks. This makes the accuracy of the embodiment of the present application on multiple general data sets exceed the best existing deep sentiment analysis model architecture.
[0198] like Figure 9 As shown, the sentiment analysis solution proposed in this application has achieved good results on multiple datasets, using the F1 metric and accuracy as examples. The F1 metric is a statistical metric used to measure the accuracy of binary classification models. It takes into account both the accuracy and recall of a classification model. The F1 metric can be viewed as a harmonic average of the two.
[0199] In addition, dataset D1 is a dataset of restaurant reviews about a certain entity in 2014, dataset D2 is a dataset of laptop reviews about a certain entity in 2014, and dataset D3 is a dataset of restaurant reviews about a certain entity in 2015. Figure 9 In the figure, the F1-a indicator is the F1 value of identifying aspect words; the F1-o indicator is the F1 value of identifying opinion words; the acc-s indicator is the accuracy of aspect-level sentiment classification; the F1-s indicator is the F1 value of aspect-level sentiment classification; and the F1-I indicator is the F1 value when aspect words are extracted correctly and sentiment classification is correct.
[0200] The second point that needs to be explained is that the above embodiment only provides a possible implementation method of aspect-level sentiment analysis. There may be other alternatives, which are not specifically limited in the embodiments of the present application. For example, in addition to processing the routing algorithm using syntax awareness, it can also be replaced by a routing algorithm that does not consider syntax awareness, that is, removing the content related to the adjacency matrix in the routing algorithm described in the above embodiment. In addition, the embodiments of the present application propose to transmit document-level information differently, and it can also be replaced by other information transmission methods, such as message-passing.
[0201] The third point to be explained is that, although the steps in the flowcharts of the above embodiments are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the above embodiments may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, which is not specifically limited in the embodiments of the present application.
[0202] Figure 10 This is a structural diagram of a text processing device provided by an embodiment of the present application. Figure 10 , the device comprises:
[0203] An acquisition module 1001 is used to acquire the text to be processed;
[0204] A shared encoding module 1002 is configured to perform vectorization processing on the text to be processed to obtain a shared feature vector;
[0205] The task-oriented module 1003 is configured to perform a first encoding process corresponding to the aspect word extraction task, a second encoding process corresponding to the opinion word extraction task, and a third encoding process corresponding to the aspect-level sentiment classification task on the shared feature vector, thereby obtaining a first feature vector, a second feature vector, and a third feature vector in sequence.
[0206] a routing module 1004 configured to perform information transfer processing based on the first feature vector, the second feature vector, and the third feature vector, wherein the information transfer processing refers to bidirectional feature information transfer between any two tasks among the aspect word extraction task, the opinion word extraction task, and the aspect-level sentiment classification task;
[0207] The aggregation module 1005 is configured to extract aspect words and classify aspect-level sentiment polarity of the text to be processed based on the feature vector obtained after the information transfer process.
[0208] The device provided in the embodiment of the present application realizes two-way feature information transmission between any two tasks among the aspect word extraction task, the opinion word extraction task and the aspect-level sentiment classification task when performing sentiment analysis on the text, that is, it realizes information sharing between tasks and makes full use of the mutual correlation and mutual influence relationship between the three tasks, thereby improving the accuracy of aspect word extraction and the accuracy of aspect-level sentiment polarity prediction. That is, the sentiment analysis scheme provided in the embodiment of the present application can show better aspect word extraction and aspect-level sentiment polarity prediction effect, which significantly improves the sentiment analysis effect.
[0209] In one possible implementation, the task-oriented module 1003 is further configured to perform a fourth encoding process corresponding to the document-level domain classification task and a fifth encoding process corresponding to the document-level sentiment classification task on the shared feature vector, thereby obtaining a fourth feature vector and a fifth feature vector in sequence.
[0210] The aggregation module 1005 is also used to perform information aggregation processing based on the fourth eigenvector, the fifth eigenvector and the eigenvector obtained after the information transfer processing; wherein, the fourth eigenvector is unidirectionally transferred to the aspect word extraction task and the opinion word extraction task, and the fifth eigenvector is unidirectionally transferred to the aspect-level sentiment classification task; based on the obtained aggregation information, aspect word extraction and aspect-level sentiment polarity classification are performed on the text to be processed.
[0211] In one possible implementation, the routing module 1004 is further used to obtain, for the aspect-level sentiment classification task, the first feature information passed from the aspect word extraction task to the aspect-level sentiment classification task based on the first feature vector; obtain the second feature information passed from the opinion word extraction task to the aspect-level sentiment classification task based on the second feature vector; and perform feature connection processing based on the third feature vector, the first feature information and the second feature information.
[0212] In one possible implementation, the routing module 1004 is further used to obtain, for the opinion word extraction task, the third feature information passed from the aspect word extraction task to the opinion word extraction task based on the first feature vector; obtain the fourth feature information passed from the aspect-level sentiment classification task to the opinion word extraction task based on the third feature vector; and perform feature connection processing based on the second feature vector, the third feature information and the fourth feature information.
[0213] In one possible implementation, the routing module 1004 is further used to obtain, for the aspect word extraction task, the fifth feature information passed from the opinion word extraction task to the aspect word extraction task based on the second feature vector; obtain the sixth feature information passed from the aspect-level sentiment classification task to the aspect word extraction task based on the third feature vector; and perform feature connection processing based on the first feature vector, the fifth feature information and the sixth feature information.
[0214] In a possible implementation, the text processing includes T iterations, where T and t are positive integers, 0≤t≤T;
[0215] The aggregation module 1005 is also used to perform information aggregation processing based on the fourth eigenvector and the sixth eigenvector for the t+1th round of iteration, return the obtained first aggregation information and perform the first encoding processing, and the sixth eigenvector is the eigenvector corresponding to the aspect word extraction task after the t-round information transmission processing; for the t+1th round of iteration, perform information aggregation processing based on the fourth eigenvector and the seventh eigenvector, return the obtained second aggregation information and perform the second encoding processing, and the seventh eigenvector is the eigenvector corresponding to the opinion word extraction task after the t-round information transmission processing; for the t+1th round of iteration, perform information aggregation processing based on the fifth eigenvector and the eighth eigenvector, return the obtained third aggregation information and perform the third encoding processing, and the eighth eigenvector is the eigenvector corresponding to the aspect-level sentiment classification task after the t-round information transmission processing.
[0216] In one possible implementation, the aggregation module 1005 is further used to obtain, after T rounds of iterations, the final hidden layer representation vector of each word in the text to be processed based on the aggregation information obtained in the T-th round of iterations; perform full connection processing on the final hidden layer representation vector of each word in the text to be processed to obtain the aspect words and aspect-level sentiment polarity classification results of the text to be processed.
[0217] In a possible implementation, the routing module 1004 is further configured to obtain an adjacency matrix of the text to be processed, wherein the element A in the adjacency matrix is j|i The first value indicates that there is no syntactic relationship between the i-th word and the j-th word in the text to be processed, and the second value indicates that there is a syntactic relationship between the i-th word and the j-th word; according to the second feature vector and the adjacency matrix of the text to be processed, the second feature information transferred from the opinion word extraction task to the aspect-level sentiment classification task is obtained; wherein, the values of i and j are both positive integers, 1≤i, j≤n, and n is the total number of words included in the text to be processed.
[0218] In a possible implementation, the routing module 1004 is further configured to obtain the hidden layer representation vector of the i-th word in the second feature vector; and obtain W ij , the W ij Refers to the weight matrix between the i-th word and the j-th word; Get b i and b j|i , the b i Refers to the probability that the hidden layer representation vector of the i-th word in the second feature vector is transferred to the hidden layer representation vector of each word in the third feature vector, and the b j|iRefers to the probability of the hidden layer representation vector of the i-th word in the second feature vector being transferred to the hidden layer representation vector of the j-th word in the third feature vector; according to the adjacency matrix, the W ij , the hidden layer representation vector of the i-th word in the second feature vector, the b i and the b j|i Sure Among them, the Refers to the feature information of the hidden layer representation vector of the j-th word transferred from the second feature vector to the third feature vector.
[0219] In a possible implementation, the aggregation module 1005 is further configured to and Perform the first full connection process and obtain Return to the task-oriented module 1003;
[0220] Task-oriented module 1003 is also used to obtain performing the first encoding process;
[0221] in, refers to the hidden layer representation vector of the i-th word in the sixth eigenvector, Refers to the hidden layer representation vector of the i-th word corresponding to the aspect word extraction task after t+1 iterations, and respectively refer to the prediction results of the aspect word extraction task, the opinion word extraction task, and the aspect-level sentiment classification task after t iterations, Refers to the attention mechanism weight of the document-level domain classification task after t iterations, is obtained based on the fourth eigenvector.
[0222] In a possible implementation, the aggregation module 1005 is further configured to and Perform the first full connection process and obtain Return to the task-oriented module 1003;
[0223] Task-oriented module 1003 is also used to obtain performing the second encoding process;
[0224] in, refers to the hidden layer representation vector of the i-th word in the seventh eigenvector, Refers to the hidden layer representation vector of the i-th word corresponding to the opinion word extraction task after t+1 iterations, and respectively refer to the prediction results of the aspect word extraction task, the opinion word extraction task, and the aspect-level sentiment classification task after t iterations, Refers to the attention mechanism weight of the document-level domain classification task after t iterations, is obtained based on the fourth eigenvector.
[0225] In a possible implementation, the aggregation module 1005 is further configured to and Perform the second full connection process and obtain Return to the task-oriented module 1003;
[0226] Task-oriented module 1003 is also used to obtain performing the first encoding process;
[0227] in, refers to the hidden layer representation vector of the i-th word in the eighth feature vector, refers to the hidden layer representation vector of the i-th word corresponding to the aspect-level sentiment classification task after t+1 iterations, and respectively refer to the prediction results of the aspect word extraction task, the opinion word extraction task, and the aspect-level sentiment classification task after t iterations, Refers to the prediction result of the document-level sentiment classification task after t iterations, Refers to the attention mechanism weight of the document-level sentiment classification task after t iterations, is obtained based on the fifth eigenvector.
[0228] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present disclosure, and will not be described in detail here.
[0229] It should be noted that the text processing device provided in the above embodiment is merely illustrated by the division of the aforementioned functional modules when processing text. In actual applications, the aforementioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the text processing device provided in the above embodiment and the text processing method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0230] Figure 111 is a structural diagram of a sentiment analysis system provided in an embodiment of the present application, wherein the sentiment analysis system can be expressed as a server. The server 1100 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1101 and one or more memories 1102, wherein the memory 1102 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 1101 to implement the text processing method provided by the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server may also include other components for implementing device functions, which will not be described in detail here.
[0231] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions. The instructions can be executed by a processor in the sentiment analysis system to perform the text processing method in the above embodiment. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0232] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.
[0233] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A text processing method, characterized in that: The method comprises: Obtaining a text to be processed, and performing vectorization processing on the text to be processed to obtain a shared feature vector; Performing a first encoding process corresponding to the aspect word extraction task, a second encoding process corresponding to the opinion word extraction task, and a third encoding process corresponding to the aspect-level sentiment classification task on the shared feature vector, respectively, to obtain a first feature vector, a second feature vector, and a third feature vector in sequence; performing information transfer processing based on the first feature vector, the second feature vector, and the third feature vector, wherein the information transfer processing refers to bidirectional feature information transfer between any two tasks among the aspect word extraction task, the opinion word extraction task, and the aspect-level sentiment classification task; Based on the feature vector obtained after the information transfer processing, the text to be processed is subjected to aspect word extraction and aspect-level sentiment polarity classification; For the aspect-level sentiment classification task, the information transfer process includes: According to the first feature vector, obtaining first feature information transferred from the aspect word extraction task to the aspect-level sentiment classification task; Get the adjacency matrix of the text to be processed, the element A in the adjacency matrix j|i The first value indicates that there is no syntactic relationship between the i-th word and the j-th word in the text to be processed, and the second value indicates that there is a syntactic relationship between the i-th word and the j-th word; according to the second feature vector and the adjacency matrix of the text to be processed, the second feature information transferred from the opinion word extraction task to the aspect-level sentiment classification task is obtained; wherein the values of i and j are both positive integers, 1≤i, j≤n, and n is the total number of words included in the text to be processed; A feature connection process is performed based on the third feature vector, the first feature information, and the second feature information.
2. The method according to claim 1, characterized in that The method further comprises: Performing a fourth encoding process corresponding to a document-level domain classification task and a fifth encoding process corresponding to a document-level sentiment classification task on the shared feature vector, thereby obtaining a fourth feature vector and a fifth feature vector in sequence; The feature vector obtained after the information transfer processing is used to extract aspect words and classify the sentiment polarity at the aspect level on the text to be processed, including: Performing information aggregation processing based on the fourth eigenvector, the fifth eigenvector, and the eigenvector obtained after the information transfer processing; wherein the fourth eigenvector is unidirectionally transferred to the aspect word extraction task and the opinion word extraction task, and the fifth eigenvector is unidirectionally transferred to the aspect-level sentiment classification task; Based on the obtained aggregated information, aspect words are extracted and aspect-level sentiment polarity classification is performed on the text to be processed.
3. The method according to claim 1, characterized in that For the opinion word extraction task, the information transfer process includes: acquiring, according to the first feature vector, third feature information transferred from the aspect word extraction task to the opinion word extraction task; According to the third feature vector, obtaining fourth feature information transferred from the aspect-level sentiment classification task to the opinion word extraction task; A feature connection process is performed based on the second feature vector, the third feature information, and the fourth feature information.
4. The method according to claim 1, wherein For the aspect word extraction task, the information transfer process includes: acquiring, according to the second feature vector, fifth feature information transferred from the opinion word extraction task to the aspect word extraction task; According to the third feature vector, obtaining sixth feature information transferred from the aspect-level sentiment classification task to the aspect word extraction task; A feature connection process is performed based on the first feature vector, the fifth feature information, and the sixth feature information.
5. The method according to claim 2, characterized in that The text processing includes T iterations, wherein T and t are positive integers, 0≤t≤T; The performing information aggregation processing based on the fourth eigenvector, the fifth eigenvector, and the eigenvector obtained after the information transfer processing includes: For the t+1th round of iteration, information aggregation processing is performed based on the fourth eigenvector and the sixth eigenvector, the obtained first aggregated information is returned and the first encoding processing is performed, and the sixth eigenvector is the eigenvector corresponding to the aspect word extraction task after the tth round of information transfer processing; For the t+1th round of iteration, performing information aggregation processing based on the fourth eigenvector and the seventh eigenvector, returning the obtained second aggregated information and performing the second encoding processing, the seventh eigenvector being the eigenvector corresponding to the opinion word extraction task after the tth round of information transfer processing; For the t+1th round of iterative process, information aggregation processing is performed based on the fifth eigenvector and the eighth eigenvector, the obtained third aggregated information is returned and the third encoding processing is performed, and the eighth eigenvector is the eigenvector corresponding to the aspect-level sentiment classification task after the t-round information transmission processing.
6. The method according to claim 5, wherein the extracting aspect words and classifying aspect-level sentiment polarity of the text to be processed based on the obtained aggregated information comprises: After T rounds of iteration, based on the aggregated information obtained in the T-th round of iteration, the final hidden layer representation vector of each word in the text to be processed is obtained; Fully connected the final hidden layer representation vector of each word in the text to be processed to obtain the aspect words and aspect-level sentiment polarity classification results of the text to be processed.
7. The method according to claim 1, characterized in that The step of obtaining, based on the second feature vector and the adjacency matrix of the text to be processed, the second feature information transferred from the opinion word extraction task to the aspect-level sentiment classification task includes: Obtaining a hidden layer representation vector of the i-th word in the second feature vector; Get W ij , the W ij Refers to the weight matrix between the i-th word and the j-th word; Get b i and b j|i , the b i Refers to the probability that the hidden layer representation vector of the i-th word in the second feature vector is transferred to the hidden layer representation vector of each word in the third feature vector, and the b j|i refers to the probability that the hidden layer representation vector of the i-th word in the second feature vector is transferred to the hidden layer representation vector of the j-th word in the third feature vector; According to the adjacency matrix, the W ij , the hidden layer representation vector of the i-th word in the second feature vector, the b i and the b j|i Sure Among them, the Refers to the feature information of the hidden layer representation vector of the j-th word transferred from the second feature vector to the third feature vector.
8. The method according to claim 5, characterized in that The performing information aggregation processing based on the fourth eigenvector and the sixth eigenvector, returning the obtained first aggregated information and performing the first encoding processing includes: right and Perform the first full connection process and obtain Return and execute the first encoding process; in, refers to the hidden layer representation vector of the i-th word in the sixth eigenvector, Refers to the hidden layer representation vector of the i-th word corresponding to the aspect word extraction task after t+1 iterations, and respectively refer to the prediction results of the aspect word extraction task, the opinion word extraction task, and the aspect-level sentiment classification task after t iterations, Refers to the attention mechanism weight of the document-level domain classification task after t iterations, is obtained based on the fourth eigenvector.
9. The method according to claim 5, characterized in that The performing information aggregation processing based on the fourth eigenvector and the seventh eigenvector, returning the obtained second aggregated information and performing the second encoding processing includes: right and Perform the first full connection process and obtain Return and execute the second encoding process; in, refers to the hidden layer representation vector of the i-th word in the seventh eigenvector, Refers to the hidden layer representation vector of the i-th word corresponding to the opinion word extraction task after t+1 iterations, and respectively refer to the prediction results of the aspect word extraction task, the opinion word extraction task, and the aspect-level sentiment classification task after t iterations, Refers to the attention mechanism weight of the document-level domain classification task after t iterations, is obtained based on the fourth eigenvector.
10. The method according to claim 5, characterized in that The performing information aggregation processing based on the fifth eigenvector and the eighth eigenvector, returning the obtained third aggregated information and performing the third encoding processing includes: right and Perform the second full connection process and obtain Return and execute the first encoding process; in, refers to the hidden layer representation vector of the i-th word in the eighth feature vector, refers to the hidden layer representation vector of the i-th word corresponding to the aspect-level sentiment classification task after t+1 iterations, and respectively refer to the prediction results of the aspect word extraction task, the opinion word extraction task, and the aspect-level sentiment classification task after t iterations, Refers to the prediction result of the document-level sentiment classification task after t iterations, Refers to the attention mechanism weight of the document-level sentiment classification task after t iterations, is obtained based on the fifth eigenvector.
11. A text processing device, characterized in that: The device comprises: Acquisition module, used to obtain the text to be processed; A shared encoding module, configured to perform vectorization processing on the text to be processed to obtain a shared feature vector; a task-oriented module, configured to perform a first encoding process corresponding to an aspect word extraction task, a second encoding process corresponding to an opinion word extraction task, and a third encoding process corresponding to an aspect-level sentiment classification task on the shared feature vector, to sequentially obtain a first feature vector, a second feature vector, and a third feature vector; a routing module, configured to perform information transfer processing based on the first feature vector, the second feature vector, and the third feature vector, wherein the information transfer processing refers to bidirectional feature information transfer between any two tasks among the aspect word extraction task, the opinion word extraction task, and the aspect-level sentiment classification task; an aggregation module, configured to extract aspect words and classify aspect-level sentiment polarity of the text to be processed based on a feature vector obtained after information transfer processing; The routing module is further used to obtain, for the aspect-level sentiment classification task, the first feature information transferred from the aspect word extraction task to the aspect-level sentiment classification task according to the first feature vector; obtain the adjacency matrix of the text to be processed, and the element A in the adjacency matrix is j|i The first value indicates that there is no syntactic relationship between the i-th word and the j-th word in the text to be processed, and the second value indicates that there is a syntactic relationship between the i-th word and the j-th word; according to the second eigenvector and the adjacency matrix of the text to be processed, the second feature information transferred from the opinion word extraction task to the aspect-level sentiment classification task is obtained; wherein the values of i and j are both positive integers, 1≤i, j≤n, and n is the total number of words included in the text to be processed; feature connection processing is performed based on the third eigenvector, the first feature information and the second feature information.
12. A storage medium, characterized in that: The storage medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the text processing method according to any one of claims 1 to 10.
13. An electronic device, characterized in that: The device includes a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the text processing method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Text data processing method and device, electronic equipment and storage medium
CN110781273A