Target object recommendation system, method, device, data processing method and device

By designing the target object recommendation system, using neural network model to extract and predict user comments and target object comments, the problem that existing systems cannot effectively deal with the two sides of comments is solved, and more accurate emotional information acquisition and target object recommendation are achieved. .

CN112364236BActive Publication Date: 2025-02-11ALIBABA GROUP HOLDING LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201910671141.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-07-24
Publication Date
2025-02-11
Estimated Expiration
2039-07-24

AI Technical Summary

Technical Problem

The existing comment-based processing system cannot effectively handle the two sides shown in user comments, and it is difficult to obtain more accurate and effective information.

Method used

A target object recommendation system was designed, including input module, feature extraction module, logic unit module, capsule network module and output module. Through the neural network model, feature extraction and emotional prediction of user comment data and target object comment data are generated to generate users. Emotional information about the target object.

Benefits of technology

Effectively explore the two-sided information in user comments, provide more accurate and effective emotional information, and help users recommend more suitable target objects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112364236B_ABST
    Figure CN112364236B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method, system, device, electronic device and computer storage medium for recommending a target object, wherein the method for recommending a target object comprises: generating corresponding first and second vectors according to the first historical comment data of the user and the second historical comment data of the target object to be recommended respectively; inputting the first and second vectors into a neural network model for predicting sentiment ratings, processing the first and second vectors through the neural network model to output the user's sentiment information about the target object based on the positive and negative sentiment features obtained after processing; and determining whether to recommend the target object to the user according to the sentiment information. Through the embodiment of the present invention, the content of user comments, especially the content of two-sided comments, can be effectively mined to obtain more accurate and effective information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a target object recommendation system, method, and device, a data processing method and device, and an electronic device and a computer storage medium. Background Art

[0002] With the rapid rise of communication and Internet technologies, platforms that provide people with various services have also emerged, and many of these platforms provide comment functions. Through the comment function, people can make various comments on objects of interest and express their opinions, usage experience, degree of preference, and other information on a certain object.

[0003] For example, taking online shopping as an example, most e-commerce platforms that provide online shopping allow users to leave corresponding comments (including product ratings and comments, etc.) based on their own shopping behaviors to express their shopping experience, etc. However, in real e-commerce scenarios, users' comments on products may have two sides, and they may like them while also dislike them. For example, users may like the functions and design of the iPhone X, but think that its price is too high. The two-sidedness shown by users can better allow merchants to understand the attributes of products and make corresponding adjustments to the products.

[0004] However, existing review-based processing systems such as product recommendation systems or product decision systems cannot effectively handle the two-sidedness shown in user reviews.

[0005] Therefore, how to effectively mine the content of user comments, especially those with two-sided nature, to obtain more accurate and effective information has become an urgent problem to be solved. Summary of the invention

[0006] In view of this, an embodiment of the present invention provides a target object recommendation solution to at least partially solve the above problem.

[0007] According to a first aspect of an embodiment of the present invention, a target object recommendation system is provided, comprising: an input module, a feature extraction module, a logic unit module, a capsule network module, and an output module; the input module comprises: a first input part for receiving a word vector corresponding to a user's comment data, and a second input part for receiving a word vector corresponding to the comment data of a target object; the feature extraction module is used to perform feature extraction on the vector output by the first input part and the vector output by the second input part, and obtain a viewpoint vector corresponding to the vector output by the first input part, and an attribute vector corresponding to the vector output by the second input part; the logic unit module is used to pair the viewpoint vector and the attribute vector to generate a corresponding logic unit; the capsule network module comprises: a first capsule network part for performing positive emotion prediction on the logic unit and outputting a positive emotion feature vector, and a second capsule network part for performing negative emotion prediction on the logic unit and outputting a negative emotion feature vector; the output module is used to predict and output the user's emotion information on the target object based on the positive emotion feature vector output by the first capsule network part and the negative emotion feature vector output by the second capsule network part.

[0008] According to a second aspect of an embodiment of the present invention, a target object recommendation method is provided, comprising: generating corresponding first and second vectors according to first historical comment data of a user and second historical comment data of a target object to be recommended, respectively; inputting the first and second vectors into a neural network model for sentiment rating prediction, processing the first and second vectors through the neural network model to output the user's sentiment information about the target object based on positive and negative sentiment features obtained after processing; determining whether to recommend the target object to the user according to the sentiment information, wherein the neural network model adopts the structure of the target object recommendation system as described in the first aspect.

[0009] According to a third aspect of an embodiment of the present invention, a data processing method is provided, comprising: receiving a first word vector corresponding to first sample data and a second word vector corresponding to second sample data through an input part of a neural network model, wherein the first sample data is used to represent user comment sample data of multiple sample users, and the second sample data is used to represent target object comment sample data of multiple sample target objects; at least part of the sample data in the first sample data and the second sample data simultaneously contains positive sentiment data and negative sentiment data; obtaining a viewpoint vector of the sample user and an attribute vector of the sample target object corresponding to the first word vector and the second word vector respectively through a feature extraction part of the neural network model; pairing the viewpoint vector and the attribute vector to generate a corresponding plurality of logical units; inputting the plurality of logical units into a capsule network part of the neural network model to obtain a corresponding sentiment feature vector; and predicting and outputting the sentiment information of the sample user on the sample target object according to the sentiment feature vector through an output part of the neural network model.

[0010] According to a fourth aspect of an embodiment of the present invention, there is provided a target object recommendation device, comprising: a generation module, for generating corresponding first and second vectors according to first historical comment data of a user and second historical comment data of a target object to be recommended, respectively; a processing module, for inputting the first and second vectors into a neural network model for sentiment rating prediction, processing the first and second vectors by the neural network model, so as to output the user's sentiment information about the target object based on the positive and negative sentiment features obtained after the processing; and a recommendation module, for determining whether to recommend the target object to the user according to the sentiment information.

[0011] According to a fifth aspect of an embodiment of the present invention, a data processing device is provided, comprising: a receiving module, used to receive a first word vector corresponding to first sample data and a second word vector corresponding to second sample data through an input part of a neural network model, wherein the first sample data is used to represent user comment sample data of multiple sample users, and the second sample data is used to represent target object comment sample data of multiple sample target objects; at least part of the sample data in the first sample data and the second sample data simultaneously contains positive sentiment data and negative sentiment data; a first obtaining module, used to obtain, through a feature extraction part of the neural network model, a viewpoint vector of the sample user and an attribute vector of the sample target object corresponding to the first word vector and the second word vector respectively; a logical unit generating module, used to pair the viewpoint vector and the attribute vector to generate a corresponding plurality of logical units; a second obtaining module, used to input the plurality of logical units into a capsule network part of the neural network model to obtain a corresponding sentiment feature vector; a prediction output module, used to predict and output, through the output part of the neural network model, the sentiment information of the sample user on the sample target object according to the sentiment feature vector.

[0012] According to the sixth aspect of an embodiment of the present invention, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the target object recommendation method as described in the second aspect, or to perform operations corresponding to the data processing method as described in the third aspect.

[0013] According to a seventh aspect of an embodiment of the present invention, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the target object recommendation method as described in the second aspect is implemented, or, when the program is executed by a processor, the data processing method as described in the third aspect is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0015] Figure 1A This is a flowchart of the steps of a target object recommendation method according to the first embodiment of the present invention;

[0016] Figure 1B For a Figure 1AA schematic diagram of a usage scenario of the illustrated embodiment;

[0017] Figure 2A This is a flowchart of a target object recommendation method according to Embodiment 2 of the present invention;

[0018] Figure 2B for Figure 2A A schematic diagram of the structure of a neural network model used in the illustrated embodiment;

[0019] Figure 3 is a flowchart of a data processing method according to Embodiment 3 of the present invention;

[0020] Figure 4 is a structural block diagram of a target object recommendation system according to Embodiment 4 of the present invention;

[0021] Figure 5 is a structural block diagram of a target object recommendation device according to Embodiment 5 of the present invention;

[0022] Figure 6 is a structural block diagram of a data processing device according to Embodiment 6 of the present invention;

[0023] Figure 7 FIG. 1 is a schematic diagram of the structure of an electronic device according to Embodiment 7 of the present invention. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in the field based on the embodiments in the embodiments of the present invention should fall within the scope of protection of the embodiments of the present invention.

[0025] The specific implementation of the embodiment of the present invention is further described below in conjunction with the accompanying drawings of the embodiment of the present invention.

[0026] Embodiment 1

[0027] Reference Figure 1A , shows a step flow chart of a target object recommendation method according to embodiment 1 of the present invention.

[0028] The target object recommendation method of this embodiment includes the following steps:

[0029] Step S102: Generate a corresponding first vector and a corresponding second vector according to the first historical comment data of the user and the second historical comment data of the target object to be recommended.

[0030] The embodiment of the present invention uses a trained neural network model for sentiment rating prediction to recommend target objects. Therefore, for the trained neural network model, the first historical comment data and / or the second historical comment data may or may not contain two-sided comment data, and may partially or completely contain it.

[0031] The first historical comment data is the comment data published by the user on the processed target object, such as the comment data published by user A on target objects X, Y and Z, etc.; the second historical comment data is the comment data commented on by the processed target object, such as the data on target object B commented on by users X, Y and Z, etc. The "processing" can be any appropriate processing, including but not limited to: purchasing, reading, posting, following, etc. The two-sided comment data means comment data containing both positive emotions and negative emotions, for example, "IPONEX has good functions, but it is too expensive", where "good functions" expresses positive emotions, while "too expensive" expresses negative emotions.

[0032] In addition, in the embodiment of the present invention, because it is necessary to obtain the user's emotional information about the target object through the neural network model, it is necessary to process both the first historical comment data and the second historical comment data into vectors that can be processed by the neural network model, that is, the first vector corresponding to the first historical comment data, and the second vector corresponding to the second historical comment data. The specific method of processing the historical comment data into vectors can be adopted by those skilled in the art in accordance with actual needs in any appropriate manner, such as the word2vec method, etc., and the embodiment of the present invention does not limit this. The first vector and the second vector can be represented in the form of word vectors.

[0033] Step S104: input the first vector and the second vector into a neural network model for sentiment rating prediction, and process the first vector and the second vector through the neural network model to output the user's sentiment information about the target object based on the positive sentiment features and negative sentiment features obtained after the processing.

[0034] As mentioned above, the neural network model in the embodiment of the present invention can be a trained neural network model. After the first vector and the second vector are input, the neural network model processes them and finally outputs the user's emotional information about the target object, including but not limited to the degree of positive emotion, the degree of negative emotion, the degree of preference, the degree of disgust, etc. The specific method of representing the emotional information can be adopted by technical personnel in this field in any appropriate form according to actual needs.

[0035] The user's emotional information about the target object is generated based on the positive emotional features and negative emotional features obtained after the neural network model processes the first vector and the second vector. The specific processing of the first and second vectors by the neural network model is related to the structure and settings of the model itself. In this embodiment, the specific structure of the model is not limited. After multiple processing of the first and second vectors, the corresponding positive emotional features and negative emotional features can be generated, and then the user's emotional information about the target object can be output based on this. In an optional manner, the neural network model of this embodiment can be used as follows: Figure 2B The neural network model shown, or, Figure 4 The structure of the target object recommendation system shown.

[0036] Step S106: Determine whether to recommend the target object to the user based on the emotion information.

[0037] The user's emotional information about the target object represents the user's preference for the target object, and based on this, it can be determined whether to recommend the target object to the user. For example, if the emotional information is higher than a certain set threshold, the target object is recommended to the user; otherwise, it is not recommended.

[0038] The following uses online shopping as an example to illustrate the use scenario of the target object recommendation method of this embodiment. Figure 1B shown. Figure 1B In the figure, the left interface shows an interface for user A to evaluate energy drink X after user A successfully purchases energy drink X online. In actual applications, user A generally does not evaluate only a certain purchased product, but will evaluate all or most of the purchased products through similar Figure 1B . After the background server collects user A’s evaluation of energy drink X, it forms user A’s first historical review data together with the previously collected evaluation data of other products by user A. When it is necessary to recommend a product to user A, the background server will use the first historical review data, combined with the second historical review data of the product to be recommended (including all review data of the product to be recommended by user A or multiple users excluding user A), to determine whether to recommend the product to be recommended to user A, and, if it is determined to recommend it to user A, which products among the products to be recommended are recommended. Take the products to be recommended as "beef oil hot pot" and a pair of "sports shoes" as an example. Figure 1BAs shown in the right interface of , the backend server converts the first historical comment data into a first vector and the second historical comment data into a second vector. Then, the first vector and the second vector are input into the neural network model for sentiment rating prediction. Through the processing of the neural network model, the sentiment information of user A for "beef oil red pot" and "sports shoes" is output. For example, user A may have a greater interest in "beef oil red pot" and a lower interest in "sports shoes". Furthermore, "beef oil red pot" can be recommended to user A instead of "sports shoes".

[0039] According to the present embodiment, the user's emotional information about the target object is obtained through a neural network model for predicting emotional ratings, because the emotional information is obtained based on both the user's positive emotional features and the user's negative emotional features. Also, the data processed by the neural network model includes comment data of a certain user or a certain type of user on the target object that has been processed by the user (i.e., the first historical comment data), and comment data of a certain user or a certain type of target object that has been commented on by multiple processors (i.e., the second historical comment data). It can be seen that this embodiment can take into account both the two-sided information contained in the historical comment data and the two-sided information of the user's emotions about the target object. Therefore, the solution provided by this embodiment can effectively mine the content of user comments, especially the content of two-sided comments, to obtain more accurate and effective information.

[0040] The target object recommendation method of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: a server, a mobile terminal (such as a mobile phone, a PAD, etc.) and a PC, etc.

[0041] Embodiment 2

[0042] Reference Figure 2A , shows a step flow chart of a target object recommendation method according to embodiment 2 of the present invention.

[0043] In order to clearly illustrate the solution provided by the embodiment of the present invention, two parts are set up in this embodiment, wherein the first part is used to illustrate how to train the neural network model, and the second part is used to illustrate how to recommend target objects based on the trained neural network model.

[0044] Based on this, the target object recommendation method of this embodiment includes:

[0045] (i) Using the first sample data and the second sample data, a neural network model for sentiment rating prediction is trained.

[0046] The following first describes the neural network model structure used in the embodiment of the present invention. Figure 2B shown.

[0047] Figure 2B In the figure, the neural network model includes an input part (dashed box ①), a feature extraction part (dashed box ②), a logic unit part (dashed box ③), a capsule network part (dashed box ④), and an output part (dashed box ⑤).

[0048] in:

[0049] The input part includes: a first input part (the upper part in the dotted box ①) for receiving a word vector corresponding to the user's comment data, and a second input part (the lower part in the dotted box ①) for receiving a word vector corresponding to the comment data of the target object.

[0050] The feature extraction part is used to extract features from the vector output by the first input part and the vector output by the second input part, and obtain a viewpoint vector corresponding to the vector output by the first input part (the upper half of the dotted box ②), and an attribute vector corresponding to the vector output by the second input part (the lower half of the dotted box ②).

[0051] The logic unit part is used to pair the viewpoint vector and the attribute vector to generate a corresponding logic unit.

[0052] The capsule network part includes: a first capsule network part (the upper part of the dotted box ④) for predicting positive emotions of logical units and outputting positive emotional feature vectors, and a second capsule network part (the lower part of the dotted box ④) for predicting negative emotions of logical units and outputting negative emotional feature vectors.

[0053] The output part is used to predict and output the user's emotional information about the target object based on the positive emotional feature vector output by the first capsule network part and the negative emotional feature vector output by the second capsule network part.

[0054] Among them, the feature extraction part includes the convolution part and the self-attention part.

[0055] The convolution part includes: a first convolution part (the left side of the upper half in the dotted box ②) for convolving the vector output by the first input part and outputting the corresponding semantic vector, and a second convolution part (the left side of the lower half in the dotted box ②) for convolving the vector output by the second input part and outputting the corresponding semantic vector.

[0056] The self-attention part includes: a first self-attention part (the right side of the upper half of the dashed box ②) for processing the semantic vector output by the first convolution part using a gate mechanism and a self-attention mechanism and outputting a user's opinion vector, and a second self-attention part (the right side of the lower half of the dashed box ②) for processing the semantic vector output by the second convolution part using a gate mechanism and a self-attention mechanism and outputting an attribute vector of the target object.

[0057] The output part of the neural network model includes a high-speed network layer and a regression layer, wherein the high-speed network layer is used to obtain the corresponding positive degree vector for characterizing the positive emotional degree and the negative degree vector for characterizing the negative emotional degree according to the positive emotional feature vector and the negative emotional feature vector; the regression layer is used to output the user's emotional information on the target object according to the positive emotional feature vector, the negative emotional feature vector, the positive degree vector and the negative degree vector.

[0058] In addition, the neural network model routes the logic unit output by the logic unit part to the capsule network part through a dual dynamic routing protocol, and the routing weight in the dual dynamic routing protocol is determined according to the first weight and the second weight; wherein the first weight is used to indicate the weight between the logic unit and the first capsule network part and the second capsule network part, and the second weight is used to indicate the logic unit weight inside the first capsule network part and the logic unit weight inside the second capsule network part.

[0059] Based on the structure of the above neural network model, the training process of the neural network model includes:

[0060] Step S202: Acquire first sample data and second sample data, and convert the first sample data and the second sample data into corresponding first word vectors and second word vectors respectively.

[0061] Among them, the first sample data is used to represent user comment sample data of multiple sample users, and the second sample data is used to represent target object comment sample data of multiple sample target objects; in the first sample data and the second sample data, at least part of the sample data contains both positive sentiment data and negative sentiment data.

[0062] The specific operations of converting the first sample data into the first word vector and converting the second sample data into the second word vector can be implemented by those skilled in the art in any appropriate manner, such as the TF-IDF method, the word2vec method, etc., and the embodiment of the present invention is not limited to this.

[0063] For example, taking online shopping as an example, for each user u, all the comments written by the user on the purchased products are concatenated together to form the comment data of user u (w1, w2, ..., wl1 ), l1 represents the number of words in the first sample data; for each product i, all the comments written by all users for the current product are concatenated together to form the comment data of product i (w1, w2, ..., w l2 ), l2 represents the number of words in the second sample data; initialize the word vector mapping matrix E, which includes the word vectors corresponding to all words in the first sample data and the second sample data. Through E, the first word vector D' corresponding to the comments spliced ​​by user u can be obtained u The second word vector D' corresponding to the comments concatenated with product i i Among them, D' u =(e1, e2, ..., e l1 ), D' i =(e1, e2, ..., e l2 ).

[0064] Step S204: Receive a first word vector corresponding to the first sample data and a second word vector corresponding to the second sample data through the input part of the neural network model.

[0065] In this embodiment, the input part of the neural network model can adopt conventional settings, and can simultaneously receive the first word vector and the second word vector and pass them to the subsequent part of the neural network model for processing.

[0066] Still taking the above online shopping as an example, in this step, you can Figure 2B The input portion shown in FIG receives the first word vector D' u and the second word vector D' i .

[0067] Step S206: Obtain the opinion vector of the sample user and the attribute vector of the sample target object corresponding to the first word vector and the second word vector respectively through the feature extraction part of the neural network model.

[0068] like Figure 2B As shown in, the feature extraction part of the neural network model of this embodiment may include a convolution part and a self-attention part. The convolution part of the neural network model can be used to obtain the first semantic vector and the second semantic vector corresponding to the first word vector and the second word vector respectively; the gate mechanism and the self-attention mechanism are used to filter the first semantic vector and the second semantic vector to obtain the opinion vector of the first semantic vector under multiple first topics and the attribute vector of the second semantic vector under multiple second topics.

[0069] The gate mechanism is also called the gating mechanism, which is used to control the transmission of information in the neural network. It can be used to control how much information in the memory unit needs to be retained and how much needs to be discarded. In this neural network model, the gate mechanism is mainly used to control how much information related to each first topic in the information carried by the first semantic vector needs to be retained and how much needs to be discarded. Similarly, the gate mechanism in this neural network model is also used to control how much information related to each second topic in the information carried by the second semantic vector needs to be retained and how much needs to be discarded. The dimension of the feature vector after filtering by the gate mechanism is consistent with the dimension before filtering. That is, through the gate mechanism, the filtering of information related to the first topic (representing the user's point of view) carried by the word vector corresponding to each word in the user comment sample data of the sample user, and the filtering of information related to the second topic (representing the target object attribute) carried by the word vector corresponding to each word in the target object comment sample data of the sample target object is realized.

[0070] The self-attention mechanism is a form of the attention mechanism, which performs attention within the attention sequence and looks for connections within the sequence. Through the self-attention mechanism, the dependence on external information is reduced, and it is better at capturing the internal correlation of data or features. Specifically for the neural network model in this embodiment, the introduction of the self-attention mechanism can focus on the feature expression and association between vectors under each topic.

[0071] In this embodiment, the first theme is obtained according to the first sample data, including but not limited to clustering the first sample data or classifying it according to the first setting rule; similarly, the second theme is obtained according to the second sample data, including but not limited to clustering the second sample data or classifying it according to the second setting rule. Among them, the first setting rule and the second setting rule can be appropriately set by those skilled in the art according to actual needs, and the embodiment of the present invention does not limit this. For example, five first themes are obtained by clustering the first sample data, such as good-looking appearance, comprehensive functions, power saving, durable, and too expensive; five second themes are obtained by clustering the second sample data, such as long standby time, power saving, simple operation, good-looking appearance, and high cost performance. It can be seen that the first theme and the second theme can contain the same theme, of course, they can also be completely different or completely the same theme. The information of the first theme and the second theme can be pre-set in the neural network model (for example, pre-set in the neural network model in the form of a vector) and used when needed. Generally speaking, the number of first themes and the number of second themes can be equal, for example, it can be set to 3, 5, 7 or 9, etc. Preferably, 5 or 7 topics can be selected, which can meet the training needs and achieve better training results. However, it is not limited thereto, and those skilled in the art can also select other appropriate number of topics according to actual conditions.

[0072] Specifically in this embodiment, the gate mechanism and the self-attention mechanism can be used to filter the first semantic vector for each first topic, and after filtering, the weights of the first semantic vectors corresponding to different first topics can be different. Similarly, the gate mechanism and the self-attention mechanism can be used to filter the second semantic vector for each second topic, and after filtering, the weights of the second semantic vectors corresponding to different second topics can be different.

[0073] Since the first semantic vector can represent the user's opinion characteristics and the second semantic vector can represent the attribute characteristics of the target object, after filtering through the gate mechanism and the self-attention mechanism, the first semantic vector corresponding to each first topic is called the opinion vector, and the second semantic vector corresponding to each second topic is called the attribute vector.

[0074] In a feasible manner, using a gate mechanism and a self-attention mechanism to filter the first semantic vector and the second semantic vector to obtain the opinion vector of the first semantic vector under multiple first topics, and the attribute vector of the second semantic vector under multiple second topics may include: filtering the first semantic vector according to the gate mechanism and the multiple first topics corresponding to the first sample data to obtain the first semantic expression of the first semantic vector under different first topics; and filtering the second semantic vector according to the gate mechanism and the multiple second topics corresponding to the second sample data to obtain the second semantic expression of the second semantic vector under different second topics; using the self-attention mechanism to extract features from the first semantic expression and the second semantic expression respectively to obtain the opinion vector of the corresponding first semantic vector under multiple first topics, and the attribute vector of the second semantic vector under multiple second topics. By filtering with the gate mechanism, the semantic expressions for different topics are more representative, and further by filtering with the self-attention mechanism, the semantic expressions under different topics can be effectively focused on features, so that the extracted features can better represent each topic.

[0075] Still taking the online shopping as an example, when the convolution part of the neural network model is used to obtain the first semantic vector and the second semantic vector corresponding to the first word vector and the second word vector, respectively, for D′ u Every word in w j Mapped to the word vector space in sequence (where j = 1, 2, ..., l1), we get the vector e j ∈R d , where d represents the embedding size, R represents the set of real numbers, and R d Represents a real number vector with dimension d. The corresponding word vector matrix D is obtained u =(e1, e2, ..., e l1 ); Similarly, for D′ i Every word in w j Mapped to the word vector space in sequence (where j = 1, 2, ..., l2), we get the vector e j ∈R d , thus obtaining the corresponding word vector matrix D i =(e1, e2, ..., e l2 ). For the word vector matrix D u and D i , through n (the range of values ​​is generally [50, 100, 150], optionally 50) convolution kernels with window size c (the value can generally be 3, 4, 5, optionally 3) on D u and D i Perform convolution operations to obtain the semantic vector c of context information with embedding length c. l1 ∈R n (corresponding to Du The first semantic vector of l2 ∈R n (corresponding to D i The second semantic vector of l1 =(c1, c2, ..., c |l1| ), c l2 =(c1, c2, ..., c |l2| ). Where n represents the number of filters, R n represents an n-dimensional real vector, |l1| represents D u The length of |l2| represents D i length. And,

[0076]

[0077]

[0078] Through the above formula, the convolution values ​​corresponding to n convolution kernels can be concatenated to obtain a real number vector with dimension n. is the convolution kernel parameter, * indicates the convolution operation, b f is a bias value. Each convolution kernel corresponds to a W f and a b f . is the output of the f-th convolution kernel at the j-th word, which is a constant.

[0079] Based on the obtained c l1 and c l2 When using the gate mechanism for filtering, the gate mechanism is used to combine the corresponding topic vectors (the vector corresponding to the first topic and the vector corresponding to the second topic) to filter the semantic vector c l1 and c l2 Perform filtering operations, and then obtain semantic expressions for different topics through a topic-shared transformation matrix. Assuming that for a topic x in the first topic, all users use the same topic transfer matrix Wx to transfer, then the topic transfer matrix can be a topic-shared transformation matrix, such as Wp in formula 4.

[0080] To c l1 For example, for c l1 =(c1, c2, ..., c |l1| ) j , using the gate mechanism to operate on c l1 The features carried by the vector are filtered to obtain the relevant opinion vector s u,x,j ∈R n , the formula is as follows:

[0081] su,x,j =c j ⊙σ(W x,1 c j +W x,2 q u,x +b x ) (Formula 3)

[0082] Among them, W x,1 , W x,2 ∈R n×n and b x ∈R n are the weight matrix and bias vector, q u,x is the xth topic vector for user u, ⊙ represents dimension-by-dimensional multiplication, and σ represents the sigmoid activation function. In a feasible way, the above weight matrix and bias vector can be randomly generated at the beginning, but conform to the normal distribution with a mean of 0 and a variance of 0.3.

[0083] The view vector s u,x,j Through a mapping matrix W p ∈R k×n Mapped to the corresponding topic space, the formula is as follows:

[0084] p u,x,j =W p s u,x,j (Formula 4)

[0085] Thus, we get c l1 The first semantic expression under different first topics u,x,j =(p u,x,1 , p u,x,2 , ..., p u,x,l1 ).

[0086] Similarly, we can get c l2 Second semantic expressions under different second topics i,x,j =(p i,x,1 , p i,x,2 , ..., p i,x,l2 ).

[0087] P u,x,j , using the self-attention mechanism, M opinion vectors corresponding to different topics are extracted for each user; similarly, for p i,x,j , using the self-attention mechanism, M attribute vectors corresponding to different topics are extracted for each product. As mentioned above, M can be appropriately set by those skilled in the art, and M=5 or M=7 can be selected.

[0088] Specifically, the semantic vector matrix P for different first topics is u,1 , P u,2 , ..., P u,M, for each semantic vector matrix P u,x , that is, for the xth topic, by the semantic vector matrix P u,x Take the average and operation to get the primary view vector v u,x ∈R k , the formula is as follows:

[0089]

[0090] Among them, l1 has the same meaning as before.

[0091] Then, according to the expression p of the jth word in the specific topic space u,x,j and the primary view vector v u,x , the weight of self-attention of the jth word under the corresponding topic is calculated as follows:

[0092]

[0093] According to the self-attention-based weights calculated by formula (6), u,x The vectors in take the weighted sum to get the final opinion expression v of user u on the xth topic u,x ∈R k , that is, the view vector is as follows:

[0094] v u,x =∑ j attn u,x,j p u,x,j (Formula 7)

[0095] Similarly, the attribute vector a of product i i,y It can be obtained by referring to the calculation method of the above opinion vector. However, it should be noted that the attribute vector a of product i i,y Although the learning process is consistent with the user's opinion vector, the parameters are not shared.

[0096] Step S208: Pair the viewpoint vector and the attribute vector to generate a corresponding plurality of logical units.

[0097] For example, each viewpoint vector in the viewpoint vector may be paired with each attribute vector in pairs, and a plurality of corresponding logic units may be generated according to the pairing results.

[0098] Assume that there are 10 opinion vectors and 10 attribute vectors. After pairing them two by two, 10*10=100 logical units will be formed.

[0099] In one feasible way, each viewpoint vector in the viewpoint vector can be paired with each attribute vector by calculating the difference between the vectors and the dot product between the vectors, and a plurality of corresponding logic units can be generated according to the pairing results. Through this pairing and pairing method, the generation of logic units can be realized efficiently and at low cost.

[0100] Still taking the above online shopping as an example, given a user u and a product i, the user opinion vector v obtained in step S206 is u,x and product attribute vector a i,y Paired in pairs, they form logical units to express g x,y ∈R 2k (a real vector with a dimension of 2K), the formula is as follows:

[0101]

[0102] in, This is a vector concatenation operation.

[0103] By pairing the opinion vector and the attribute vector into the form of logical units, an objective and comprehensive data basis is provided for the subsequent generation of the sentiment feature vector.

[0104] Step S210: Input multiple logical units into the capsule network part to obtain the corresponding emotion feature vector.

[0105] A capsule network is composed of capsules instead of neurons, where a capsule is a small group of neurons. The output of the capsule network is a vector (for example, an 8-dimensional vector), and the length of each capsule network output vector represents the estimated probability of the existence of the target. The capsule network is also composed of multiple layers. The capsules at the bottom layer are called vector capsules. Each of them uses only a part of the data as input, and then tries to detect whether a specific feature (for example, a set language expression) exists. Capsules at higher layers detect larger and more complex targets, etc. With the present neural network model, the capsule network's good modeling ability for complex relationships between features can well solve the problem of reasoning about the potential causes of emotional behavior in user comments, thereby effectively obtaining the emotional feature vector corresponding to each logical unit.

[0106] The capsule network part in this embodiment includes a first capsule network part for positive emotion prediction and a second capsule network part for negative emotion prediction. Therefore, this step can be implemented as follows: input multiple logic units into the first capsule network part for positive emotion prediction and the second capsule network part for negative emotion prediction, respectively, to obtain the corresponding positive emotion feature vector and negative emotion feature vector. That is, after the multiple logic units generated by the logic unit part are input into the capsule network part, a corresponding positive emotion feature vector is obtained through the processing of the first capsule network part, and a corresponding negative emotion feature vector is obtained through the processing of the second capsule network part.

[0107] Wherein, a dual dynamic routing protocol is adopted between the logic unit part and the capsule network part, and the routing weight in the dual dynamic routing protocol is determined according to the first weight and the second weight, the first weight is used to indicate the weight between the logic unit and the capsule network part (including the first capsule network part and the second capsule network part), and the second weight is used to indicate the logic unit weight inside the first capsule network part and the logic unit weight inside the second capsule network part. The weight of each logic unit and the capsule network part comprehensively considers the first weight and the second weight corresponding to the logic unit.

[0108] The logic unit part routes each logic unit to the capsule network part according to the dual dynamic routing protocol, and obtains the positive emotion feature vector and negative emotion feature vector corresponding to each logic unit through the capsule network part.

[0109] For example, given a user u and a product i, all the logical units g obtained in step S208 1,1 , g 1,2 , ..., g M,M The first capsule network representing positive sentiment prediction and the second capsule network representing negative sentiment prediction are input respectively.

[0110] For each logical unit g x,y , initialization parameter b s,x,y = 0, through a transformation matrix (such as W in Formula 9 s,x,y ) converts it into the hidden vector t of the capsule network s,x,y ∈R k , (real vector with dimension K) x, y∈1...M, s∈S={pos, neg} (first capsule network and second capsule network), the formula is as follows:

[0111] t s,x,y =W s,x,y g x,y (Formula 9)

[0112] Among them, W s,x,y ∈R k×2kIt is the conversion weight matrix corresponding to the logical unit of the (x, y)th pair in the sth capsule.

[0113] For each pair of logic cells g x,y , according to the parameter b in the corresponding capsule s,x,y , calculate the weights between its capsules respectively (first weight) and the weight within the capsule (Second weight) is as follows:

[0114]

[0115]

[0116] According to the weights between the capsules corresponding to the logical unit and the weights within the capsule, each logical unit g is calculated through the L1 normalization operation. x,y The corresponding weights in the corresponding capsule s are as follows:

[0117]

[0118] According to the hidden vector t in the obtained capsule s s,x,y and the corresponding weight c s,x,y , and merge them into a vector as follows:

[0119] s s,u, i=∑ x,y c s,x,y t s,x,y (Formula 13)

[0120] Similar to the general capsule network, for the vector s s,u,i Compress to get the final output o of the capsule network s,u,i ∈R k , the formula is as follows:

[0121]

[0122] Among them, |||| represents the length of the vector and also represents the probability of the corresponding emotion existing.

[0123] According to the output o s,u,i , update the capsule internal parameter b s,x,y , the formula is as follows:

[0124]

[0125] The calculation steps of returning the weight between capsules (first weight) and the weight within capsules (second weight) are iteratively calculated (such as iteration 1-4 times, optionally 3 times), and the final output sentiment vector o s,u,i is regarded as the emotional feature vector output by the emotional capsule s, which includes the vector o poS,u,i , oneg,u,i ∈R k .

[0126] Step S212: Through the output part of the neural network model, the emotional information of the sample user towards the sample target object is predicted and output according to the emotional feature vector.

[0127] In the output part, the Figure 2B When the high-speed network layer and regression layer shown in are set, this step can be implemented as follows: input the positive emotion feature vector and the negative emotion feature vector into the high-speed network layer in the output part to obtain the corresponding positive degree vector for characterizing the positive emotion degree and the negative degree vector for characterizing the negative emotion degree; through the regression layer in the output part of the neural network model, according to the positive emotion feature vector, the negative emotion feature vector, the positive degree vector and the negative degree vector, the emotion information of the sample user on the sample target object is output.

[0128] The highway network layer is used to control the transmission of information in the neural network. In this neural network model, the highway network layer is used to control how much information in the input vector needs to be retained, how much needs to be discarded, and how much of the new state vector needs to be retained.

[0129] For example, given user u and product i, the positive sentiment vector o obtained according to the previous steps is pos,u,i and negative sentiment vector o neg,u,i , the prediction of user u's score for product i is completed through the following process

[0130] The process includes: taking the output o of the capsule network s,u,i , the final sentiment feature vector h is obtained through a layer of high-speed network s,u,i , the formula is as follows:

[0131] η s =σ(H s,1 o s,u,i +b s,1 ) (Formula 16)

[0132] h s,u,i =η s ⊙o s,u,i +(1-η s )⊙tanh(H s,2 o s,u,i +b s,2 ) (Formula 17)

[0133] Among them, H s,1 , H s,2 ∈R k×k is the transformation matrix, b s,1 , bs,2 ∈Rk is the bias vector. σ represents the sigmoid activation function.

[0134] It should be noted that the “conversion matrix” and other calculation parameters introduced in the calculation in this embodiment can all be implemented by referring to the setting and operation of the conversion matrix in the existing capsule network.

[0135] According to the sentiment feature vector h s,u,i , through a regression layer to calculate the degree vector r of the user's positive / negative sentiment towards the product s,u,i , the formula is as follows:

[0136]

[0137] Among them, w s ∈R k is the weight vector of the regression function, b s,3 ∈R is the bias value.

[0138] The positive degree vector r calculated for the positive sentiment feature vector and the negative sentiment feature vector pos,u,i and the negative degree vector r neg,u,i , and according to ||o pos,u,i || and ||o neg,u,i ||, after a deformed sigmoid function, the score prediction of user u for product i is completed The formula is as follows:

[0139]

[0140] Among them, ||o pos,u,i || and ||o neg,u,i || represents the length of the positive sentiment vector and the negative sentiment vector, respectively, and also represents the probability that user u holds the corresponding sentiment towards product i. Function It is a deformation of the sigmoid function and can predict scores in the range of [1, C].

[0141] Step S214: adjusting the training parameters of the neural network model according to the difference between the predicted output emotional information and the corresponding emotional annotation information, and iteratively training the neural network model according to the adjusted training parameters until the training termination condition is met.

[0142] The emotional annotation information may be the emotional information expressed in the actual comments made by the sample user on the sample target object; the adjusted training parameters may be conventional parameters that need to be adjusted during the training of the neural network model, including but not limited to: various weight parameters, various convolution parameters, etc.; the training termination condition may be that the training is terminated after meeting the set number of times, or that the difference between the predicted output emotional information and the emotional annotation information meets the set threshold. The set number of times and the set threshold may be appropriately set by those skilled in the art according to the actual situation, and the embodiments of the present invention do not limit this.

[0143] For example, during training, given the set O = {(u, i)} 1→|O| , where (u, i) represents a user-item pair, u represents the u-th user, i represents the i-th item, and r u,i represents the actual score given by user u to product i, based on the predicted score The MSE loss function of the model can be obtained as follows:

[0144]

[0145] According to the actual scores given by users to the products, the scoring behaviors of users in set O can be divided into positive O and negative O. pos and negative O neg Two separate data sets. Then according to the sentiment feature vector o s,u,i , we get the sentiment classification function of the model, the formula is as follows:

[0146]

[0147] in, Represents an emotional tendency opposite to s.

[0148] Combining formulas 20 and 21, the final loss function during model training is as follows:

[0149] L=λL sqr +(1-λ)L stm (Formula 22)

[0150] Among them, λ is an importance factor that can adjust the importance of the two tasks, usually a real number between 0 and 1. The model is optimized using back propagation and stochastic gradient descent algorithms during training. The model is trained for several rounds before training is completed.

[0151] As can be seen from the above, the neural network model of this embodiment can complete the score prediction task and the reasoning task of the potential reasons for the user's scoring behavior by modeling the bipolar emotions of the comments written by the user. This neural network model constructs a semantic expression of embedded context information by embedding word vectors, convolution operations, etc., and then extracts multiple implicit expressions related to users and products and topics through a gate mechanism and self-attention mechanism with topic vectors, and extracts the most important correlation signal features through two emotion capsule networks, and then converts the positive and negative emotional features into predicted scores based on specific users for the products through a layer of high-speed network and a modified sigmoid function. In order to introduce emotional factors, a multi-task training process is adopted during model training to ensure that the model has the ability to perceive positive and negative emotions.

[0152] The neural network model of this embodiment makes good use of the rich information in the word vector space, and effectively completes the reasoning tasks of score prediction and potential causes of user scoring behavior through self-attention mechanism, capsule network, multi-task training and other technologies. The neural network model of this embodiment can be well applied to the score prediction task of the recommendation system, and has good explainability for the user's scoring behavior. At the same time, the neural network model of this embodiment can be well applied to various scenarios, and has broad practical significance and commercial value.

[0153] After the model is trained, the historical review data D′ corresponding to user u and product i is given u and D′ i After that, we can predict the score of user u and product i.

[0154] That is, the trained neural network model can output information on whether to recommend the target object to the user based on the input first historical comments of the user and the second historical comments of the target object. The details are described in the following part (II).

[0155] (ii) using the trained neural network model to obtain a recommendation on whether to recommend the target object to the user.

[0156] Specifically, it includes:

[0157] Step S216: Acquire the user's first historical comment data and the second historical comment data of the target object to be recommended.

[0158] Among them, at least part of the first historical comment data among the multiple first historical comment data contain both positive emotional data and negative emotional data; and / or, at least part of the second historical comment data among the multiple second historical comment data contain both positive emotional data and negative emotional data.

[0159] Step S218: Generate a corresponding first vector and a corresponding second vector according to the first historical comment data of the user and the second historical comment data of the target object to be recommended.

[0160] The first vector may be a first word vector, and the second vector may be a second word vector.

[0161] Step S220: Input the first vector and the second vector into a neural network model for sentiment rating prediction, and process the first vector and the second vector through the neural network model to output the user's sentiment information on the target object based on the positive sentiment features and negative sentiment features obtained after the processing.

[0162] Based on the neural network model of the aforementioned part (I), by inputting the first vector corresponding to the first historical comment data and the second vector corresponding to the second historical comment data, the user's emotional information about the target object can be obtained, for example, information about the user's interest in or degree of liking for the target object.

[0163] Step S222: Determine whether to recommend the target object to the user based on the emotion information.

[0164] For example, if the emotion information indicates that the user's interest in the target object exceeds a certain set threshold, the target object is recommended to the user; otherwise, it is not recommended.

[0165] According to the present embodiment, the user's emotional information about the target object is obtained through a neural network model for predicting emotional ratings, because the emotional information is obtained based on both the user's positive emotional features and the user's negative emotional features. Also, the data processed by the neural network model includes comment data of a certain user or a certain type of user on the target object that has been processed by the user (i.e., the first historical comment data), and comment data of a certain user or a certain type of target object that has been commented on by multiple processors (i.e., the second historical comment data). It can be seen that this embodiment can take into account both the two-sided information contained in the historical comment data and the two-sided information of the user's emotions about the target object. Therefore, the solution provided by this embodiment can effectively mine the content of user comments, especially the content of two-sided comments, to obtain more accurate and effective information.

[0166] The target object recommendation method of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: a server, a mobile terminal (such as a mobile phone, a PAD, etc.) and a PC, etc.

[0167] Embodiment 3

[0168] Reference Figure 3 , shows a step flow chart of a data processing method according to embodiment 3 of the present invention.

[0169] The data processing method of this embodiment includes the following steps:

[0170] Step S302: Receive a first word vector corresponding to the first sample data and a second word vector corresponding to the second sample data through the input part of the neural network model.

[0171] Among them, the first sample data is used to represent user comment sample data of multiple sample users, and the second sample data is used to represent target object comment sample data of multiple sample target objects; in the first sample data and the second sample data, at least part of the sample data contains both positive sentiment data and negative sentiment data.

[0172] Step S304: Obtain the opinion vector of the sample user and the attribute vector of the sample target object corresponding to the first word vector and the second word vector respectively through the feature extraction part of the neural network model.

[0173] Optionally, this step can be implemented as follows: through the convolution part of the neural network model, obtaining the first semantic vector and the second semantic vector corresponding to the first word vector and the second word vector respectively; using the gate mechanism and the self-attention mechanism, filtering the first semantic vector and the second semantic vector to obtain the opinion vector of the first semantic vector under multiple first topics, and the attribute vector of the second semantic vector under multiple second topics.

[0174] Optionally, the use of a gate mechanism and a self-attention mechanism to filter the first semantic vector and the second semantic vector to obtain an opinion vector of the first semantic vector under multiple first topics and an attribute vector of the second semantic vector under multiple second topics includes: filtering the first semantic vector according to the gate mechanism and multiple first topics corresponding to the first sample data to obtain a first semantic expression of the first semantic vector under different first topics; and filtering the second semantic vector according to the gate mechanism and multiple second topics corresponding to the second sample data to obtain a second semantic expression of the second semantic vector under different second topics; and using a self-attention mechanism to perform feature extraction on the first semantic expression and the second semantic expression, respectively, to obtain the opinion vector of the corresponding first semantic vector under multiple first topics and an attribute vector of the second semantic vector under multiple second topics.

[0175] Step S306: Pair the viewpoint vector and the attribute vector to generate corresponding multiple logical units.

[0176] Optionally, this step may be implemented as follows: pairing each of the viewpoint vectors with each of the attribute vectors in pairs, and generating corresponding multiple logic units according to the pairing results.

[0177] Further optionally, each of the viewpoint vectors is paired with each of the attribute vectors in pairs, and a corresponding plurality of logic units are generated according to the pairing results, including: each of the viewpoint vectors is paired with each of the attribute vectors in pairs by calculating the difference between the vectors and the dot product between the vectors, and a corresponding plurality of logic units are generated according to the pairing results.

[0178] Step S308: Input multiple logical units into the capsule network part of the neural network model to obtain corresponding emotion feature vectors.

[0179] Optionally, this step can be implemented as: inputting the multiple logic units into the first capsule network part for positive emotion prediction and the second capsule network part for negative emotion prediction respectively, and obtaining corresponding positive emotion feature vectors and negative emotion feature vectors.

[0180] Step S310: Through the output part of the neural network model, the emotional information of the sample user towards the sample target object is predicted and output according to the emotional feature vector.

[0181] Optionally, this step can be implemented as follows: inputting the positive emotion feature vector and the negative emotion feature vector into the high-speed network layer in the output part to obtain the corresponding positive degree vector for characterizing the positive emotion degree and the negative degree vector for characterizing the negative emotion degree; through the regression layer in the output part of the neural network model, outputting the emotion information of the sample user on the sample target object according to the positive emotion feature vector, the negative emotion feature vector, the positive degree vector and the negative degree vector.

[0182] Step S312: adjusting the training parameters of the neural network model according to the emotional information output by the output part, and continuing to train the neural network model using the adjusted training parameters until a training termination condition is reached.

[0183] The training parameters are conventional training parameters in the neural network model, including but not limited to weight parameters, bias parameters, etc. After adjusting the training parameters, the neural network model continues to be trained, such as returning to step S304 to continue execution, and the neural network model is iteratively trained until a training termination condition is reached, such as the number of training times reaches a predetermined number of times, or, for example, the target parameter of the training, such as the loss value corresponding to the loss function, reaches a predetermined threshold, etc.

[0184] By iteratively training the neural network model, a neural network model that meets the requirements for sentiment rating prediction is finally achieved.

[0185] It should be noted that the process of the data processing method of this embodiment is similar to the first part of the aforementioned embodiment 2, namely, the neural network model training part, and is therefore described relatively simply. The relevant parts may refer to the description of the relevant parts in embodiment 2 and will not be described in detail here.

[0186] Through this embodiment, the training of a neural network model for sentiment rating prediction is achieved. Through the trained neural network model, the user's sentiment information on the target object can be obtained, because the sentiment information is based on both the user's positive sentiment characteristics and the user's negative sentiment characteristics of the target object. In addition, the data processed by the neural network model includes the comment data of a certain user or a certain type of user on the target object that has been processed by it (i.e., the first historical comment data), and the comment data of a certain user or a certain type of target object that has been commented on by multiple processors (i.e., the second historical comment data). It can be seen that the neural network model can take into account both the two-sided information contained in the historical comment data and the two-sided information of the user's emotions on the target object. Therefore, the neural network model can effectively mine the content of user comments, especially the content with two-sided comments, to obtain more accurate and effective information.

[0187] The data processing method of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: a server, a mobile terminal (such as a mobile phone, a PAD, etc.) and a PC, etc.

[0188] Embodiment 4

[0189] Reference Figure 4 , shows a structural block diagram of a target object recommendation system according to Embodiment 4 of the present invention.

[0190] The target object recommendation system of this embodiment includes: an input module 402 , a feature extraction module 404 , a logic unit module 406 , a capsule network module 408 , and an output module 410 .

[0191] The input module 402 includes: a first input part for receiving a word vector corresponding to the user's comment data, and a second input part for receiving a word vector corresponding to the comment data of the target object.

[0192] For each user u, all the comments written by the user are concatenated together to form the user's comment data (i.e., the user's comment document) (w1, w2, ..., w l1 ). Give each word in the corpus an initial word embedding with a dimension of 300, and then convert each word in the user's comment data into the corresponding word vector e w (embedding). In this way, the user's comment data is a word vector matrix D'u ∈ Where l1 represents the length of the user's comment data, which can be set to l1=300, and d is the word vector dimension, which can be set to 300.

[0193] Similarly, for each target object, all the comments corresponding to the target object can be concatenated and processed similarly to be vectorized into a word vector matrix D' i , Similarly, l2=300 and d=300 can be set.

[0194] Then, D' u and D' i Input module 402, wherein the first input part receives D' u , the second input part receives D' i The feature extraction module 404 is used to extract features from the vector output by the first input part and the vector output by the second input part, and obtain a viewpoint vector corresponding to the vector output by the first input part and an attribute vector corresponding to the vector output by the second input part.

[0195] Optionally, the feature extraction module 404 includes a convolution part and a self-attention part; the convolution part includes: a first convolution part for convolving the vector output by the first input part and outputting the corresponding semantic vector, and a second convolution part for convolving the vector output by the second input part and outputting the corresponding semantic vector; the self-attention part includes: a first self-attention part for processing the semantic vector output by the first convolution part using a gate mechanism and a self-attention mechanism and outputting a user's opinion vector, and a second self-attention part for processing the semantic vector output by the second convolution part using a gate mechanism and a self-attention mechanism and outputting an attribute vector of the target object.

[0196] The convolution part can be implemented as a convolution layer. The convolution layer can have only one layer, and the corresponding word vector matrix D' is obtained according to the comment data of each user. u After that, the word vector matrix D' u A one-dimensional convolution operation is used, the convolution kernel length is c = 3, the step size is 1 each time, and the number of filters is n = 50. The convolution layer converts D' u Each word vector e in the matrix s Convert to word vector c embedded in context j ∈R n , which is the first semantic vector. The convolutional layer output matrix C l1 =[c1, c2, ..., c|l1|]. Similarly, we can get D' i Corresponding to the second semantic vector, the convolutional layer output matrix C l2=[c1, c2, …, c|l2|], which is the second semantic vector.

[0197] The self-attention part is mainly used to get the word vector C embedded in the context l1 and C l2 to perform the operation.

[0198] Specifically, each topic (including: multiple first topics obtained according to the user's comment data and multiple second topics obtained according to the target object's comment data) corresponds to a corresponding topic vector The value of n is consistent with the number of filters in the convolutional layer, n = 50, q u,x Represents the xth topic vector for user u. Then the gate mechanism is used to operate the filtered word vector C l1 and C l2 Information carried by each dimension:

[0199] s u,x,j =c j ⊙σ(W x,1 c j +W x,2 q u,x +b x )

[0200] Among them, W x,1 , W x,2 ∈R n×n and b x ∈R n are the weight matrix and bias vector respectively, and ⊙ represents dimension-by-dimensional multiplication.

[0201] After the gate mechanism, each word vector is equivalent to a filter, and the vector expression s is obtained. u,x,j Then, the vector s corresponding to each word u,x,j Through different mapping matrices W p ∈R k×n Mapped to each topic space:

[0202] p u,x,j =W p s u,x,j

[0203] Here, k can have multiple values, such as 25.

[0204] Then, a self-attetion operation is performed on the word vectors in each topic space.

[0205] The self-attention operation first performs a u,x,j Take the mean and get a preliminary opinion table v u,x. Then according to the vector v u,x and vector p u,x,j Calculate the weight (attentive weight) attn corresponding to each word u,x,j Then, according to the calculated weight, the vector p u,x,j After recalculating the weighted sum, we get the final view vector v u,x :

[0206]

[0207]

[0208] v u,x =∑ j attn u,x,j p u,x,j

[0209] v u,x represents the opinion vector of user u under the xth first topic. Similarly, the attribute vector a of target object i under the yth second topic can be obtained i,y .

[0210] After the self-attention mechanism, each user u can be associated with M v u,x Vector, each target object i is associated with M a i,y The final output of the self-attention part is: M user’s opinion vectors and M target object’s attribute vectors.

[0211] The logic unit module 406 is used to pair the viewpoint vector and the attribute vector to generate a corresponding logic unit.

[0212] For each user there will be M v u,x vector, there will be M a for each target object i,y vector. Given a pair of user-target objects, the target object recommendation system will make the obtained v u,x Vector and a i,y The vectors are paired in pairs to obtain M*M logical units g x,y :

[0213]

[0214] Among them, the symbol Represents a vector concatenation operation, that is, each v u,x Vector and a i,y The dimension-by-dimension difference and dimension-by-dimension product of the vectors are then concatenated to obtain the vector The constructed M*M (e.g., 5*5=25) logic units are used as input of the capsule network module 308 (Sentiment Capsule).

[0215] The capsule network module 408 includes: a first capsule network part for performing positive emotion prediction on the logical unit and outputting a positive emotion feature vector, and a second capsule network part for performing negative emotion prediction on the logical unit and outputting a negative emotion feature vector.

[0216] The first capsule network part of this embodiment represents positive emotions (positive caps), and the second capsule network part represents negative emotions (negative caps). The two have the same structure but different parameters. The input is the M*M logic units constructed in the previous step. The two capsules will learn their own output expressions based on all the logic units. pos,u,i (Positive sentiment feature vector) / o neg,u,i (Negative sentiment feature vector). A feature of the capsule network part is that the input is a bunch of vectors and the output is a vector. The details are as follows:

[0217] t s,x,y =W s,x,y g x,y

[0218] s s,u,i =∑ x,y C s,x,y t s,x,y

[0219]

[0220] In the above process, first, each capsule network part assigns a weight b with an initial value of 0 to each input logic unit. s,x,y Each logical unit in each capsule network part will correspond to a transfer matrix W s,x,y ∈R k×2k , we get the vector Then C s,x,y is the weight corresponding to each logical unit, and the specific value is determined by the corresponding b s,x,y Calculated. s,x,y The weighted sum of the vectors is s s,u,i The length of the output vector of the capsule network part represents the probability of the existence of the feature learned by this capsule network part, so the last step is to s s,u,i The vector is subjected to a nonlinear squash operation, and the vector length is compressed to between (0-1). This step is performed iteratively, and each iteration updates the b value corresponding to the vector t according to the relationship between the vectors o and t.

[0221] In this embodiment, the recommendation system routes the logic unit output by the logic unit module to the capsule network module through a dual dynamic routing protocol, and the routing weight in the dual dynamic routing protocol is determined according to the first weight and the second weight; wherein the first weight is used to indicate the weight between the logic unit and the first capsule network part and the second capsule network part, and the second weight is used to indicate the weight of the logic unit inside the first capsule network part and the weight of the logic unit inside the second capsule network part.

[0222] That is, in this embodiment, the traditional dynamic routing mechanism is changed to a bi-agreement mechanism in the capsule network. x, y, this weight (inter-caps), this embodiment x, y are also included in the calculation (intra-caps). The final outputs of the capsule network module 408 are positive emotion feature vectors O embedded with positive emotion information. pos,u,i and the negative sentiment feature vector O embedded with negative sentiment information neg,u,i .

[0223] The output module 410 is used to predict and output the user's emotional information about the target object based on the positive emotional feature vector output by the first capsule network part and the negative emotional feature vector output by the second capsule network part.

[0224] Optionally, the output module 410 includes a high-speed network layer and a regression layer. The high-speed network layer is used to obtain a corresponding positive degree vector for representing the positive emotion degree and a negative degree vector for representing the negative emotion degree according to the positive emotion feature vector and the negative emotion feature vector; the regression layer is used to output the user's emotion information on the target object according to the positive emotion feature vector, the negative emotion feature vector, the positive degree vector and the negative degree vector.

[0225] The final prediction of the score by the target object recommendation system is: probability of liking × degree of liking - probability of disliking × degree of disliking. Since the length of the vector o learned by the capsule network represents the probability of the feature existing, the probability of the corresponding emotion can be directly obtained by ||o||.

[0226] The degree of liking and the degree of disliking r are calculated based on the vectors opos,u,i and oneg,u,i. The calculation is performed with the help of a highway network layer and a regression layer.

[0227] The first step is to pass the vector o through a high-speed network layer to extract effective features:

[0228] η s =σ(H s,1 o s,u,i +b s,1 )

[0229] h s,u,i =η s ⊙o s,u,i +(1-η s )⊙tanh(H s,2 o s,u,i +b s,2 )

[0230] Among them, H s,1 , H s,2 ∈R k×k is the transformation matrix, b s,1 , b s,2 ∈R k is the bias vector.

[0231] Then, based on the transformed vector h, the final sentiment level is calculated through the regression layer operation:

[0232]

[0233] Among them, w s ∈R k is the weight vector of the regression function, b s,3 ∈R is the bias value.

[0234] Finally, based on the obtained sentiment level and probability, the final predicted score is calculated through a stretched sigmoid function as follows:

[0235]

[0236]

[0237] It can be seen that the score predicted by this stretched sigmoid function fc(x) is in the range [1, C], optionally, C=5.

[0238] Based on this, if a user is likely to like a target object, then the value of x is positive (like - dislike > 0), otherwise x is negative, but the final predicted score is 1-5, so a transformation is made here, and the value range is between 1-5. At the same time, it is also interpretable, and the reason for the score can be inferred by looking at the degree of likes and dislikes of users.

[0239] It should be noted that if you just want to predict the score in the end, you can also use traditional methods, such as concatenating two o vectors and then passing through a layer of full connection (MLP), to simply implement and reduce costs. However, through the prediction method of this embodiment, likes and dislikes can be quantified and have interpretability.

[0240] It should be noted that the target object recommendation system of this embodiment is described briefly. Its specific structure and description can be found in Figure 2B And the relevant parts in Example 2.

[0241] According to this embodiment, the user's emotional information about the target object is obtained through a neural network model for predicting emotional ratings, because the emotional information is obtained based on both the user's positive emotional features and the user's negative emotional features. Also, the data processed by the neural network model includes comment data of a certain user or a certain type of user on the target object that has been processed by it (i.e., the first historical comment data), and comment data of a certain user or a certain type of target object that has been commented on by multiple processors (i.e., the second historical comment data). It can be seen that the embodiments of the present invention can take both the two-sided information contained in the historical comment data and the two-sided information of the user's emotions about the target object into account. Therefore, the scheme provided by the embodiments of the present invention can effectively mine the content of user comments, especially the content of two-sided comments, to obtain more accurate and effective information.

[0242] Embodiment 5

[0243] Reference Figure 5 , shows a structural block diagram of a target object recommendation device according to Embodiment 5 of the present invention.

[0244] The target object recommendation device of this embodiment includes: a generation module 502, which is used to generate corresponding first vectors and second vectors according to the user's first historical comment data and the second historical comment data of the target object to be recommended, respectively; a processing module 504, which is used to input the first vector and the second vector into a neural network model for sentiment rating prediction, and process the first vector and the second vector through the neural network model to output the user's sentiment information about the target object based on the positive sentiment features and negative sentiment features obtained after the processing; a recommendation module 506, which is used to determine whether to recommend the target object to the user according to the sentiment information.

[0245] Optionally, at least some of the first historical comment data among the multiple first historical comment data contain both positive sentiment data and negative sentiment data; and / or, at least some of the second historical comment data among the multiple second historical comment data contain both positive sentiment data and negative sentiment data.

[0246] Optionally, the target object recommendation system of this embodiment also includes: a training module 508, which is used to train the neural network model using first sample data and second sample data; wherein the first sample data is used to represent user comment sample data of multiple sample users, and the second sample data is used to represent target object comment sample data of multiple sample target objects; in both the first sample data and the second sample data, at least part of the sample data contains both positive sentiment data and negative sentiment data.

[0247] Optionally, the training module 508 includes: an input submodule 5082, which is used to receive a first word vector corresponding to the first sample data and a second word vector corresponding to the second sample data through the input part of the neural network model; a feature extraction submodule 5084, which is used to obtain the opinion vector of the sample user and the attribute vector of the sample target object corresponding to the first word vector and the second word vector respectively through the feature extraction part of the neural network model; a logic unit submodule 5086, which is used to pair the opinion vector and the attribute vector to generate a corresponding plurality of logic units; a capsule network submodule 5088, which is used to input the plurality of logic units into the capsule network part to obtain a corresponding emotion feature vector; and an output submodule 5080, which predicts and outputs the emotion information of the sample user towards the sample target object according to the emotion feature vector through the output part of the neural network model.

[0248] Optionally, the feature extraction submodule 5084 is used to obtain, through the convolution part of the neural network model, a first semantic vector and a second semantic vector corresponding to the first word vector and the second word vector respectively; and use a gate mechanism and a self-attention mechanism to filter the first semantic vector and the second semantic vector to obtain an opinion vector of the first semantic vector under multiple first topics, and an attribute vector of the second semantic vector under multiple second topics.

[0249] Optionally, when the feature extraction submodule 5084 uses a gate mechanism and a self-attention mechanism to filter the first semantic vector and the second semantic vector to obtain an opinion vector of the first semantic vector under multiple first topics and an attribute vector of the second semantic vector under multiple second topics: filter the first semantic vector according to the gate mechanism and multiple first topics corresponding to the first sample data to obtain a first semantic expression of the first semantic vector under different first topics; and filter the second semantic vector according to the gate mechanism and multiple second topics corresponding to the second sample data to obtain a second semantic expression of the second semantic vector under different second topics; use the self-attention mechanism to perform feature extraction on the first semantic expression and the second semantic expression, respectively, to obtain the opinion vector of the corresponding first semantic vector under multiple first topics and the attribute vector of the second semantic vector under multiple second topics.

[0250] Optionally, the logic unit submodule 5086 is used to pair each of the viewpoint vectors with each of the attribute vectors in pairs, and generate a corresponding plurality of logic units according to the pairing results.

[0251] Optionally, the logic unit submodule 5086 is used to pair each of the viewpoint vectors with each of the attribute vectors by calculating the difference between the vectors and the dot product between the vectors, and generate corresponding multiple logic units according to the pairing results.

[0252] Optionally, the capsule network submodule 5088 is used to input the multiple logic units into the first capsule network part for positive emotion prediction and the second capsule network part for negative emotion prediction, respectively, to obtain corresponding positive emotion feature vectors and negative emotion feature vectors.

[0253] Optionally, the output submodule 5080 is used to input the positive emotion feature vector and the negative emotion feature vector into the high-speed network layer in the output part to obtain the corresponding positive degree vector for characterizing the positive emotion degree and the negative degree vector for characterizing the negative emotion degree; through the regression layer in the output part of the neural network model, the emotion information of the sample user on the sample target object is output according to the positive emotion feature vector, the negative emotion feature vector, the positive degree vector and the negative degree vector.

[0254] Optionally, the neural network model includes: an input part, a feature extraction part, a logic unit part, a capsule network part, and an output part.

[0255] in,

[0256] The input part includes: a first input part for receiving a word vector corresponding to the comment data of the user, and a second input part for receiving a word vector corresponding to the comment data of the target object;

[0257] The feature extraction part is used to extract features from the vector output by the first input part and the vector output by the second input part, so as to obtain a viewpoint vector corresponding to the vector output by the first input part and an attribute vector corresponding to the vector output by the second input part;

[0258] The logic unit part is used to pair the viewpoint vector and the attribute vector to generate a corresponding logic unit;

[0259] The capsule network part includes: a first capsule network part for performing positive emotion prediction on the logic unit and outputting a positive emotion feature vector, and a second capsule network part for performing negative emotion prediction on the logic unit and outputting a negative emotion feature vector;

[0260] The output part is used to predict and output the user's emotional information about the target object based on the positive emotional feature vector output by the first capsule network part and the negative emotional feature vector output by the second capsule network part.

[0261] Optionally, the feature extraction part includes a convolution part and a self-attention part; the convolution part includes: a first convolution part for convolving the vector output by the first input part and outputting a corresponding semantic vector, and a second convolution part for convolving the vector output by the second input part and outputting a corresponding semantic vector; the self-attention part includes: a first self-attention part for processing the semantic vector output by the first convolution part using a gate mechanism and a self-attention mechanism and outputting a user's opinion vector, and a second self-attention part for processing the semantic vector output by the second convolution part using a gate mechanism and a self-attention mechanism and outputting an attribute vector of the target object.

[0262] Optionally, the neural network model routes the logic unit output by the logic unit part to the capsule network part through a dual dynamic routing protocol, and the routing weight in the dual dynamic routing protocol is determined according to a first weight and a second weight; wherein the first weight is used to indicate the weight between the logic unit and the first capsule network part and the second capsule network part, and the second weight is used to indicate the logic unit weight inside the first capsule network part and the logic unit weight inside the second capsule network part.

[0263] Optionally, the output part includes a high-speed network layer and a regression layer; the high-speed network layer is used to obtain a corresponding positive degree vector for characterizing the degree of positive emotion and a negative degree vector for characterizing the degree of negative emotion based on the positive emotion feature vector and the negative emotion feature vector; the regression layer is used to output the user's emotional information on the target object based on the positive emotion feature vector, the negative emotion feature vector, the positive degree vector and the negative degree vector.

[0264] The target object recommendation device of this embodiment is used to implement the corresponding target object recommendation methods in the aforementioned multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here. In addition, the functional implementation of each module in the target object recommendation device of this embodiment can refer to the description of the corresponding parts in the aforementioned method embodiments, which will not be repeated here.

[0265] Embodiment 6

[0266] Reference Figure 6 , shows a structural block diagram of a data processing device according to embodiment 6 of the present invention.

[0267] The data processing device of this embodiment includes: a receiving module 602, which is used to receive a first word vector corresponding to first sample data and a second word vector corresponding to second sample data through the input part of the neural network model, wherein the first sample data is used to represent user comment sample data of multiple sample users, and the second sample data is used to represent target object comment sample data of multiple sample target objects; at least part of the first sample data and the second sample data simultaneously contain positive sentiment data and negative sentiment data; a first obtaining module 604, which is used to obtain the opinion vector of the sample user and the attribute vector of the sample target object corresponding to the first word vector and the second word vector respectively through the feature extraction part of the neural network model; a logical unit generating module 606, which is used to pair the opinion vector and the attribute vector to generate a corresponding plurality of logical units; a second obtaining module 608, which is used to input the plurality of logical units into the capsule network part of the neural network model to obtain the corresponding sentiment feature vector; a prediction output module 610, which is used to predict and output the sentiment information of the sample user to the sample target object according to the sentiment feature vector through the output part of the neural network model.

[0268] Optionally, the first acquisition module 604 is used to obtain the first semantic vector and the second semantic vector corresponding to the first word vector and the second word vector respectively through the convolution part of the neural network model; use the gate mechanism and the self-attention mechanism to filter the first semantic vector and the second semantic vector to obtain the opinion vector of the first semantic vector under multiple first topics, and the attribute vector of the second semantic vector under multiple second topics.

[0269] Optionally, when the first acquisition module 604 uses the gate mechanism and the self-attention mechanism to filter the first semantic vector and the second semantic vector to obtain the opinion vector of the first semantic vector under multiple first topics and the attribute vector of the second semantic vector under multiple second topics: filter the first semantic vector according to the gate mechanism and the multiple first topics corresponding to the first sample data to obtain the first semantic expression of the first semantic vector under different first topics; and filter the second semantic vector according to the gate mechanism and the multiple second topics corresponding to the second sample data to obtain the second semantic expression of the second semantic vector under different second topics; use the self-attention mechanism to perform feature extraction on the first semantic expression and the second semantic expression, respectively, to obtain the opinion vector of the corresponding first semantic vector under multiple first topics and the attribute vector of the second semantic vector under multiple second topics.

[0270] Optionally, the logic unit generating module 606 is used to pair each of the viewpoint vectors with each of the attribute vectors in pairs, and generate a corresponding plurality of logic units according to the pairing results.

[0271] Further optionally, the logic unit generation module 606 is used to pair each of the viewpoint vectors with each of the attribute vectors by calculating the difference between the vectors and the dot product between the vectors, and generate corresponding multiple logic units according to the pairing results.

[0272] Optionally, the second acquisition module 608 is used to input the multiple logic units into the first capsule network part for positive emotion prediction and the second capsule network part for negative emotion prediction, respectively, to obtain corresponding positive emotion feature vectors and negative emotion feature vectors.

[0273] Optionally, the prediction output module 610 is used to input the positive emotion feature vector and the negative emotion feature vector into the high-speed network layer in the output part to obtain the corresponding positive degree vector for characterizing the positive emotion degree and the negative degree vector for characterizing the negative emotion degree; through the regression layer in the output part of the neural network model, the emotion information of the sample user on the sample target object is output according to the positive emotion feature vector, the negative emotion feature vector, the positive degree vector and the negative degree vector.

[0274] Optionally, the data processing device of this embodiment also includes: a continued training module 612, which is used to adjust the training parameters of the neural network model according to the emotional information output by the output part, and continue to train the neural network model using the adjusted training parameters until the training termination condition is reached.

[0275] The data processing device of this embodiment is used to implement the corresponding data processing methods in the aforementioned multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be described in detail here. In addition, the functional implementation of each module in the data processing device of this embodiment can refer to the description of the corresponding parts in the aforementioned method embodiments, which will not be described in detail here.

[0276] Embodiment 7

[0277] Reference Figure 7 , shows a schematic diagram of the structure of an electronic device according to Embodiment 7 of the present invention. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.

[0278] like Figure 7 As shown, the electronic device may include: a processor (processor) 702 , a communication interface (Communications Interface) 704 , a memory (memory) 706 , and a communication bus 708 .

[0279] in:

[0280] The processor 702 , the communication interface 704 , and the memory 706 communicate with each other via a communication bus 708 .

[0281] The communication interface 704 is used to communicate with other electronic devices or servers.

[0282] The processor 702 is used to execute the program 710, and specifically can execute the relevant steps in the above-mentioned target object recommendation method embodiment, or can execute the relevant steps in the above-mentioned data processing method embodiment.

[0283] Specifically, the program 710 may include program codes, which include computer operation instructions.

[0284] The processor 702 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0285] The memory 706 is used to store the program 710. The memory 706 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0286] Program 710 can be specifically used to enable processor 702 to perform the following operations: generate corresponding first vectors and second vectors based on the user's first historical comment data and the second historical comment data of the target object to be recommended, respectively; input the first vector and the second vector into a neural network model for sentiment rating prediction, and process the first vector and the second vector through the neural network model to output the user's sentiment information about the target object based on the positive sentiment features and negative sentiment features obtained after the processing; and determine whether to recommend the target object to the user based on the sentiment information.

[0287] In an optional embodiment, at least part of the first historical comment data among the multiple first historical comment data contain both positive sentiment data and negative sentiment data; and / or, at least part of the second historical comment data among the multiple second historical comment data contain both positive sentiment data and negative sentiment data.

[0288] In an optional embodiment, the program 710 is also used to enable the processor 702 to train the neural network model using the first sample data and the second sample data before generating the corresponding first vector and the second vector respectively according to the user's first historical comment data and the second historical comment data of the target object to be recommended; wherein the first sample data is used to represent user comment sample data of multiple sample users, and the second sample data is used to represent target object comment sample data of multiple sample target objects; and in the first sample data and the second sample data, at least part of the sample data contains both positive sentiment data and negative sentiment data.

[0289] In an optional embodiment, the program 710 is also used to enable the processor 702 to: receive a first word vector corresponding to the first sample data and a second word vector corresponding to the second sample data through the input part of the neural network model when training the neural network model; obtain a sample user's opinion vector and a sample target object's attribute vector corresponding to the first word vector and the second word vector respectively through the feature extraction part of the neural network model; pair the opinion vector and the attribute vector to generate a corresponding plurality of logical units; input the plurality of logical units into the capsule network part to obtain a corresponding emotion feature vector; and predict and output the sample user's emotion information about the sample target object according to the emotion feature vector through the output part of the neural network model.

[0290] In an optional embodiment, the program 710 is also used to enable the processor 702 to obtain the opinion vector of the sample user and the attribute vector of the sample target object respectively corresponding to the first word vector and the second word vector through the feature extraction part of the neural network model: obtain the first semantic vector and the second semantic vector respectively corresponding to the first word vector and the second word vector through the convolution part of the neural network model; use the gate mechanism and the self-attention mechanism to filter the first semantic vector and the second semantic vector to obtain the opinion vector of the first semantic vector under multiple first topics, and the attribute vector of the second semantic vector under multiple second topics.

[0291] In an optional embodiment, the program 710 is also used to enable the processor 702 to filter the first semantic vector and the second semantic vector using a gate mechanism and a self-attention mechanism to obtain the opinion vector of the first semantic vector under multiple first topics and the attribute vector of the second semantic vector under multiple second topics: filter the first semantic vector according to the gate mechanism and the multiple first topics corresponding to the first sample data to obtain the first semantic expression of the first semantic vector under different first topics; and filter the second semantic vector according to the gate mechanism and the multiple second topics corresponding to the second sample data to obtain the second semantic expression of the second semantic vector under different second topics; use the self-attention mechanism to perform feature extraction on the first semantic expression and the second semantic expression, respectively, to obtain the opinion vector of the corresponding first semantic vector under multiple first topics and the attribute vector of the second semantic vector under multiple second topics.

[0292] In an optional embodiment, the program 710 is also used to enable the processor 702 to pair the viewpoint vector and the attribute vector to generate a corresponding plurality of logical units: for each viewpoint vector, pair each of the viewpoint vectors with each of the attribute vectors in pairs, and generate a corresponding plurality of logical units according to the pairing results.

[0293] In an optional embodiment, the program 710 is also used to enable the processor 702 to pair each of the viewpoint vectors with each of the attribute vectors in pairs, and generate corresponding multiple logical units according to the pairing results: for each of the viewpoint vectors, pair each of the attribute vectors in pairs by calculating the difference between the vectors and the dot product between the vectors, and generate corresponding multiple logical units according to the pairing results.

[0294] In an optional embodiment, the program 710 is also used to enable the processor 702 to input the multiple logical units into the capsule network part to obtain the corresponding emotion feature vector: input the multiple logical units into the first capsule network part for positive emotion prediction and the second capsule network part for negative emotion prediction respectively to obtain the corresponding positive emotion feature vector and negative emotion feature vector.

[0295] In an optional embodiment, the program 710 is also used to enable the processor 702 to predict and output the emotional information of the sample user on the sample target object based on the emotional feature vector through the output part of the neural network model: input the positive emotional feature vector and the negative emotional feature vector into the high-speed network layer in the output part to obtain the corresponding positive degree vector for characterizing the positive emotional degree and the negative degree vector for characterizing the negative emotional degree; and output the emotional information of the sample user on the sample target object based on the positive emotional feature vector, the negative emotional feature vector, the positive degree vector and the negative degree vector through the regression layer in the output part of the neural network model.

[0296] In an optional embodiment, the neural network model includes: an input part, a feature extraction part, a logic unit part, a capsule network part, and an output part; wherein the input part includes: a first input part for receiving a word vector corresponding to the user's comment data, and a second input part for receiving a word vector corresponding to the comment data of the target object; the feature extraction part is used to perform feature extraction on the vector output by the first input part and the vector output by the second input part to obtain a viewpoint vector corresponding to the vector output by the first input part, and an attribute vector corresponding to the vector output by the second input part; the logic unit part is used to pair the viewpoint vector and the attribute vector to generate a corresponding logic unit; the capsule network part includes: a first capsule network part for performing positive emotion prediction on the logic unit and outputting a positive emotion feature vector, and a second capsule network part for performing negative emotion prediction on the logic unit and outputting a negative emotion feature vector; the output part is used to predict and output the user's emotional information on the target object based on the positive emotion feature vector output by the first capsule network part and the negative emotion feature vector output by the second capsule network part.

[0297] In an optional embodiment, the feature extraction part includes a convolution part and a self-attention part; the convolution part includes: a first convolution part for convolving the vector output by the first input part and outputting the corresponding semantic vector, and a second convolution part for convolving the vector output by the second input part and outputting the corresponding semantic vector; the self-attention part includes: a first self-attention part for processing the semantic vector output by the first convolution part using a gate mechanism and a self-attention mechanism and outputting a user's opinion vector, and a second self-attention part for processing the semantic vector output by the second convolution part using a gate mechanism and a self-attention mechanism and outputting an attribute vector of the target object.

[0298] In an optional embodiment, the neural network model routes the logic unit output by the logic unit part to the capsule network part through a dual dynamic routing protocol, and the routing weight in the dual dynamic routing protocol is determined according to a first weight and a second weight; wherein the first weight is used to indicate the weight between the logic unit and the first capsule network part and the second capsule network part, and the second weight is used to indicate the logic unit weight inside the first capsule network part and the logic unit weight inside the second capsule network part.

[0299] In an optional embodiment, the output part includes a high-speed network layer and a regression layer; the high-speed network layer is used to obtain a corresponding positive degree vector for characterizing the positive emotion degree and a negative degree vector for characterizing the negative emotion degree according to the positive emotion feature vector and the negative emotion feature vector; the regression layer is used to output the user's emotional information on the target object according to the positive emotion feature vector, the negative emotion feature vector, the positive degree vector and the negative degree vector.

[0300] In another implementation scenario:

[0301] Program 710 can be specifically used to enable processor 702 to perform the following operations: receive a first word vector corresponding to first sample data and a second word vector corresponding to second sample data through the input part of the neural network model, wherein the first sample data is used to represent user comment sample data of multiple sample users, and the second sample data is used to represent target object comment sample data of multiple sample target objects; at least part of the first sample data and the second sample data simultaneously contain positive sentiment data and negative sentiment data; obtain the opinion vector of the sample user and the attribute vector of the sample target object corresponding to the first word vector and the second word vector respectively through the feature extraction part of the neural network model; pair the opinion vector and the attribute vector to generate corresponding multiple logical units; input the multiple logical units into the capsule network part of the neural network model to obtain corresponding emotion feature vectors; and predict and output the emotion information of the sample user to the sample target object according to the emotion feature vector through the output part of the neural network model.

[0302] In an optional embodiment, the program 710 is also used to enable the processor 702 to obtain the opinion vector of the sample user and the attribute vector of the sample target object respectively corresponding to the first word vector and the second word vector through the feature extraction part of the neural network model: obtain the first semantic vector and the second semantic vector respectively corresponding to the first word vector and the second word vector through the convolution part of the neural network model; use the gate mechanism and the self-attention mechanism to filter the first semantic vector and the second semantic vector to obtain the opinion vector of the first semantic vector under multiple first topics, and the attribute vector of the second semantic vector under multiple second topics.

[0303] In an optional embodiment, the program 710 is also used to enable the processor 702 to filter the first semantic vector and the second semantic vector using a gate mechanism and a self-attention mechanism to obtain the opinion vector of the first semantic vector under multiple first topics and the attribute vector of the second semantic vector under multiple second topics: filter the first semantic vector according to the gate mechanism and the multiple first topics corresponding to the first sample data to obtain the first semantic expression of the first semantic vector under different first topics; and filter the second semantic vector according to the gate mechanism and the multiple second topics corresponding to the second sample data to obtain the second semantic expression of the second semantic vector under different second topics; use the self-attention mechanism to perform feature extraction on the first semantic expression and the second semantic expression, respectively, to obtain the opinion vector of the corresponding first semantic vector under multiple first topics and the attribute vector of the second semantic vector under multiple second topics.

[0304] In an optional embodiment, the program 710 is also used to enable the processor 702 to pair the viewpoint vector and the attribute vector to generate a corresponding plurality of logical units: for each viewpoint vector, pair each of the viewpoint vectors with each of the attribute vectors in pairs, and generate a corresponding plurality of logical units according to the pairing results.

[0305] In an optional embodiment, the program 710 is also used to enable the processor 702 to pair each of the viewpoint vectors with each of the attribute vectors in pairs, and generate corresponding multiple logical units according to the pairing results: for each of the viewpoint vectors, pair each of the attribute vectors in pairs by calculating the difference between the vectors and the dot product between the vectors, and generate corresponding multiple logical units according to the pairing results.

[0306] In an optional embodiment, the program 710 is also used to enable the processor 702 to input the multiple logical units into the capsule network part to obtain the emotion feature vector corresponding to each of the logical units: input the multiple logical units into the first capsule network part for positive emotion prediction and the second capsule network part for negative emotion prediction respectively to obtain the corresponding positive emotion feature vector and negative emotion feature vector.

[0307] In an optional embodiment, the program 710 is also used to enable the processor 702 to predict and output the emotional information of the sample user on the sample target object based on the emotional feature vector through the output part of the neural network model: input the positive emotional feature vector and the negative emotional feature vector into the high-speed network layer in the output part to obtain the corresponding positive degree vector for characterizing the positive emotional degree and the negative degree vector for characterizing the negative emotional degree; and output the emotional information of the sample user on the sample target object based on the positive emotional feature vector, the negative emotional feature vector, the positive degree vector and the negative degree vector through the regression layer in the output part of the neural network model.

[0308] In an optional embodiment, the program 710 is also used to enable the processor 702 to adjust the training parameters of the neural network model according to the emotional information output by the output part, and continue to train the neural network model using the adjusted training parameters until the training termination condition is reached.

[0309] The specific implementation of each step in program 710 can refer to the corresponding description of the corresponding steps and units in the above-mentioned target object recommendation method embodiment, or the corresponding description of the corresponding steps and units in the above-mentioned data processing method embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above-mentioned method embodiment, which will not be repeated here.

[0310] Through the electronic device of this embodiment, through the neural network model for sentiment rating prediction, the user's sentiment information on the target object is obtained, because the sentiment information is obtained based on both the user's positive sentiment characteristics and the user's negative sentiment characteristics. In addition, the data processed by the neural network model includes the comment data of a certain user or a certain type of user on the target object that has been processed by it (i.e., the first historical comment data), and the comment data of a certain user or a certain type of target object that has been commented on by multiple processors (i.e., the second historical comment data). It can be seen that this embodiment can take into account both the two-sided information contained in the historical comment data and the two-sided information of the user's emotions on the target object. Therefore, the solution provided by this embodiment can effectively mine the content of user comments, especially the content of two-sided comments, to obtain more accurate and effective information.

[0311] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present invention can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present invention.

[0312] The above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as software or computer code that can be stored in a recording medium (such as CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or can be implemented as computer code that is originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and will be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a special-purpose processor or programmable or special-purpose hardware (such as ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the target object recommendation method or data processing method described herein is implemented. In addition, when a general-purpose computer accesses a code for implementing the target object recommendation method or data processing method shown here, the execution of the code converts the general-purpose computer into a special-purpose computer for executing the target object recommendation method or data processing method shown here.

[0313] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present invention.

[0314] The above implementation methods are only used to illustrate the embodiments of the present invention, and are not limitations of the embodiments of the present invention. Ordinary technicians in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present invention. The patent protection scope of the embodiments of the present invention should be defined by the claims.

Claims

1. A target object recommendation system, comprising: Input module, feature extraction module, logic unit module, capsule network module, and output module; The input module includes: a first input part for receiving a word vector corresponding to the comment data of the user, and a second input part for receiving a word vector corresponding to the comment data of the target object; The feature extraction module is used to extract features from the vector output by the first input part and the vector output by the second input part, so as to obtain a viewpoint vector corresponding to the vector output by the first input part and an attribute vector corresponding to the vector output by the second input part; The logic unit module is used to pair the viewpoint vector and the attribute vector to generate a corresponding logic unit; The capsule network module includes: a first capsule network part for performing positive emotion prediction on the logic unit and outputting a positive emotion feature vector, and a second capsule network part for performing negative emotion prediction on the logic unit and outputting a negative emotion feature vector; The output module is used to predict and output the user's emotional information about the target object based on the positive emotional feature vector output by the first capsule network part and the negative emotional feature vector output by the second capsule network part.

2. The system according to claim 1, wherein: The feature extraction module includes a convolution part and a self-attention part; The convolution part includes: a first convolution part for convolving the vector output by the first input part and outputting the corresponding semantic vector, and a second convolution part for convolving the vector output by the second input part and outputting the corresponding semantic vector; The self-attention part includes: a first self-attention part for processing the semantic vector output by the first convolution part using a gate mechanism and a self-attention mechanism and outputting a user's opinion vector, and a second self-attention part for processing the semantic vector output by the second convolution part using a gate mechanism and a self-attention mechanism and outputting an attribute vector of a target object.

3. The system according to claim 1, wherein: The recommendation system routes the logic unit output by the logic unit module to the capsule network module through a dual dynamic routing protocol, and the routing weight in the dual dynamic routing protocol is determined according to a first weight and a second weight; wherein the first weight is used to indicate the weight between the logic unit and the first capsule network part and the second capsule network part, and the second weight is used to indicate the weight of the logic unit inside the first capsule network part and the weight of the logic unit inside the second capsule network part.

4. The system according to claim 1, wherein: The output module includes a high-speed network layer and a regression layer; The high-speed network layer is used to obtain a corresponding positive degree vector for representing the degree of positive emotion and a negative degree vector for representing the degree of negative emotion according to the positive emotion feature vector and the negative emotion feature vector; The regression layer is used to output the user's emotional information about the target object based on the positive emotional feature vector, the negative emotional feature vector, the positive degree vector and the negative degree vector.

5. A target object recommendation method, comprising: Generate a corresponding first vector and a second vector according to the first historical comment data of the user and the second historical comment data of the target object to be recommended respectively; Inputting the first vector and the second vector into a neural network model for predicting sentiment rating, processing the first vector and the second vector through the neural network model, so as to output the user's sentiment information on the target object based on the positive sentiment features and negative sentiment features obtained after the processing; wherein the neural network model adopts the structure of the target object recommendation system as described in any one of claims 1 to 4; Determine whether to recommend the target object to the user according to the emotion information.

6. The method according to claim 5, wherein: At least part of the first historical comment data among the plurality of first historical comment data contains both positive sentiment data and negative sentiment data; and / or, At least some of the second historical comment data among the plurality of second historical comment data contain both positive sentiment data and negative sentiment data.

7. The method according to claim 5 or 6, wherein: Before generating the corresponding first vector and second vector according to the first historical comment data of the user and the second historical comment data of the target object to be recommended, the method further includes: Using the first sample data and the second sample data, training the neural network model; Among them, the first sample data is used to represent user comment sample data of multiple sample users, and the second sample data is used to represent target object comment sample data of multiple sample target objects; in the first sample data and the second sample data, at least part of the sample data contains both positive sentiment data and negative sentiment data.

8. The method according to claim 7, wherein: The using the first sample data and the second sample data to train the neural network model includes: Receiving, through an input part of the neural network model, a first word vector corresponding to the first sample data and a second word vector corresponding to the second sample data; Obtaining, through the feature extraction part of the neural network model, a sample user's opinion vector and a sample target object's attribute vector corresponding to the first word vector and the second word vector respectively; Pairing the viewpoint vector and the attribute vector to generate a corresponding plurality of logical units; Inputting the plurality of logic units into the capsule network part to obtain corresponding emotion feature vectors; The output part of the neural network model predicts and outputs the emotional information of the sample user towards the sample target object according to the emotional feature vector.

9. The method according to claim 8, wherein: The obtaining, through the feature extraction part of the neural network model, a sample user's opinion vector and a sample target object's attribute vector corresponding to the first word vector and the second word vector, respectively, comprises: Obtaining, through the convolution part of the neural network model, a first semantic vector and a second semantic vector corresponding to the first word vector and the second word vector respectively; The first semantic vector and the second semantic vector are filtered by using a gate mechanism and a self-attention mechanism to obtain an opinion vector of the first semantic vector under multiple first topics and an attribute vector of the second semantic vector under multiple second topics.

10. The method according to claim 9, wherein: The use of a gate mechanism and a self-attention mechanism to filter the first semantic vector and the second semantic vector to obtain an opinion vector of the first semantic vector under a plurality of first topics and an attribute vector of the second semantic vector under a plurality of second topics includes: filtering the first semantic vector according to a gate mechanism and a plurality of first topics corresponding to the first sample data to obtain first semantic expressions of the first semantic vector under different first topics; and filtering the second semantic vector according to the gate mechanism and a plurality of second topics corresponding to the second sample data to obtain second semantic expressions of the second semantic vector under different second topics; A self-attention mechanism is used to perform feature extraction on the first semantic expression and the second semantic expression respectively, to obtain the opinion vector of the corresponding first semantic vector under multiple first topics, and the attribute vector of the second semantic vector under multiple second topics.

11. The method according to claim 8, wherein: The pairing of the viewpoint vector and the attribute vector to generate a corresponding plurality of logic units includes: Each of the viewpoint vectors is paired with each of the attribute vectors in pairs, and a plurality of corresponding logic units are generated according to the pairing results.

12. The method according to claim 11, wherein: The step of pairing each of the viewpoint vectors with each of the attribute vectors, and generating corresponding multiple logic units according to the pairing results, includes: Each of the viewpoint vectors is paired with each of the attribute vectors by calculating the difference between the vectors and the dot product between the vectors, and a plurality of corresponding logic units are generated according to the pairing results.

13. The method according to claim 8, wherein: The step of inputting the plurality of logic units into the capsule network part to obtain the emotion feature vector corresponding to each of the logic units comprises: The multiple logic units are respectively input into the first capsule network part for positive emotion prediction and the second capsule network part for negative emotion prediction to obtain corresponding positive emotion feature vectors and negative emotion feature vectors.

14. The method according to claim 13, wherein: The output part of the neural network model predicts and outputs the sample user's emotional information about the sample target object according to the emotional feature vector, including: Inputting the positive emotion feature vector and the negative emotion feature vector into the high-speed network layer in the output part to obtain a corresponding positive degree vector for representing the positive emotion degree and a negative degree vector for representing the negative emotion degree; Through the regression layer in the output part of the neural network model, the emotional information of the sample user on the sample target object is output according to the positive emotional feature vector, the negative emotional feature vector, the positive degree vector and the negative degree vector.

15. A data processing method, comprising: Receiving, through an input part of a neural network model, a first word vector corresponding to first sample data and a second word vector corresponding to second sample data, wherein the first sample data is used to represent user comment sample data of a plurality of sample users, and the second sample data is used to represent target object comment sample data of a plurality of sample target objects; at least part of the sample data in both the first sample data and the second sample data contains both positive sentiment data and negative sentiment data; Obtaining, through the feature extraction part of the neural network model, a sample user's opinion vector and a sample target object's attribute vector corresponding to the first word vector and the second word vector respectively; Pairing the viewpoint vector and the attribute vector to generate a corresponding plurality of logical units; Inputting the multiple logic units into the capsule network part of the neural network model to obtain corresponding emotion feature vectors, including: inputting the multiple logic units into a first capsule network part for positive emotion prediction and a second capsule network part for negative emotion prediction, respectively, to obtain corresponding positive emotion feature vectors and negative emotion feature vectors; Through the output part of the neural network model, the emotional information of the sample user towards the sample target object is predicted and output according to the positive emotional feature vector and the negative emotional feature vector.

16. The method according to claim 15, wherein: The obtaining, through the feature extraction part of the neural network model, a sample user's opinion vector and a sample target object's attribute vector corresponding to the first word vector and the second word vector, respectively, comprises: Obtaining, through the convolution part of the neural network model, a first semantic vector and a second semantic vector corresponding to the first word vector and the second word vector respectively; The first semantic vector and the second semantic vector are filtered by using a gate mechanism and a self-attention mechanism to obtain an opinion vector of the first semantic vector under multiple first topics and an attribute vector of the second semantic vector under multiple second topics.

17. The method according to claim 16, wherein: The use of a gate mechanism and a self-attention mechanism to filter the first semantic vector and the second semantic vector to obtain an opinion vector of the first semantic vector under a plurality of first topics and an attribute vector of the second semantic vector under a plurality of second topics includes: filtering the first semantic vector according to a gate mechanism and a plurality of first topics corresponding to the first sample data to obtain first semantic expressions of the first semantic vector under different first topics; and filtering the second semantic vector according to the gate mechanism and a plurality of second topics corresponding to the second sample data to obtain second semantic expressions of the second semantic vector under different second topics; A self-attention mechanism is used to perform feature extraction on the first semantic expression and the second semantic expression respectively, to obtain the opinion vector of the corresponding first semantic vector under multiple first topics, and the attribute vector of the second semantic vector under multiple second topics.

18. The method according to claim 15, wherein: The pairing of the viewpoint vector and the attribute vector to generate a corresponding plurality of logic units includes: Each of the viewpoint vectors is paired with each of the attribute vectors in pairs, and a plurality of corresponding logic units are generated according to the pairing results.

19. The method according to claim 18, wherein: The step of pairing each of the viewpoint vectors with each of the attribute vectors, and generating corresponding multiple logic units according to the pairing results, includes: Each of the viewpoint vectors is paired with each of the attribute vectors by calculating the difference between the vectors and the dot product between the vectors, and a plurality of corresponding logic units are generated according to the pairing results.

20. The method according to claim 15, wherein: The output part of the neural network model predicts and outputs the sample user's emotional information about the sample target object according to the emotional feature vector, including: Inputting the positive emotion feature vector and the negative emotion feature vector into the high-speed network layer in the output part to obtain a corresponding positive degree vector for representing the positive emotion degree and a negative degree vector for representing the negative emotion degree; Through the regression layer in the output part of the neural network model, the emotional information of the sample user on the sample target object is output according to the positive emotional feature vector, the negative emotional feature vector, the positive degree vector and the negative degree vector.

21. The method according to any one of claims 15 to 20, wherein: The method further comprises: The training parameters of the neural network model are adjusted according to the emotional information output by the output part, and the neural network model is continuously trained using the adjusted training parameters until a training termination condition is reached.

22. A target object recommendation device, comprising: A generating module, used to generate corresponding first vectors and second vectors according to the first historical comment data of the user and the second historical comment data of the target object to be recommended respectively; A processing module, used for inputting the first vector and the second vector into a neural network model for sentiment rating prediction, processing the first vector and the second vector by the neural network model, so as to output the sentiment information of the user towards the target object based on the positive sentiment features and negative sentiment features obtained after the processing; A recommendation module is used to determine whether to recommend the target object to the user based on the emotion information.

23. A data processing device, comprising: A receiving module, configured to receive, through an input part of a neural network model, a first word vector corresponding to first sample data and a second word vector corresponding to second sample data, wherein the first sample data is used to represent user comment sample data of a plurality of sample users, and the second sample data is used to represent target object comment sample data of a plurality of sample target objects; and at least part of the sample data in both the first sample data and the second sample data contains both positive sentiment data and negative sentiment data; A first obtaining module, configured to obtain, through a feature extraction part of the neural network model, a sample user's opinion vector and a sample target object's attribute vector corresponding to the first word vector and the second word vector, respectively; A logic unit generation module, used to pair the viewpoint vector and the attribute vector to generate a corresponding plurality of logic units; A second acquisition module is used to input the multiple logical units into the capsule network part of the neural network model to obtain a corresponding emotion feature vector; The second acquisition module is specifically used to input the multiple logical units into the first capsule network part for positive emotion prediction and the second capsule network part for negative emotion prediction, respectively, to obtain the corresponding positive emotion feature vector and negative emotion feature vector; The prediction output module is used to predict and output the sample user's emotional information about the sample target object based on the positive emotional feature vector and the negative emotional feature vector through the output part of the neural network model.

24. An electronic device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the target object recommendation method described in any one of claims 5-14, or to perform operations corresponding to the data processing method described in any one of claims 15-21.

25. A computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the target object recommendation method as described in any one of claims 5 to 14, or, when executed by a processor, implements the data processing method as described in any one of claims 15 to 21.

Citation Information

Patent Citations

  • Tourism service recommending method based on deep learning

    CN108537624A