Emotion analysis method and device, equipment, medium and program product

Through the emotion analysis model, the method of processing and quantifying dialogue data in the financial field is solved, and the traditional financial field system relies on manual operations and low accuracy of sentiment analysis results is achieved, achieving more efficient and accurate sentiment analysis.

CN119719376APending Publication Date: 2025-03-28INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411869178.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The traditional financial field system relies on manual operations, is inefficient and prone to errors, and the existing NLP technology cannot be quantified in the judgment of emotional polarity, resulting in the accuracy of the emotional analysis results being insufficient.

Method used

A sentiment analysis method is provided. Through the decoder of the sentiment analysis model, the user's initial conversation data is processed, the lost data is completed, and feature extraction is performed based on preset feature indicators, the normalized feature value and emotional intensity of the conversation segment are determined, and aspect-level sentiment analysis is finally carried out to improve the accuracy of sentiment analysis.

Benefits of technology

By quantifying emotional intensity, emotional polarity can be determined more accurately, the accuracy of emotion analysis can be improved, and the efficiency and intelligence of the financial field system can be enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719376A_ABST
    Figure CN119719376A_ABST
Patent Text Reader

Abstract

The invention provides an emotion analysis method and device, equipment, a storage medium and a program product, which can be applied to the technical fields of natural language processing and financial science and technology. The method comprises the following steps: processing initial dialogue data of a user by using a decoder under the condition that user permission is obtained, so as to obtain dialogue data; based on the preset number of feature indexes, performing preset number of times of feature extraction on the coding features of the plurality of dialog segments to obtain a preset number of feature values of the plurality of dialog segments; determining a normalized feature value based on each feature value of the dialog segment, a feature index corresponding to the feature value and a plurality of feature values in the feature index; based on the normalized feature value corresponding to each feature value, determining the emotional intensity of the dialog segment; based on the emotion intensity, the object category, the object description, the viewpoint description and the emotion polarity, determining an emotion analysis sub-result of the dialog segment; and based on the plurality of sentiment analysis sub-results, determining a sentiment analysis result of the dialogue data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of artificial intelligence and financial technology, specifically to the field of natural language processing, and more specifically to a sentiment analysis method, device, equipment, medium and program product. Background Art

[0002] Traditional financial systems usually rely on manual operations, which is inefficient and error-prone. With the continuous advancement of artificial intelligence and natural language processing (NLP) technology, NLP technology has been widely used in the financial field. In this field, NLP technology can be used for text analysis, semantic understanding and information extraction to improve work efficiency, enhance user experience, and improve the intelligence of services.

[0003] In related technologies, the sentiment polarity determined by NLP is usually used to judge the sentiment polarity of text, which can only classify the sentiment tendency of the text into positive, neutral or negative, but cannot quantify it, resulting in the insufficient accuracy of the sentiment analysis results. Summary of the invention

[0004] In view of the above problems, the present disclosure provides a sentiment analysis method, apparatus, device, medium and program product.

[0005] According to a first aspect of the present disclosure, a sentiment analysis method is provided, comprising: with the permission of the user, using a decoder of a sentiment analysis model to process the initial dialogue data of the user to obtain dialogue data, wherein the decoder is used to complete the missing data in the initial dialogue data according to the semantics of the initial dialogue data to obtain the dialogue data; performing a preset number of feature extractions on the encoding features of a plurality of dialogue segments based on a preset number of feature indicators respectively to obtain a preset number of feature values ​​of each of the plurality of dialogue segments, wherein the plurality of dialogue segments are obtained by slicing the dialogue data; for each dialogue segment, determining a normalized feature value of the dialogue segment on the feature indicator based on each feature value of the dialogue segment, a feature indicator corresponding to the feature value, and a plurality of feature values ​​in the feature indicator; determining the sentiment intensity of the dialogue segment based on the normalized feature value on the feature indicator corresponding to each feature value; determining a sentiment analysis sub-result of the dialogue segment based on the sentiment intensity, object category, object description, viewpoint description, and sentiment polarity, wherein the object category, object intensity, viewpoint description, and sentiment polarity are obtained by performing aspect-level sentiment analysis on the dialogue segment; and determining a sentiment analysis result of the dialogue data based on the sentiment analysis sub-results of each of the plurality of dialogue segments.

[0006] According to an embodiment of the present disclosure, based on each feature value of the dialogue segment, the feature index corresponding to the feature value and multiple feature values ​​in the feature index, a normalized feature value of the dialogue segment on the feature index is determined, including: based on the multiple feature values ​​in the feature index, determining the maximum feature value and the minimum feature value in the multiple feature values ​​corresponding to each feature indicator; and based on the maximum feature value and the minimum feature value, normalizing the feature value to obtain a normalized feature value.

[0007] According to an embodiment of the present disclosure, a sentiment analysis sub-result of a discourse segment is determined based on sentiment intensity, object category, object description, viewpoint description and sentiment polarity, including: performing aspect-level sentiment analysis on the discourse segment to determine the object category, object description, viewpoint description and sentiment polarity of the discourse segment; performing feature fusion of the sentiment intensity, object category, object description, viewpoint description and sentiment polarity to obtain a fusion feature of the discourse segment; and determining a sentiment analysis sub-result of the discourse segment based on the fusion feature.

[0008] According to an embodiment of the present disclosure, the user's initial conversation data is processed using a decoder of a sentiment analysis model to obtain conversation data, including: determining unknown conversation data that is invisible in the initial conversation data; using the decoder to restore the unknown conversation data based on the semantics of the initial conversation data to obtain restored data; and using the restored data to repair the initial conversation data to obtain conversation data.

[0009] According to an embodiment of the present disclosure, the sentiment analysis method further includes: text embedding the dialogue segment to obtain a text embedding vector of the dialogue segment; and encoding the text embedding vector using an encoder to obtain an encoding feature of the dialogue segment.

[0010] According to an embodiment of the present disclosure, a sentiment analysis model is trained in the following manner: sample conversation data is sliced ​​to obtain a plurality of sample conversation segments; based on the text complexity of each of the plurality of sample conversation segments, the plurality of sample conversation segments are randomly masked to obtain masked segments, wherein the masking probability of the random masking is determined according to the text complexity; the masked segments are restored using a decoder of an initial sentiment analysis model to obtain restored segments; text embedding and encoding are performed on the restored segments to obtain sample coding features of each of the plurality of sample conversation segments; using the initial sentiment analysis model, based on a preset number of feature indicators, a preset number of feature extractions are performed on the plurality of sample coding features to obtain a preset number of sample feature values ​​of each of the plurality of sample conversation segments; for each sample conversation segment, based on each sample feature value of the sample conversation segment and the feature values ​​corresponding to the sample feature values, The method comprises the following steps: using the index and multiple sample feature values ​​in the feature index to determine the normalized sample feature value of the sample dialogue segment on the feature index; determining the sample emotion intensity of the sample dialogue segment based on the normalized feature value on the feature index corresponding to each sample feature value; determining the sample emotion analysis sub-result of the sample dialogue segment based on the sample emotion intensity, sample object category, sample object description, sample viewpoint description and sample emotion polarity, wherein the sample object category, sample object description, sample viewpoint description and sample emotion polarity are obtained by performing aspect-level emotion analysis on the sample dialogue segment; determining the loss value of the sample dialogue segment based on the sample emotion analysis sub-result and the sample sub-result corresponding to the sample dialogue segment; and adjusting the model parameters of the initial emotion analysis model based on the loss value until the loss value is less than the loss threshold, and determining the emotion analysis model based on the current model parameters of the initial emotion analysis model.

[0011] According to an embodiment of the present disclosure, a loss value of a sample dialogue segment is determined based on a sample sentiment analysis sub-result and a sample sub-result corresponding to a sample dialogue segment, including: determining a cross entropy loss, an object loss, and an opinion loss based on the sample sentiment analysis sub-result and the sample sub-result; determining a sentiment loss based on the sample sentiment intensity and the sample sentiment polarity; and determining a loss value based on the cross entropy loss, the object loss, the opinion loss, and the sentiment loss.

[0012] The second aspect of the present disclosure provides a sentiment analysis device, including: a dialogue processing module, which is used to process the user's initial dialogue data using a decoder of a sentiment analysis model with the user's permission to obtain dialogue data, wherein the decoder is used to complete the missing data in the initial dialogue data according to the semantics of the initial dialogue data to obtain the dialogue data; a feature extraction module, which is used to perform a preset number of feature extractions on the encoding features of multiple dialogue segments based on a preset number of feature indicators, respectively, to obtain a preset number of feature values ​​of each of the multiple dialogue segments, wherein the multiple dialogue segments are obtained by slicing the dialogue data; a feature value normalization module, which is used to extract the feature values ​​of the multiple dialogue segments based on the preset number of feature indicators for each dialogue segment. Each feature value of a discourse segment, a feature index corresponding to the feature value, and multiple feature values ​​in the feature index are used to determine the normalized feature value of the dialogue segment on the feature index; an intensity determination module is used to determine the emotional intensity of the dialogue segment based on the normalized feature value on the feature index corresponding to each feature value; a sub-result determination module is used to determine the emotional analysis sub-result of the dialogue segment based on the emotional intensity, object category, object description, viewpoint description, and emotional polarity, wherein the object category, object intensity, viewpoint description, and emotional polarity are obtained by performing aspect-level emotional analysis on the dialogue segment; and a result determination module is used to determine the emotional analysis result of the dialogue data based on the emotional analysis sub-results of each of the multiple dialogue segments.

[0013] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0014] The fourth aspect of the present disclosure further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the above computer program or instructions are executed by a processor.

[0015] The fifth aspect of the present disclosure further provides a computer program product, including a computer program or instructions, which implement the steps of the above method when the above computer program or instructions are executed by a processor.

[0016] According to an embodiment of the present disclosure, the user's conversation data is input into a sentiment analysis model to determine the feature strength, object category, object description, viewpoint description and sentiment polarity of the conversation data, thereby determining the data characteristics of the conversation data, and further determining the sentiment analysis results of the conversation data. By quantifying the sentiment strength, the sentiment polarity can be determined more accurately, thereby improving the accuracy of the sentiment analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0018] Figure 1 The application scenario diagram of the sentiment analysis method, apparatus, device, medium and program product according to the embodiments of the present disclosure is schematically shown;

[0019] Figure 2 The flowchart of the sentiment analysis method according to the embodiment of the present disclosure is schematically shown;

[0020] Figure 3 A schematic diagram schematically shows masking and encoding of a sample dialogue segment by a sample sentiment analysis model according to an embodiment of the present disclosure;

[0021] Figure 4 A structural block diagram of a sentiment analysis device according to an embodiment of the present disclosure is schematically shown; and

[0022] Figure 5 A block diagram of an electronic device suitable for implementing a sentiment analysis method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0023] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0024] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0025] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0026] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0027] In the technical solution of the present disclosure, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0028] In the scenario of using personal information for automated decision-making, the methods, devices, and systems provided by the embodiments of the present disclosure provide users with corresponding operation portals for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating a person's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs, and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge and skills, and have reached a certain level of professionalism.

[0029] The embodiment of the present disclosure provides a sentiment analysis method, comprising: with the permission of the user, using a decoder of a sentiment analysis model to process the initial dialogue data of the user to obtain dialogue data, wherein the decoder is used to complete the missing data in the initial dialogue data according to the semantics of the initial dialogue data to obtain the dialogue data; performing a preset number of feature extractions on the encoding features of multiple dialogue segments based on a preset number of feature indicators respectively to obtain a preset number of feature values ​​of each of the multiple dialogue segments, wherein the multiple dialogue segments are obtained by slicing the dialogue data; for each dialogue segment, based on each feature value of the dialogue segment, a feature indicator corresponding to the feature value, and multiple feature values ​​in the feature indicator, determining a normalized feature value of the dialogue segment on the feature indicator; determining the sentiment intensity of the dialogue segment based on the normalized feature value on the feature indicator corresponding to each feature value; determining a sentiment analysis sub-result of the dialogue segment based on the sentiment intensity, object category, object description, viewpoint description, and sentiment polarity, wherein the object category, object intensity, viewpoint description, and sentiment polarity are obtained by performing aspect-level sentiment analysis on the dialogue segment; and determining a sentiment analysis result of the dialogue data based on the sentiment analysis sub-results of each of the multiple dialogue segments.

[0030] Figure 1 The application scenario diagram of the sentiment analysis method, apparatus, device, medium and program product according to the embodiments of the present disclosure is schematically shown.

[0031] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0032] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).

[0033] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0034] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0035] It should be noted that the sentiment analysis method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the sentiment analysis device provided in the embodiment of the present disclosure can generally be set in the server 105. The sentiment analysis method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the sentiment analysis device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.

[0036] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0037] The following will be based on Figure 1 The scene described by Figure 2~Figure 3 The sentiment analysis method of the disclosed embodiment is described in detail.

[0038] Figure 2 The flowchart of the sentiment analysis method according to the embodiment of the present disclosure is schematically shown.

[0039] like Figure 2 As shown, the sentiment analysis of this embodiment includes operations S210 to S260.

[0040] In operation S210, with the user's permission, the user's initial dialogue data is processed using a decoder of the sentiment analysis model to obtain dialogue data.

[0041] According to an embodiment of the present disclosure, the initial dialogue data is the content of the communication between the user and the customer service when consulting, complaining, etc. The decoder is used to complete the missing data in the initial dialogue data according to the semantics of the initial dialogue data to obtain the dialogue data.

[0042] In operation S220, based on a preset number of feature indicators, feature extraction is performed on the encoding features of the plurality of dialogue segments a preset number of times to obtain a preset number of feature values ​​for each of the plurality of dialogue segments.

[0043] According to an embodiment of the present disclosure, the plurality of dialogue segments are obtained by slicing the dialogue data, wherein the granularity of the slice may be a single sentence, that is, each dialogue segment is a sentence in the dialogue data.

[0044] According to an embodiment of the present disclosure, the feature index may include the frequency of occurrence of words representing emotions, the emotional intensity of words representing emotions, the sentence length of a dialogue segment, the number of occurrences of negative words in a dialogue sentence, the number of occurrences of stop words in a dialogue sentence, the use of punctuation marks in a dialogue sentence, etc. Feature extraction is performed on each dialogue segment according to the above feature indexes to obtain a feature value corresponding to the feature index.

[0045] In operation S230 , for each dialogue segment, based on each feature value of the dialogue segment, a feature index corresponding to the feature value, and multiple feature values ​​in the feature index, a normalized feature value of the dialogue segment on the feature index is determined.

[0046] According to an embodiment of the present disclosure, for each feature value in each dialogue segment, based on the feature index corresponding to the feature value, the feature value corresponding to the feature index in each dialogue segment is determined, and the corresponding feature value of the current dialogue segment is normalized using multiple feature values ​​corresponding to the feature index to obtain a normalized feature value.

[0047] Taking the sentence length of a dialogue segment as an example, the sentence length of the current dialogue segment is determined, and the sentence lengths of multiple dialogue segments are determined respectively. The sentence length of the current dialogue segment is normalized using the multiple sentence lengths, and the normalized feature value of the current dialogue segment on the feature indicator of sentence length can be obtained.

[0048] In operation S240 , the sentiment intensity of the dialogue segment is determined based on the normalized feature value on the feature index corresponding to each feature value.

[0049] According to an embodiment of the present disclosure, the sentiment intensity of a conversation segment can be determined based on the normalized feature values ​​of each feature indicator of the conversation segment and the feature weights of each feature indicator, wherein the feature weights can be determined based on expert experience or in pre-training.

[0050] In operation S250 , a sentiment analysis sub-result of the discourse segment is determined based on sentiment intensity, object category, object description, viewpoint description, and sentiment polarity.

[0051] According to the embodiments of the present disclosure, object category, object strength, viewpoint description and sentiment polarity are obtained by performing aspect-level sentiment analysis on the dialogue segment. Based on sentiment strength and sentiment polarity, the user's sentiment tendency in the dialogue segment can be determined, and the sentiment analysis sub-result of the dialogue segment can be further determined in combination with other parameters.

[0052] In operation S260 , a sentiment analysis result of the dialogue data is determined based on the sentiment analysis sub-results of each of the plurality of dialogue segments.

[0053] According to an embodiment of the present disclosure, sentiment analysis results of the dialogue data may be determined by performing operations such as summing and combining the sentiment analysis sub-results of the multiple dialogue segments.

[0054] According to an embodiment of the present disclosure, the user's conversation data is input into a sentiment analysis model to determine the feature strength, object category, object description, viewpoint description and sentiment polarity of the conversation data, thereby determining the data characteristics of the conversation data, and further determining the sentiment analysis results of the conversation data. By quantifying the sentiment strength, the sentiment polarity can be determined more accurately, thereby improving the accuracy of the sentiment analysis.

[0055] According to an embodiment of the present disclosure, based on each feature value of the dialogue segment, the feature index corresponding to the feature value and multiple feature values ​​in the feature index, a normalized feature value of the dialogue segment on the feature index is determined, including: based on the multiple feature values ​​in the feature index, determining the maximum feature value and the minimum feature value in the multiple feature values ​​corresponding to each feature indicator; and based on the maximum feature value and the minimum feature value, normalizing the feature value to obtain a normalized feature value.

[0056] According to an embodiment of the present disclosure, based on the feature values ​​corresponding to the feature index of each of the multiple dialogue segments, the maximum value and the minimum value are determined as the maximum feature value and the minimum feature value, respectively. Based on the maximum feature value and the minimum feature value, the feature value f corresponding to the current dialogue segment and the feature index is calculated in the manner shown in formula (1). i Normalize:

[0057] (1)

[0058] in, They are the frequency of occurrence of words representing emotions, the emotional intensity of words representing emotions, the sentence length of the dialogue segment, the number of times negative words appear in the dialogue sentence, the number of times stop words appear in the dialogue sentence, and the use of punctuation marks in the dialogue sentence. * The calculation process of (I) is shown in formula (2):

[0059] (2)

[0060] The characteristic index currently calculated is the i-th one among the multiple characteristic indexes, min(I) is the minimum value among the multiple characteristic values ​​of the characteristic index, and max(I) is the maximum value among the multiple characteristic values ​​of the characteristic index.

[0061] According to the embodiments of the present disclosure, by normalizing multiple eigenvalues ​​in each characteristic indicator through the maximum eigenvalue and the minimum eigenvalue corresponding to the characteristic indicator, the sentiment intensity can be within a predetermined value range, so that the sentiment polarity can be correctly weighted when the sentiment intensity is subsequently used for calculation, thereby improving the efficiency and accuracy of sentiment analysis.

[0062] According to an embodiment of the present disclosure, a sentiment analysis sub-result of a discourse segment is determined based on sentiment intensity, object category, object description, viewpoint description and sentiment polarity, including: performing aspect-level sentiment analysis on the discourse segment to determine the object category, object description, viewpoint description and sentiment polarity of the discourse segment; performing feature fusion of the sentiment intensity, object category, object description, viewpoint description and sentiment polarity to obtain a fusion feature of the discourse segment; and determining a sentiment analysis sub-result of the discourse segment based on the fusion feature.

[0063] According to an embodiment of the present disclosure, aspect-based sentiment analysis (ABSA) is a sentiment analysis method that can determine a user's sentiment toward a specific aspect or function of an entity by parsing natural language.

[0064] According to an embodiment of the present disclosure, after using ABSA to determine the object category, object description, viewpoint description and sentiment polarity of a dialogue segment, the user's emotional tendency is determined based on the sentiment polarity and sentiment intensity, wherein the sentiment tendency can simultaneously characterize the user's sentiment polarity and sentiment intensity, that is, whether the attitude towards a certain aspect of an entity is positive or negative, and the degree of positivity or negativity.

[0065] For example, users who express "I like it very much" are more positive than users who express "I like it", and have a higher degree of affirmation of the entity. Users who express "relatively bad" are less negative than users who express "very bad", and have a lower degree of negation of the entity. This can more accurately characterize user emotions.

[0066] According to an embodiment of the present disclosure, object category, object description, viewpoint description and sentiment tendency are fused to obtain fused features, which are processed using a fully connected layer and the sentiment analysis sub-result of the dialogue segment is determined after an activation function.

[0067] According to an embodiment of the present disclosure, feature fusion is performed on the object category, object description, viewpoint description, sentiment polarity, and sentiment intensity determined through aspect-level sentiment analysis, and the sentiment analysis sub-result of the dialogue segment is determined using the fused features. This enables a more accurate quantification of sentiment polarity, thereby improving the accuracy of the sentiment analysis sub-result.

[0068] According to an embodiment of the present disclosure, the user's initial conversation data is processed using a decoder of a sentiment analysis model to obtain conversation data, including: determining unknown conversation data that is invisible in the initial conversation data; using the decoder to restore the unknown conversation data based on the semantics of the initial conversation data to obtain restored data; and using the restored data to repair the initial conversation data to obtain conversation data.

[0069] According to the embodiments of the present disclosure, the initial conversation data of the user may be obtained by converting speech to text in addition to being directly derived from text. Therefore, if the sound quality is poor or the user's expression is unclear, the converted text may be partially invisible. Therefore, this part of the data can be determined as unknown conversation data.

[0070] According to an embodiment of the present disclosure, an encoder is used to determine the semantics of the initial conversation data based on data other than the unknown conversation data in the initial conversation data. A decoder is used to reconstruct and restore the unknown conversation data based on the semantics, and after obtaining the restored data, the initial conversation data is repaired to obtain the conversation data.

[0071] According to an embodiment of the present disclosure, invisible unknown dialogue data is restored by a decoder, thereby improving the accuracy of data features and thus improving the accuracy of sentiment analysis.

[0072] According to an embodiment of the present disclosure, the sentiment analysis method further includes: text embedding the dialogue segment to obtain a text embedding vector of the dialogue segment; and encoding the text embedding vector using an encoder to obtain an encoding feature of the dialogue segment.

[0073] According to an embodiment of the present disclosure, text embedding is a natural language processing technology that can convert text into fixed-length vector representations so that these fixed-length vectors can capture the semantic features of the text in a high-dimensional space, wherein a conversation segment can be text embedded, the entire conversation segment can be text embedded to obtain a text embedding vector, and each word in the conversation segment can also be text embedded separately to obtain multiple text embedding vectors.

[0074] Taking text embedding for each word in a conversation segment as an example, after obtaining multiple text embedding vectors, the multiple text embedding vectors are processed using an encoder, and the network structure such as a recurrent neural network is used to capture contextual information, thereby determining the encoding features of the conversation segment.

[0075] According to an embodiment of the present disclosure, text data of a dialogue segment is converted into features that can be processed by a model through text embedding and encoding. Since the length of the feature vector obtained after the conversion is fixed, a unified format is used to facilitate subsequent model processing, thereby improving the efficiency of sentiment analysis.

[0076] According to an embodiment of the present disclosure, a sentiment analysis model is trained in the following manner: sample conversation data is sliced ​​to obtain a plurality of sample conversation segments; based on the text complexity of each of the plurality of sample conversation segments, the plurality of sample conversation segments are randomly masked to obtain masked segments, wherein the masking probability of the random masking is determined according to the text complexity; the masked segments are restored using a decoder of an initial sentiment analysis model to obtain restored segments; text embedding and encoding are performed on the restored segments to obtain sample coding features of each of the plurality of sample conversation segments; using the initial sentiment analysis model, based on a preset number of feature indicators, a preset number of feature extractions are performed on the plurality of sample coding features to obtain a preset number of sample feature values ​​of each of the plurality of sample conversation segments; for each sample conversation segment, based on each sample feature value of the sample conversation segment and the feature values ​​corresponding to the sample feature values, The method comprises the following steps: using the index and multiple sample feature values ​​in the feature index to determine the normalized sample feature value of the sample dialogue segment on the feature index; determining the sample emotion intensity of the sample dialogue segment based on the normalized feature value on the feature index corresponding to each sample feature value; determining the sample emotion analysis sub-result of the sample dialogue segment based on the sample emotion intensity, sample object category, sample object description, sample viewpoint description and sample emotion polarity, wherein the sample object category, sample object description, sample viewpoint description and sample emotion polarity are obtained by performing aspect-level emotion analysis on the sample dialogue segment; determining the loss value of the sample dialogue segment based on the sample emotion analysis sub-result and the sample sub-result corresponding to the sample dialogue segment; and adjusting the model parameters of the initial emotion analysis model based on the loss value until the loss value is less than the loss threshold, and determining the emotion analysis model based on the current model parameters of the initial emotion analysis model.

[0077] According to an embodiment of the present disclosure, the slicing method and slicing granularity of the sample dialogue data are the same as those of the dialogue data. In the case where the sample dialogue data is an English sentence, the text complexity f of the sample dialogue segment t is c (t) can be calculated based on the number of words in the sample dialogue segment f n (t), average word length f l(t) and sentence embedding depth f d (t) is determined as shown in formula (3):

[0078] (3)

[0079] in, and is the weight coefficient.

[0080] According to an embodiment of the present disclosure, according to the text complexity f c (t), the masking probability of masking the sample dialogue segment t can be determined , as shown in formula (4):

[0081] (4)

[0082] Among them, α and β are hyperparameters.

[0083] Figure 3 The diagram schematically shows masking and encoding of a sample conversation segment by a sample sentiment analysis model according to an embodiment of the present disclosure.

[0084] like Figure 3 As shown, after the sample dialogue data is sliced ​​to obtain sample dialogue segment 1 to sample dialogue segment N, the mask probability of each sample dialogue segment is calculated respectively, and a masking operation is performed based on the masking probability to obtain the masked segment.

[0085] According to an embodiment of the present disclosure, an encoder is used to determine the semantics of sample dialogue data based on masked segments, and a decoder is used to reconstruct and restore the masked parts of sample dialogue sentences based on the semantics to obtain restored segments, which are then filled into positions corresponding to masked segments and further restored to obtain sliced ​​sample dialogue segments 1 to sample dialogue segments N, thereby completing the restoration of masked data.

[0086] According to an embodiment of the present disclosure, between the decoder and the encoder of the sample sentiment analysis model, Fourier transform can be used to map the word vector sequence to the frequency domain to obtain the value vector V, and analyze the characteristics of the text at different frequencies to distinguish between high-frequency signals representing overall semantics and low-frequency signals representing local details.

[0087] According to the embodiments of the present disclosure, a multi-layer perceptron can be used to process data, thereby effectively capturing key features of the data, as shown in formula (5):

[0088] (5)

[0089] Among them, Att freq(Q, K, V) is the output of the attention mechanism after considering the frequency domain information. Q, K, and V are query, key, and value, respectively. The Softmax function is used to calculate the attention weights. HiFreq(V) and LoFreq(V) are the high-frequency and low-frequency vectors extracted from the value vector V, respectively. μ and σ are weight parameters used to control the relative importance of high-frequency and low-frequency signals in the final weighted representation.

[0090] According to an embodiment of the present disclosure, the restored segment input is embedded and encoded using the method shown in formulas (6) and (7) to obtain sample encoding features Features:

[0091] (6)

[0092] Among them, TextEmbedding is the text embedding vector, and EmbeddingModel (·) is the processing logic of the text embedding model.

[0093] (7)

[0094] Among them, Encoder is the processing logic of the encoder.

[0095] According to an embodiment of the present disclosure, the initial sentiment analysis model has the same model architecture as the sentiment analysis model, the model parameters may be different, and the preset number of feature indicators used for feature extraction are the same as the number and categories of feature indicators in the sentiment analysis model.

[0096] According to the embodiment of the present disclosure, the calculation process of the normalized sample feature value and the sample sentiment intensity is the same as the calculation process of the normalized sample feature value and the sentiment intensity. ABSA is used to determine the sample object category C, sample object description A, sample view description O and sample sentiment polarity S of the sample dialogue segment, and the sample object category C, sample object description A, sample view description O and sample sentiment polarity S and sample sentiment intensity P are combined, and features are extracted, as shown in formula (8):

[0097] (8)

[0098] Among them, FeaturesExtract is the operation logic used to combine and extract features.

[0099] According to an embodiment of the present disclosure, the sample sentiment analysis sub-result Output is determined using formula (9):

[0100] (9)

[0101] Among them, MLP (·) is a multi-layer perceptron processing.

[0102] According to an embodiment of the present disclosure, based on the sample sentiment analysis sub-result and the sample sub-result corresponding to the sample dialogue segment, the loss value of the sample dialogue segment is determined using formula (10):

[0103] (10)

[0104] Among them, P(i) is the sample set with the same label as the sample sentiment analysis sub-result, h ci is a sample dialogue segment, i is the sequence number of the sample dialogue segment in the sample set, the interference rate p can be taken as 0.1, and by interfering with the samples in the sample set, the set of other dialogue segments B(i) in the sample set except the sample dialogue segment can be determined, γ is a hyperparameter, and sim(·) is the cosine similarity.

[0105] According to an embodiment of the present disclosure, based on the loss value, the model parameters of the initial sentiment analysis model are adjusted using the back propagation method, and the adjusted model is used to continue the sentiment analysis. When the loss value is less than the loss threshold, the sentiment analysis model is determined based on the model structure and the current model parameters.

[0106] According to the embodiments of the present disclosure, masking the text based on the complexity of the text can improve the masking probability when the complexity is high. When actually converting according to the voice data, the data with high complexity is more likely to be distorted or lost. Therefore, masking and restoring through the masking probability can improve the model's ability to restore data with high complexity, thereby improving the model's sentiment analysis accuracy.

[0107] According to an embodiment of the present disclosure, a loss value of a sample dialogue segment is determined based on a sample sentiment analysis sub-result and a sample sub-result corresponding to a sample dialogue segment, including: determining a cross entropy loss, an object loss, and an opinion loss based on the sample sentiment analysis sub-result and the sample sub-result; determining a sentiment loss based on the sample sentiment intensity and the sample sentiment polarity; and determining a loss value based on the cross entropy loss, the object loss, the opinion loss, and the sentiment loss.

[0108] According to an embodiment of the present disclosure, based on the sample sentiment analysis sub-result and the sample sub-result, the cross entropy loss is determined. , and combined with formula (10), determine the object loss respectively and view loss .

[0109] According to an embodiment of the present disclosure, the emotional loss can be determined according to formula (11):

[0110] (11)

[0111] in, is the loss of sentiment polarity between sample sentiment analysis sub-results and sample sub-results, is the weight of the sentiment polarity determined according to the sentiment intensity, as shown in formula (12):

[0112] (12)

[0113] Among them, p is the intensity of emotion.

[0114] According to an embodiment of the present disclosure, after determining the cross entropy loss, object loss, viewpoint loss and sentiment loss, the loss value is determined according to formula (13):

[0115] (13)

[0116] Among them, α1, α2, and α3 are hyperparameters respectively.

[0117] According to the embodiments of the present disclosure, by introducing emotion intensity, the weight of emotion polarity can be made smaller when the emotion intensity is smaller, and the weight of emotion polarity can be made close to 1 when the emotion intensity is larger, thereby quantifying emotion polarity in combination with emotion intensity and improving the accuracy of emotion analysis.

[0118] Based on the above sentiment analysis method, the present disclosure also provides a sentiment analysis device. Figure 4 The device is described in detail.

[0119] Figure 4 The structural block diagram of the sentiment analysis device according to an embodiment of the present disclosure is schematically shown.

[0120] like Figure 4 As shown, the sentiment analysis device 400 of this embodiment includes a dialogue processing module 410, a feature extraction module 420, a feature value normalization module 430, an intensity determination module 440, a sub-result determination module 450 and a result determination module 460.

[0121] The dialogue processing module 410 is used to process the user's initial dialogue data using the decoder of the sentiment analysis model to obtain dialogue data, with the user's permission, wherein the decoder is used to complete the missing data in the initial dialogue data according to the semantics of the initial dialogue data to obtain the dialogue data. In one embodiment, the dialogue processing module 410 can be used to perform the operation S210 described above, which will not be repeated here.

[0122] The feature extraction module 420 is used to perform a preset number of feature extractions on the encoding features of the plurality of dialogue segments based on a preset number of feature indicators, respectively, to obtain a preset number of feature values ​​for each of the plurality of dialogue segments, wherein the plurality of dialogue segments are obtained by slicing the dialogue data. In one embodiment, the feature extraction module 420 can be used to perform the operation S220 described above, which will not be described in detail herein.

[0123] The feature value normalization module 430 is used to determine, for each dialogue segment, a normalized feature value of the dialogue segment on the feature index based on each feature value of the dialogue segment, a feature index corresponding to the feature value, and multiple feature values ​​in the feature index. In one embodiment, the feature value normalization module 430 can be used to perform the operation S230 described above, which will not be repeated here.

[0124] The strength determination module 440 is used to determine the emotional strength of the dialogue segment based on the normalized feature value on the feature index corresponding to each feature value. In one embodiment, the strength determination module 440 can be used to perform the operation S240 described above, which will not be repeated here.

[0125] The sub-result determination module 450 is used to determine the sentiment analysis sub-result of the dialogue segment based on sentiment intensity, object category, object description, viewpoint description and sentiment polarity, wherein the object category, object intensity, viewpoint description and sentiment polarity are obtained by performing aspect-level sentiment analysis on the dialogue segment. In one embodiment, the sub-result determination module 450 can be used to perform the operation S250 described above, which will not be repeated here.

[0126] The result determination module 460 is used to determine the sentiment analysis result of the dialogue data based on the sentiment analysis sub-results of each of the multiple dialogue segments. In one embodiment, the result determination module 460 can be used to perform the operation S260 described above, which will not be described in detail here.

[0127] According to an embodiment of the present disclosure, the eigenvalue normalization module 430 includes a singular value determination submodule and an eigenvalue normalization submodule.

[0128] The singular value determination submodule is used to determine the maximum eigenvalue and the minimum eigenvalue among the multiple eigenvalues ​​corresponding to each characteristic indicator based on the multiple eigenvalues ​​in the characteristic indicator.

[0129] The eigenvalue normalization submodule is used to normalize the eigenvalue based on the maximum eigenvalue and the minimum eigenvalue to obtain a normalized eigenvalue.

[0130] According to an embodiment of the present disclosure, the sub-result determination module 450 includes an attribute determination sub-module, a feature determination sub-module and a sub-result determination sub-module.

[0131] The attribute determination submodule is used to perform aspect-level sentiment analysis on the dialogue segment to determine the object category, object description, viewpoint description and sentiment polarity of the dialogue segment.

[0132] The feature determination submodule is used to fuse the features of sentiment intensity, object category, object description, viewpoint description and sentiment polarity to obtain the fused features of the dialogue segment.

[0133] The sub-result determination sub-module is used to determine the sentiment analysis sub-result of the dialogue segment based on the fusion features.

[0134] According to an embodiment of the present disclosure, the dialogue processing module 410 includes an unknown data determination submodule, a data restoration submodule and a data repair submodule.

[0135] The unknown data determination submodule is used to determine the unknown dialogue data that is invisible in the initial dialogue data.

[0136] The data restoration submodule is used to restore the unknown conversation data based on the semantics of the initial conversation data using a decoder to obtain restored data.

[0137] The data repair submodule is used to repair the initial dialogue data using the restored data to obtain the dialogue data.

[0138] According to an embodiment of the present disclosure, the sentiment analysis device 400 also includes a text embedding module and a vector encoding module.

[0139] The text embedding module is used to embed the dialogue segment into text to obtain the text embedding vector of the dialogue segment.

[0140] The vector encoding module is used to encode the text embedding vector using an encoder to obtain the encoding features of the dialogue segment.

[0141] According to an embodiment of the present disclosure, the sentiment analysis device 400 also includes a data slicing module, a random masking module, a paragraph restoration module, a sample feature determination module, a sample feature extraction module, a sample feature normalization module, a sample strength determination module, a sample sub-result determination module, a loss value determination module and a parameter adjustment module.

[0142] The data slicing module is used to slice the sample dialogue data to obtain multiple sample dialogue segments.

[0143] The random masking module is used to perform random masking processing on multiple sample dialogue segments based on the text complexity of each of the multiple sample dialogue segments to obtain masked segments, wherein the masking probability of the random masking processing is determined according to the text complexity.

[0144] The segment restoration module is used to restore the masked segment using the decoder of the initial sentiment analysis model to obtain a restored segment.

[0145] The sample feature determination module is used to perform text embedding and encoding on the restored segment to obtain sample encoding features of each of the multiple sample dialogue segments.

[0146] The sample feature extraction module is used to use the initial sentiment analysis model to perform a preset number of feature extractions on multiple sample encoding features based on a preset number of feature indicators, and obtain a preset number of sample feature values ​​for each of the multiple sample dialogue segments.

[0147] The sample feature normalization module is used to determine, for each sample dialogue segment, the normalized sample feature value of the sample dialogue segment on the feature index based on each sample feature value of the sample dialogue segment, the feature index corresponding to the sample feature value, and multiple sample feature values ​​in the feature index.

[0148] The sample strength determination module is used to determine the sample emotion strength of the sample dialogue segment based on the normalized feature value on the feature index corresponding to each sample feature value.

[0149] The sample sub-result determination module is used to determine the sample sentiment analysis sub-result of the sample pair discourse segment based on the sample sentiment intensity, sample object category, sample object description, sample opinion description and sample sentiment polarity, wherein the sample object category, sample object description, sample opinion description and sample sentiment polarity are obtained by performing aspect-level sentiment analysis on the sample pair discourse segment.

[0150] The loss value determination module is used to determine the loss value of the sample dialogue segment based on the sample sentiment analysis sub-result and the sample sub-result corresponding to the sample dialogue segment.

[0151] The parameter adjustment module is used to adjust the model parameters of the initial sentiment analysis model based on the loss value until the loss value is less than the loss threshold, and determine the sentiment analysis model based on the current model parameters of the initial sentiment analysis model.

[0152] According to an embodiment of the present disclosure, the loss value determination module includes a cross entropy determination submodule, a sentiment loss determination submodule and a loss value determination submodule.

[0153] The cross entropy determination submodule is used to determine the cross entropy loss, object loss and opinion loss based on the sample sentiment analysis sub-result and the sample sub-result.

[0154] The sentiment loss determination submodule is used to determine the sentiment loss based on the sample sentiment intensity and the sample sentiment polarity.

[0155] The loss value determination submodule is used to determine the loss value based on cross entropy loss, object loss, view loss and sentiment loss.

[0156] According to an embodiment of the present disclosure, any multiple modules among the dialogue processing module 410, the feature extraction module 420, the feature value normalization module 430, the strength determination module 440, the sub-result determination module 450 and the result determination module 460 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the dialogue processing module 410, the feature extraction module 420, the feature value normalization module 430, the strength determination module 440, the sub-result determination module 450 and the result determination module 460 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware and firmware or in a suitable combination of any of them. Alternatively, at least one of the dialogue processing module 410, the feature extraction module 420, the feature value normalization module 430, the strength determination module 440, the sub-result determination module 450 and the result determination module 460 can be at least partially implemented as a computer program module, which can perform the corresponding function when it is executed.

[0157] Figure 5 A block diagram of an electronic device suitable for implementing a sentiment analysis method according to an embodiment of the present disclosure is schematically shown.

[0158] like Figure 5 As shown, the electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 to a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include an onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0159] In RAM 503, various programs and data required for the operation of electronic device 500 are stored. Processor 501, ROM 502 and RAM 503 are connected to each other via bus 504. Processor 501 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 502 and / or RAM 503. It should be noted that the program can also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0160] According to an embodiment of the present disclosure, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to the bus 504. The electronic device 500 may further include one or more of the following components connected to the input / output (I / O) interface 505: an input portion 506 including a keyboard, a mouse, etc.; an output portion 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 508 including a hard disk, etc.; and a communication portion 509 including a network interface card such as a LAN card, a modem, etc. The communication portion 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output (I / O) interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage portion 508 as needed.

[0161] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0162] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 502 and / or RAM 503 described above and / or one or more memories other than ROM 502 and RAM 503.

[0163] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the sentiment analysis method provided by the embodiment of the present disclosure.

[0164] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 501. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0165] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 509, and / or installed from the removable medium 511. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0166] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.

[0167] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).

[0168] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0169] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0170] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A sentiment analysis method, characterized in that: The method comprises: With the user's permission, using the decoder of the sentiment analysis model to process the user's initial conversation data to obtain conversation data, wherein the decoder is used to complete the missing data in the initial conversation data according to the semantics of the initial conversation data to obtain the conversation data; Based on a preset number of feature indicators, respectively, feature extraction is performed a preset number of times on the coding features of the plurality of dialogue segments to obtain a preset number of feature values ​​for each of the plurality of dialogue segments, wherein the plurality of dialogue segments are obtained by slicing the dialogue data; For each of the dialogue segments, Determine a normalized feature value of the conversation segment on the feature index based on each feature value of the conversation segment, a feature index corresponding to the feature value, and multiple feature values ​​in the feature index; Determining the sentiment intensity of the dialogue segment based on the normalized feature value on the feature index corresponding to each of the feature values; Determining a sentiment analysis sub-result of the dialogue segment based on the sentiment intensity, object category, object description, viewpoint description, and sentiment polarity, wherein the object category, the object intensity, the viewpoint description, and the sentiment polarity are obtained by performing aspect-level sentiment analysis on the dialogue segment; and A sentiment analysis result of the dialogue data is determined based on the sentiment analysis sub-results of each of the multiple dialogue segments.

2. The method according to claim 1, characterized in that: The determining, based on each of the feature values ​​of the conversation segment, the feature index corresponding to the feature value, and multiple feature values ​​in the feature index, a normalized feature value of the conversation segment on the feature index includes: Based on the multiple eigenvalues ​​in the characteristic indicators, determining the maximum eigenvalue and the minimum eigenvalue in the multiple eigenvalues ​​corresponding to each of the characteristic indicators; and The eigenvalue is normalized based on the maximum eigenvalue and the minimum eigenvalue to obtain the normalized eigenvalue.

3. The method according to claim 1 or 2, characterized in that: The determining of the sentiment analysis sub-result of the dialogue segment based on the sentiment intensity, object category, object description, viewpoint description and sentiment polarity includes: Performing aspect-level sentiment analysis on the dialogue segment to determine the object category, the object description, the viewpoint description, and the sentiment polarity of the dialogue segment; Performing feature fusion on the emotion intensity, the object category, the object description, the viewpoint description, and the emotion polarity to obtain a fusion feature of the dialogue segment; and Based on the fusion feature, a sentiment analysis sub-result of the dialogue segment is determined.

4. The method according to claim 1, characterized in that The process of processing the initial conversation data of the user by using the decoder of the sentiment analysis model to obtain the conversation data includes: determining unknown conversation data that is invisible in the initial conversation data; Using the decoder, based on the semantics of the initial conversation data, the unknown conversation data is restored to obtain restored data; and The initial conversation data is repaired using the restored data to obtain the conversation data.

5. The method according to claim 1, characterized in that: The method further comprises: Performing text embedding on the dialogue segment to obtain a text embedding vector for the dialogue segment; and The text embedding vector is encoded by using an encoder to obtain the encoding feature of the dialogue segment.

6. The method according to claim 1, characterized in that The sentiment analysis model is trained in the following way: Slice the sample dialogue data to obtain multiple sample dialogue segments; Based on the text complexity of each of the multiple sample dialogue segments, performing random masking processing on the multiple sample dialogue segments to obtain masked segments, wherein the masking probability of the random masking processing is determined according to the text complexity; Restoring the masked segment using a decoder of the initial sentiment analysis model to obtain a restored segment; Performing text embedding and encoding on the restored speech segment to obtain sample encoding features of each of the multiple sample dialogue segments; Using the initial sentiment analysis model, based on a preset number of feature indicators, a preset number of feature extractions are performed on the plurality of sample coding features to obtain a preset number of sample feature values ​​for each of the plurality of sample dialogue segments; For each of the sample dialogue segments, Determine a normalized sample feature value of the sample dialogue segment on the feature index based on each of the sample feature values ​​of the sample dialogue segment, a feature index corresponding to the sample feature value, and a plurality of sample feature values ​​in the feature index; Determining the sample sentiment intensity of the sample dialogue segment based on the normalized feature value on the feature index corresponding to each of the sample feature values; Determine a sample sentiment analysis sub-result of the sample pair discourse segment based on the sample sentiment intensity, the sample object category, the sample object description, the sample viewpoint description, and the sample sentiment polarity, wherein the sample object category, the sample object description, the sample viewpoint description, and the sample sentiment polarity are obtained by performing aspect-level sentiment analysis on the sample pair discourse segment; Determining a loss value of the sample dialogue segment based on the sample sentiment analysis sub-result and the sample sub-result corresponding to the sample dialogue segment; and Based on the loss value, the model parameters of the initial sentiment analysis model are adjusted until the loss value is less than a loss threshold, and based on the current model parameters of the initial sentiment analysis model, the sentiment analysis model is determined.

7. The method according to claim 6, characterized in that The determining the loss value of the sample dialogue segment based on the sample sentiment analysis sub-result and the sample sub-result corresponding to the sample dialogue segment includes: Determining a cross entropy loss, an object loss, and an opinion loss based on the sample sentiment analysis sub-result and the sample sub-result; Determining a sentiment loss based on the sample sentiment intensity and the sample sentiment polarity; and The loss value is determined based on the cross entropy loss, the object loss, the opinion loss, and the sentiment loss.

8. A sentiment analysis device, characterized in that: The device comprises: A dialogue processing module, configured to process the initial dialogue data of the user using the decoder of the sentiment analysis model to obtain dialogue data with the permission of the user, wherein the decoder is configured to complete the missing data in the initial dialogue data according to the semantics of the initial dialogue data to obtain the dialogue data; a feature extraction module, configured to perform a preset number of feature extractions on the coding features of a plurality of dialogue segments based on a preset number of feature indicators, respectively, to obtain a preset number of feature values ​​for each of the plurality of dialogue segments, wherein the plurality of dialogue segments are obtained by slicing the dialogue data; A feature value normalization module is used for each of the dialogue segments. Determine a normalized feature value of the conversation segment on the feature index based on each feature value of the conversation segment, a feature index corresponding to the feature value, and multiple feature values ​​in the feature index; An intensity determination module, configured to determine the emotional intensity of the dialogue segment based on a normalized characteristic value on a characteristic index corresponding to each of the characteristic values; a sub-result determination module, configured to determine a sentiment analysis sub-result of the dialogue segment based on the sentiment intensity, object category, object description, viewpoint description, and sentiment polarity, wherein the object category, the object intensity, the viewpoint description, and the sentiment polarity are obtained by performing aspect-level sentiment analysis on the dialogue segment; and The result determination module is used to determine the sentiment analysis result of the dialogue data based on the sentiment analysis sub-results of each of the multiple dialogue segments.

9. An electronic device, comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.