Product review sentiment analysis method, system, electronic device and storage medium

By using a pre-trained language model to obtain word embedding representations in product review sentiment analysis, and combining syntax and part-of-speech attention calculation, high-accuracy analysis of emotional polarity is achieved, solving the problem of low intelligence in the existing technology.

CN113536773BActive Publication Date: 2025-04-04BEIJING MININGLAMP SOFTWARE SYST CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202110821905.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-20
Publication Date
2025-04-04
Estimated Expiration
2041-07-20

AI Technical Summary

Technical Problem

The existing product review sentiment analysis methods are low in intelligence, making it difficult to conduct sentiment analysis quickly and effectively.

Method used

The word embedding representation acquisition step is adopted, and the word embedding representation in the comment is obtained through pre-trained language models such as RoBERTa; then the syntactic and part-of-speech attention calculation of the comment is obtained through syntactic attention calculation and part-of-speech attention calculation; finally, through interactive attention calculation and softmax processing of the fully connected layer, the emotional polarity of the comment under a specific evaluation object is obtained.

Benefits of technology

It improves the intelligence of product review sentiment analysis, can obtain the emotional polarity in comments more accurately, and provides valuable business decision-making information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113536773B_ABST
    Figure CN113536773B_ABST
Patent Text Reader

Abstract

The present invention proposes a method, system, electronic device and storage medium for sentiment analysis of product reviews, and the technical scheme of the method includes a word embedding representation acquisition step, obtaining a review of a product and an evaluation object of the review, inputting the review and the evaluation object into a pre-trained language model to obtain a word embedding representation of each word in the review; a sentence attention calculation step, calculating the syntactic attention of the review according to the word embedding representation, and further calculating the part-of-speech attention in the review according to the word embedding representation; an interactive attention calculation step, calculating the interactive attention of the syntactic attention and the part-of-speech attention with the word embedding representation; and a sentiment polarity acquisition step, inputting the interactive attention into a fully connected layer, performing softmax processing and obtaining the sentiment polarity of the review under the current evaluation object. The present application solves the problem of low intelligence level of existing sentiment analysis methods for product reviews.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of natural language processing, and in particular relates to a product review sentiment analysis method, system, electronic device and storage medium. Background Art

[0002] Product reviews are an important way for businesses to obtain consumer feedback on products. Understanding the emotions expressed by consumers in product reviews is called sentiment analysis. At present, sentiment analysis based on product reviews is divided into sentence level and evaluation object level. The evaluation object level refers to obtaining the sentiment polarity of a certain attribute or feature of a specific product proposed by consumers. This level of sentiment analysis is very valuable information for business decision-making. However, product reviews are often not structured texts due to the influence of consumer language habits, and the real-time nature of their information and the huge amount of data make it difficult to quickly perform sentiment analysis through manual methods. Therefore, sentiment analysis technology for product reviews based on evaluation objects has attracted the attention of many researchers at home and abroad and has become a hot topic in current research. Summary of the invention

[0003] The embodiments of the present application provide a product review sentiment analysis method, system, electronic device and storage medium to at least solve the problem of low intelligence level of existing product review sentiment analysis methods.

[0004] In a first aspect, an embodiment of the present application provides a method for sentiment analysis of product reviews, comprising: a word embedding representation acquisition step, acquiring a review of a product and an evaluation object of the review, and inputting the review and the evaluation object into a pre-trained language model to obtain a word embedding representation of each word in the review; a sentence attention calculation step, calculating the syntactic attention of the review according to the word embedding representation, and further calculating the part-of-speech attention in the review according to the word embedding representation; an interactive attention calculation step, calculating the interactive attention of the syntactic attention and the part-of-speech attention with the word embedding representation; a sentiment polarity acquisition step, inputting the interactive attention into a fully connected layer, performing softmax processing, and obtaining the sentiment polarity of the review under the current evaluation object.

[0005] Preferably, the word embedding representation acquisition step further includes: inputting the comment and the evaluation object into RoBERTa with shared parameters to obtain the word embedding representation.

[0006] Preferably, the word and sentence attention calculation step further comprises: training the weight V of the kth syntactic dependency relationship in the general Chinese sentiment analysis context through the general Chinese sentiment analysis corpus k, convert the comment into a syntactic dependency tree through a syntactic parsing tool, and calculate the syntactic attention of the i-th word in the comment to the j-th word Wherein i→j represents the syntactic dependency path from the i-th word to the j-th word in the syntactic dependency tree.

[0007] Preferably, the sentence attention calculation step further includes: obtaining a syntactic attention matrix based on the comments, and multiplying the word embedding representation with the syntactic attention matrix to obtain a second word embedding representation, and further training a part-of-speech vector corresponding to each part of speech in the comments, and calculating the part-of-speech attention based on the second word embedding representation and the part-of-speech vector.

[0008] In the second aspect, an embodiment of the present application provides a product review sentiment analysis system, which is applicable to the above-mentioned product review sentiment analysis method, including: a word embedding representation acquisition module, which acquires a review of a product and an evaluation object of the review, and inputs the review and the evaluation object into a pre-trained language model to obtain a word embedding representation of each word in the review; a sentence attention calculation module, which calculates the syntactic attention of the review according to the word embedding representation, and further calculates the part-of-speech attention in the review according to the word embedding representation; an interactive attention calculation module, which calculates the interactive attention of the syntactic attention and the part-of-speech attention with the word embedding representation; a sentiment polarity acquisition module, which inputs the interactive attention into a fully connected layer, performs softmax processing, and obtains the sentiment polarity of the comment under the current evaluation object.

[0009] In some embodiments, the word embedding representation acquisition module further includes: inputting the comment and the evaluation object into RoBERTa with shared parameters to obtain the word embedding representation.

[0010] In some embodiments, the word and sentence attention calculation module further includes: training the weight V of the kth syntactic dependency relationship in the general Chinese sentiment analysis context through the general Chinese sentiment analysis corpus k , convert the comment into a syntactic dependency tree through a syntactic parsing tool, and calculate the syntactic attention of the i-th word in the comment to the j-th word Wherein i→j represents the syntactic dependency path from the i-th word to the j-th word in the syntactic dependency tree.

[0011] In some embodiments, the sentence attention calculation module further includes: obtaining a syntactic attention matrix based on the comments, and multiplying the word embedding representation with the syntactic attention matrix to obtain a second word embedding representation, and further training a part-of-speech vector corresponding to each part of speech in the comments, and calculating the part-of-speech attention based on the second word embedding representation and the part-of-speech vector.

[0012] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a product review sentiment analysis method as described in the first aspect above is implemented.

[0013] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a product review sentiment analysis method as described in the first aspect above.

[0014] The present application can be applied to the field of marketing intelligence technology. Compared with the related art, the present application embodiment provides a product review sentiment analysis method, which gives a complete product review and a specific evaluation object in the review as the input of the model, with the purpose of obtaining the sentiment polarity (positive, neutral, negative) of the review based on the current specific evaluation object. In order to obtain a word vector embedding representation with richer word information, RoBERTa is used as the word embedding tool of the model. Secondly, considering that the syntactic dependency structure and word part of speech can effectively improve the accuracy of sentiment analysis, a syntactic attention module and a part of speech attention module are designed to extract information richer in sentiment polarity in the comments, and then the interactive attention between the text representation and the evaluation object representation is used to reduce the influence of irrelevant words, and finally the sentiment polarity is obtained through the fully connected layer. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0016] Figure 1 This is a flow chart of the product review sentiment analysis method of the present invention;

[0017] Figure 2 This is a framework diagram of the commodity review sentiment analysis system of the present invention;

[0018] Figure 3 A framework diagram of an electronic device of the present invention;

[0019] In the above picture:

[0020] 1. Word embedding representation acquisition module; 2. Word and sentence attention calculation module; 3. Interaction attention calculation module; 4. Sentiment polarity acquisition module; 60. Bus; 61. Processor; 62. Memory; 63. Communication interface. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0022] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as insufficient content disclosed in this application.

[0023] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0024] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a kind of", "the" and the like involved in this application do not indicate a quantitative limitation and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices.

[0025] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings:

[0026] Figure 1 For a flowchart of the product review sentiment analysis method of the present invention, please refer to Figure 1 The product review sentiment analysis method of the present invention comprises the following steps:

[0027] S1: Obtain a review of a product and an evaluation object of the review, and input the review and the evaluation object into a pre-trained language model to obtain a word embedding representation of each word in the review.

[0028] Optionally, the pre-trained language model may be RoBERTa, and the comments and the evaluation objects are input into RoBERTa with shared parameters to obtain the word embedding representation.

[0029] In the specific implementation, the complete product review and the specific evaluation object are simultaneously input into the shared parameter RoBERTa to obtain the word embedding representation of each word. Because RoBERTa is a large-scale pre-trained language model, the word embedding representation obtained in this step contains richer semantic information.

[0030] S2: Calculate the syntactic attention of the comment according to the word embedding representation, and further calculate the part-of-speech attention in the comment according to the word embedding representation.

[0031] Optionally, through the common Chinese sentiment analysis corpus, train the weight V of the kth syntactic dependency in the common Chinese sentiment analysis context k , convert the comment into a syntactic dependency tree through a syntactic parsing tool, and calculate the syntactic attention of the i-th word in the comment to the j-th word Wherein i→j represents the syntactic dependency path from the i-th word to the j-th word in the syntactic dependency tree.

[0032] Optionally, a syntactic attention matrix is ​​obtained based on the comments, and the word embedding representation is multiplied by the syntactic attention matrix to obtain a second word embedding representation, and a part-of-speech vector corresponding to each part of speech in the comments is further trained, and the part-of-speech attention is calculated based on the second word embedding representation and the part-of-speech vector.

[0033] In the specific implementation, the word embedding representation of the complete product review is used for syntactic attention calculation. It is known that a sentence can be decomposed into a complete syntactic dependency tree through syntactic dependency parsing. The lines between nodes in the syntactic dependency tree represent different syntactic dependency relationships. Different syntactic dependency relationships have different weights for sentiment analysis. First, through the general Chinese sentiment analysis corpus, the weight V of the kth syntactic dependency relationship in the general sentiment analysis context is trained. kThe current complete product review is converted into a syntactic dependency tree through a syntactic parsing tool. The syntactic attention of the i-th word in the sentence to the j-th word can be expressed as Where i→j represents the syntactic dependency path from word i to word j in the syntactic dependency tree. For a product review with a length of n, a syntactic attention matrix of size n*n can be obtained. The word embedding representation is matrix-multiplied with the syntactic attention matrix to obtain a new word embedding representation, i.e., the second word embedding representation.

[0034] In the specific implementation, the acquired second word embedding representation is used for part-of-speech attention calculation. First, the corresponding part-of-speech vector is trained for each part-of-speech on the current product review corpus, and the second word embedding representation and the part-of-speech vector are used for attention calculation, which can effectively consider the impact of different parts of speech on the sentiment analysis results.

[0035] S3: Calculate the interactive attention between the syntactic attention and the part-of-speech attention and the word embedding representation.

[0036] In a specific implementation, the obtained words are combined with the syntactic attention and part-of-speech attention of the syntactic relationship and part-of-speech relationship, and the interactive attention is calculated with the word embedding representation of the evaluation object obtained in step S1. It can be calculated that under the current evaluation object, the parts of the sentence that the sentiment polarity should pay more attention to.

[0037] S4: Input the interactive attention into the fully connected layer, perform softmax processing, and obtain the sentiment polarity of the comment under the current evaluation object.

[0038] In a specific implementation, the result obtained in step S3 is input into the fully connected layer, and after softmax processing, the sentiment polarity of the complete product review under the current evaluation object is obtained.

[0039] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0040] The embodiment of the present application provides a product review sentiment analysis system, which is applicable to the above-mentioned product review sentiment analysis method. As used below, the terms "unit", "module", etc. can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0041] Figure 2For a framework diagram of the commodity review sentiment analysis system according to the present invention, see Figure 2 ,include:

[0042] Word embedding representation acquisition module 1: obtain a comment on a product and the evaluation object of the comment, and input the comment and the evaluation object into a pre-trained language model to obtain the word embedding representation of each word in the comment.

[0043] Optionally, the pre-trained language model may be RoBERTa, and the comments and the evaluation objects are input into RoBERTa with shared parameters to obtain the word embedding representation.

[0044] In the specific implementation, the complete product reviews and specific evaluation objects are simultaneously input into the shared parameter RoBERTa to obtain the word embedding representation of each word. Because RoBERTa is a large-scale pre-trained language model, the word embedding representation obtained in this module contains richer semantic information.

[0045] Word and sentence attention calculation module 2: calculates the syntactic attention of the comment according to the word embedding representation, and further calculates the part-of-speech attention in the comment according to the word embedding representation.

[0046] Optionally, through the common Chinese sentiment analysis corpus, train the weight V of the kth syntactic dependency in the common Chinese sentiment analysis context k , convert the comment into a syntactic dependency tree through a syntactic parsing tool, and calculate the syntactic attention of the i-th word in the comment to the j-th word Wherein i→j represents the syntactic dependency path from the i-th word to the j-th word in the syntactic dependency tree.

[0047] Optionally, a syntactic attention matrix is ​​obtained based on the comments, and the word embedding representation is multiplied by the syntactic attention matrix to obtain a second word embedding representation, and a part-of-speech vector corresponding to each part of speech in the comments is further trained, and the part-of-speech attention is calculated based on the second word embedding representation and the part-of-speech vector.

[0048] In the specific implementation, the word embedding representation of the complete product review is used for syntactic attention calculation. It is known that a sentence can be decomposed into a complete syntactic dependency tree through syntactic dependency parsing. The lines between nodes in the syntactic dependency tree represent different syntactic dependency relationships. Different syntactic dependency relationships have different weights for sentiment analysis. First, through the general Chinese sentiment analysis corpus, the weight V of the kth syntactic dependency relationship in the general sentiment analysis context is trained. kThe current complete product review is converted into a syntactic dependency tree through a syntactic parsing tool. The syntactic attention of the i-th word in the sentence to the j-th word can be expressed as Where i→j represents the syntactic dependency path from word i to word j in the syntactic dependency tree. For a product review with a length of n, a syntactic attention matrix of size n*n can be obtained. The word embedding representation is matrix-multiplied with the syntactic attention matrix to obtain a new word embedding representation, i.e., the second word embedding representation.

[0049] In the specific implementation, the acquired second word embedding representation is used for part-of-speech attention calculation. First, the corresponding part-of-speech vector is trained for each part-of-speech on the current product review corpus, and the second word embedding representation and the part-of-speech vector are used for attention calculation, which can effectively consider the impact of different parts of speech on the sentiment analysis results.

[0050] Interactive attention calculation module 3: performs interactive attention calculation on the syntactic attention and the part-of-speech attention with the word embedding representation.

[0051] In the specific implementation, the syntactic attention and part-of-speech attention of the acquired words combined with the syntactic relationship and part-of-speech relationship are used to calculate the interactive attention with the word embedding representation of the evaluation object obtained in the word embedding representation acquisition module 1. It can be calculated that under the current evaluation object, the parts of the sentence that the sentiment polarity should pay more attention to.

[0052] Sentiment polarity acquisition module 4: input the interactive attention into the fully connected layer, perform softmax processing and obtain the sentiment polarity of the comment under the current evaluation object.

[0053] In the specific implementation, the result obtained by the interactive attention calculation module 3 is input into the fully connected layer, and the sentiment polarity of the complete product review under the current evaluation object is obtained after softmax processing.

[0054] In addition, combined Figure 1 The described product review sentiment analysis method can be implemented by an electronic device. Figure 3 It is a framework diagram of the electronic device of the present invention.

[0055] The electronic device may include a processor 61 and a memory 62 storing computer program instructions.

[0056] Specifically, the processor 61 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0057] Among them, the memory 62 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 62 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 62 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 62 may be inside or outside the data processing device. In a specific embodiment, the memory 62 is a non-volatile memory. In a specific embodiment, the memory 62 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (Programmable Read-Only Memory, PROM for short), an erasable PROM (Erasable ProgrammableRead-Only Memory, EPROM for short), an electrically erasable PROM (Electrically Erasable ProgrammableRead-Only Memory, EEPROM for short), an electrically alterable ROM (Electrically Alterable Read-Only Memory, EAROM for short) or a flash memory (FLASH) or a combination of two or more of these. Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM can be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.

[0058] The memory 62 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 61 .

[0059] The processor 61 implements any one of the commodity review sentiment analysis methods in the above embodiments by reading and executing computer program instructions stored in the memory 62 .

[0060] In some of the embodiments, the electronic device may further include a communication interface 63 and a bus 60. Figure 3 As shown, the processor 61, the memory 62, and the communication interface 63 are connected via a bus 60 and communicate with each other.

[0061] The communication port 63 can realize data communication with other components such as external devices, image / data acquisition devices, databases, external storage, and image / data processing workstations.

[0062] The bus 60 includes hardware, software or both, and couples the components of the electronic device to each other. The bus 60 includes but is not limited to at least one of the following: a data bus, an address bus, a control bus, an expansion bus, and a local bus. By way of example and not limitation, bus 60 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, bus 60 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.

[0063] The electronic device can execute a product review sentiment analysis method in an embodiment of the present application.

[0064] In addition, in combination with a product review sentiment analysis method in the above embodiment, the present application embodiment can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any product review sentiment analysis method in the above embodiment is implemented.

[0065] The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes.

[0066] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0067] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for sentiment analysis of product reviews, characterized in that: include: A word embedding representation acquisition step, acquiring a review of a product and an evaluation object of the review, and inputting the review and the evaluation object into a pre-trained language model to acquire a word embedding representation of each word in the review; a word and sentence attention calculation step, calculating the syntactic attention of the comment according to the word embedding representation, and further calculating the part-of-speech attention in the comment according to the word embedding representation; An interactive attention calculation step, performing interactive attention calculation on the syntactic attention and the part-of-speech attention and the word embedding representation; The sentiment polarity acquisition step is to input the interactive attention into the fully connected layer, and obtain the sentiment polarity of the comment under the current evaluation object after softmax processing; Input the comment and the evaluation object into RoBERTa with shared parameters to obtain the word embedding representation; The word and sentence attention calculation step further includes: Through the common Chinese sentiment analysis corpus, the weight V of the kth syntactic dependency in the common Chinese sentiment analysis context is trained. k , convert the comment into a syntactic dependency tree through a syntactic parsing tool, and calculate the syntactic attention of the i-th word in the comment to the j-th word Wherein i→j represents the syntactic dependency path from the i-th word to the j-th word in the syntactic dependency tree; The word and sentence attention calculation step further includes: A syntactic attention matrix is ​​obtained according to the comments, and the word embedding representation is multiplied by the syntactic attention matrix to obtain a second word embedding representation, and a part-of-speech vector corresponding to each part of speech in the comments is further trained, and the part-of-speech attention is calculated according to the second word embedding representation and the part-of-speech vector, wherein a corresponding part-of-speech vector is trained for each part of speech on the current product review corpus, and attention calculation is performed on the second word embedding representation and the part-of-speech vector.

2. A product review sentiment analysis system, characterized in that: include: A word embedding representation acquisition module is used to acquire a review of a product and an evaluation object of the review, and input the review and the evaluation object into a pre-trained language model to acquire a word embedding representation of each word in the review; a word and sentence attention calculation module, which calculates the syntactic attention of the comment according to the word embedding representation, and further calculates the part-of-speech attention in the comment according to the word embedding representation; An interactive attention calculation module, which performs interactive attention calculation on the syntactic attention and the part-of-speech attention with the word embedding representation; The sentiment polarity acquisition module inputs the interactive attention into the fully connected layer, performs softmax processing, and obtains the sentiment polarity of the comment under the current evaluation object; The word embedding representation acquisition module further includes: inputting the comment and the evaluation object into RoBERTa with shared parameters to obtain the word embedding representation; The word and sentence attention calculation module further includes: Through the common Chinese sentiment analysis corpus, the weight V of the kth syntactic dependency in the common Chinese sentiment analysis context is trained. k , convert the comment into a syntactic dependency tree through a syntactic parsing tool, and calculate the syntactic attention of the i-th word in the comment to the j-th word Wherein i→j represents the syntactic dependency path from the i-th word to the j-th word in the syntactic dependency tree; The word and sentence attention calculation module further includes: A syntactic attention matrix is ​​obtained according to the comments, and the word embedding representation is multiplied by the syntactic attention matrix to obtain a second word embedding representation, and a part-of-speech vector corresponding to each part of speech in the comments is further trained, and the part-of-speech attention is calculated according to the second word embedding representation and the part-of-speech vector, wherein a corresponding part-of-speech vector is trained for each part of speech on the current product review corpus, and attention calculation is performed on the second word embedding representation and the part-of-speech vector.

3. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the product review sentiment analysis method according to claim 1 is implemented.

4. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the product review sentiment analysis method as described in claim 1 is implemented.

Citation Information

Patent Citations

  • A topic text-oriented interactive attention coding sentiment analysis method

    CN109885670A

  • Knowledge graph relational data classification method based on syntactic attention neural network

    CN111177394A

  • Emotion feature representation learning system and method based on global interaction and syntax dependence

    CN111488734A

  • Text sentiment classification method and system

    CN111881291A