Resource recommendation method and device, electronic equipment and storage medium

文档序号:7861 发布日期:2021-09-17 浏览:33次 中文

1. A method for resource recommendation, the method comprising:

updating the first user characteristics of the corresponding user based on the second user characteristics of each user in the at least one user; the first user characteristic represents the user characteristic determined at the first moment; the second user characteristic represents the user characteristic determined at a second moment after the first moment;

clustering the at least one user based on the updated first user characteristics corresponding to each user in the at least one user to obtain a category corresponding to each user;

and recommending corresponding resources for each user based on the corresponding category of each user.

2. The resource recommendation method of claim 1, further comprising:

determining text information sent by a user on a set application based on behavior data of the user in the set application;

and extracting corresponding user characteristics based on text information sent by the user on the set application.

3. The resource recommendation method according to claim 2, wherein the determining text information sent by the user on the setting application based on the behavior data of the user in the setting application further comprises:

and determining the user sending the corresponding text information based on the user identification in the behavior data of the set application.

4. The resource recommendation method according to claim 1, wherein when the first user characteristic of the corresponding user is updated based on the second user characteristic of each user of the at least one user, the method comprises:

for each user, judging whether each second label in the at least one second label is the same as each first label in the at least one first label or not to obtain a judgment result;

updating the weight corresponding to the first label based on the weight corresponding to the second label when the judgment result represents that the second label is the same as the first label and the number of the second label is greater than or equal to 1, wherein the second label and the first label are the same label; wherein the content of the first and second substances,

the second user characteristic comprises the at least one second label and a weight corresponding to each second label; the first user characteristic includes a weight corresponding to each of the at least one first tag.

5. The resource recommendation method according to claim 4, wherein the updating the weight corresponding to the first tag based on the weight corresponding to the second tag comprises:

performing derivation on the weight corresponding to the second label to obtain a derivation result;

and updating the weight corresponding to the same first label based on the derivation result.

6. The resource recommendation method according to claim 4, wherein when the first user characteristic of the corresponding user is updated based on the second user characteristic of each of the at least one user, the method further comprises:

and adding the corresponding second label and the corresponding weight into the first user characteristic under the condition that the judgment result represents that the second label is different from the first label and the number of the second label different from the first label is greater than or equal to 1.

7. The resource recommendation method according to claim 1, wherein the clustering the at least one user based on the updated first user characteristic corresponding to each of the at least one user to obtain a category corresponding to each user comprises:

clustering the first user characteristics corresponding to each user in the at least one updated user according to a density-based noisy clustering DBSCAN algorithm to obtain at least one type of clustering results;

and adjusting each cluster result in the at least one cluster result according to a K nearest neighbor KNN algorithm to obtain a class corresponding to each user.

8. An apparatus for resource recommendation, the apparatus comprising:

the updating unit is used for updating the first user characteristics of the corresponding user based on the second user characteristics of each user in the at least one user; the first user characteristic represents the user characteristic determined at the first moment; the second user characteristic represents the user characteristic determined at a second moment after the first moment;

the clustering unit is used for clustering the at least one user based on the updated first user characteristics corresponding to each user in the at least one user to obtain a category corresponding to each user;

and the recommending unit is used for recommending corresponding resources for each user based on the category corresponding to each user.

9. An electronic device, comprising: a processor and a memory for storing a computer program capable of running on the processor, wherein,

the processor is adapted to perform the steps of the method of any one of claims 1 to 7 when running the computer program.

10. A storage medium on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.

Background

The user representation is a tag of user information, and refining and summarizing of user characteristics can be realized. In the related art, corresponding resources are generally recommended for a user based on a certain user figure, however, the recommendation method has the problem of low recommendation precision.

Disclosure of Invention

In view of the above, embodiments of the present disclosure provide a resource recommendation method, a resource recommendation device, an electronic device, and a storage medium, so as to solve the problem of low resource recommendation accuracy in the related art.

In order to achieve the above purpose, the technical solution of the embodiment of the present application is implemented as follows:

the embodiment of the application provides a resource recommendation method, which comprises the following steps:

updating the first user characteristics of the corresponding user based on the second user characteristics of each user in the at least one user; the first user characteristic represents the user characteristic determined at the first moment; the second user characteristic represents the user characteristic determined at a second moment after the first moment;

clustering the at least one user based on the updated first user characteristics corresponding to each user in the at least one user to obtain a category corresponding to each user;

and recommending corresponding resources for each user based on the corresponding category of each user.

In the above scheme, the method further comprises:

determining text information sent by a user on a set application based on behavior data of the user in the set application;

and extracting corresponding user characteristics based on text information sent by the user on the set application.

In the foregoing solution, the determining text information sent by a user on a setting application based on behavior data of the user in the setting application further includes:

and determining the user sending the corresponding text information based on the user identification in the behavior data of the set application.

In the foregoing solution, when the first user characteristic of the corresponding user is updated based on the second user characteristic of each user in the at least one user, the method includes:

for each user, judging whether each second label in the at least one second label is the same as each first label in the at least one first label or not to obtain a judgment result;

updating the weight corresponding to the first label based on the weight corresponding to the second label when the judgment result represents that the second label is the same as the first label and the number of the second label is greater than or equal to 1, wherein the second label and the first label are the same label; wherein the second user characteristic comprises the at least one second label and a weight corresponding to each second label; the first user characteristic includes a weight corresponding to each of the at least one first tag.

In the foregoing solution, the updating the weight corresponding to the first tag based on the weight corresponding to the second tag includes:

performing derivation on the weight corresponding to the second label to obtain a derivation result;

and updating the weight corresponding to the same first label based on the derivation result.

In the foregoing solution, when the first user characteristic of the corresponding user is updated based on the second user characteristic of each user in the at least one user, the method further includes:

and adding the corresponding second label and the corresponding weight into the first user characteristic under the condition that the judgment result represents that the second label is different from the first label and the number of the second label different from the first label is greater than or equal to 1.

In the foregoing solution, the clustering, based on the updated first user characteristic corresponding to each user of the at least one user, the at least one user to obtain a category corresponding to each user includes:

clustering the updated first user characteristics corresponding to each user in the at least one user according to a Density-Based noisy Clustering (DBSCAN) algorithm to obtain at least one type of Clustering result;

and adjusting each class of clustering results in the at least one class of clustering results according to a K Nearest Neighbor (KNN, K Nearest Neighbor) algorithm to obtain a class corresponding to each user.

An embodiment of the present application further provides a resource recommendation device, where the device includes:

the updating unit is used for updating the first user characteristics of the corresponding user based on the second user characteristics of each user in the at least one user; the first user characteristic represents the user characteristic determined at the first moment; the second user characteristic represents the user characteristic determined at a second moment after the first moment;

the clustering unit is used for clustering the at least one user based on the updated first user characteristics corresponding to each user in the at least one user to obtain a category corresponding to each user;

and the recommending unit is used for recommending corresponding resources for each user based on the category corresponding to each user.

An embodiment of the present application further provides an electronic device, including: a processor and a memory for storing a computer program operable on the processor, wherein the processor is operable to perform the steps of any of the methods described above when executing the computer program.

Embodiments of the present application further provide a storage medium on which a computer program is stored, where the computer program is executed by a processor to implement the steps of any one of the above methods.

In an embodiment of the application, the first user characteristics of the corresponding user are updated based on the second user characteristics of each user of the at least one user. The first user characteristic represents the user characteristic determined at the first moment, and the second user characteristic represents the user characteristic determined at the second moment after the first moment. And clustering at least one user based on the updated first user characteristics corresponding to each user in the at least one user to obtain a category corresponding to each user. And recommending corresponding resources for each user based on the corresponding category of each user. Therefore, the users are classified based on the dynamically updated user characteristics, resources are recommended for the users based on the categories corresponding to the users, and dynamic changes of the user characteristics are considered when the resources are recommended for the users, so that the resources recommended to the users can accurately fit with the current characteristics of the users, and the resource recommendation precision is improved.

Drawings

Fig. 1 is a schematic flow chart illustrating an implementation of a resource recommendation method according to an embodiment of the present application;

fig. 2 is a schematic diagram of a resource recommendation device according to an embodiment of the present application;

fig. 3 is a schematic diagram of a hardware component structure of an electronic device according to an embodiment of the present application.

Detailed Description

The user portrait refers to information related to the user, such as professional background, cultural degree, knowledge acquisition mode, interest preference and the like of the user. The user representation is a tag of user information, and refining and summarizing of user characteristics can be realized. User portrayal is generally applied to intelligent recommendation systems for realizing accurate recommendation services. The method can be used for carrying out model identification based on the user portrait to obtain the specific attribute labels corresponding to the users, classifying the users with the same attribute labels by analyzing the attribute labels corresponding to the users to form different user categories, facilitating mastering of characteristics, preferences and requirements of the users of different user categories, and facilitating personalized recommendation for the users according to the categories corresponding to the users. Different user categories can be sorted according to importance, important, core and large-scale user categories are highlighted, and analysis and management of users are facilitated. By carrying out multi-dimensional analysis on the user portrait, the attribute label corresponding to the user can be constructed in a multi-dimensional manner.

In the related technology, a feature collector is constructed to process user portrait data, application list data and data reported by a client to obtain normalized feature vectors meeting data modeling requirements, the feature vectors are input into a plurality of basic recommendation models to predict, a preliminary user application recommendation list and corresponding download probabilities are generated, and a final application recommendation list is generated by combining the download probabilities and a fusion model trained by actual labels. A user portrait data warehouse can be constructed by performing multi-dimensional feature extraction on a user history log. The basic recommendation model may be a time-series based long-short term memory network model. The fusion model can integrate the learning results of the models.

However, this method recommends a corresponding resource for a user based on a certain user image, and has a problem of low recommendation accuracy.

Based on this, the embodiment of the application provides a resource recommendation method, a resource recommendation device, an electronic device and a storage medium, and the first user characteristics of the corresponding user are updated based on the second user characteristics of each user in at least one user. The first user characteristic represents the user characteristic determined at the first moment, and the second user characteristic represents the user characteristic determined at the second moment after the first moment. And clustering at least one user based on the updated first user characteristics corresponding to each user in the at least one user to obtain a category corresponding to each user. And recommending corresponding resources for each user based on the corresponding category of each user. Therefore, the users are classified based on the dynamically updated user characteristics, resources are recommended for the users based on the categories corresponding to the users, and dynamic changes of the user characteristics are considered when the resources are recommended for the users, so that the resources recommended to the users can accurately fit with the current characteristics of the users, and the resource recommendation precision is improved.

The present application will be described in further detail with reference to the following drawings and examples.

Fig. 1 is a schematic view of an implementation flow of a resource recommendation method provided in an embodiment of the present application. As shown in fig. 1, the method includes:

step 101: updating the first user characteristics of the corresponding user based on the second user characteristics of each user in the at least one user; the first user characteristic represents the user characteristic determined at the first moment; the second user characteristic characterizes a user characteristic determined at a second time after the first time.

Here, the user characteristic corresponding to the user dynamically changes with the passage of time, and therefore, after the second user characteristic of the user is acquired at the second time, the first user characteristic of the corresponding user is updated based on the second user characteristic. The first user characteristic represents a user characteristic obtained at a first moment. The second time is after the first time. In the embodiment of the application, the user characteristics represent interest attribute characteristics of the user. The user features pertain to a user representation.

In some embodiments, the first user characteristic of the corresponding user may be updated based on the second user characteristic of the user every set length of time. That is, the second time is after the first time and is separated from the first time by a set time period. The set time period may be 1 day, 3 days, 5 days, and the specific value may be set according to an actual situation, which is not limited in the embodiment of the present application.

Step 102: clustering the at least one user based on the updated first user characteristics corresponding to each user in the at least one user to obtain a category corresponding to each user.

After the first user characteristics corresponding to the users are updated, clustering is performed on at least one user based on the updated first user characteristics, and a category corresponding to each user is obtained. Therefore, the category corresponding to the user can be obtained based on the latest first user characteristic corresponding to the user, and the obtained category corresponding to the user is more accurate.

Step 103: and recommending corresponding resources for each user based on the corresponding category of each user.

Here, after the category corresponding to each user is obtained, the resource matching the category corresponding to the user is recommended for each user based on the category corresponding to each user.

In an embodiment, the method further comprises:

determining text information sent by a user on a set application based on behavior data of the user in the set application;

and extracting corresponding user characteristics based on text information sent by the user on the set application.

Here, when the user uses the setting application, the user performs various kinds of action operations such as approval, comment, share, attention, order placement, report, and the like. When the user performs behavior operation in the setting application, the setting application records the behavior operation of the user and stores the behavior operation as corresponding behavior data. One piece of behavior data corresponds to one piece of behavior operation record. Therefore, the text information sent out by the user on the setting application can be determined based on the behavior data of the user in the setting application. The text information sent by the user on the set application represents the text comment information sent by the user when the user comments on the set application.

In an internet platform, comments of a user on a set application generally include two aspects of text comment information and grading. The score reflection is an evaluation of the overall satisfaction of the user on the setting application, and cannot reflect the evaluation and preference of the user on a certain function in the setting application. The text comment information is real feedback of the user after using the set application and experiencing related services, and can reflect evaluation and preference of the user on functions and detail parts in the set application. Therefore, the text comment information can reflect the preference of the user more than the score.

In practical application, text information sent by a user on a set application can be crawled through a crawler technology.

After obtaining the text information sent by the user on the setting application, storing the text information into the document, where the number of the text information stored in each document may be fixed, for example, 50 pieces of text information are stored in one document.

In the embodiment of the application, the user features are constructed based on a vector space model. Vector space models are commonly applied in the fields of text mining and information retrieval. The vector space model converts a given document into a high-dimensional vector, and takes the feature item as the basic unit of document representation, namely, one feature item represents one word in the document. Each dimension of the vector space corresponds to a word in the document. Each dimension itself represents the weight of the corresponding word in the document. The weight reflects how important a word is in the document it belongs to, i.e., how well the word can reflect the category of the document it belongs to.

Specifically, for each word included in the Document, a degree of importance of each word included in the Document, that is, a weight of each word included in the Document is determined using a Term Frequency-Inverse text Frequency (TF-IDF) algorithm. The TF-IDF algorithm is a weighting method used in information retrieval and text mining to evaluate the importance of a word to one of a set of documents. The importance of a word increases in proportion to the number of times it appears in a document, but at the same time decreases in inverse proportion to the frequency with which it appears in the collection of documents. The larger the TF-IDF value of a word, the better the classification ability of the word. Where TF refers to how often a word appears in a document, assuming that word i is in the documentThe number of occurrences inDocument, documentThe total number of words contained in isThen, the TF value for word i is calculated as follows:

equation 1

The IDF is a measure of the general importance of a word, and in a document set, if the number of documents containing a word is less, the IDF value of the word is larger, so that the word has good category distinguishing capability. Conversely, if more documents contain a word in a document set, the smaller the IDF value of the word. IDF may reduce the weight of common words in a document set. Assuming that the total number of documents in the document set is N, the number of documents in which the word i appears is NThen the IDF value for word i is calculated as follows:

equation 2

DocumentThe calculation formula of the TF-IDF value of the word i in (1) is as follows:

equation 3

Illustratively, assume that word i is in the documentNumber of occurrences inIs 10, documentTotal number of words contained inAt 100, then, the TF value for keyword i is 0.1. The total number N of the documents in the document set is 100, and the number of the documents with the word i appearsIs 10, then the IDF value of the word i is 1. Therefore, the documentThe TF-IDF value of the Chinese word i is 0.1.

The TF-IDF algorithm is used to calculate the importance of each word in the document, i.e., to calculate the weight of each word in the document. After the weight calculation of each word in the document is completed, each word in the document and the corresponding weight are stored in a set, and the set represents the user characteristics.

The method comprises the steps of determining text information sent by a user on a set application based on behavior data of the user in the set application, and extracting user features according to the text information sent by the user, so that the extracted user features are more accurate.

In an embodiment, the determining the text information sent by the user on the setting application based on the behavior data of the user in the setting application further includes:

and determining the user sending the corresponding text information based on the user identification in the behavior data of the set application.

Here, the user who issues the corresponding text information is determined based on the user identification in the behavior data of the setting application. The behavior data of the setting application records the object of the behavior operation, the time when the behavior operation occurs, the place where the behavior operation occurs, the specific content of the behavior operation, and how the behavior operation occurs. The object of the behavior operation recorded in the behavior data contains the user identification, and the user who sends out the corresponding text information can be determined based on the behavior operation object. The user identification in the behavior data of the set application comprises a user account identification and a device identification used by the user. When a user uses a set application, an account is usually registered, the registered account is logged in to perform behavior operation on the set application, and each account corresponds to one user, so that the user sending corresponding text information can be determined based on the user account identification. Under the condition that a user does not log in an account to use a set application or one user has a plurality of accounts, different users can be distinguished by collecting the identification of equipment used by the user. Taking a mobile phone as an example, each mobile phone has a unique identification code, so that different users can be distinguished by the identification code of the mobile phone.

After a user sending out text information is determined, the text information sent out by the user is stored in a document corresponding to the user, and a TF-IDF value is calculated for each word in the document corresponding to each user to obtain the weight of each word. And storing each word and corresponding weight in the document corresponding to each user in a set to obtain the user characteristics corresponding to each user.

Illustratively, user characteristics corresponding to the user may be availableTo indicate the manner in which, among others,representing any one word in the document to which the user corresponds,and representing the weight corresponding to any word in the document corresponding to the user, namely the TF-IDF value of any word in the document corresponding to the user.

The user sending the corresponding text information is determined based on the user identification in the behavior data of the set application, so that the user characteristics of the corresponding user can be extracted more accurately based on the text information corresponding to the user.

In an embodiment, when the first user characteristic of the corresponding user is updated based on the second user characteristic of each user of the at least one user, the method includes:

for each user, judging whether each second label in the at least one second label is the same as each first label in the at least one first label or not to obtain a judgment result;

updating the weight corresponding to the first label based on the weight corresponding to the second label when the judgment result represents that the second label is the same as the first label and the number of the second label is greater than or equal to 1, wherein the second label and the first label are the same label; wherein the second user characteristic comprises the at least one second label and a weight corresponding to each second label; the first user characteristic includes a weight corresponding to each of the at least one first tag.

Here, as time goes by, behavior data of the user in setting the application increases, text information issued by the user based on the behavior data changes, and words in a document corresponding to the user and weights corresponding to the words obtained based on the text information issued by the user change accordingly. Thus, for each user, it is determined whether each second label included in the second user profile is the same as each first label included in the first user profile. The second label characterizes words included in the second user characteristic, and the first label characterizes words included in the first user characteristic.

If the second label is the same as the first label, the word in all words included by the second user characteristic is the same as the word included by the first user characteristic, and the word still exists in the second user characteristic after a period of time. The number of the second labels, which is the same as that of the first labels, is greater than or equal to 1, which indicates that at least one second label exists in the second user characteristics and is the same as at least one first label in the first user characteristics, that is, at least one word exists in all words included in the second user characteristics and is the same as at least one word included in the first user characteristics, and in this case, the weight corresponding to the same first label is updated based on the weight corresponding to each second label in the at least one second label.

The second user characteristic includes at least one second label and a weight corresponding to each second label, that is, the second user characteristic includes at least one word and a weight corresponding to each word. The first user characteristic includes at least one first label and a weight corresponding to each first label, that is, the first user characteristic includes at least one word and a weight corresponding to each word.

By judging whether the second label in the second user characteristic is the same as the first label in the first user characteristic or not and updating the weight corresponding to the same first label based on the weight corresponding to the second label under the same condition, the user characteristic corresponding to the user can be updated in time, so that the recommendation result based on the user characteristic is more accurate.

In an embodiment, the updating the weight corresponding to the first tag based on the weight corresponding to the second tag includes:

performing derivation on the weight corresponding to the second label to obtain a derivation result;

and updating the weight corresponding to the same first label based on the derivation result.

Here, updating the weight corresponding to the same first label based on the weight corresponding to the corresponding second label includes deriving the weight corresponding to the corresponding second label to obtain a derivation result, and updating the weight corresponding to the same first label based on the derivation result.

It should be noted that the first user characteristic is determined at a first time, and the second user characteristic is determined at a second time, so that the weight corresponding to any one of the first tags included in the first user characteristic may be considered as the weight at the first time, and the weight corresponding to any one of the second tags included in the second user characteristic may be considered as the weight at the second time. Therefore, when deriving the weight corresponding to the corresponding second tag, the derivation is performed based on the weight corresponding to the second tag and the time interval between the second time and the first time, and the derivation result is obtained.

The update formula of the weight corresponding to the same first label is as follows:

equation 4

Wherein the content of the first and second substances,indicating the weight corresponding to the updated first label,indicating the corresponding weight of the second tag at the second time,representing the corresponding weight of the same first label at a first time,is the time interval between the second time and the first time.

By updating the same weight corresponding to the first label based on the weight corresponding to the second label, the label and the weight included in the user feature corresponding to the user can be ensured to be the most accurate, so that the recommendation result based on the user feature is more accurate.

In an embodiment, when the first user characteristic of the corresponding user is updated based on the second user characteristic of each of the at least one user, the method further includes:

and adding the corresponding second label and the corresponding weight into the first user characteristic under the condition that the judgment result represents that the second label is different from the first label and the number of the second label different from the first label is greater than or equal to 1.

Here, if the second tag is different from the first tag, it indicates that the existing word in all the words included in the second user characteristic is different from the word included in the first user characteristic, and indicates that a new word appears in the second user characteristic after a period of time has elapsed. The number of the second labels different from the first labels is greater than or equal to 1, which indicates that at least one second label exists in the second user characteristics and the first label in the first user characteristics are different, that is, at least one word exists in all words included in the second user characteristics and the word included in the first user characteristics are different, in this case, each second label and corresponding weight in the at least one second label are added to the first user characteristics, so as to update the first user characteristics.

Illustratively, the first user characteristic of one user is a setThe second user characteristic of the user is set. Wherein the content of the first and second substances,is the first label and is a label of the first label,is the second label.

It is determined whether each second label in the second user profile is the same as each first label in the first user profile. Specifically, any one of the second labels is extracted from the second user characteristicsIf judged to result inIs equal toThen updateThe corresponding weight. The specific updating method is toThe corresponding weight is subjected to derivation, and the derivation result is updated based on the obtained derivation resultThe corresponding weight.

If it is notAnd each one ofAll are different, then willTo the set K, thereby updating the first user profile.

And circulating the judging process until all the second labels in the second user characteristics are detected.

Under the condition that any one second label is different from each first label, the corresponding second label and the corresponding weight are added to the first user characteristics, so that the user characteristics corresponding to the user can be updated in time, and the recommendation result based on the user characteristics is more accurate.

In an embodiment, the clustering, based on the updated first user characteristic corresponding to each of the at least one user, the at least one user to obtain a category corresponding to each user includes:

clustering the first user characteristics corresponding to each user in the at least one updated user according to the DBSCAN algorithm to obtain at least one type of clustering result;

and adjusting each type of clustering result in the at least one type of clustering results according to a KNN algorithm to obtain the type corresponding to each user.

Here, the DBSCAN algorithm uses the idea of density-based clustering, that is, the number of objects included in a certain region of each cluster space is not less than a set threshold value. The DBSCAN algorithm has two main parameters, neighborhood radius eps when defining the density and threshold MinPts when defining the core point. In the DBSCAN algorithm, data points are classified into 3 classes, the first class is core points, and if a data point contains more than MinPts number of data points within a radius eps, the data point is core point; class 2 is a boundary point, which is a data point if it contains a number of data points less than MinPts within the radius eps, but falls within the radius eps of the core point; class 3 is a noise point, and a data point is a noise point if it is neither a core point nor a boundary point.

When clustering is carried out by using a DBSCAN algorithm, firstly, a smaller radius eps is selected, the updated first user characteristics corresponding to each user are clustered, and at least one type of clustering results are obtainedAnd at least one noise pointWherein n and m are both positive integers greater than 1. At this time, the first user feature included in each category result is highly relevant.

Determining core points for each class result

The distance between each noise point and the core point of each categorical result is calculated,selecting the minimum distance. And judging the magnitude relation between the minimum distance and the radius eps, and classifying the noise point as a clustering result with the minimum distance if the minimum distance is not greater than the radius eps. If the minimum distance is greater than the radius eps, the noise point is discarded.

Other noise points are processed in the same way until all the noise points are processed, so that all the noise points are eliminated.

And in at least one type of clustering results obtained after the noise points are eliminated, adjusting each type of clustering results in the at least one type of clustering results according to a KNN algorithm to obtain the type corresponding to each user. Namely, for at least one first user feature included in each clustering result, performing clustering analysis by using a KNN algorithm to determine a final corresponding category of a user corresponding to the first user feature.

In particular, a document vector for a certain category to be determinedCalculatingSimilarity with cosine distance between all document vectors in the training set R. Documents of a category to be determined(Vector)At least one word and a weight corresponding to each word are included, and thus, the document vectorA first user characteristic characterizing a corresponding user. Wherein the document vector of the category to be determinedAnd any document vector in the training setThe cosine included angle between the two calculation formulas is as follows:

equation 5

Wherein the content of the first and second substances,are respectively document vectorsThe weight corresponding to the ith word in the list,a larger value of (d) indicates a higher degree of similarity of the two document vectors.

ComputingThe weight W belonging to each of the categories,belong toThe calculation formula of the weight of the class is as follows:

Equation 6

Wherein the content of the first and second substances,as a voting weight function, typically 1 orIs an attribute class function and takes a value of 0 or 1 whenIf so, the function value is 1, otherwise, the function value is 0.

Calculate outAfter the weight belonging to each category, willThe category with the greatest weight is determined.

And processing each first user characteristic contained in each category of result obtained by the DBSCAN algorithm based on the same mode to obtain the category corresponding to each user. And then recommending corresponding products for each user based on the corresponding category of each user.

The first user characteristics are classified by combining the DBSCAN algorithm and the KNN algorithm, so that the category corresponding to each user can be accurately obtained, the corresponding resources can be accurately recommended to the user based on the category accurately corresponding to each user, and the recommendation precision is improved.

In an embodiment of the application, the first user characteristics of the corresponding user are updated based on the second user characteristics of each user of the at least one user. The first user characteristic represents the user characteristic determined at the first moment, and the second user characteristic represents the user characteristic determined at the second moment after the first moment. And clustering at least one user based on the updated first user characteristics corresponding to each user in the at least one user to obtain a category corresponding to each user. And recommending corresponding resources for each user based on the corresponding category of each user. Therefore, the users are classified based on the dynamically updated user characteristics, resources are recommended for the users based on the categories corresponding to the users, and dynamic changes of the user characteristics are considered when the resources are recommended for the users, so that the resources recommended to the users can accurately fit with the current characteristics of the users, and the resource recommendation precision is improved.

In order to implement the method according to the embodiment of the present application, an embodiment of the present application further provides a resource recommendation device, fig. 2 is a schematic diagram of the resource recommendation device according to the embodiment of the present application, please refer to fig. 2, where the device includes:

an updating unit 201, configured to update the first user characteristics of the corresponding user based on the second user characteristics of each user in the at least one user; the first user characteristic represents the user characteristic determined at the first moment; the second user characteristic characterizes a user characteristic determined at a second time after the first time.

A clustering unit 202, configured to cluster the at least one user based on the updated first user characteristic corresponding to each user of the at least one user, so as to obtain a category corresponding to each user.

A recommending unit 203, configured to recommend a corresponding resource for each user based on the category corresponding to each user.

In one embodiment, the apparatus further comprises: a determination unit and an extraction unit; the determining unit is used for determining text information sent by a user on the set application based on the behavior data of the user in the set application;

the extraction unit is used for extracting corresponding user characteristics based on text information sent by a user on the set application.

In an embodiment, the determining unit is further configured to determine, based on a user identifier in the behavior data of the set application, a user who sends out the corresponding text message.

In an embodiment, the updating unit 201 is further configured to determine, for each user, whether each second tag in the at least one second tag is the same as each first tag in the at least one first tag, so as to obtain a determination result;

updating the weight corresponding to the first label based on the weight corresponding to the second label when the judgment result represents that the second label is the same as the first label and the number of the second label is greater than or equal to 1, wherein the second label and the first label are the same label; wherein the second user characteristic comprises the at least one second label and a weight corresponding to each second label; the first user characteristic includes a weight corresponding to each of the at least one first tag.

In an embodiment, the updating unit 201 is further configured to perform derivation on the weight corresponding to the second tag to obtain a derivation result;

and updating the weight corresponding to the same first label based on the derivation result.

In one embodiment, the apparatus further comprises: and the adding unit is used for adding the corresponding second label and the corresponding weight into the first user characteristic under the condition that the judging result represents that the second label is different from the first label and the number of the second label different from the first label is greater than or equal to 1.

In an embodiment, the clustering unit 202 is further configured to cluster the updated first user feature corresponding to each of the at least one user according to a DBSCAN algorithm, so as to obtain at least one type of clustering result;

and adjusting each type of clustering result in the at least one type of clustering results according to a KNN algorithm to obtain the type corresponding to each user.

In practical applications, the updating Unit 201, the clustering Unit 202, the recommending Unit 203, the determining Unit, the extracting Unit, and the adding Unit may be implemented by a Processor in a terminal, such as a Central Processing Unit (CPU), a Digital Signal Processor (DSP), a Micro Control Unit (MCU), or a Programmable Gate Array (FPGA).

It should be noted that: in the resource recommendation device provided in the above embodiment, when displaying information, the above-mentioned division of each program module is merely exemplified, and in practical applications, the above-mentioned processing allocation may be completed by different program modules according to needs, that is, the internal structure of the device is divided into different program modules to complete all or part of the above-mentioned processing. In addition, the resource recommendation device and the resource recommendation method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.

Based on the hardware implementation of the program module, in order to implement the method of the embodiment of the present application, an embodiment of the present application further provides an electronic device. Fig. 3 is a schematic diagram of a hardware component structure of an electronic device according to an embodiment of the present application, and as shown in fig. 3, the electronic device includes:

a communication interface 301 capable of performing information interaction with other devices such as network devices and the like;

and the processor 302 is connected with the communication interface 301 to implement information interaction with other devices, and is used for executing the method provided by one or more technical schemes of the terminal side when running a computer program. And the computer program is stored on the memory 303.

Specifically, the processor 302 is configured to update the first user characteristic of the corresponding user based on the second user characteristic of each user of the at least one user; the first user characteristic represents the user characteristic determined at the first moment; the second user characteristic represents the user characteristic determined at a second moment after the first moment;

clustering the at least one user based on the updated first user characteristics corresponding to each user in the at least one user to obtain a category corresponding to each user;

and recommending corresponding resources for each user based on the corresponding category of each user.

In an embodiment, the processor 302 is further configured to determine, based on behavior data of the user in the setting application, a text message issued by the user on the setting application;

and extracting corresponding user characteristics based on text information sent by the user on the set application.

In an embodiment, the processor 302 is further configured to determine a user who sends out a corresponding text message based on a user identification in the behavior data of the set application.

In an embodiment, when the first user characteristic of the corresponding user is updated based on the second user characteristic of each of the at least one user, the processor 302 is further configured to determine, for each user, whether each second tag in the at least one second tag is the same as each first tag in the at least one first tag, so as to obtain a determination result;

updating the weight corresponding to the first label based on the weight corresponding to the second label when the judgment result represents that the second label is the same as the first label and the number of the second label is greater than or equal to 1, wherein the second label and the first label are the same label; wherein the second user characteristic comprises the at least one second label and a weight corresponding to each second label; the first user characteristic includes a weight corresponding to each of the at least one first tag.

In an embodiment, the processor 302 is further configured to perform derivation on the weight corresponding to the second tag to obtain a derivation result;

and updating the weight corresponding to the same first label based on the derivation result.

In an embodiment, when the first user characteristic of the corresponding user is updated based on the second user characteristic of each of the at least one user, the processor 302 is further configured to add the corresponding second tag and the corresponding weight to the first user characteristic when the determination result indicates that the second tag is different from the first tag and the number of the second tag being different from the first tag is greater than or equal to 1.

In an embodiment, the processor 302 is further configured to cluster the updated first user feature corresponding to each of the at least one user according to a DBSCAN algorithm, so as to obtain at least one type of clustering result;

and adjusting each type of clustering result in the at least one type of clustering results according to a KNN algorithm to obtain the type corresponding to each user.

Of course, in practice, the various components in the electronic device are coupled together by the bus system 304. It will be appreciated that the bus system 304 is used to enable communications among the components. The bus system 304 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 304 in fig. 3.

The memory 303 in the embodiments of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program for operating on an electronic device.

It will be appreciated that the memory 303 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memory 303 described in embodiments herein is intended to comprise, without being limited to, these and any other suitable types of memory.

The method disclosed in the embodiments of the present application may be applied to the processor 302, or implemented by the processor 302. The processor 302 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 302. The processor 302 described above may be a general purpose processor, a DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. The processor 302 may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in the memory 303, and the processor 302 reads the program in the memory 303 and performs the steps of the aforementioned method in conjunction with its hardware.

The processor 302 implements the corresponding flow in the methods of the embodiments of the present application when executing the program.

In an exemplary embodiment, the present application further provides a storage medium, i.e., a computer storage medium, specifically a computer readable storage medium, for example, including a memory 303 storing a computer program, which can be executed by a processor 302 to perform the steps of the foregoing method. The computer readable storage medium may be Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM.

In the several embodiments provided in the present application, it should be understood that the disclosed apparatus, terminal and method may be implemented in other manners. The above-described device embodiments are only illustrative, for example, the division of the unit is only one logical function division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.

Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.

Alternatively, the integrated units described above in the present application may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or portions thereof that contribute to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling an electronic device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.

The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:一种基于隐私保护的多社交平台用户推荐方法和系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!