Content recommendation method and device, equipment and medium
By employing parallel retrieval and dynamic weight fusion technologies, the problems of inaccuracy and high cost in information retrieval from massive knowledge bases have been solved, achieving efficient and accurate content recommendation.
Patent Information
- Application Number
- CN202512045959.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies suffer from inaccurate search results and high deployment costs of complex graph neural network models when retrieving information from massive knowledge bases. Furthermore, hybrid recommendation schemes fail to effectively integrate the confidence differences between different retrieval tools.
A parallel retrieval method is adopted, which combines statistical feature retrieval, semantic embedding retrieval and preset content association graph retrieval. The confidence information of each retrieval method is integrated through dynamic weight fusion to generate a comprehensive score and ranking.
It improves search accuracy and speed, enables efficient and precise mixed content retrieval, deeply explores user needs, and reduces deployment costs.
Smart Images

Figure CN121765140A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of information retrieval and recommendation, and in particular to methods, apparatus, devices and media for content recommendation. Background Technology
[0002] With the research and development and deployment of new-generation information technologies, organizations around the world have stored massive amounts of data. When users retrieve information from this data according to their own needs, there are problems such as a large amount of knowledge data but a single database category. At the same time, there are problems such as inaccurate search results due to information exchange errors between humans and machines. How to filter useful data from the massive knowledge base based on the limited information provided by users and provide priority ranking is one of the key tasks that the field of intelligent recommendation needs to solve.
[0003] Existing hybrid recommendation schemes typically fuse results from different retrieval systems using linear weighting or cascading methods. However, these weights are often statically set, failing to consider the confidence differences within a single retrieval system (e.g., the first-ranked result should have different weights than the tenth-ranked result). Furthermore, while complex graph neural network models are highly effective, their deployment costs limit their practicality. Therefore, a general recommendation method is needed that can efficiently fuse multi-source signals, capture complex content relationships at a lower cost, and possess good interpretability. Summary of the Invention
[0004] This application provides a content recommendation method, apparatus, device, and medium that can improve the accuracy of recommended content, increase response speed, and improve recommendation efficiency.
[0005] On the one hand, embodiments of this application provide a content recommendation method, the method including:
[0006] In response to a user's query request, obtain the query information;
[0007] Based on the query information, the candidate recommended content is retrieved in parallel to obtain at least two ordered lists. The parallel retrieval includes at least two of the following: statistical feature retrieval, semantic embedding retrieval, and preset content association graph retrieval. The ordered lists include multiple candidate recommended content.
[0008] The dynamic weights corresponding to the internal rankings of the ordered list are combined with the preset static weights to obtain a comprehensive score for each candidate recommendation content.
[0009] The candidate recommended content is sorted according to the comprehensive score to generate a final recommendation list, and content is recommended according to the final recommendation list, wherein the final recommendation list is used to represent the order in which the recommended content is pushed.
[0010] Optionally, statistical feature retrieval is performed on the candidate recommended content to obtain a first ordered list corresponding to the candidate recommended content, including:
[0011] The query information is preprocessed to obtain multiple query terms;
[0012] Statistical features are extracted for each query term and each candidate recommendation content to obtain statistical features, including term frequency, document length, and inverse document frequency.
[0013] For each candidate recommendation, a first relevance score between each candidate recommendation and the query term is determined based on the statistical features and the preset relevance algorithm.
[0014] Sort all primary relevance scores and select a preset number of target candidate recommendations;
[0015] Based on the preset number of target candidate recommendations, a first ordered list is generated.
[0016] Optionally, semantic embedding retrieval is performed on the candidate recommendation content to obtain a second ordered list corresponding to the candidate recommendation content, including:
[0017] The query information is vector-encoded to obtain a semantic vector;
[0018] In a preset vector library, based on a preset semantic similarity algorithm, the similarity between the semantic vector and the preset document vector is determined to obtain a second relevance score;
[0019] Using a preset approximate nearest neighbor search algorithm, find multiple candidate vectors that are similar to the semantic vector;
[0020] A second ordered list is generated based on the multiple candidate vectors.
[0021] Optionally, a preset content association graph retrieval is performed on the candidate recommended content to obtain a third ordered list corresponding to the candidate recommended content, including:
[0022] The query information is subjected to keyword extraction to obtain a query keyword set, which includes multiple query keywords;
[0023] The set of query keywords is vectorized to obtain a personalized vector;
[0024] The personalized vector is used as the initial propagation seed and input into the preset content association graph. The preset content association graph performs personalized association propagation based on the personalized vector to obtain the third relevance score corresponding to each candidate recommended content.
[0025] Based on the third relevance score and the preset score, multiple candidate recommended contents are filtered to obtain a third ordered list.
[0026] Optionally, the personalized vector is used as an initial propagation seed and input into the preset content association graph. The preset content association graph performs personalized association propagation based on the personalized vector to obtain a third relevance score corresponding to each candidate recommended content, including:
[0027] Starting from the personalized vector, iterative calculations are performed using a preset iterative propagation formula to obtain the probability score of the personalized vector;
[0028] If the difference between the results of two iterations is less than a preset threshold, the current probability score is used as the third relevance score.
[0029] Optionally, before performing a preset content association graph retrieval on the candidate recommended content to obtain a third ordered list corresponding to the candidate recommended content, the method further includes:
[0030] Obtain a node set, which includes document nodes and keyword nodes. The document nodes include multiple candidate recommendation articles, and the keyword nodes include multiple keywords.
[0031] An edge set is constructed based on the document node and the keyword node. The edge set includes membership edges and co-occurrence edges. The membership edges are used to represent the connection between the keyword node and the document node, and the co-occurrence edges are used to represent the connection between the keyword nodes.
[0032] Based on the node set, edge set, and preset probability transition matrix, a preset content association graph is constructed.
[0033] Optionally, the ordered list includes a first ordered list, a second ordered list, and a third ordered list, wherein the first ordered list is obtained based on statistical feature retrieval, the second ordered list is obtained based on semantic embedding retrieval, and the third ordered list is obtained based on the preset content association graph.
[0034] Before fusing the dynamic weights corresponding to the internal rankings of the ordered list with preset static weights to obtain a comprehensive score for each candidate recommendation, the method further includes:
[0035] The original scores of the candidate recommended content are determined using a preset minimum-maximum normalization algorithm.
[0036] For the first ordered list, the second ordered list, and the third ordered list, a dynamic weight is assigned using an explicit decay function;
[0037] Based on the dynamic weights and the preset static weights, the final weight corresponding to each candidate recommendation content is determined;
[0038] The step of fusing the dynamic weights corresponding to the internal rankings of the ordered list with preset static weights to obtain a comprehensive score for each candidate recommendation content includes:
[0039] The comprehensive score corresponding to each candidate recommendation is determined by multiplying the preset indicator function and the final weight.
[0040] On the other hand, embodiments of this application provide a content recommendation device, the device comprising:
[0041] The acquisition module is used to acquire the query information in response to a query request input by the user;
[0042] The parallel retrieval module is used to perform parallel retrieval of candidate recommended content based on the query information to obtain at least two ordered lists. The parallel retrieval includes at least two of the following: statistical feature retrieval, semantic embedding retrieval, and preset content association graph retrieval. The ordered lists include multiple candidate recommended content.
[0043] The fusion module is used to fuse the dynamic weights corresponding to the internal rankings of the ordered list with preset static weights to obtain a comprehensive score for each candidate recommendation content.
[0044] The sorting module is used to sort the candidate recommended content according to the comprehensive score and generate a final recommendation list, so as to recommend content according to the final recommendation list, wherein the final recommendation list is used to represent the order in which the recommended content is pushed.
[0045] In another aspect, embodiments of this application provide an electronic device, the device including: a processor and a memory storing computer program instructions;
[0046] When the processor executes the computer program instructions, it implements the content recommendation method as described in the first aspect.
[0047] In another aspect, embodiments of this application provide a computer storage medium on which computer program instructions are stored, which, when executed by a processor, implement the content recommendation method as described in the first aspect.
[0048] The content recommendation method, apparatus, device, and medium of this application embodiment can obtain at least two ordered lists by performing at least two parallel searches among statistical feature retrieval, semantic embedding retrieval, and preset content association graph retrieval based on query information. It retrieves query information from three aspects: features, semantics, and content, and performs diverse retrieval. In addition to static method weights, it introduces dynamic decay weights to more finely utilize the confidence information of each retrieval method, thereby improving fusion accuracy and fast response. It not only improves retrieval speed but also deeply explores the needs of query information. Through the implicit association formed by shared keywords in the preset content association graph, it improves retrieval accuracy and achieves efficient, accurate, and practical hybrid content retrieval. Attached Figure Description
[0049] Figure 1 This is a structural block diagram of a content recommendation system provided in an embodiment of this application;
[0050] Figure 2 This is a flowchart illustrating a content recommendation method provided in an embodiment of this application;
[0051] Figure 3 This is a structural block diagram of a content recommendation device provided in an embodiment of this application;
[0052] Figure 4 This is a schematic diagram of the electronic device provided in the embodiments of this application. Detailed Implementation
[0053] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0054] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0055] To address the problems of existing technologies, embodiments of this application provide a content recommendation method, apparatus, device, and medium. In these embodiments, at least two of the following parallel retrieval methods—statistical feature retrieval, semantic embedding retrieval, and preset content association graph retrieval—are performed based on query information to obtain at least two ordered lists. The query information is retrieved from three aspects: features, semantics, and content, employing diverse retrieval methods. Furthermore, dynamic attenuation weights are introduced on top of static method weights to more precisely utilize the confidence information of each retrieval method, improving fusion accuracy and enabling rapid response. This not only increases retrieval speed but also allows for deeper exploration of query information needs. Implicit associations formed by shared keywords in the preset content association graph further enhance retrieval accuracy, achieving efficient, accurate, and practical hybrid content retrieval.
[0056] The following section first introduces the content recommendation and retrieval system provided in the embodiments of this application. Figure 1 The following is a system architecture diagram of a content recommendation retrieval system provided in one embodiment of this application, such as... Figure 1 As shown, a content recommendation system may include:
[0057] The online retrieval service module 101, the support module 102, and the offline preprocessing module 103 are connected in communication with the support module 102 and the offline preprocessing module 103, respectively.
[0058] In this embodiment, the online retrieval service module 101 is used to respond to the user's query request and obtain query information; perform parallel retrieval of candidate recommended content based on the query information to obtain at least two ordered lists, wherein the parallel retrieval includes at least two of statistical feature retrieval, semantic embedding retrieval, and preset content association graph retrieval, and the ordered lists include multiple candidate recommended content; the dynamic weights corresponding to the internal rankings of the ordered lists are fused with preset static weights to obtain a comprehensive score corresponding to each candidate recommended content; the candidate recommended content is sorted according to the comprehensive score to generate a final recommendation list, and content is recommended according to the final recommendation list, wherein the final recommendation list is used to represent the order in which the recommended content is pushed.
[0059] The support module 102 includes a cache manager and a weight configuration manager. The cache manager is used to provide cached documents for the online retrieval service module, and the weight configuration manager is used to provide dynamic weights for the online retrieval service module.
[0060] The offline preprocessing module 103 is used to clean and preprocess documents in the document library, and provides a document vector library and graph structure files for the online retrieval service module 101.
[0061] In this embodiment of the application, the offline preprocessing module 103 is responsible for completing all computationally intensive tasks. The semantic embedding computation module uses a pre-trained encoder model (such as BGE or BERT) to encode each document d in the candidate content set D=d1,d2,...,dN into a fixed-dimensional semantic vector E(d) and persists it for storage.
[0062] Keyword graph construction module: Extracts key terms from content set D to construct keyword-content heterogeneity graph G (see Section 0053 for details). This graph is also stored serially.
[0063] The online search service module is responsible for responding to real-time queries. Among them, the multi-parallel search module receives the user query Q and executes three-way searches in parallel.
[0064] Dynamic weighted fusion ranking module: Based on the fusion strategy proposed in this application, the three-way retrieval results are fused and re-ranked.
[0065] Output module: Returns the final sorted list of recommendations, R.
[0066] The content recommendation method provided in the embodiments of this application is described below.
[0067] Figure 2 A flowchart illustrating a content recommendation method provided in one embodiment of this application is shown. Figure 2 As shown, content recommendation methods may include S201-S204:
[0068] S201, in response to the user's query request, obtain the query information.
[0069] In this embodiment of the application, the user inputs query information through an electronic device, and the system responds to the query request input by the user and obtains the query information input by the user. The query information can be the document that the user wants to query, and may include time, content, attributes, name and format, which are not limited here.
[0070] S202, perform parallel retrieval of candidate recommended content based on query information to obtain at least two ordered lists.
[0071] In this embodiment, to obtain more accurate recommended content that the user wants to query, the system performs parallel retrieval based on the query information. The parallel retrieval includes at least two of the following: statistical feature retrieval, semantic embedding retrieval, and preset content association graph retrieval. A comprehensive retrieval is performed from multiple aspects to obtain multiple ordered lists, which are then fused to obtain recommended content that matches the user's query. The ordered list may include multiple candidate recommended content. The candidate recommended content can be documents, tables, or drawings, and there is no limitation here. For ease of understanding, the following explanation will use documents as the candidate recommended content.
[0072] S203: The dynamic weights corresponding to the internal rankings of the ordered list are combined with the preset static weights to obtain a comprehensive score for each candidate recommendation.
[0073] In this embodiment of the application, a dynamic weighted fusion mechanism is set up. On the basis of static method weights, a dynamic decay weight based on ranking is introduced. The higher the ranking of the result, the greater its contribution to the comprehensive score, thereby making more precise use of the confidence information of each retrieval method.
[0074] S204: Sort the candidate recommendations based on the comprehensive score and generate a final recommendation list for content recommendation.
[0075] In this embodiment, the final recommendation list represents the order in which recommended content is pushed. By performing at least two parallel searches—statistical feature retrieval, semantic embedding retrieval, and preset content association graph retrieval—based on the query information, at least two ordered lists are obtained. The query information is retrieved from three aspects: features, semantics, and content, employing diverse retrieval methods. Furthermore, dynamic decay weights are introduced on top of static method weights to more precisely utilize the confidence information of each retrieval method, improving fusion accuracy and enabling rapid response. This not only increases retrieval speed but also allows for deeper exploration of query information needs. Implicit associations formed by shared keywords in the preset content association graph further enhance retrieval accuracy, achieving efficient, accurate, and practical hybrid content retrieval to precisely obtain the content the user wants to query.
[0076] In some other embodiments, on the retrieval path based on statistical features, S202 may include:
[0077] The query information is preprocessed to obtain multiple query terms;
[0078] Statistical features are extracted for each query term and candidate recommendation content. These statistical features include term frequency, document length, and inverse document frequency.
[0079] For each candidate recommendation, a first relevance score between each candidate and the query term is determined based on statistical features and a preset relevance algorithm.
[0080] Sort all primary relevance scores and select a preset number of target candidate recommendations;
[0081] Based on a preset number of target candidate recommendations, a first ordered list is generated.
[0082] In this embodiment of the application, after obtaining the query information, the query information can be cleaned and segmented to obtain multiple query terms t. The multiple query terms are then set together to obtain the query term set Q. Necessary stop word removal and stemming processes are then performed to prepare standardized terms for subsequent calculations.
[0083] Then, statistical features are extracted for each query term t and candidate recommended document d to obtain term frequency, document length, and inverse document frequency. Term frequency represents the number of times query term t appears in candidate recommended document d, document length is the total number of terms in the candidate recommended document, and inverse document frequency measures the discriminative power of query term t in the entire document set. The specific calculation formula is as follows:
[0084]
[0085] Where N is the total number of documents, and n(t) is the number of documents containing the query term t.
[0086] After obtaining the above statistical characteristics, the BM25 algorithm can be used to calculate the first relevance score between the candidate recommended document and the query term for each candidate recommended document d. The specific formula is as follows:
[0087]
[0088] Where t is a term in query Q; f(t, d) is the term frequency of term t in document d; |d| is the length of document d; avgdl is the average length of the document set; IDF(t) is the inverse document frequency; k1 and b are adjustment parameters, usually k1∈[1.2,2.0], b=0.75.
[0089] After obtaining the first relevance score for each candidate recommended document, the candidate recommended documents can be sorted in descending order, and a preset number of target candidate recommended contents can be selected to generate a first ordered list. The preset number can be set manually.
[0090] Among them, the retrieval return is based on The formula for sorting the first ordered list in descending order is:
[0091]
[0092] in, Let Q be the ordered list returned by the statistical feature retrieval, and D be the set of candidate documents. The length of the result list returned by the statistical feature retrieval. This represents the original score of document d obtained based on statistical feature retrieval.
[0093] In some other embodiments, on the retrieval path based on semantic embedding retrieval, S202 may include:
[0094] The query information is vector-encoded to obtain a semantic vector.
[0095] In the preset vector library, based on the preset semantic similarity algorithm, the similarity between the semantic vector and the preset document vector is determined to obtain the second relevance score;
[0096] Using a pre-defined approximate nearest neighbor search algorithm, multiple candidate vectors similar to the semantic vector are found.
[0097] A second ordered list is generated based on multiple candidate vectors.
[0098] In this embodiment, an ordered list can be generated by calculating the similarity between the query terms and candidate recommended documents in the semantic space. Specifically, an encoder can first be used to encode the query information to obtain the semantic information. Then, based on a preset semantic similarity algorithm, the cosine similarity between the semantic vector and the preset document vector in the preset vector library can be determined to determine the second relevance score.
[0099] Among them, the pre-set vector library can be used in the offline preprocessing stage, and the pre-trained encoder model can be used to generate candidate recommendation content sets D=d1,d2,...,d N Each document d in the dataset is encoded as a fixed-dimensional semantic vector E(d) and persistently stored.
[0100] In this embodiment, the preset semantic similarity algorithm can calculate the second relevance score based on the following formula:
[0101]
[0102] Where E(·) is the encoding function, using a pre-trained language model (such as BGE, BERT); E(Q) is the semantic vector of the query; E(d) is the semantic vector of the document (pre-computed); · represents the vector dot product; ‖·‖ represents the L2 norm; the cosine similarity ranges from [-1, 1], and the higher the value, the closer the directions in the semantic space are, that is, the stronger the semantic relevance.
[0103] In this embodiment, to improve the retrieval efficiency of the large vector set, an approximate nearest neighbor search algorithm (such as HNSW, IVF, etc.) is typically used to quickly find the nearest neighbor. The most similar candidate vector. Then, candidate documents are ranked according to their similarity scores. Sort in descending order.
[0104] The search returned by sorted in descending order List :
[0105]
[0106] in, Let Q be the ordered list returned by semantic embedding retrieval, and D be the set of candidate documents. The length of the result list returned by semantic embedding retrieval. This is the original score of document d obtained based on semantic embedding retrieval.
[0107] The second ordered list obtained through the above method allows for a deeper understanding of the user's query needs, ensuring that the recommended content is more accurate.
[0108] In some other embodiments, the retrieval path based on a preset content association graph may include, in step S202:
[0109] Keyword extraction is performed on the query information to obtain a set of query keywords, which includes multiple query keywords;
[0110] Vectorize the set of query keywords to obtain personalized vectors;
[0111] The personalized vector is used as the initial propagation seed and input into the preset content association graph. The preset content association graph performs personalized association propagation based on the personalized vector to obtain the third relevance score corresponding to each candidate recommended content.
[0112] Based on the third relevance score and the preset score, multiple candidate recommended content are filtered to obtain a third ordered list.
[0113] In this embodiment, the query information can be processed to extract a set of keywords. It can transform natural language queries into entity nodes that can be located in a pre-defined knowledge graph or network of connections.
[0114] The query keywords are then converted into personalized vectors, which are used as input to a predefined content association graph. This means the keyword set is used as a seed set, and a personalized PageRank (PR) algorithm is run on the predefined content association graph. The personalized vectors can be:
[0115]
[0116] Specifically, the personalized vector is used as the initial propagation seed and input into a preset content association graph. The preset content association graph performs personalized association propagation based on the personalized vector, obtaining a third relevance score for each candidate recommendation content, including:
[0117] Starting with the personalized vector, the probability score of the personalized vector is obtained by iterative calculation using a preset iterative propagation formula.
[0118] If the difference between the results of two iterations is less than a preset threshold, the current probability score is used as the third relevance score.
[0119] In this embodiment, the preset content association graph is initialized, that is... Then, iterative propagation is performed. For l=0,1,2,..., the preset iterative propagation formula is executed as follows:
[0120]
[0121] in, This is a damping factor that controls the probability of returning to the seed node in each iteration, ensuring that propagation revolves around the query keyword. A preset probability transition matrix is used to propagate the value of a node to its neighborhood along the edge.
[0122] Convergence condition: When PR is stable, take After iterative convergence, the stable PR value of each document node d represents its relationship with the query keyword set T. Q The strength of association within the graph structure is defined as the third relevance score, where the PageRank (PR) value represents the overall strength of the document's association with the query keyword set through the graph structure. This score considers not only direct keyword matching but also indirect relevance transmitted through paths such as common keywords and second-order associations.
[0123] The search returned the third ordered list in descending order:
[0124]
[0125] in, This is an ordered list returned by a search based on a predefined content association graph, where Q represents the user query and D represents the set of candidate documents. The length of the result list returned by the search based on the preset content association graph. This is the original score of document d obtained based on the preset content association graph retrieval.
[0126] To accurately obtain the third ordered list, before S202, the method may also include:
[0127] Retrieve a set of nodes, which includes document nodes and keyword nodes. The document nodes include multiple candidate recommendation articles, and the keyword nodes include multiple keywords.
[0128] An edge set is constructed based on document nodes and keyword nodes. The edge set includes membership edges and co-occurrence edges. Membership edges are used to represent the connection between keyword nodes and document nodes, and co-occurrence edges are used to represent the connection between keyword nodes.
[0129] Based on the node set, edge set, and preset probability transition matrix, a preset content association graph is constructed.
[0130] In this embodiment, a preset content association graph is constructed by obtaining a set of nodes and a set of edges, wherein the set of nodes includes document nodes. This corresponds to the content of N documents in the document collection, and the keyword nodes: This corresponds to the M core keywords extracted from the document set.
[0131] Furthermore, an edge set can be constructed based on document nodes and keyword nodes. The edge set includes membership edges and co-occurrence edges. Membership edges are used to represent the connection between keyword nodes and document nodes, and co-occurrence edges are used to represent the connection between keyword nodes.
[0132] Specifically, belonging to the edge: When keywords Appears in document Establish connection in the middle, weight
[0133] Co-occurrence edge: A link is established when two keywords frequently co-occur in multiple documents, and the weight is determined accordingly. .
[0134] In this embodiment, the preset content association graph is stored in the form of an adjacency matrix or an adjacency list, and the adjacency matrix representation of the graph is defined as follows:
[0135]
[0136] Where: N: number of document nodes; M: number of keyword nodes; A[i,j]: edge weight from node j to node i.
[0137] The preset probability transition matrix is obtained by column normalization:
[0138]
[0139] A predefined content association graph is constructed using the aforementioned predefined probability transition matrix, node set, and edge set.
[0140] In some other embodiments, when performing a retrieval using the above three retrieval paths, before S203, the method may further include:
[0141] Before fusing the dynamic weights corresponding to the internal rankings of the ordered list with the preset static weights to obtain the comprehensive score for each candidate recommendation, the method also includes:
[0142] The original scores of candidate recommended content are determined using a pre-defined minimum-maximum normalization algorithm.
[0143] For the first ordered list, the second ordered list, and the third ordered list, a dynamic weight is assigned using an explicit decay function;
[0144] The final weight for each candidate recommendation is determined based on dynamic weights and preset static weights.
[0145] The dynamic weights corresponding to the internal rankings of the ordered list are combined with preset static weights to obtain a comprehensive score for each candidate recommendation, including:
[0146] The comprehensive score for each candidate recommendation is determined by multiplying the preset indicator function and the final weight.
[0147] In this embodiment, in order to dynamically merge the first, second, and third ordered lists of the three retrieval paths to obtain the final ordered list, the original scores obtained by each retrieval method can first be mapped to the [0,1] interval to eliminate the influence of units, and min-max normalization can be used:
[0148]
[0149] in, Document d represents the method The original score.
[0150] After normalization, And it maintains the relative order of the original list.
[0151] In other embodiments, within the same retrieval method, results ranked higher have higher confidence. Therefore, for a list... The ranking is Documents are assigned dynamic weights This weight decays with ranking. This scheme uses a linear decay function:
[0152]
[0153] This means that the document ranked number 1 receives weight. Ranked The document receives a weight of 1.
[0154] Assign fixed static weights to the three retrieval methods. ,satisfy These weights can be obtained through grid search or learning on the validation set, reflecting the degree of prior reliance on different retrieval methods.
[0155] For any candidate document Its final overall score Its ranking is determined by its normalized score in each list, dynamic ranking weight, and method static weight.
[0156]
[0157] in, For indicator functions, when Appear in list The value is 1 if it is in the middle, and 0 otherwise. for exist The ranking in the middle.
[0158] In this embodiment of the application, all candidate recommended documents are sorted in descending order according to the calculated comprehensive score S(d) to generate the final recommendation list R:
[0159]
[0160] in, This indicates sorting by score in descending order. This means taking the first N elements.
[0161] Based on the content recommendation method provided in the above embodiments, this application also provides specific implementations of a content recommendation device. Please refer to the following embodiments.
[0162] First see Figure 3 The content recommendation device 300 provided in this application embodiment may include:
[0163] The acquisition module 301 is used to acquire query information in response to a user's input query request;
[0164] The parallel retrieval module 302 is used to perform parallel retrieval of candidate recommended content based on query information to obtain at least two ordered lists. The parallel retrieval includes at least two of the following: statistical feature retrieval, semantic embedding retrieval, and preset content association graph retrieval. The ordered lists include multiple candidate recommended content.
[0165] The fusion module 303 is used to fuse the dynamic weights corresponding to the internal rankings of the ordered list with the preset static weights to obtain a comprehensive score for each candidate recommendation content.
[0166] The sorting module 304 is used to sort the candidate recommended content according to the comprehensive score and generate a final recommendation list, so as to recommend content according to the final recommendation list. The final recommendation list is used to represent the order in which the recommended content is pushed.
[0167] As an optional implementation, the parallel retrieval module 302 is also used for:
[0168] The query information is preprocessed to obtain multiple query terms;
[0169] Statistical features are extracted for each query term and candidate recommendation content. These statistical features include term frequency, document length, and inverse document frequency.
[0170] For each candidate recommendation, a first relevance score between each candidate recommendation and the query term is determined based on statistical features and a preset relevance algorithm.
[0171] Sort all primary relevance scores and select a preset number of target candidate recommendations;
[0172] Based on a preset number of target candidate recommendations, a first ordered list is generated.
[0173] As an optional implementation, the parallel retrieval module 302 is also used for:
[0174] The query information is vector-encoded to obtain a semantic vector;
[0175] In the preset vector library, based on the preset semantic similarity algorithm, the similarity between the semantic vector and the preset document vector is determined to obtain the second relevance score;
[0176] Using a pre-defined approximate nearest neighbor search algorithm, multiple candidate vectors similar to the semantic vector are found.
[0177] A second ordered list is generated based on multiple candidate vectors.
[0178] As an optional implementation, the parallel retrieval module 302 is also used for:
[0179] Keyword extraction is performed on the query information to obtain a set of query keywords, which includes multiple query keywords;
[0180] Vectorize the set of query keywords to obtain personalized vectors;
[0181] The personalized vector is used as the initial propagation seed and input into the preset content association graph. The preset content association graph performs personalized association propagation based on the personalized vector to obtain the third relevance score corresponding to each candidate recommended content.
[0182] Based on the third relevance score and the preset score, multiple candidate recommended content are filtered to obtain a third ordered list.
[0183] As an optional implementation, the parallel retrieval module 302 is also used for:
[0184] Starting with the personalized vector, the probability score of the personalized vector is obtained by iterative calculation using a preset iterative propagation formula.
[0185] If the difference between the results of two iterations is less than a preset threshold, the current probability score is used as the third relevance score.
[0186] As an optional implementation, the parallel retrieval module 302 is also used for:
[0187] Retrieve a set of nodes, which includes document nodes and keyword nodes. The document nodes include multiple candidate recommendation articles, and the keyword nodes include multiple keywords.
[0188] An edge set is constructed based on document nodes and keyword nodes. The edge set includes membership edges and co-occurrence edges. Membership edges are used to represent the connection between keyword nodes and document nodes, and co-occurrence edges are used to represent the connection between keyword nodes.
[0189] Based on the node set, edge set, and preset probability transition matrix, a preset content association graph is constructed.
[0190] As an optional implementation, the ordered list includes a first ordered list, a second ordered list, and a third ordered list. The first ordered list is obtained based on statistical feature retrieval, the second ordered list is obtained based on semantic embedding retrieval, and the third ordered list is obtained based on a preset content association graph retrieval. The fusion module 303 is also specifically used for:
[0191] The original scores of candidate recommended content are determined using a pre-defined minimum-maximum normalization algorithm.
[0192] For the first ordered list, the second ordered list, and the third ordered list, a dynamic weight is assigned using an explicit decay function;
[0193] The final weight for each candidate recommendation is determined based on dynamic weights and preset static weights.
[0194] The dynamic weights corresponding to the internal rankings of the ordered list are combined with preset static weights to obtain a comprehensive score for each candidate recommendation, including:
[0195] The comprehensive score for each candidate recommendation is determined by multiplying the preset indicator function and the final weight.
[0196] Figure 4 A schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application is shown.
[0197] An electronic device may include a processor 401 and a memory 402 storing computer program instructions.
[0198] Specifically, the processor 401 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0199] Memory 402 may include mass storage for data or instructions. For example, and not limitingly, memory 402 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. In one instance, memory 402 may include removable or non-removable (or fixed) media, or memory 402 may be non-volatile solid-state memory. Memory 402 may be internal or external to the integrated gateway disaster recovery device.
[0200] In one instance, memory 402 may be read-only memory (ROM). In one instance, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
[0201] Memory 402 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Therefore, generally, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described in the methods recommended according to the first aspect of this disclosure.
[0202] The processor 401 reads and executes computer program instructions stored in the memory 402 to achieve... Figure 1 The illustrated embodiment presents a content recommendation method.
[0203] In one example, the electronic device may also include a communication interface 403 and a bus 404. For example, Figure 4 As shown, the processor 401, memory 402, and communication interface 403 are connected through bus 404 and complete communication with each other.
[0204] The communication interface 403 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0205] Bus 404 includes hardware, software, or both, that couples components of an electronic device together. For example, and not as a limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 404 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.
[0206] The electronic device can execute the content recommendation method described in the embodiments of this application, thereby achieving a combination of Figure 2 Figure 3 The description recommends methods and apparatus.
[0207] Furthermore, in conjunction with the content recommendation methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the content recommendation methods in the above embodiments.
[0208] In an optional embodiment, in conjunction with the content recommendation methods in the above embodiments, this application embodiment can provide a computer program product to implement the method. The instructions in the computer program product are executed by the processor of an electronic device, enabling the electronic device to implement any of the content recommendation methods in the above embodiments.
[0209] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0210] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0211] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0212] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0213] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A content recommendation method, characterized in that, include: In response to a user's query request, obtain the query information; Based on the query information, the candidate recommended content is retrieved in parallel to obtain at least two ordered lists. The parallel retrieval includes at least two of the following: statistical feature retrieval, semantic embedding retrieval, and preset content association graph retrieval. The ordered lists include multiple candidate recommended content. The dynamic weights corresponding to the internal rankings of the ordered list are combined with the preset static weights to obtain a comprehensive score for each candidate recommendation content. The candidate recommended content is sorted according to the comprehensive score to generate a final recommendation list, and content is recommended according to the final recommendation list, wherein the final recommendation list is used to represent the order in which the recommended content is pushed.
2. The method according to claim 1, characterized in that, Statistical feature retrieval is performed on the candidate recommended content to obtain a first ordered list corresponding to the candidate recommended content, including: The query information is preprocessed to obtain multiple query terms; Statistical features are extracted for each query term and each candidate recommendation content to obtain statistical features, including term frequency, document length, and inverse document frequency. For each candidate recommendation, a first relevance score between each candidate recommendation and the query term is determined based on the statistical features and the preset relevance algorithm. Sort all primary relevance scores and select a preset number of target candidate recommendations; Based on the preset number of target candidate recommendations, a first ordered list is generated.
3. The method according to claim 2, characterized in that, Semantic embedding retrieval is performed on the candidate recommendation content to obtain a second ordered list corresponding to the candidate recommendation content, including: The query information is vector-encoded to obtain a semantic vector; In a preset vector library, based on a preset semantic similarity algorithm, the similarity between the semantic vector and the preset document vector is determined to obtain a second relevance score; Using a preset approximate nearest neighbor search algorithm, find multiple candidate vectors that are similar to the semantic vector; A second ordered list is generated based on the multiple candidate vectors.
4. The method according to claim 2 or 3, characterized in that, A preset content association graph retrieval is performed on the candidate recommended content to obtain a third ordered list corresponding to the candidate recommended content, including: The query information is subjected to keyword extraction to obtain a query keyword set, which includes multiple query keywords; The set of query keywords is vectorized to obtain a personalized vector; The personalized vector is used as the initial propagation seed and input into the preset content association graph. The preset content association graph performs personalized association propagation based on the personalized vector to obtain the third relevance score corresponding to each candidate recommended content. Based on the third relevance score and the preset score, multiple candidate recommended contents are filtered to obtain a third ordered list.
5. The method according to claim 4, characterized in that, The personalized vector is used as an initial propagation seed and input into the preset content association graph. The preset content association graph performs personalized association propagation based on the personalized vector to obtain a third relevance score corresponding to each candidate recommended content, including: Starting from the personalized vector, iterative calculations are performed using a preset iterative propagation formula to obtain the probability score of the personalized vector; If the difference between the results of two iterations is less than a preset threshold, the current probability score is used as the third relevance score.
6. The method according to claim 4, characterized in that, Before performing a preset content association graph retrieval on the candidate recommended content to obtain a third ordered list corresponding to the candidate recommended content, the method further includes: Obtain a node set, which includes document nodes and keyword nodes. The document nodes include multiple candidate recommendation articles, and the keyword nodes include multiple keywords. An edge set is constructed based on the document node and the keyword node. The edge set includes membership edges and co-occurrence edges. The membership edges are used to represent the connection between the keyword node and the document node, and the co-occurrence edges are used to represent the connection between the keyword nodes. Based on the node set, edge set, and preset probability transition matrix, a preset content association graph is constructed.
7. The method according to claim 1, characterized in that, The ordered list includes a first ordered list, a second ordered list, and a third ordered list. The first ordered list is obtained based on statistical feature retrieval, the second ordered list is obtained based on semantic embedding retrieval, and the third ordered list is obtained based on the preset content association graph. Before fusing the dynamic weights corresponding to the internal rankings of the ordered list with preset static weights to obtain a comprehensive score for each candidate recommendation, the method further includes: The original scores of the candidate recommended content are determined using a preset minimum-maximum normalization algorithm. For the first ordered list, the second ordered list, and the third ordered list, a dynamic weight is assigned using an explicit decay function; Based on the dynamic weights and the preset static weights, the final weight corresponding to each candidate recommendation content is determined; The step of fusing the dynamic weights corresponding to the internal rankings of the ordered list with preset static weights to obtain a comprehensive score for each candidate recommendation content includes: The comprehensive score corresponding to each candidate recommendation is determined by multiplying the preset indicator function and the final weight.
8. A content recommendation device, characterized in that, The device includes: The acquisition module is used to acquire the query information in response to a query request input by the user; The parallel retrieval module is used to perform parallel retrieval of candidate recommended content based on the query information to obtain at least two ordered lists. The parallel retrieval includes at least two of the following: statistical feature retrieval, semantic embedding retrieval, and preset content association graph retrieval. The ordered lists include multiple candidate recommended content. The fusion module is used to fuse the dynamic weights corresponding to the internal rankings of the ordered list with preset static weights to obtain a comprehensive score for each candidate recommendation content. The sorting module is used to sort the candidate recommended content according to the comprehensive score and generate a final recommendation list, so as to recommend content according to the final recommendation list, wherein the final recommendation list is used to represent the order in which the recommended content is pushed.
9. An electronic device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the content recommendation method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions that, when executed by a processor, implement the content recommendation method as described in any one of claims 1-7.