A method and device for determining implicit emotions

CN117708321BActive Publication Date: 2026-08-14CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-18
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0003]目前,在对文本信息中包含的内隐情绪进行确定时,往往是通过预先训练好的Span(跨度)-ASTE(Aspect Sentiment Triplet Extraction,情感三元组抽取)模型进行分析确定,但该模型中Span是采用传统的高度枚举方式进行生成,因此会造成计算成本的增加

Benefits of technology

[0006]基于上述技术方案,本申请提供的一种内隐情绪确定方法,可以基于目标文本信息,确定多个特征词向量,然后根据多个特征词向量,确定多个向量分数,并根据多个向量分数,生成多个跨度词向量,最后基于多个跨度词向量,确定目标文本信息中包含的内隐情绪。其中,任一向量分数是基于任意两个特征词向量得到的;任一跨度词向量包含至少两个特征词向量。通过上述方法,可以在确定出目标文本信息中包含的内隐情绪的同时,有效节约计算成本。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117708321B_ABST
    Figure CN117708321B_ABST
Patent Text Reader

Abstract

This application provides a method and apparatus for determining implicit sentiment, relating to the field of computer technology, and can effectively save computational costs. The method includes: determining multiple feature word vectors based on target text information; then determining multiple vector scores based on the multiple feature word vectors; generating multiple span word vectors based on the multiple vector scores; and finally determining the implicit sentiment contained in the target text information based on the multiple span word vectors. The embodiments of this application are used in the implicit sentiment determination process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method and apparatus for determining implicit emotions. Background Technology

[0002] With the widespread application of information data analytics, it is crucial to discover feedback from different online users and to analyze and identify the opinions and implicit emotions contained within each piece of feedback. For example, analyzing and identifying customers' implicit emotions and the opinions contained in their reviews on e-commerce platforms can help improve products or services and conduct better marketing campaigns.

[0003] Currently, when determining the implicit emotions contained in text information, it is often done by analyzing and determining them through a pre-trained Span-ASTE (Aspect Sentiment Triplet Extraction) model. However, the Span in this model is generated using a traditional high-enumeration method, which increases the computational cost. Summary of the Invention

[0004] This application provides a method and apparatus for determining implicit emotions, which can effectively save computational costs.

[0005] To achieve the above objectives, this application adopts the following technical solution: Firstly, this application provides a method for determining implicit emotions, the method comprising: Based on the target text information, determine multiple feature word vectors; Multiple vector scores are determined based on multiple feature word vectors; any vector score is obtained based on any two feature word vectors. Multiple span word vectors are generated based on multiple vector scores; each span word vector contains at least two feature word vectors. Based on multiple span word vectors, the implicit emotions contained in the target text information are determined.

[0006] Based on the above technical solution, this application provides a method for determining implicit sentiment. This method involves determining multiple feature word vectors based on target text information, then determining multiple vector scores based on these feature word vectors, generating multiple span word vectors based on these scores, and finally determining the implicit sentiment contained in the target text information based on these span word vectors. Specifically, each vector score is obtained based on any two feature word vectors; each span word vector contains at least two feature word vectors. This method effectively saves computational costs while determining the implicit sentiment contained in the target text information.

[0007] Optionally, based on the target text information, multiple feature word vectors are determined, including: Determine the initial word vectors corresponding to each word in the target text information to obtain multiple initial word vectors; Multiple initial word vectors are input into a pre-trained vector transformation model to obtain multiple feature word vectors.

[0008] Optionally, the multiple feature word vectors include a first feature word vector and a second feature word vector; the step of generating multiple span word vectors based on multiple vector scores includes: If the vector score between the first feature word vector and the second feature word vector is greater than a preset vector score threshold, then a span word vector is generated based on the first feature word vector, the second feature word vector, and each feature word vector between the first feature word vector and the second feature word vector.

[0009] Optionally, based on multiple span word vectors, the implicit sentiment contained in the target text information is determined, including: Based on the probability scores corresponding to each span word vector, multiple combined word vectors are obtained; Determine the sentiment probability corresponding to each combined word vector; Based on the sentiment probabilities corresponding to each combined word vector, the implicit sentiment contained in the target text information is determined.

[0010] Optionally, based on the probability scores corresponding to each span word vector, multiple combined word vectors are obtained, including: Based on the probability scores corresponding to each span word vector, each span word vector is divided into opinion span word vectors or aspect span word vectors. By combining the word vector of any opinion span with the word vector of any aspect span, multiple combined word vectors are obtained.

[0011] Secondly, this application provides an implicit emotion determination device, the device comprising: The first determining unit is used to determine multiple feature word vectors based on the target text information; The second determining unit is used to determine multiple vector scores based on multiple feature word vectors; any vector score is obtained based on any two feature word vectors. The generation unit is used to generate multiple span word vectors based on multiple vector scores; each span word vector contains at least two feature word vectors. The processing unit is used to determine the implicit sentiment contained in the target text information based on multiple span word vectors.

[0012] Optionally, the first determining unit is specifically used for: Determine the initial word vectors corresponding to each word in the target text information to obtain multiple initial word vectors; Multiple initial word vectors are input into a pre-trained vector transformation model to obtain multiple feature word vectors.

[0013] Optionally, the multiple feature word vectors include a first feature word vector and a second feature word vector; the generation unit is specifically used for: If the vector score between the first feature word vector and the second feature word vector is greater than a preset vector score threshold, then a span word vector is generated based on the first feature word vector, the second feature word vector, and each feature word vector between the first feature word vector and the second feature word vector.

[0014] Optionally, the processing unit is specifically used for: Based on the probability scores corresponding to each span word vector, multiple combined word vectors are obtained; Determine the sentiment probability corresponding to each combined word vector; Based on the sentiment probabilities corresponding to each combined word vector, the implicit sentiment contained in the target text information is determined.

[0015] Optionally, the processing unit is specifically used for: Based on the probability scores corresponding to each span word vector, each span word vector is divided into opinion span word vectors or aspect span word vectors. By combining the word vector of any opinion span with the word vector of any aspect span, multiple combined word vectors are obtained.

[0016] Thirdly, this application provides an implicit emotion determination apparatus, which includes: a processor and a communication interface; the communication interface and the processor are coupled, and the processor is used to run computer programs or instructions to implement the implicit emotion determination method as described in the first aspect and any possible implementation of the first aspect.

[0017] Fourthly, this application provides a computer-readable storage medium storing instructions that, when executed on a terminal, cause the terminal to perform the implicit sentiment determination method as described in the first aspect and any possible implementation thereof.

[0018] Fifthly, embodiments of this application provide a computer program product containing instructions that, when run on an implicit emotion determination device, cause the implicit emotion determination device to perform the implicit emotion determination method as described in the first aspect and any possible implementation thereof.

[0019] In a sixth aspect, embodiments of this application provide a chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run computer programs or instructions to implement the implicit emotion determination method as described in the first aspect and any possible implementation thereof.

[0020] Specifically, the chip provided in this application embodiment also includes a memory for storing computer programs or instructions. Attached Figure Description

[0021] Figure 1 A system framework diagram of an implicit emotion determination method provided in this application embodiment; Figure 2 A flowchart illustrating an implicit emotion determination method provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an implicit emotion determination device provided in an embodiment of this application; Figure 4 This is another possible structural schematic diagram of an implicit emotion determination device provided in an embodiment of this application. Detailed Implementation

[0022] The following description, in conjunction with the accompanying drawings, details a method and apparatus for determining implicit emotions according to embodiments of this application.

[0023] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0024] The terms "first" and "second," etc., used in the specification and drawings of this application are used to distinguish different objects or to distinguish different treatments of the same object, rather than to describe a specific order of objects.

[0025] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.

[0026] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0027] With the widespread application of information data analytics, it is crucial to discover feedback from different online users and to analyze and identify the opinions and implicit emotions contained within each piece of feedback. For example, analyzing and identifying customers' implicit emotions and the opinions contained in their reviews on e-commerce platforms can help improve products or services and conduct better marketing campaigns.

[0028] Therefore, it is necessary to design an automated computational framework to analyze and identify opinions and implicit emotions hidden in textual information, which has led to the emergence of sentiment analysis and opinion mining in the research field.

[0029] Traditional sentiment analysis research primarily focuses on identifying the overall sentiment of textual information. To predict the overall sentiment of a target text, it's necessary to assume that people experience a single emotion regarding a single topic within the text. However, in reality, most textual information contains diverse emotions. Therefore, it's necessary to identify opinions and emotions at a more granular level, focusing on aspects. This has led to the development of aspect-based sentiment analysis methods, such as ABSA (Aspect-based Sentiment Analysis). ABSA is a fine-grained sentiment identification method designed to identify the sentiment polarity of one or more aspects mentioned in textual information. For example, in restaurant reviews, aspects could include food, service, price, etc. ABSA aims to identify and determine the sentiment of one or more of these aspects.

[0030] However, we noted that approximately 30% of the text messages did not contain explicit opinion words, yet still conveyed clear emotional orientations with human consciousness—that is, implicit emotions. Traditional aspect-based sentiment analysis methods cannot accurately identify and determine implicit emotions contained in text messages. Implicit emotions refer to emotional polarities that are not directly expressed in the text but can be inferred from a specific context. For example, in the sentence "The hotel room was small, but very clean," the word "clean" might evoke positive emotions, even though it is not directly expressed. The presence of implicit emotions increases the difficulty of aspect-based sentiment analysis.

[0031] Currently, when determining the implicit emotions contained in text information, it is often done by analyzing and determining them through a pre-trained Span-ASTE model. However, the Span in this model is generated using a traditional high-enumeration method, which increases the computational cost.

[0032] To address the aforementioned technical problems, this application provides a method for determining implicit sentiment. This method involves determining multiple feature word vectors based on target text information, then determining multiple vector scores based on these feature word vectors, generating multiple span word vectors based on these scores, and finally determining the implicit sentiment contained in the target text information based on these span word vectors. Each vector score is obtained based on any two feature word vectors; each span word vector contains at least two feature word vectors. This method effectively saves computational costs while determining the implicit sentiment contained in the target text information.

[0033] Figure 1 This is a system framework diagram of an implicit emotion determination method provided in an embodiment of this application. Figure 1 As shown, the system framework diagram may include a base encoder module 101, a distilled span pool 102, a classification module 103, a concatenate module 104, and a prediction module 105.

[0034] The base encoder module 101 may include an embedding layer and a vector transformation layer. The target text information is input into the embedding layer to obtain the initial word vectors corresponding to each word contained in the target text information. The initial word vectors corresponding to each word are input into the vector transformation layer to obtain the feature word vectors corresponding to each initial word vector, that is, multiple feature word vectors are obtained.

[0035] In one optional implementation, the embedding layer may include an embedding model, and the vector transformation layer may include a vector transformation model. The target text information is input into the embedding model within the embedding layer. The embedding model outputs initial word vectors corresponding to each word in the target text information. After obtaining the initial word vectors, these initial word vectors are input into the vector transformation model within the vector transformation layer. The vector transformation model outputs feature word vectors corresponding to each initial word vector, i.e., outputting multiple feature word vectors. Both the embedding model and the vector transformation model are pre-trained.

[0036] In this embodiment, the vector transformation model may include, but is not limited to, BiLSTM (Bi-directional Long Short-Term Memory) or the Bert model, and the embedding model may include, but is not limited to, the GloVe model. This embodiment does not limit the embedding model and the vector transformation model.

[0037] After obtaining multiple feature word vectors using the above method, these vectors can be input into the distillation span pool 102. The distillation span pool 102 can determine multiple vector scores based on these feature word vectors and generate multiple span word vectors based on these scores. Each vector score is obtained based on any two feature word vectors. Each span word vector contains at least two feature word vectors.

[0038] In one optional implementation, the distillation span pool 102 may include a self-attention layer. After obtaining multiple feature word vectors, the vector scores corresponding to the feature word vectors can be obtained by distilling the self-attention layer contained in the span pool 102, and multiple span word vectors (i.e., multiple spans) can be generated based on the multiple vector scores.

[0039] The classification module 103 may include an opinion word classifier and an aspect word classifier. After obtaining multiple span word vectors in the above manner, the opinion word classifier and the aspect word classifier can be used to classify each span word vector, that is, to divide each span word vector into opinion span word vectors or aspect span word vectors.

[0040] In one alternative implementation, the opinion term classifier may include, but is not limited to, OTE (Opinion Term Extension), and the aspect term classifier may include, but is not limited to, ATE (Aspect Term Extraction).

[0041] After obtaining the opinion span word vector or aspect span word vector through the above method, the coupling module 104 can be used to combine any opinion span word vector and any aspect span word vector to obtain multiple combined word vectors.

[0042] In one alternative implementation, the concepts of relative position and span width can be introduced during the combination of word vectors for any opinion span and word vectors for any aspect span, thereby making the resulting combined word vectors more comprehensive. After combining multiple word vectors in the above manner, the sentiment probability of each combined word vector can be obtained through the prediction module 105.

[0043] In an optional implementation, the prediction module 105 may include a feedforward neural network and a Softmax function. Specifically, after obtaining the opinion span word vector or aspect span word vector, the feedforward neural network and Softmax function included in the prediction module 105 can be used to determine the corresponding emotion probability between each combined word vector and each emotion label. The emotion labels may include emotion labels for intrinsic emotions and emotion labels for explicit emotions. For example, I-Neg represents an implicit negative emotion label, I-Pos represents an implicit positive emotion label, E-Po represents an explicit positive emotion label, E-Neg represents an explicit negative emotion label, Neutral represents a neutral emotion label, and Invalid represents an invalid emotion label.

[0044] After obtaining the corresponding emotion probabilities between any combined word vector and each emotion tag using the above method, the emotion tag with the highest emotion probability can be taken as the emotion corresponding to that combined word vector. Finally, based on the emotions corresponding to each combined word vector, the explicit and implicit emotions contained in the target text information are determined.

[0045] In the embodiments of this application, the feedforward neural network may include, but is not limited to, FNNs (feed forward neural networks). The embodiments of this application do not limit this.

[0046] In one alternative implementation, based on the implicit emotions contained in the target text information determined by the above models, the above models can be trained using a training dataset until the models converge to obtain a trained model. The trained model can then be tested using a test dataset to obtain the optimal parameters, and each model can be obtained based on the optimal parameters.

[0047] In an alternative implementation, before training the model using the training dataset, SCAPT (Supervised Contrastive Pre-Training) can be used to pre-train the initial training dataset. Specifically: SCAPT employs a supervised contrastive learning objective, aligning explicit and implicit emotion representations with the same emotion. Supervised contrastive learning encourages the model to capture implicit emotional orientation within the context and incorporate it into the emotion representation.

[0048] Specifically, for the same batch (in) , We start from The sentence means Extracting sentiment representation .in, , =[CLS] + + [SEP], This represents the i-th sentence. The tag representing the i-th sentence. This can be viewed as a trainable sentence sentiment perceiver. The supervised contrastive loss for this batch can be defined using the following Equations 1 and 2: (Formula 1) (Formula 2) Where B indicates that this batch is batch B. express and The most similar probability, where τ represents the temperature of the softmax. It can be used to measure similarity. , Indicates the same category in this batch The number of samples.

[0049] It is worth noting that we do not use sentence representations directly during supervised contrastive pre-training. Instead, we use sentiment representations to fully leverage a document-level tagged corpus to mine inherent sentiment perception.

[0050] By employing the above technical solution and adopting the construction approach of supervised contrastive learning, and through the construction of a loss function, explicit and implicit emotional expressions with the same emotional orientation can be grouped together in the embedding space, while emotional expressions with different emotional labels can be separated, thereby effectively identifying implicit emotions.

[0051] Figure 2 This is a flowchart illustrating a method for determining implicit emotions provided in an embodiment of this application, as shown below. Figure 2 As shown, the method includes: Step S201: Determine multiple feature word vectors based on the target text information.

[0052] In one optional implementation, when performing step S201, the initial word vectors corresponding to each word in the target text information can be determined to obtain multiple initial word vectors. The multiple initial word vectors are then input into a pre-trained vector transformation model to obtain multiple feature word vectors.

[0053] Specifically, in some embodiments, the target text information can be input into a pre-trained embedding model to obtain initial word vectors corresponding to each word in the target text information, and then multiple initial word vectors can be input into a pre-trained vector transformation model to obtain multiple feature word vectors.

[0054] For example, in one embodiment, assuming the target text information is "this place has great service", the target text information "this place has great service" can be input into a pre-trained embedding model (e.g., GloVe embedding model) to obtain the initial word vectors corresponding to each word ("this", "place", "has", "great", "service") in the target text information. After obtaining the initial word vectors corresponding to each word in the target text information, the initial word vectors corresponding to each word can be input into a pre-trained vector transformation model (e.g., BiLSTM model) to obtain multiple feature word vectors.

[0055] The above technical solution can obtain the contextual features of each initial word vector through a vector transformation model (such as the BiLSTM model), and generate the feature word vectors corresponding to each initial word vector based on the contextual features of each initial word vector. This can make each feature word vector contain richer semantic information, thereby making the identification of implicit emotions contained in the target text information more accurate.

[0056] Step S202: Determine multiple vector scores based on multiple feature word vectors.

[0057] In this context, any vector score is obtained based on any two feature word vectors.

[0058] Specifically, after obtaining multiple feature word vectors through step S201, the vector score (i.e., attention score) between any two feature word vectors can be determined using Formula 3.

[0059] (Formula 3) in, Let Q and K represent the vector scores (i.e., attention scores), where Q and K are both feature word vectors, and d represents the span between any two feature word vectors. and This is the weight matrix that needs to be learned.

[0060] Step S203: Generate multiple span word vectors based on multiple vector scores.

[0061] Each span word vector contains at least two feature word vectors.

[0062] In one optional implementation, the multiple feature word vectors may include a first feature word vector and a second feature word vector; if the vector score between the first feature word vector and the second feature word vector is greater than a preset vector score threshold, then a span word vector is generated based on the first feature word vector, the second feature word vector, and each feature word vector between the first feature word vector and the second feature word vector.

[0063] Specifically, in some embodiments, after obtaining the vector score between the first feature word vector and the second feature word vector in step S202, the vector score between the first feature word vector and the second feature word vector can be compared with a preset vector score threshold. If the vector score between the first feature word vector and the second feature word vector is greater than the preset vector score threshold, a span word vector is generated based on the first feature word vector, the second feature word vector, and each feature word vector between the first feature word vector and the second feature word vector. If the vector score between the first feature word vector and the second feature word vector is less than or equal to the preset vector score threshold, a span word vector is not generated based on the first feature word vector and the second feature word vector.

[0064] For example, in one embodiment, assuming the target text information is "this place has great service", if the vector score between the feature word vector corresponding to "this" and the feature word vector corresponding to "service" is greater than a preset vector score threshold obtained through step S202, then a span word vector can be generated based on the feature word vector corresponding to "this", the feature word vector corresponding to "service", and each feature word vector between the feature word vector corresponding to "this" and the feature word vector corresponding to "service", namely the feature word vector corresponding to "place", the feature word vector corresponding to "has", and the feature word vector corresponding to "great". This span word vector may contain the feature word vector corresponding to "this", the feature word vector corresponding to "service", the feature word vector corresponding to "place", the feature word vector corresponding to "has", and the feature word vector corresponding to "great".

[0065] The above-described technical solution can generate span word vectors through vector scores. Compared with the existing technology that generates span word vectors through high enumeration, it can greatly reduce the number of span word vectors generated, thus simplifying the generation of span word vectors and achieving the beneficial effect of effectively saving computational costs.

[0066] Step S204: Based on multiple span word vectors, determine the implicit emotions contained in the target text information.

[0067] In one optional implementation, during step S204, multiple combined word vectors can be obtained based on the probability scores corresponding to each span word vector, and the sentiment probability corresponding to each combined word vector can be determined. Then, based on the sentiment probabilities corresponding to each combined word vector, the implicit sentiment contained in the target text information can be determined.

[0068] In one alternative implementation, in the process of obtaining multiple combined word vectors based on the probability scores corresponding to each span word vector, each span word vector can first be divided into opinion span word vectors or aspect span word vectors based on the probability scores corresponding to each span word vector; then any opinion span word vector and any aspect span word vector are combined to obtain multiple combined word vectors.

[0069] Specifically, in some embodiments, the opinion probability score and aspect probability score corresponding to each span word vector can be determined first, and then each span word vector can be divided into opinion span word vectors or aspect span word vectors based on the opinion probability score and aspect probability score.

[0070] Optionally, the aspect probability score corresponding to each span word vector can be determined first using Formula 4, and the opinion probability score corresponding to each span word vector can be determined using Formula 5.

[0071] (Formula 4) (Formula 5) (Formula 6) in, Represents aspect probability fractions. Opinion probability score This represents the span word vector. P( | The operation of ) is essentially the classifier calculating probability scores.

[0072] After determining the aspect probability score and opinion probability score corresponding to each span word vector through the above technical solution, the aspect probability score and opinion probability score can be compared. If the aspect probability score is greater than the opinion probability score, the span word vector is determined as an aspect span word vector. If the opinion probability score is greater than the aspect probability score, the span word vector is determined as an opinion span word vector.

[0073] After determining the aspect span word vector and opinion span word vector through the above technical solution, any opinion span word vector and any aspect span word vector can be combined to obtain multiple combined word vectors. Then, the sentiment probability corresponding to each combined word vector is determined by Formula 7.

[0074] (Formula 7) in, Represents aspect span word vectors, Word vectors representing the span of opinions This represents the probability of an emotion.

[0075] After obtaining the sentiment probability corresponding to each combined word vector through the above technical solution, the implicit sentiment contained in the target text information can be determined based on the sentiment probability corresponding to each combined word vector.

[0076] Specifically, the emotion probability corresponding to any combination of word vectors can include the emotion probabilities corresponding to multiple emotion labels. The emotion labels can include emotion labels for intrinsic emotions and emotion labels for explicit emotions. For example, suppose the emotion tags include I-Neg emotion tags, I-Pos emotion tags, E-Po emotion tags, E-Neg emotion tags, Neutral emotion tags, and Invalid emotion tags, where I-Neg represents an implicit negative emotion tag, I-Pos represents an implicit positive emotion tag, E-Po represents an explicit positive emotion tag, E-Neg represents an explicit negative emotion tag, Neutral represents a neutral emotion tag, and Invalid represents an invalid emotion tag. The emotion probability corresponding to any combination of word vectors can include the emotion probabilities corresponding to the above six emotion tags. The emotion tag with the highest emotion probability can be determined as the emotion corresponding to that combination of word vectors. Finally, based on the emotions corresponding to each combination of word vectors, the explicit and implicit emotions contained in the target text information are determined.

[0077] By employing the aforementioned technical solution, after generating span word vectors through vector scores, the implicit sentiment contained in the target text information can be directly determined based on the generated multiple span word vectors. Compared to existing technologies that generate span word vectors through high enumeration, this significantly reduces the number of span word vectors generated, thus simplifying the generation of span word vectors. Consequently, in the subsequent process of determining the implicit sentiment contained in the target text information based on the generated multiple span word vectors, it effectively saves computational costs.

[0078] In an optional implementation, in the process of dividing each span word vector into opinion span word vectors or aspect span word vectors according to opinion probability scores and aspect probability scores, the span word vectors can be sorted sequentially according to opinion probability scores, and then the span word vectors whose ranking is within a preset ranking threshold range are taken as opinion span word vectors, and the span word vectors can be sorted sequentially according to aspect probability scores, and then the span word vectors whose ranking is within a preset ranking threshold range are taken as aspect span word vectors.

[0079] In this embodiment of the application, the preset ranking threshold range can be 1-3 or 1-4, and this embodiment of the application does not limit it.

[0080] In an optional implementation, during the process of determining the opinion span word vector or aspect span word vector, the number of span word vectors can be limited according to the length of the target text information and a preset adjustable deviation number. For example, assuming the length of the target text information is N and the preset adjustable deviation number is Z, the number of span word vectors can be set to NZ.

[0081] The above technical solution can limit the number of span word vectors, thereby achieving the beneficial effect of further saving computing costs.

[0082] Figure 3 This is a schematic diagram of the structure of an implicit emotion determination device provided in an embodiment of this application, as shown below. Figure 3 As shown, the device includes: The first determining unit 301 is used to determine multiple feature word vectors based on the target text information; The second determining unit 302 is used to determine multiple vector scores based on the multiple feature word vectors; any vector score is obtained based on any two feature word vectors. The generation unit 303 is used to generate multiple span word vectors based on the multiple vector scores; each span word vector contains at least two feature word vectors. Processing unit 304 is used to determine the implicit sentiment contained in the target text information based on the multiple span word vectors.

[0083] Optionally, the first determining unit 301 is specifically used for: Determine the initial word vectors corresponding to each word in the target text information to obtain multiple initial word vectors; The multiple initial word vectors are input into a pre-trained vector transformation model to obtain the multiple feature word vectors.

[0084] Optionally, the multiple feature word vectors may include a first feature word vector and a second feature word vector; The generating unit 303 is specifically used for: If the vector score between the first feature word vector and the second feature word vector is greater than a preset vector score threshold, then a span word vector is generated based on the first feature word vector, the second feature word vector, and each feature word vector between the first feature word vector and the second feature word vector.

[0085] Optionally, the processing unit 304 is specifically used for: Based on the probability scores corresponding to each span word vector, multiple combined word vectors are obtained; Determine the sentiment probability corresponding to each combined word vector; Based on the sentiment probabilities corresponding to each combined word vector, the implicit sentiment contained in the target text information is determined.

[0086] Optionally, the processing unit 304 is specifically used for: Based on the probability scores corresponding to each span word vector, each span word vector is divided into opinion span word vectors or aspect span word vectors. By combining the word vector of any opinion span with the word vector of any aspect span, multiple combined word vectors are obtained.

[0087] Figure 4 This diagram illustrates another possible structural design of the implicit emotion determination device described in the above embodiments. The implicit emotion determination device includes a processor 401 and a communication interface 402. The processor 401 controls and manages the operation of the implicit emotion determination device, and the communication interface 402 supports communication between the implicit emotion determination device and other network entities. The implicit emotion determination device may also include a memory 403 and a bus 404. The memory 403 stores the program code and data of the implicit emotion determination device.

[0088] The memory 403 may be the memory in the implicit emotion determination device, etc. The memory may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk or solid-state drive; the memory may also include a combination of the above types of memory.

[0089] The processor 401 described above can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0090] Bus 404 can be an Extended Industry Standard Architecture (EISA) bus, etc. Bus 404 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0091] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0092] This application provides a computer program product containing instructions that, when run on a computer, cause the computer to execute the implicit emotion determination method in the above method embodiments.

[0093] This application also provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the implicit sentiment determination method in the method flow shown in the above method embodiments.

[0094] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires; a portable computer disk drive; a hard disk drive; a random access memory (RAM); a read-only memory (ROM); an erasable programmable read-only memory (EPROM); a register; a hard disk drive; an optical fiber; a portable compact disc read-only memory (CD-ROM); an optical storage device; a magnetic storage device; or any suitable combination thereof; or any other form of computer-readable storage medium known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read a product from the storage medium and to write a product to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may reside in an application-specific integrated circuit (ASIC). In the embodiments of this application, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0095] Embodiments of the present invention provide a computer program product containing instructions that, when executed on a computer, cause the computer to perform the implicit emotion determination method described in the embodiments of this application.

[0096] Since the implicit emotion determination device, computer-readable storage medium, and computer program product in the embodiments of the present invention can be applied to the above method, the technical effects they can achieve can also be referred to the above method embodiments. The embodiments of the present invention will not be described again here.

[0097] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0098] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0099] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for determining implicit emotions, characterized in that, The method includes: Based on the target text information, determine multiple feature word vectors; Based on the multiple feature word vectors, multiple vector scores are determined; the vector scores are determined according to the formula... A defined attention score, where, Let Q and K represent vector scores, where Q and K are feature word vectors, d represents the span between any two feature word vectors, and W represents the vector score. Q and W K The weight matrix to be learned; the multiple feature word vectors include a first feature word vector and a second feature word vector; If the vector score between the first feature word vector and the second feature word vector is greater than a preset vector score threshold, then a span word vector is generated based on the first feature word vector, the second feature word vector, and each feature word vector between the first feature word vector and the second feature word vector; the span word vector contains at least two feature word vectors. Based on the probability scores corresponding to each span word vector, multiple combined word vectors are obtained; Determine the sentiment probability corresponding to each combined word vector; Based on the sentiment probabilities corresponding to each combined word vector, the implicit sentiment contained in the target text information is determined.

2. The method according to claim 1, characterized in that, The determination of multiple feature word vectors based on target text information includes: Determine the initial word vectors corresponding to each word in the target text information to obtain multiple initial word vectors; The multiple initial word vectors are input into a pre-trained vector transformation model to obtain the multiple feature word vectors.

3. The method according to claim 1, characterized in that, The process involves obtaining multiple combined word vectors based on the probability scores corresponding to each span word vector, including: Based on the probability scores corresponding to each span word vector, each span word vector is divided into opinion span word vectors or aspect span word vectors. By combining the word vector of any opinion span with the word vector of any aspect span, multiple combined word vectors are obtained.

4. A device for determining implicit emotions, characterized in that, The device includes: The first determining unit is used to determine multiple feature word vectors based on the target text information; The second determining unit is used to determine multiple vector scores based on the multiple feature word vectors; the vector scores are determined according to the formula... A defined attention score, where, Let Q and K represent vector scores, where Q and K are feature word vectors, d represents the span between any two feature word vectors, and W represents the vector score. Q and W K This is the weight matrix that needs to be learned; The generation unit is configured to include a first feature word vector and a second feature word vector among the plurality of feature word vectors; if the vector score between the first feature word vector and the second feature word vector is greater than a preset vector score threshold, then a span word vector is generated based on the first feature word vector, the second feature word vector, and each feature word vector between the first feature word vector and the second feature word vector; the span word vector includes at least two feature word vectors; The processing unit is configured to obtain multiple combined word vectors based on the probability scores corresponding to each span word vector; determine the sentiment probability corresponding to each combined word vector; and determine the implicit sentiment contained in the target text information based on the sentiment probabilities corresponding to each combined word vector.

5. The apparatus according to claim 4, characterized in that, The first determining unit is specifically used for: Determine the initial word vectors corresponding to each word in the target text information to obtain multiple initial word vectors; The multiple initial word vectors are input into a pre-trained vector transformation model to obtain the multiple feature word vectors.

6. The apparatus according to claim 4, characterized in that, The processing unit is specifically used for: Based on the probability scores corresponding to each span word vector, each span word vector is divided into opinion span word vectors or aspect span word vectors. By combining the word vector of any opinion span with the word vector of any aspect span, multiple combined word vectors are obtained.

7. A device for determining implicit emotions, characterized in that, include: A processor and a communication interface; the communication interface is coupled to the processor, the processor being configured to run computer programs or instructions to implement the implicit emotion determination method as described in any one of claims 1-3.

8. A computer-readable storage medium storing instructions, characterized in that, When the computer executes the instruction, the computer performs the implicit emotion determination method according to any one of claims 1-3.

Citation Information

Patent Citations

  • Text emotion analysis method and device and storage medium

    CN108717406A

  • Aspect sentiment analysis method and system oriented to natural language

    CN114357155A