CN116467523A - News recommendation method, device, electronic equipment and computer readable storage medium - Google Patents

News recommendation method, device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN116467523A
CN116467523A CN202310452697.5A CN202310452697A CN116467523A CN 116467523 A CN116467523 A CN 116467523A CN 202310452697 A CN202310452697 A CN 202310452697A CN 116467523 A CN116467523 A CN 116467523A
Authority
CN
China
Prior art keywords
news
vector
user
candidate
neural network
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310452697.5A
Other languages
Chinese (zh)
Inventor
陈浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202310452697.5A priority Critical patent/CN116467523A/en
Publication of CN116467523A publication Critical patent/CN116467523A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Databases & Information Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to the technical field of deep learning and the technical field of digital medical treatment, and discloses a news recommending method, a news recommending device, electronic equipment and a computer readable storage medium, wherein the method comprises the following steps: based on a first convolutional neural network, respectively carrying out text coding processing on the candidate news text and at least one historical news text of a user to obtain a candidate news vector and at least one historical news vector; based on a second convolutional neural network, carrying out similarity coding processing on the candidate news vector and at least one historical news vector to obtain a user feature vector; based on the fully connected neural network, whether to recommend candidate news texts to the user is determined according to the candidate news vectors and the user feature vectors. According to the news recommendation method and device, the news text to be recommended can be quickly encoded into the news vector through the convolutional neural network, the user feature vector is obtained through a small amount of historical news text, the recommendation result is determined through matching the news vector and the user feature vector, and the accuracy of the news recommendation result is improved.

Description

News recommendation method, device, electronic equipment and computer readable storage medium
Technical Field
The disclosure relates to the technical field of deep learning and digital medical treatment, in particular to a news recommending method, a news recommending device, electronic equipment and a computer readable storage medium.
Background
With the development of information technology and the internet, people gradually move from the age of information deficiency to the age of information overload. It is almost impossible for a user to search for interesting contents by browsing through all news information, so personalized news recommendation technology has been developed, and plays a vital role in helping to relieve overload of user information, improve news reading experience of the user, and the like.
In the prior art, news can be recommended to users based on a collaborative filtering method, specifically, historical news records of two users can be compared, and if the historical news records are similar, news watched by one user can be recommended to the other user. However, in this method, the time span of the history news record for comparison is large, and news has high timeliness, so news recommended to another user may be quickly outdated in a history period, thereby reducing accuracy of personalized news recommendation results, and click rate of news text. Therefore, a method for providing accurate news recommendation results is needed.
Disclosure of Invention
Aiming at the situation, the embodiment of the application provides a news recommending method, a news recommending device, electronic equipment and a computer readable storage medium, and aims to solve the problem of improving accuracy of personalized news recommending results.
In a first aspect, an embodiment of the present application provides a news recommendation method, where the method is implemented by a news recommendation model, where the news recommendation model includes a first convolutional neural network, a second convolutional neural network, and a fully-connected neural network;
the method comprises the following steps:
based on the first convolutional neural network, respectively carrying out text coding processing on the candidate news text and at least one historical news text of the user to obtain a candidate news vector and at least one historical news vector;
based on the second convolutional neural network, performing similarity coding processing on the candidate news vector and the at least one historical news vector to obtain a user feature vector;
and determining the interest degree of the user on the candidate news text according to the candidate news vector and the user feature vector based on the fully-connected neural network, and determining whether to recommend the candidate news text to the user according to the interest degree.
In a second aspect, an embodiment of the present application further provides a news recommendation device, where a news recommendation model is deployed in the news recommendation device, and the news recommendation model includes a first convolutional neural network, a second convolutional neural network, and a fully-connected neural network;
the device comprises:
the text coding unit is used for respectively carrying out text coding processing on the candidate news text and at least one historical news text of the user based on the first convolutional neural network to obtain a candidate news vector and at least one historical news vector;
the similarity coding unit is used for carrying out similarity coding processing on the candidate news vectors and the at least one historical news vector based on the second convolutional neural network to obtain user feature vectors;
and the prediction unit is used for determining the interest degree of the user on the candidate news text according to the candidate news vector and the user feature vector based on the fully-connected neural network, and determining whether to recommend the candidate news text to the user according to the interest degree.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the steps of the news recommendation method described above.
In a fourth aspect, embodiments of the present application also provide a computer-readable storage medium storing one or more programs that, when executed by an electronic device that includes a plurality of application programs, cause the electronic device to perform the steps of the news recommendation method described above.
The above-mentioned at least one technical scheme that this application embodiment adopted can reach following beneficial effect:
according to the news recommendation method, a news recommendation model is built, text coding processing is conducted on candidate news texts and one or more historical news texts of a user based on a first convolution neural network of the model, candidate news vectors and a plurality of historical news vectors are obtained, similarity coding processing is conducted on the candidate news vectors and each historical news vector based on a second convolution neural network of the model, user feature vectors are obtained, a full-connection neural network of the model is based, the interest degree of the user on the candidate news texts is determined according to the candidate news vectors and the user feature vectors, and whether the candidate news texts are recommended to the user is determined according to the interest degree. The user feature vector of the user can be quickly and accurately constructed by utilizing a small amount of latest historical news texts based on the convolutional neural network, and then the user feature vector is used as a standard to give the user a more accurate personalized news recommendation result, so that the click rate of the recommended news texts is greatly improved, and the timeliness of the recommended news is greatly improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1 illustrates a flow diagram of a news recommendation method according to one embodiment provided herein;
FIG. 2 illustrates a schematic diagram of a news recommendation model, according to one embodiment provided herein;
FIG. 3 shows a flow diagram of a news recommendation method according to yet another embodiment provided herein;
FIG. 4 shows a schematic diagram of a news recommender according to one embodiment provided herein;
fig. 5 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purposes, technical solutions and advantages of the present application, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The following describes in detail the technical solutions provided by the embodiments of the present application with reference to the accompanying drawings.
Personalized news recommendation is an important technology for realizing personalized news service, and can reduce the occurrence of overload condition of user information. In the prior art, news can be recommended to the user based on a collaborative filtering method, specifically, the historical news records of the user A and the user B can be compared, and if the historical news records are similar, the news watched by the user B can be recommended to the user A. However, in this method, the time span of the history news record for comparison is large, and news has high timeliness, so the news recommended to the user a may be quickly outdated in the history period, thereby reducing the accuracy of the personalized news recommendation result, and the click rate of the news text. Based on the method, the news recommending method is provided, the news text to be recommended can be quickly encoded into the news vector through the convolutional neural network, the user characteristic vector is obtained by utilizing a small amount of historical news text of the user, the recommending result is obtained by matching the news vector and the user characteristic vector, and the accuracy of the news recommending result is improved.
Fig. 1 shows a flow chart of a news recommending method according to an embodiment provided in the present application, and as can be seen from fig. 1, the present application at least includes steps S101 to S103:
step S101: and respectively carrying out text coding processing on the candidate news text and at least one historical news text of the user based on the first convolutional neural network to obtain a candidate news vector and at least one historical news vector.
The news recommending method of the present application is implemented based on a news recommending model, fig. 2 shows a schematic structural diagram of the news recommending model according to an embodiment provided in the present application, and as can be seen from fig. 2, the news recommending model 200 includes a first convolutional neural network 201, a second convolutional neural network 202, and a fully connected neural network 203, where the first convolutional neural network 201 and the second convolutional neural network 202 are respectively connected to the fully connected neural network 203.
Firstly, based on a first convolutional neural network, text encoding processing is respectively carried out on candidate news texts and at least one historical news text of a user to obtain candidate news vectors and at least one historical news vector, and the dimensions of the vectors can be, but are not limited to, 64 dimensions.
In some embodiments, the number of the historical news texts may be set to one or more, and here, 2 are taken as an example for illustration, and based on the first convolutional neural network, text encoding processing is performed on the candidate news texts and 2 historical news texts of the user respectively, so as to obtain candidate news vectors and 2 historical news vectors. In other embodiments, the number of the historical news texts may be set to be 100, and based on the first convolutional neural network, text encoding processing is performed on the candidate news texts and 100 historical news texts of the user, so as to obtain candidate news vectors and 100 historical news vectors.
Aiming at the embodiment that the number of the historical news texts is 2, the number of the set historical news texts is smaller, and although the effect of representing the preference of the user by the user feature vector obtained according to the historical news vector is slightly poor, the speed is high, the computing power is saved, and the occupation of hardware resources is small; in the embodiment with 100 historical news texts, the number of the set historical news texts is large, the calculation time of the model is increased, the calculation efficiency is reduced, the preference of the user can be better represented, and the accuracy of the decision result is relatively improved. In other embodiments of the present application, in order to improve the calculation efficiency of the news recommendation model and improve the accuracy of the news recommendation result, through a large number of experiments, the preferred number of the obtained historical news texts may be set moderately between 2 and 100, for example, may be set to 10.
Step S102: and carrying out similarity coding processing on the candidate news vector and the at least one historical news vector based on the second convolutional neural network to obtain a user feature vector.
And carrying out similarity coding processing on the candidate news vector and at least one historical news vector based on the second convolutional neural network to obtain a user feature vector, wherein the dimension of the user feature vector is not limited, for example, the dimension of the vector can be 64 dimensions.
Wherein the history news vector may include 1 or more, these 2 cases are respectively exemplified below.
If the historical news vectors include 1, in some embodiments, dot product processing may be performed on the candidate news vectors and the historical news vectors based on the second convolutional neural network, so as to obtain the user feature vector. In other embodiments, similarity calculation may be performed on the candidate news vector and the historical news vector by using a similarity calculation formula, such as a euclidean distance calculation formula, a cosine similarity calculation formula, a manhattan distance calculation formula, and the like, to obtain the user feature vector.
If the historical news vector includes a plurality of historical news vectors, for example, the historical news vector 1 and the historical news vector 2. In some embodiments, dot product processing may be performed on the candidate news vector and the historical news vector 1 to obtain a result 1, dot product processing may be performed on the candidate news vector and the historical news vector 2 to obtain a result 2, and a sum of the result 1 and the result 2 may be averaged to obtain the user feature vector.
However, in an actual news scenario, each user has his own reading preference, and the above embodiment equally treats the historical news vector 1 and the historical news vector 2, so the obtained user feature vector is slightly less targeted, and in order to further improve the accuracy of the prediction result, in some embodiments of the present application, an attention mechanism may be introduced in the second convolutional neural network. Specifically, in some embodiments of the present application, in the foregoing method, the performing, based on the second convolutional neural network, similarity encoding processing on the candidate news vector and a plurality of historical news vectors to obtain a user feature vector includes: determining dot products of the candidate news vectors and the historical news vectors to obtain initial similarity of the candidate news vectors and the historical news vectors; normalizing the initial similarity to obtain a weight corresponding to the initial similarity; determining the product of the initial similarity and the corresponding weight to obtain the similarity of the candidate news vector and the historical news vector; and determining the accumulated value of each similarity to obtain the user characteristic vector.
The dot product of the candidate news vector and each historical news vector can be determined, and the initial similarity of the candidate news vector and each historical news vector is obtained. In some embodiments, the initial similarities may be determined according to the following equation (1):
α i =e*e i formula (1);
wherein e is a candidate news vector, e i Is the i-th historical news vector.
Specifically, if the history news vector includes a history news vector 1, a history news vector 2 and a history news vector 3, the candidate news vector and the history news vector 1 may be substituted into the above formula (1), to obtain an initial similarity 1 between the candidate news vector and the history news vector 1; substituting the candidate news vector and the historical news vector 2 into the formula (1) to obtain initial similarity 2 of the candidate news vector and the historical news vector 2; similarly, an initial similarity of 3 can be obtained.
And then, carrying out normalization processing on each initial similarity to obtain the weight corresponding to each initial similarity. In some embodiments, the weights may be determined according to the following equation (2):
where m is the total number of historical news vectors.
Specifically, in order to obtain the weight corresponding to the initial similarity 1, the initial similarity 2 and the initial similarity 3 may be respectively brought into an exp () function to obtain an initial similarity 11, an initial similarity 21 and an initial similarity 31, the initial similarity 21 and the initial similarity 31 are added to obtain a similarity sum value, and the ratio of the initial similarity 11 to the similarity sum value may be used as the weight 1 corresponding to the initial similarity 1.
Finally, determining the product of each initial similarity and the corresponding weight to obtain the similarity of the candidate news vector and each historical news vector; and determining the accumulated value of each similarity to obtain the user feature vector.
Specifically, according to the above formula (2), the weight 1, the weight 2 and the weight 3 can be obtained, the product 1 of the weight 1 and the historical news vector 1, the product 2 of the weight 2 and the historical news vector 2, and the product 3 of the weight 3 and the historical news vector 3 can be obtained respectively, and the product 1, the product 2 and the product 3 can be added to obtain the user feature vector.
According to the embodiment, the candidate news vectors and the historical news vectors of the user are fused by using the weighted summation attention mechanism, so that the user feature vector can be more accurately determined, the interest change of the user is effectively captured, the interest preference of the user is accurately identified, the user experience is improved, and the final click rate is further improved.
Step S103: and determining the interest degree of the user on the candidate news text according to the candidate news vector and the user feature vector based on the fully-connected neural network, and determining whether to recommend the candidate news text to the user according to the interest degree.
After obtaining the candidate news vectors and the user feature vectors, the candidate news vectors and the user feature vectors can be input into a fully-connected neural network, such as a feedforward neural network, so as to obtain the interest degree of the user on the candidate news texts, and whether to recommend the candidate news texts to the user is determined according to the interest degree.
In some embodiments of the present application, in the above method, the determining, based on the fully connected neural network, an interest degree of the user in the candidate news text according to the candidate news vector and the user feature vector, and determining whether to recommend the candidate news text to the user according to the interest degree includes: fusing the candidate news vectors and the user feature vectors to obtain fusion vectors; inputting the fusion vector to the fully-connected neural network to obtain the interest degree of the user on the candidate news text; if the interestingness is greater than or equal to a preset threshold, determining to recommend the candidate news text to the user; and if the interestingness is smaller than the preset threshold, determining that the candidate news text is not recommended to the user.
The candidate news vector and the user feature vector can be fused to obtain a fusion vector; inputting the fusion vector into a fully-connected neural network to obtain the interest degree of the user on the candidate news text; if the interestingness is greater than or equal to a preset threshold, determining to recommend candidate news texts to the user; and if the interestingness is smaller than a preset threshold, determining that candidate news texts are not recommended to the user.
In some embodiments, the candidate news vector and the user feature vector may be spliced to obtain the fusion vector. In other embodiments, the candidate news vector and the user feature vector may be added in a point-by-point manner to obtain the fusion vector.
And then, inputting the fusion vector into a fully-connected neural network to obtain the interest degree of the user on the candidate news text. If the preset threshold is set to be 80, if the interest level is greater than or equal to 80, the user is indicated to have a relatively large interest level in the candidate news text, and the candidate news text can be recommended to the user; if the interest level is less than 80, the interest level of the user in the candidate news text is indicated to be smaller, and the candidate news text can not be recommended to the user. The preset threshold may be set according to actual needs, and is only illustrated here as an example.
As can be seen from the method shown in FIG. 1, the method comprises the steps of constructing a news recommendation model, respectively carrying out text coding processing on candidate news texts and one or more historical news texts of a user based on a first convolution neural network of the model to obtain candidate news vectors and a plurality of historical news vectors, carrying out similarity coding processing on the candidate news vectors and each historical news vector based on a second convolution neural network of the model to obtain user feature vectors, determining the interest degree of the user on the candidate news texts according to the candidate news vectors and the user feature vectors based on a fully-connected neural network of the model, and determining whether to recommend the candidate news texts to the user according to the interest degree. The method overcomes the problem brought by timeliness of news, based on the convolutional neural network, a user characteristic vector of a user can be quickly and accurately constructed by using a small amount of latest historical news text, and further, the user characteristic vector is used as a standard, and a precise personalized news recommendation result is given to the user, so that the click rate of the recommended news text is greatly improved.
In some embodiments of the present application, in the above method, the candidate news text includes a plurality of; the method further comprises the steps of: inputting a plurality of candidate news texts and at least one historical news text of the user into the news recommendation model respectively to obtain a plurality of interestingness degrees; sorting the candidate news texts in a descending order according to the interest degrees to obtain a sorting result; and determining a news recommendation list of the user according to the sorting result.
Inputting the candidate news texts and at least one historical news text of the user into a news recommendation model respectively to obtain a plurality of interestingness degrees; sorting the candidate news texts in a descending order according to the interestingness of the candidate news texts to obtain a sorting result; and determining a news recommendation list of the user according to the sorting result.
In some embodiments, if there is a candidate news text 1, a candidate news text 2, a candidate news text 3, and a candidate news text 4, at least one historical news text of the user may be input to the first convolutional neural network first, so as to obtain a plurality of historical news vectors. Then, inputting the candidate news text 1 into a first convolution neural network to obtain a candidate news vector 1, inputting the candidate news vector 1 and the plurality of historical news vectors into a second convolution neural network to obtain a user feature vector 1, and determining the interest degree 1 of a user on the candidate news text 1 according to the candidate news vector 1 and the user feature vector 1 based on the fully connected neural network; inputting the candidate news text 2 into a first convolution neural network to obtain a candidate news vector 2, inputting the candidate news vector 2 and the plurality of historical news vectors into a second convolution neural network to obtain a user feature vector 2, and determining the interest degree 2 of a user on the candidate news text 2 according to the candidate news vector 2 and the user feature vector 2 based on the fully connected neural network; similarly, the interestingness 3 corresponding to the candidate news text 3 and the interestingness 4 corresponding to the candidate news text 4 can be obtained.
If the value of the interestingness 1 is 90, the value of the interestingness 2 is 95, the value of the interestingness 3 is 97, and the value of the interestingness 4 is 89, the candidate news texts are sorted in descending order according to the sizes of the interestingness, and a sorting result can be obtained: if the news recommendation list of the user is set to include 3 recommended news, it can be determined that the candidate news text 3, the candidate news text 2 and the candidate news text 1 form a news recommendation list of the user.
In the digital medical scene, news of the medical field can be recommended to the user, and the news of the medical field can be classified into a plurality of categories, for example, medical instruments, medical drugs, biological products, health products and nutritional foods, physical examination, diagnosis and treatment, medical insurance, accompanying diagnosis, overseas medical treatment and the like. The candidate news texts related to medical treatment and at least one history news text of the user can be input into a news recommendation model respectively to obtain a plurality of interestingness; sorting the candidate news texts in a descending order according to the interestingness of the candidate news texts to obtain a sorting result; and determining a news recommendation list of the user according to the sorting result.
In some embodiments of the present application, in the above method, the news recommendation model is trained according to the following method: constructing a training sample set; the training sample set comprises a plurality of groups of user data and corresponding sample labels, wherein the user data is a history recommendation news list containing a plurality of history recommendation news texts, and the sample labels are whether a user clicks the corresponding history recommendation news; acquiring a news recommendation initial model, wherein the model comprises a first convolution neural network, a second convolution neural network and a full-connection neural network, and the first convolution neural network and the second convolution neural network are respectively connected with the full-connection neural network; inputting the training sample set into the news recommendation initial model to obtain a plurality of predicted values; and training the news recommendation initial model for multiple times according to a logistic regression loss function based on the plurality of predicted values and the sample labels to obtain a news recommendation model.
Firstly, a training sample set is constructed, wherein the training sample set comprises a plurality of groups of user data and corresponding sample labels, the user data is a history recommendation news list containing a plurality of history recommendation news texts, and the sample labels are whether a user clicks corresponding history recommendation news.
Specifically, in some embodiments of the present application, the training sample set described above may be expressed as d= { (u) 1 ,r 1 ),…,(u i ,r i ),…,(u n ,r n ),},r i =[(x i1 ,y i1 ),…,(x ij ,y ij )…,(x im ,y im )]Where n represents the number of users in training sample set D, u i Representing the ith user, r, in training sample set D i Representing user u i History of recommended news listings, instant u i User data corresponding to a user, m represents the number of news in a history recommended news list, x ij Representing user u i Is a j-th historical recommended news text. y is ij For sample labels, y ij 1 represents user u i Click through the j-th historical recommended news textx ij ;y ij 1 represents user u i No click on the j-th historical recommended news text x ij
In practice, the historical recommended news text is typically a 300-word news profile, and in order to facilitate the processing of the news recommendation model, the news profile may be subjected to text preprocessing. In some embodiments of the present application, in the above method, the constructing a training sample set includes: acquiring an initial training sample set; deleting invalid characters in each historical recommended news text in the initial training sample set, wherein the invalid characters comprise: title number, repeat punctuation, blank symbol, and link symbol; and performing word segmentation processing on the deleted historical recommended news texts to obtain the training sample set.
The latest 10 historical recommended news texts of each user can be selected and used as training corpus of the initial training sample set. Since a large number of useless characters exist in each obtained historical recommended news text, such as a title number, repeated punctuation marks as modifications, blank marks, link marks and the like, the useless characters need to be filtered out first.
After deleting invalid characters in each history recommended news text in the initial training sample set, word segmentation processing can be performed on each deleted history recommended news text, and a final training sample set is obtained. Specifically, in some embodiments, word segmentation tools, such as a disc paleo word segmentation tool, a Yaha word segmentation tool, a Jieba word segmentation tool, a bloom THULAC tool, and the like, may be used to perform word segmentation processing on each history recommended news text, so as to obtain each processed history recommended news text, and further obtain the training sample set. Here, the history recommends news text x ij Can be expressed as x ij ={t 1 ,2,…, q …,t l And t is }, where q Represents x ij The q-th word (token), l represents x ij Number of token.
Then, a news recommendation initial model is obtained, as shown in fig. 2, specifically, in some embodiments, each parameter of the news recommendation model in fig. 2 may be initialized to obtain a news recommendation initial model.
Inputting the training sample set into a news recommendation initial model to obtain a plurality of predicted values; and training the news recommendation initial model for multiple times according to the logistic regression loss function based on the multiple predicted values and the sample labels to obtain a news recommendation model.
Specifically, in some embodiments, if the training sample set includes: user data 1 and sample tag 1, user data 2 and sample tag 2, user data 2 and sample tags 2, …, user data N and sample tag N, where N is the number of samples in the training sample set. User data 1 can be input into the news recommendation initial model to obtain a predicted value 1, and parameters in the news recommendation initial model are updated according to the predicted value 1 and a sample label 1 according to a logistic regression loss function such as a cross entropy loss function and the like to obtain a news recommendation model 1.
And then inputting the user data 2 into the news recommendation model 1 to obtain a predicted value 2, and updating parameters in the news recommendation model 1 based on the predicted value 2 and the sample label 2 based on the cross entropy loss function to obtain the news recommendation model 2. And by analogy, inputting the user data x into the news recommendation model x-1 to obtain a final news recommendation model, wherein x is 3, 4, 5, … and N.
In other embodiments, a loss threshold may be further set, and the predicted value and the corresponding sample label are substituted into the logistic regression loss function to obtain a loss value, and if the loss value is smaller than the loss threshold, training of the model is completed, and a final news recommendation model is obtained.
Fig. 3 shows a flowchart of a news recommending method according to another embodiment provided in the present application, and as can be seen from fig. 3, the news recommending method of the present embodiment includes the following steps S301 to S316:
step S301: an initial training sample set is obtained.
Step S302: and deleting invalid characters in each historical recommended news text in the initial training sample set.
Step S303: and performing word segmentation processing on each deleted historical recommended news text to obtain a training sample set.
Step S304: and acquiring a news recommendation initial model.
Step S305: and inputting the training sample set into a news recommendation initial model to obtain a plurality of predicted values.
Step S306: and training the news recommendation initial model for multiple times according to the logistic regression loss function based on the multiple predicted values and the sample labels to obtain a news recommendation model.
Step S307: and respectively carrying out text coding processing on the candidate news text and at least one historical news text of the user based on the first convolution neural network of the model to obtain a candidate news vector and at least one historical news vector.
Step S308: and determining the dot product of the candidate news vector and each historical news vector based on the attention mechanism and the second convolution neural network of the model, and obtaining the initial similarity of the candidate news vector and each historical news vector.
Step S309: and carrying out normalization processing on each initial similarity to obtain the weight corresponding to each initial similarity.
Step S310: and determining the product of each initial similarity and the corresponding weight to obtain the similarity of the candidate news vector and each historical news vector.
Step S311: and determining the accumulated value of each similarity to obtain the user feature vector.
Step S312: and fusing the candidate news vectors and the user feature vectors to obtain fusion vectors.
Step S313: and inputting the fusion vector into a fully-connected neural network to obtain the interest degree of the user on the candidate news text.
Step S314: judging whether the interestingness is larger than or equal to a preset threshold value or not. If yes, go to step S315; if not, go to step S316.
Step S315: a recommendation of candidate news text to the user is determined.
Step S316: it is determined that candidate news text is not recommended to the user. In other embodiments, if there are multiple candidate news texts, the multiple candidate news texts and at least one historical news text of the user may be respectively input into the news recommendation model to obtain multiple interestingness; sorting the candidate news texts in a descending order according to the interestingness of the candidate news texts to obtain a sorting result; and determining a news recommendation list of the user according to the sorting result.
FIG. 4 illustrates a schematic diagram of a news recommender deployed with a news recommendation model including a first convolutional neural network, a second convolutional neural network, and a fully-connected neural network, according to one embodiment provided herein; the apparatus 400 comprises a text encoding unit 401, a similarity encoding unit 402, a determining unit 403, wherein:
a text encoding unit 401, configured to perform text encoding processing on the candidate news text and at least one historical news text of the user based on the first convolutional neural network, to obtain a candidate news vector and at least one historical news vector;
a similarity encoding unit 402, configured to perform similarity encoding processing on the candidate news vector and the at least one historical news vector based on the second convolutional neural network, to obtain a user feature vector;
and a prediction unit 403, configured to determine, based on the fully connected neural network, an interest degree of the user in the candidate news text according to the candidate news vector and the user feature vector, and determine whether to recommend the candidate news text to the user according to the interest degree.
In some embodiments of the present application, in the above apparatus, the historical news vector includes a plurality of; the similarity encoding unit 402 is configured to determine a dot product of the candidate news vector and each of the historical news vectors, so as to obtain an initial similarity between the candidate news vector and each of the historical news vectors; normalizing the initial similarity to obtain a weight corresponding to the initial similarity; determining the product of the initial similarity and the corresponding weight to obtain the similarity of the candidate news vector and the historical news vector; and determining the accumulated value of each similarity to obtain the user characteristic vector.
In some embodiments of the present application, in the foregoing apparatus, the prediction unit 403 is configured to fuse the candidate news vector and the user feature vector to obtain a fused vector; inputting the fusion vector to the fully-connected neural network to obtain the interest degree of the user on the candidate news text; if the interestingness is greater than or equal to a preset threshold, determining to recommend the candidate news text to the user; and if the interestingness is smaller than the preset threshold, determining that the candidate news text is not recommended to the user.
In some embodiments of the present application, the candidate news text includes a plurality of; the device further comprises a list generation unit, wherein the list generation unit is used for inputting a plurality of candidate news texts and at least one historical news text of the user into the news recommendation model respectively to obtain a plurality of interestingness; sorting the candidate news texts in a descending order according to the interest degrees to obtain a sorting result; and determining a news recommendation list of the user according to the sorting result.
In some embodiments of the present application, the apparatus further includes a model training unit, configured to construct a training sample set; the training sample set comprises a plurality of groups of user data and corresponding sample labels, wherein the user data is a history recommendation news list containing a plurality of history recommendation news texts, and the sample labels are whether a user clicks the corresponding history recommendation news; acquiring a news recommendation initial model, wherein the model comprises a first convolution neural network, a second convolution neural network and a full-connection neural network, and the first convolution neural network and the second convolution neural network are respectively connected with the full-connection neural network; inputting the training sample set into the news recommendation initial model to obtain a plurality of predicted values; and training the news recommendation initial model for multiple times according to a logistic regression loss function based on the plurality of predicted values and the sample labels to obtain a news recommendation model.
In some embodiments of the present application, in the foregoing apparatus, a model training unit is configured to obtain an initial training sample set; deleting invalid characters in each historical recommended news text in the initial training sample set, wherein the invalid characters comprise: title number, repeat punctuation, blank symbol, and link symbol; and performing word segmentation processing on the deleted historical recommended news texts to obtain the training sample set.
In some embodiments of the present application, in the above apparatus, the second convolutional neural network is formed based on an attention mechanism.
It should be noted that any of the above news recommending apparatuses may be in one-to-one correspondence with the above news recommending method, which is not described herein again.
Fig. 5 shows a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 5, at the hardware level, the electronic device comprises a processor, optionally together with an internal bus, a network interface, a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory (non-volatile Memory), such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, network interface, and memory may be interconnected by an internal bus, which may be an ISA (Industry Standard Architecture ) bus, a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus, or EISA (Extended Industry Standard Architecture ) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 5, but not only one bus or type of bus.
And the memory is used for storing programs. In particular, the program may include program code including computer-operating instructions. The memory may include memory and non-volatile storage and provide instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the news recommending device on a logic level. And the processor is used for executing the program stored in the memory and particularly used for executing the method.
The processor 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 in a processor or by instructions in the form of software. The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method.
The electronic device may execute the news recommending method provided in the embodiments of the present application and implement the functions of the embodiment shown in fig. 4 as the news recommending device, which is not described herein again.
The embodiments also provide a computer-readable storage medium storing one or more programs, the one or more programs including instructions, which when executed by an electronic device comprising a plurality of application programs, enable the electronic device to perform the news recommendation method provided by the embodiments of the present application.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other identical elements in a process, method, article or apparatus that comprises the element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.

Claims (10)

1. The news recommending method is characterized by being realized through a news recommending model, wherein the news recommending model comprises a first convolution neural network, a second convolution neural network and a fully-connected neural network;
the method comprises the following steps:
based on the first convolutional neural network, respectively carrying out text coding processing on the candidate news text and at least one historical news text of the user to obtain a candidate news vector and at least one historical news vector;
Based on the second convolutional neural network, performing similarity coding processing on the candidate news vector and the at least one historical news vector to obtain a user feature vector;
and determining the interest degree of the user on the candidate news text according to the candidate news vector and the user feature vector based on the fully-connected neural network, and determining whether to recommend the candidate news text to the user according to the interest degree.
2. The method of claim 1, wherein the historical news vector comprises a plurality of; the step of performing similarity coding processing on the candidate news vector and the historical news vector based on the second convolutional neural network to obtain a user feature vector, includes:
determining dot products of the candidate news vectors and the historical news vectors to obtain initial similarity of the candidate news vectors and the historical news vectors;
normalizing the initial similarity to obtain a weight corresponding to the initial similarity;
determining the product of the initial similarity and the corresponding weight to obtain the similarity of the candidate news vector and the historical news vector;
And determining the accumulated value of each similarity to obtain the user characteristic vector.
3. The method of claim 1, wherein the determining, based on the fully connected neural network, the user's interest level in the candidate news text from the candidate news vector and the user feature vector, and determining whether to recommend the candidate news text to the user from the interest level comprises:
fusing the candidate news vectors and the user feature vectors to obtain fusion vectors;
inputting the fusion vector to the fully-connected neural network to obtain the interest degree of the user on the candidate news text;
if the interestingness is greater than or equal to a preset threshold, determining to recommend the candidate news text to the user;
and if the interestingness is smaller than the preset threshold, determining that the candidate news text is not recommended to the user.
4. The method of claim 1, wherein the candidate news text includes a plurality of;
the method further comprises the steps of:
inputting a plurality of candidate news texts and at least one historical news text of the user into the news recommendation model respectively to obtain a plurality of interestingness degrees;
Sorting the candidate news texts in a descending order according to the interest degrees to obtain a sorting result;
and determining a news recommendation list of the user according to the sorting result.
5. The method of claim 1, wherein the news recommendation model is trained according to the following method:
constructing a training sample set; the training sample set comprises a plurality of groups of user data and corresponding sample labels, wherein the user data is a history recommendation news list containing a plurality of history recommendation news texts, and the sample labels are whether a user clicks the corresponding history recommendation news;
acquiring a news recommendation initial model, wherein the model comprises a first convolution neural network, a second convolution neural network and a full-connection neural network, and the first convolution neural network and the second convolution neural network are respectively connected with the full-connection neural network;
inputting the training sample set into the news recommendation initial model to obtain a plurality of predicted values;
and training the news recommendation initial model for multiple times according to a logistic regression loss function based on the plurality of predicted values and the sample labels to obtain a news recommendation model.
6. The method of claim 5, wherein the constructing a training sample set comprises:
acquiring an initial training sample set;
deleting invalid characters in each historical recommended news text in the initial training sample set, wherein the invalid characters comprise: title number, repeat punctuation, blank symbol, and link symbol;
and performing word segmentation processing on the deleted historical recommended news texts to obtain the training sample set.
7. The method of any one of claims 1-6, wherein the second convolutional neural network is formed based on an attention mechanism.
8. A news recommender, wherein a news recommendation model is deployed for the news recommender, the news recommendation model comprising a first convolutional neural network, a second convolutional neural network, and a fully-connected neural network;
the device comprises:
the text coding unit is used for respectively carrying out text coding processing on the candidate news text and at least one historical news text of the user based on the first convolutional neural network to obtain a candidate news vector and at least one historical news vector;
the similarity coding unit is used for carrying out similarity coding processing on the candidate news vectors and the at least one historical news vector based on the second convolutional neural network to obtain user feature vectors;
And the prediction unit is used for determining the interest degree of the user on the candidate news text according to the candidate news vector and the user feature vector based on the fully-connected neural network, and determining whether to recommend the candidate news text to the user according to the interest degree.
9. An electronic device, comprising:
a processor; and
a memory arranged to store computer executable instructions which, when executed, cause the processor to perform the steps of the news recommendation method of any of claims 1 to 7.
10. A computer readable storage medium storing one or more programs, which when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform the steps of the news recommendation method of any one of claims 1-7.
CN202310452697.5A 2023-04-17 2023-04-17 News recommendation method, device, electronic equipment and computer readable storage medium Pending CN116467523A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310452697.5A CN116467523A (en) 2023-04-17 2023-04-17 News recommendation method, device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310452697.5A CN116467523A (en) 2023-04-17 2023-04-17 News recommendation method, device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116467523A true CN116467523A (en) 2023-07-21

Family

ID=87180499

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310452697.5A Pending CN116467523A (en) 2023-04-17 2023-04-17 News recommendation method, device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116467523A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116911304A (en) * 2023-09-12 2023-10-20 深圳须弥云图空间科技有限公司 Text recommendation method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116911304A (en) * 2023-09-12 2023-10-20 深圳须弥云图空间科技有限公司 Text recommendation method and device
CN116911304B (en) * 2023-09-12 2024-02-20 深圳须弥云图空间科技有限公司 Text recommendation method and device

Similar Documents

Publication Publication Date Title
CN109344406B (en) Part-of-speech tagging method and device and electronic equipment
US20160170982A1 (en) Method and System for Joint Representations of Related Concepts
CN112231569B (en) News recommendation method, device, computer equipment and storage medium
CN109325146B (en) Video recommendation method and device, storage medium and server
CN110990560B (en) Judicial data processing method and system
CN112347787A (en) Method, device and equipment for classifying aspect level emotion and readable storage medium
CN112163149B (en) Method and device for recommending message
CN112667782A (en) Text classification method, device, equipment and storage medium
CN113032525A (en) False news detection method and device, electronic equipment and storage medium
CN111401062A (en) Text risk identification method, device and equipment
CN116467523A (en) News recommendation method, device, electronic equipment and computer readable storage medium
CN112507724A (en) Word weight determination method, device, server and computer readable storage medium
CN116401466A (en) Book classification recommendation method and system
CN116469110A (en) Image classification method, device, electronic equipment and computer readable storage medium
CN117056575B (en) Method for data acquisition based on intelligent book recommendation system
CN112017777B (en) Method and device for predicting similar pair problem and electronic equipment
CN116610872B (en) Training method and device for news recommendation model
CN116611497B (en) Click rate estimation model training method and device
CN114564958B (en) Text recognition method, device, equipment and medium
CN113704466B (en) Text multi-label classification method and device based on iterative network and electronic equipment
Meng et al. Variational Bayesian representation learning for grocery recommendation
CN116578778A (en) News recommendation method, device, electronic equipment and computer readable storage medium
CN113076453A (en) Domain name classification method, device and computer readable storage medium
CN112417290A (en) Training method of book sorting push model, electronic equipment and storage medium
CN110990522B (en) Legal document determining method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination