News recommendation method and device based on popularity and location awareness of comparative learning, equipment and medium
By adopting a popular and position perception method based on contrast learning in the news recommendation system, the problems of singularity and popularity bias of recommendation content are solved, and higher recommendation diversity and system performance are achieved.
Patent Information
- Application Number
- CN202411420378.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-03-07
AI Technical Summary
The existing news recommendation system has problems such as single-in-one recommendation content and biased popularity, which makes it difficult for users to access new fields and new opinions, the proportion of popular news is too high, and unpopular news does not receive enough attention.
Using a news recommendation method based on popularity and location perception based on contrast learning, the predicted scores of candidate news are calculated to improve the diversity and fairness of recommendations by obtaining user candidate news, retrieving similar news, coding fusion, obtaining popularity embedding and matching scores.
It improves the diversity of news recommendations, reduces the bias of popular news, improves the overall performance of the recommendation system, and ensures that users can access more new fields and new perspectives.
Smart Images

Figure CN119577234A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of information recommendation, and in particular to a popularity and location-aware news recommendation method, device, equipment and medium based on contrastive learning. Background Art
[0002] In today's era of information explosion, news recommendation systems can help users quickly find the news they are interested in among massive amounts of information. However, existing news recommendation systems mainly rely on users' browsing history for personalized recommendations. Although this method can meet users' interest needs to a certain extent, it also has many problems.
[0003] First, the recommendation method based on historical browsing history can easily lead to the homogeneity of recommended content. Users may find themselves repeatedly recommended news on similar topics or types, which limits users' opportunities to access new areas and new perspectives and lacks content diversity.
[0004] Secondly, the existing system has a popularity bias problem. Due to its high click-through rate, popular news is more likely to be captured by the recommendation system and frequently recommended, which leads to an excessively high proportion of popular news in the recommendation results. This bias makes some unpopular but equally important news not receive enough attention, thus affecting the diversity of news and users' comprehensive information acquisition.
[0005] In view of this, the applicant filed this application after studying the existing technology. Summary of the invention
[0006] The present invention provides a popularity and location-aware news recommendation method, apparatus, device and medium based on contrastive learning to improve at least one of the above technical problems.
[0007] In a first aspect, the present invention provides a popularity and location-aware news recommendation method based on contrastive learning, which comprises steps S1 to S7.
[0008] S1. Obtain candidate news for the user.
[0009] S2. Retrieve similar news based on the candidate news.
[0010] S3. Encode the candidate news and the similar news into a news embedding space and fuse them to obtain a fused news embedding representation.
[0011] S4. Obtain the click rate of the candidate news, and map the click rate to the popularity embedding space to obtain popularity embedding.
[0012] S5. Obtain popularity scores of candidate news based on the popularity embedding.
[0013] S6. Multiply the fused news embedding representation and the user vector to obtain a matching score.
[0014] S7. Obtain a predicted score of the candidate news according to the popularity score and the matching score, wherein the predicted score is used as a reference when recommending news to the user.
[0015] Preferably, the popularity and location-aware news recommendation method based on contrastive learning further includes step S8. S8, recommending news to the user according to the predicted score. Step S8 specifically includes generating a new news title through a large language model according to the candidate news and the similar news, and then recommending news to the user according to the predicted score and the new news title.
[0016] In an optional implementation, the news embedding space is obtained by regularization through contrastive learning based on popularity and location awareness. The contrastive learning based on popularity and location awareness specifically includes steps A1 to A6.
[0017] A1. Encode the news and obtain the original news embedding representation of the news in the news embedding space.
[0018] A2. Obtain the click rate of the news and map the click rate to the popularity embedding space to obtain the popularity embedding.
[0019] A3. Arrange the user's browsing history by time to generate a browsing sequence. Then encode each news position in the browsing sequence to obtain position embedding.
[0020] A4. Concatenate the popularity embedding and the position embedding into a perturbation vector, and then map the perturbation vector to the news embedding space to obtain the perturbation embedding.
[0021] A5. Perform element-wise addition on the original news embedding representation and the perturbed embedding representation to obtain the perturbed news embedding representation.
[0022] A6. The original news embedding representation and the perturbed news embedding representation are regarded as different views of the same data. The similarity between the same views is maximized and the similarity between different views is minimized through comparative learning, so as to optimize the parameters of the model and obtain the final news embedding space.
[0023] In an optional implementation, step A4 specifically includes step A41 to step A42.
[0024] A41. Concatenate popularity embedding and position embedding into a perturbation vector.
[0025] A42. Through a learnable mapping matrix, the concatenated vector is mapped to the news embedding space. The mapping process applies the hyperbolic tangent function for nonlinear transformation to generate perturbation embedding. In the formula, is the perturbation embedding, is the hyperbolic tangent function, is a learnable mapping matrix, For popularity embedding, Embed for position.
[0026] Preferably, the loss function for contrastive learning is for: In the formula, represents a set of samples in a batch, and represents the index of the sample in the batch, and Respectively represent and The original news embedding representation of samples, Indicates transposition, represents the news embedding representation after perturbation and 𝜏 is the temperature coefficient.
[0027] In an optional implementation, step S2 specifically includes steps S21 to S23.
[0028] S21. Perform natural language processing on candidate news and extract entities S22, preprocessing is performed according to the title of the candidate news, wherein the preprocessing includes word segmentation and / or removal of stop words.
[0029] S23. Retrieve similar news from a news database based on the entity and the preprocessed title.
[0030] In an optional implementation, step S3 specifically includes steps S31 to S33.
[0031] S31. Encode the candidate news to obtain a candidate embedding representation of the candidate news in a news embedding space.
[0032] S32: Encode the similar news to obtain similar embedding representations of the similar news in the news embedding space.
[0033] S33. The candidate embedding representation and the similar embedding representation are fused through a multi-head attention mechanism and a cross-attention mechanism to obtain a fused news embedding representation.
[0034] In an optional implementation, step S4 specifically includes step S41 to step S42.
[0035] S41, obtaining the click rate of the candidate news within a preset time period.
[0036] S42: Map the click rate data to the popularity embedding space through a dense layer to obtain popularity embedding.
[0037] In an optional implementation, step S5 specifically includes: mapping the popularity embedding into the range of [0, 1] through a linear transformation to generate a normalized popularity score of the candidate news.
[0038] In an optional implementation, step S7 specifically includes: weighting and summing the popularity score and the matching score according to a preset ratio to generate a predicted score for the candidate news. The weighted sum model is: In the formula, It is a hyperparameter used to control the direct weight of the two. is the matching score, is the popularity score.
[0039] In a second aspect, the present invention provides a popularity and location-aware news recommendation device based on contrastive learning, which includes a candidate news acquisition module, a similar news retrieval module, a coding fusion module, a popularity module, a first scoring module, a second scoring module and a final scoring module.
[0040] The candidate news acquisition module is used to obtain the user's candidate news.
[0041] The similar news retrieval module is used to retrieve similar news based on the candidate news.
[0042] The encoding fusion module is used to encode the candidate news and the similar news into a news embedding space and fuse them to obtain a fused news embedding representation.
[0043] The popularity module is used to obtain the click rate of the candidate news and map the click rate to the popularity embedding space to obtain the popularity embedding.
[0044] The first scoring module is used to obtain the popularity score of the candidate news according to the popularity embedding.
[0045] The second scoring module is used to multiply the fused news embedding representation and the user vector to obtain a matching score.
[0046] The final scoring module is used to obtain the predicted score of the candidate news according to the popularity score and the matching score, wherein the predicted score is used as a reference when recommending news to users.
[0047] In a third aspect, the present invention provides a news recommendation device based on popularity and location awareness of contrastive learning, comprising a processor, a memory, and a computer program stored in the memory. The computer program can be executed by the processor to implement a news recommendation method based on popularity and location awareness of contrastive learning as described in any paragraph of the first aspect.
[0048] In a fourth aspect, the present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute a popularity and location-aware news recommendation method based on comparative learning as described in any paragraph of the first aspect.
[0049] By adopting the above technical solution, the present invention can achieve the following technical effects: The popularity and location-aware news recommendation method based on contrastive learning of the present invention can improve the diversity of news recommendations, reduce the bias of popular news, and improve the overall performance of the recommendation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the specific implementation methods of the present invention. It should be understood that the following drawings only show certain specific implementation methods of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 It is a flowchart of the popularity and location-aware news recommendation method based on contrastive learning.
[0052] Figure 2 This is a network structure diagram of the popularity and location-aware news recommendation method based on contrastive learning. DETAILED DESCRIPTION
[0053] The technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all of the embodiments. Based on the embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0054] Example 1, please refer to Figure 1 and Figure 2The first embodiment of the present invention provides a popularity and location-aware news recommendation method based on contrastive learning, which can be performed by a popularity and location-aware news recommendation device based on contrastive learning (hereinafter referred to as: news recommendation device). In particular, it is performed by one or more processors in the news recommendation device to implement steps S1 to S7.
[0055] S1. Obtain candidate news for the user.
[0056] S2, retrieving similar news according to the candidate news. Preferably, step S2 specifically includes steps S21 to S23.
[0057] S21. Perform natural language processing on the candidate news and extract entities. Specifically, perform natural language processing on the candidate news and extract entities (such as names of people, places, and organizations). This step can utilize existing entity recognition technologies and tools, such as Spacy and Stanford NER.
[0058] S22, preprocessing is performed according to the title of the candidate news. The preprocessing includes word segmentation and / or removal of stop words. Specifically, the title of the candidate news is obtained and preprocessed, such as word segmentation, removal of stop words, etc. The preprocessed title will be used as one of the search keywords.
[0059] S23. Retrieve similar news from a news database based on the entity and the preprocessed title. Specifically, based on the extracted entity and the processed title, retrieve similar news from a news vector storage database. Vector storage can use efficient vector retrieval tools such as FAISS. The retrieval process uses the vector representation of the entity and the title to find similar news by calculating similarity (such as cosine similarity).
[0060] S3, encoding the candidate news and the similar news into the news embedding space and fusing them to obtain the fused news embedding representation. Specifically, the main purpose of this module is to retrieve related news by using entities and titles, and to fuse the candidate news and the retrieved enhanced news through a cascaded attention network to form a richer news semantic representation. Preferably, step S3 specifically includes steps S31 to S33.
[0061] S31, encoding the candidate news to obtain a candidate embedding representation of the candidate news in the news embedding space. Specifically, the encoding method may use a pre-trained BERT model, and use the last hidden state of its output as the vector representation of the news.
[0062] S32: Encode the similar news to obtain similar embedded representations of the similar news in the news embedding space. Specifically, the encoding method also uses the pre-trained BERT model.
[0063] S33. The candidate embedding representation and the similar embedding representation are fused through a multi-head attention mechanism and a cross-attention mechanism to obtain a fused news embedding representation.
[0064] Specifically, the representations of candidate news and enhanced news are input into the multi-head attention mechanism for information fusion to obtain the final news representation. The multi-head attention mechanism captures richer semantic information by paying multiple attention to different aspects of the news content. The fused news representation will more comprehensively reflect the semantic information of the news.
[0065] S4, obtaining the click rate of the candidate news, and mapping the click rate to the popularity embedding space to obtain popularity embedding. Preferably, step S4 specifically includes steps S41 to S42.
[0066] S41, obtaining the click rate of the candidate news within a preset time period.
[0067] S42: Map the click rate data to the popularity embedding space through a dense layer to obtain popularity embedding.
[0068] Specifically, the click rate of news in a period of time is counted. Click rate data can be obtained by analyzing the user's click behavior log. Then the click rate data is mapped to the popularity embedding space through a dense layer. The parameters of the dense layer are learned through training data to ensure that the mapped popularity embedding can accurately reflect the popularity of the news.
[0069] S5. Obtain the popularity score of the candidate news according to the popularity embedding. Preferably, step S5 specifically includes: mapping the popularity embedding to the range of [0,1] through linear transformation to generate a normalized popularity score of the candidate news.
[0070] S6. Multiply the fused news embedding representation and the user vector to obtain a matching score.
[0071] Specifically, a dot product operation is performed on the user vector and the candidate news vector to calculate the matching score. The user vector can be obtained by encoding according to the user's browsing history, or by encoding in other forms. Encoding to obtain the user vector is a conventional technical means for those skilled in the art, and the present invention does not specifically limit this.
[0072] S7. Obtain the predicted score of the candidate news according to the popularity score and the matching score. The predicted score is used as a reference when recommending news to users. Preferably, step S7 specifically comprises: weighting and summing the popularity score and the matching score according to a preset ratio to generate the predicted score of the candidate news. The weighted sum model is: In the formula, It is a hyperparameter used to control the direct weight of the two. is the matching score, is the popularity score.
[0073] Specifically, the preset ratio is further set between [0, 1] by those skilled in the art according to needs, and the present invention does not make any specific limitation on this.
[0074] The popularity and location-aware news recommendation method based on contrastive learning of the present invention improves the diversity of news recommendations, alleviates popularity deviation, reduces the bias of hot news, and improves the overall performance of the recommendation system by introducing entity-level retrieval enhancement and popularity and location-aware contrastive learning modules.
[0075] Preferably, the popularity and location-aware news recommendation method based on contrastive learning further includes step S8. S8, recommending news to the user according to the predicted score. Step S8 specifically includes generating a new news title through a large language model according to the candidate news and the similar news, and then recommending news to the user according to the predicted score and the new news title.
[0076] In this embodiment, accurate news headlines are regenerated based on content and entities to avoid the phenomenon of clickbait. The specific steps are as follows: content analysis is performed on the retrieved similar news to extract the core content and important information. A large-scale pre-trained language model (such as GPT-3) is used to re-describe the core content and generate news headlines that are highly matched with the content and are not misleading. The generated headlines should be able to accurately reflect the main information and theme of the news.
[0077] In an optional implementation, the news embedding space is obtained by regularization through contrastive learning based on popularity and location awareness. The contrastive learning based on popularity and location awareness specifically includes steps A1 to A6.
[0078] A1. Encode the news and obtain the original news embedding representation of the news in the news embedding space.
[0079] A2. Obtain the click rate of the news and map the click rate to the popularity embedding space to obtain the popularity embedding.
[0080] A3. Arrange the user's browsing history by time to generate a browsing sequence. Then encode each news position in the browsing sequence to obtain position embedding.
[0081] In this embodiment, the position information of the user's browsing sequence is obtained and the position embedding is generated. Specifically, the user's browsing history is arranged in chronological order to generate a browsing sequence. Then, each news position in the browsing sequence is encoded to generate a position embedding. The position encoding can adopt the position encoding method in Transformer to map the position information to a vector representation of fixed dimension through sine and cosine functions.
[0082] A4, concatenating the popularity embedding and the position embedding into a disturbance vector, and then mapping the disturbance vector to the news embedding space to obtain the disturbance embedding. Preferably, step A4 specifically includes steps A41 to A42.
[0083] A41. Concatenate popularity embedding and position embedding into a perturbation vector.
[0084] A42. Through a learnable mapping matrix, the concatenated vector is mapped to the news embedding space. The mapping process applies the hyperbolic tangent function for nonlinear transformation to generate perturbation embedding. In the formula, is the perturbation embedding, is the hyperbolic tangent function, is a learnable mapping matrix, For popularity embedding, Embed for position.
[0085] A5. Perform element-wise addition on the original news embedding representation and the perturbed embedding representation to obtain the perturbed news embedding representation.
[0086] A6. The original news embedding representation and the perturbed news embedding representation are regarded as different views of the same data. The similarity between the same views is maximized and the similarity between different views is minimized through comparative learning, so as to optimize the parameters of the model and obtain the final news embedding space.
[0087] Preferably, the loss function for contrastive learning is for: In the formula, represents a set of samples in a batch, and represents the index of the sample in the batch, and Respectively represent and The original news embedding representation of samples, Represents transposition, represents the news embedding representation after perturbation and 𝜏 is the temperature coefficient.
[0088] Specifically, by contrasting the learned loss function for back propagation and parameter update, the model parameters are optimized so that the news representation can better reflect the actual information of the news and reduce the impact of popularity bias.
[0089] Embodiment 2: The present invention provides a popularity and location-aware news recommendation device based on contrastive learning, which comprises a candidate news acquisition module, a similar news retrieval module, a coding fusion module, a popularity module, a first scoring module, a second scoring module and a final scoring module.
[0090] The candidate news acquisition module is used to obtain the user's candidate news.
[0091] The similar news retrieval module is used to retrieve similar news based on the candidate news.
[0092] The encoding fusion module is used to encode the candidate news and the similar news into a news embedding space and fuse them to obtain a fused news embedding representation.
[0093] The popularity module is used to obtain the click rate of the candidate news and map the click rate to the popularity embedding space to obtain the popularity embedding.
[0094] The first scoring module is used to obtain the popularity score of the candidate news according to the popularity embedding.
[0095] The second scoring module is used to multiply the fused news embedding representation and the user vector to obtain a matching score.
[0096] The final scoring module is used to obtain the predicted score of the candidate news according to the popularity score and the matching score, wherein the predicted score is used as a reference when recommending news to users.
[0097] Embodiment 3: The present invention provides a news recommendation device based on popularity and location awareness of contrastive learning, which includes a processor, a memory, and a computer program stored in the memory. The computer program can be executed by the processor to implement a news recommendation method based on popularity and location awareness of contrastive learning as described in any paragraph of Embodiment 1.
[0098] Embodiment 4: The present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute a popularity and location-aware news recommendation method based on comparative learning as described in any paragraph of Embodiment 1.
[0099] It is understandable that the news recommendation device may be an electronic device with computing capabilities, such as a portable notebook computer, a desktop computer, a server, a smart phone or a tablet computer.
[0100] In several embodiments provided in the embodiments of the present invention, it should be understood that the disclosed apparatus and method can also be implemented in other ways. The apparatus and method embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the apparatus, method and computer program product according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0101] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0102] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, an electronic device, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code. It should be noted that in this article, the term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such process, method, article or device. Without more constraints, an element defined by the phrase "comprising a..." does not exclude the existence of other identical elements in the process, method, article or apparatus comprising the element.
[0103] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0104] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0105] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0106] The "first\second" mentioned in the embodiments is only to distinguish similar objects, and does not represent a specific order for the objects. It is understandable that the "first\second" can be interchanged with the specific order or sequence where permitted. It should be understood that the objects distinguished by "first\second" can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than those illustrated or described herein.
[0107] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A popularity and location-aware news recommendation method based on contrastive learning, characterized in that: Include: Get the user's candidate news; Retrieving similar news based on the candidate news; Encoding the candidate news and the similar news into a news embedding space and fusing them to obtain a fused news embedding representation; Obtaining the click rate of the candidate news, and mapping the click rate to a popularity embedding space to obtain popularity embedding; Obtaining popularity scores of candidate news according to the popularity embedding; Multiplying the fused news embedding representation and the user vector to obtain a matching score; The predicted score of the candidate news is obtained according to the popularity score and the matching score; wherein the predicted score is used as a reference when recommending news to the user.
2. A popularity and location-aware news recommendation method based on contrastive learning according to claim 1, characterized in that: The news embedding space is obtained by regularization through contrastive learning based on popularity and location awareness; the contrastive learning based on popularity and location awareness specifically includes: Encode the news and obtain the original news embedding representation of the news in the news embedding space; Get the click rate of the news, and map the click rate to the popularity embedding space to obtain the popularity embedding; Arrange the user's browsing history by time to generate a browsing sequence; then encode each news position in the browsing sequence to obtain position embedding; The popularity embedding and the position embedding are concatenated into a perturbation vector, and then the perturbation vector is mapped to the news embedding space to obtain the perturbation embedding; Performing element-wise addition of the original news embedding representation and the perturbed embedding representation to obtain a perturbed news embedding representation; The original news embedding representation and the perturbed news embedding representation are regarded as different views of the same data. The similarity between the same views is maximized and the similarity between different views is minimized through comparative learning, so as to optimize the parameters of the model and obtain the final news embedding space.
3. A popularity and location-aware news recommendation method based on contrastive learning according to claim 2, characterized in that: The popularity embedding and the position embedding are concatenated into a perturbation vector, and then the perturbation vector is mapped to the news embedding space to obtain the perturbation embedding, which specifically includes: Concatenate popularity embedding and position embedding into a perturbation vector; Through a learnable mapping matrix, the concatenated vector is mapped to the news embedding space. The mapping process applies the hyperbolic tangent function for nonlinear transformation to generate perturbation embedding; In the formula, is the perturbation embedding, is the hyperbolic tangent function, is a learnable mapping matrix, For popularity embedding, Embed for position.
4. The popularity and location-aware news recommendation method based on contrastive learning according to claim 2, characterized in that: Loss Function for Contrastive Learning for: In the formula, represents a set of samples in a batch, and represents the index of the sample in the batch, and Respectively represent and The original news embedding representation of samples, Indicates transposition, represents the news embedding representation after perturbation and 𝜏 is the temperature coefficient.
5. The popularity and location-aware news recommendation method based on contrastive learning according to claim 1, characterized in that: Retrieving similar news according to the candidate news specifically includes: Perform natural language processing on candidate news and extract entities Preprocessing is performed according to the title of the candidate news; wherein the preprocessing includes word segmentation and / or removal of stop words; Retrieve similar news from a news database based on the entity and the preprocessed title.
6. The popularity and location-aware news recommendation method based on contrastive learning according to claim 1, characterized in that: Encoding the candidate news and the similar news into the news embedding space and fusing them to obtain a fused news embedding representation, specifically including: Encoding the candidate news to obtain a candidate embedding representation of the candidate news in a news embedding space; Encoding the similar news to obtain similar embedding representations of the similar news in the news embedding space; The candidate embedding representation and the similar embedding representation are fused through a multi-head attention mechanism and a cross-attention mechanism to obtain a fused news embedding representation.
7. The popularity and location-aware news recommendation method based on contrastive learning according to claim 1, characterized in that: Obtaining the click rate of the candidate news, and mapping the click rate to the popularity embedding space to obtain popularity embedding, specifically includes: Obtaining the click rate of the candidate news within a preset time period; Mapping the click rate data to the popularity embedding space through a dense layer to obtain popularity embedding; According to the popularity embedding, obtaining the popularity score of the candidate news, specifically comprising: mapping the popularity embedding to a range of [0,1] through a linear transformation to generate a normalized popularity score of the candidate news; According to the popularity score and the matching score, the predicted score of the candidate news is obtained, specifically including: The popularity score and the matching score are weighted and summed according to a preset ratio to generate a predicted score for the candidate news; wherein the weighted sum model is: In the formula, It is a hyperparameter used to control the direct weight of the two. is the matching score, is the popularity score; The popularity and location-aware news recommendation method based on contrastive learning also includes: generating new news titles through a large language model according to the candidate news and the similar news.
8. A news recommendation device based on popularity and location awareness based on contrastive learning, characterized in that: Include: A candidate news acquisition module is used to acquire candidate news for users; A similar news retrieval module, used for retrieving similar news based on the candidate news; An encoding fusion module, used for encoding the candidate news and the similar news into a news embedding space and fusing them to obtain a fused news embedding representation; A popularity module, used to obtain the click rate of the candidate news, and map the click rate to the popularity embedding space to obtain popularity embedding; A first scoring module, configured to obtain a popularity score of the candidate news according to the popularity embedding; A second scoring module, used for multiplying the fused news embedding representation and the user vector to obtain a matching score; The final scoring module is used to obtain the predicted score of the candidate news according to the popularity score and the matching score; wherein the predicted score is used as a reference when recommending news to users.
9. A news recommendation device based on popularity and location awareness based on contrastive learning, characterized in that: It includes a processor, a memory, and a computer program stored in the memory; the computer program can be executed by the processor to implement a popularity and location-aware news recommendation method based on contrastive learning as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute a popularity and location-aware news recommendation method based on contrastive learning as described in any one of claims 1 to 7.