Conversation recommendation method, system, electronic device and storage medium
By constructing a time stamp session graph and global graph, computing node feature correlation and weights, and generating combined recommendation representations, the problem of dynamic changes in user interests in session recommendations is solved, and the accuracy and fit of recommendations are improved.
Patent Information
- Application Number
- CN202510827948.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-06-20
AI Technical Summary
The prior art ignores dynamic changes and time information of user interests in session recommendations, resulting in low correlation between recommended content and user needs and inability to completely recommend content that users are interested in.
By constructing a time-sequential session graph and an undirected global graph based on timestamps, node features are extracted and the correlation degree of neighbor node information is calculated, user dynamic interest information is generated, node feature weights are calculated using in-degree and out-degree time interval matrices, prediction models are constructed and cross-entropy loss function training is performed, and combination recommendation representations are finally generated.
It realizes the recommendation of content that meets user interests based on a longer session sequence, improves the degree of recommendations, and can dynamically adapt to changes in user interests.
Smart Images

Figure CN120372096B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of recommendation systems, and in particular to a conversation recommendation method, system, electronic device, and storage medium. Background Art
[0002] Thanks to the development of the internet, users are constantly faced with a vast amount of information. Selecting the information that best meets their needs is a pressing issue. Recommendation algorithms have emerged in the era of big data. By analyzing individual behavior and preferences, they recommend content to users, enabling rapid retrieval.
[0003] The recommendation system analyzes user behavior and preferences based on a series of user characteristic information such as the user's previous personal interests, behaviors, social relationships, etc., and predicts the user's preference for items based on this information, and then recommends corresponding content to the user based on this.
[0004] In the field of conversation recommendation, existing technologies mainly focus on conversation sequence information. Since user interests change dynamically, the time information of clicked items is ignored, resulting in a low correlation between recommended content and user needs. In addition, when processing conversation sequences, the conversation length is often short, resulting in an inability to fully recommend content that users are interested in. Summary of the Invention
[0005] Based on this, the purpose of the present invention is to provide a conversation recommendation method, system, electronic device and storage medium to address the deficiencies in the above-mentioned prior art.
[0006] In a first aspect, the present invention provides a conversation recommendation method, the method comprising:
[0007] Get the user's single session information and historical session information;
[0008] Constructing a time-series session graph of the single session information and an undirected global graph of the historical session information based on the timestamp;
[0009] Extracting node features from the temporal session graph, aggregating neighbor node information in the undirected global graph, and sequentially propagating the neighbor node information to generate project candidate states, and generating a final candidate state based on the project candidate states;
[0010] Calculating the correlation between the neighbor node information in the final candidate state, and generating user dynamic interest information based on the correlation;
[0011] Constructing an in-degree time interval matrix and an out-degree time interval matrix, calculating weights between the node features based on the in-degree time interval matrix and the out-degree time interval matrix to generate user current interest information, and obtaining user interest categories according to the final candidate state;
[0012] Constructing a prediction model, and training the prediction model through a cross-entropy loss function to obtain a trained prediction model, inputting the user dynamic interest information into the trained prediction model for prediction to generate a set of candidate recommendation items;
[0013] An association relationship between the user's current interest information and the user's interest category is established, and the association relationship and the candidate recommendation item set are linearly fused to generate a combined recommendation representation.
[0014] Compared with the prior art, the beneficial effects of the present invention are: by constructing a time-series conversation graph and an undirected global graph through timestamps, it is possible to avoid ignoring time information when extracting features, resulting in the recommendation content being unable to meet the user's dynamic interest changes; by calculating the correlation between the neighbor node information in the final candidate state, the final output conversation recommendation is more in line with the user's changing needs; and by calculating the current interest information generated by the weights in the node features through two time interval matrices, and by linearly fusing the association relationship and the candidate recommendation items to generate a combined recommendation representation, it is possible to recommend content that meets the user's interests based on a longer conversation sequence.
[0015] Furthermore, the step of constructing the time-series session graph of the single session information and the undirected global graph of the historical session information based on the timestamp includes:
[0016] Converting the single session information into a time-series session graph with a timestamp based on the time information of the single session information;
[0017] Each item information in the historical session information is extracted, and the neighborhood of each item information is queried to form a neighborhood node set, and an undirected global graph is generated according to the neighborhood node set and the timestamp corresponding to each item information.
[0018] Furthermore, the step of extracting node features from the temporal session graph, aggregating neighbor node information in the undirected global graph, and sequentially propagating the neighbor node information to generate project candidate states, and generating a final candidate state based on the project candidate states includes:
[0019] Extracting spatial structural features from the time-series conversation graph, and extracting node features based on time information in the time-series conversation graph and the spatial structural features;
[0020] Arranging the neighbor node information in the undirected global graph according to an ordered list, and aggregating the arranged neighbor node information through an aggregation function to generate a project candidate state;
[0021] Useless information in the candidate states of the items is deleted based on the aggregation function to obtain a final candidate state.
[0022] Furthermore, the expression of the aggregation function is:
[0023] ;
[0024] ;
[0025] ;
[0026] ;
[0027] ;
[0028] Where, Representation node The intermediate representation obtained by aggregating neighbor information, Indicates the neighbor node information, represents the weight coefficient, represents the time step, Represents the information of each node in the time series session graph, represents the transposed matrix, represents the hidden state matrix of the node, represents the bias term, represents the output of the update gate, represents the sigmoid activation function, 、 Represent the two weight matrices of the update gate, Representation node exist The hidden state of the layer, represents the output of the reset gate, 、 Represent the two weight matrices of the reset gate, represents the candidate hidden state, represents the hyperbolic tangent activation function, 、 Represent two weight matrices of candidate states, Indicates the amount of information that the reset gate adjusts the old state, Indicates The final hidden state of the layer, Indicates the proportion of retaining the old state, Indicates the ratio of the update gate to control the new state.
[0029] Furthermore, the step of calculating the correlation between the neighbor node information in the final candidate state and generating the user dynamic interest information based on the correlation includes:
[0030] Designing a neighborhood-aware attention mechanism, and calculating the correlation between the neighbor node information based on the neighborhood-aware attention mechanism;
[0031] The degree of association is described by an association score, and the user dynamic interest information is generated by combining the association score with the neighbor node information.
[0032] Furthermore, the steps of constructing an in-degree time interval matrix and an out-degree time interval matrix, calculating weights between the node features based on the in-degree time interval matrix and the out-degree time interval matrix to generate user current interest information, and obtaining the user interest category based on the final candidate state include:
[0033] Construct the adjacency matrix of the two time intervals to obtain the in-degree time interval matrix and the out-degree time interval matrix;
[0034] Calculating weights between the node features based on the in-degree time interval matrix and the out-degree time interval matrix by linear interpolation, and generating user current interest information based on the weights and the time series conversation graph;
[0035] The session information in the final candidate state is sorted to obtain a session information table, and the user interest category is obtained according to the session information table.
[0036] Furthermore, the step of establishing an association relationship between the user's current interest information and the user's interest categories, and linearly fusing the association relationship and the candidate recommendation item set to generate a combined recommendation representation includes:
[0037] Obtaining a co-occurrence representation based on the user interest categories, and obtaining a sequential representation of the user interest categories through the session information table in the final candidate state;
[0038] The co-occurrence representation and the sequential representation are linearly fused to generate a combined recommendation representation.
[0039] In a second aspect, the present invention further provides a conversation recommendation system, comprising:
[0040] The acquisition module is used to obtain the user's single session information and historical session information;
[0041] A first building module is configured to build a time-series session graph of the single session information and an undirected global graph of the historical session information based on timestamps;
[0042] An extraction module is configured to extract node features from the temporal session graph, aggregate neighbor node information from the undirected global graph, and sequentially propagate the neighbor node information to generate candidate states for items, and generate a final candidate state based on the candidate states for items;
[0043] A calculation module, configured to calculate the correlation between the neighbor node information in the final candidate state, and generate user dynamic interest information based on the correlation;
[0044] A second construction module is configured to construct an in-degree time interval matrix and an out-degree time interval matrix, calculate weights between the node features based on the in-degree time interval matrix and the out-degree time interval matrix to generate user current interest information, and obtain user interest categories based on the final candidate state;
[0045] A third construction module is configured to construct a prediction model, train the prediction model using a cross-entropy loss function to obtain a trained prediction model, input the user dynamic interest information into the trained prediction model for prediction, and generate a set of candidate recommendation items;
[0046] The establishing module is used to establish an association relationship between the user's current interest information and the user's interest category, and linearly fuse the association relationship and the candidate recommendation item set to generate a combined recommendation representation.
[0047] In a third aspect, the present invention further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned conversation recommendation method when executing the computer program.
[0048] In a fourth aspect, the present invention further provides a storage medium storing a computer program, which implements the above-mentioned conversation recommendation method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 Flowchart of a conversation recommendation method in a first embodiment of the present invention;
[0050] Figure 2 is a structural block diagram of a conversation recommendation system in a second embodiment of the present invention;
[0051] Figure 3 FIG. 4 is a structural block diagram of an electronic device in a third embodiment of the present invention.
[0052] Description of main component symbols:
[0053] 10. Acquisition module; 20. First construction module; 30. Extraction module; 40. Calculation module; 50. Second construction module; 60. Third construction module; 70. Establishment module;
[0054] 80. Bus; 81. Processor; 82. Memory; 83. Communication interface.
[0055] The following specific embodiments will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0056] To facilitate understanding of the present invention, the present invention will be described more fully below with reference to the accompanying drawings. The drawings illustrate several embodiments of the present invention. However, the present invention may be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and comprehensive understanding of the present invention.
[0057] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be an intermediate element. When an element is referred to as being "connected to" another element, it may be directly connected to the other element or there may be an intermediate element. The terms "vertical," "horizontal," "left," "right," and similar expressions used herein are for illustrative purposes only.
[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one skilled in the art to which this invention pertains. The terms used in this specification of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0059] Example 1
[0060] See also Figure 1 , which shows a conversation recommendation method in a first embodiment of the present invention, comprising steps S1 to S7:
[0061] S1, obtain the user's single session information and historical session information;
[0062] It is understandable that single session information includes a user's single network search behavior, including the content requested by the user, timestamp, IP address and cache, and historical session information includes the content information, time information, IP address and cache of the user's previous network searches.
[0063] S2, constructing a time-series session graph of the single session information and an undirected global graph of the historical session information based on the timestamp;
[0064] Specifically, step S2 includes steps S21 to S22:
[0065] S21, converting the single session information into a time-series session graph with a timestamp based on the time information of the single session information;
[0066] It can be understood that each edge in the time-series session graph represents the items that users clicked on in the same session. Adjacent edges in the time-series session graph represent adjacent items. To preserve the time information in a single session, the edges of the time-series session graph are numbered and sorted, and each number represents the time information of the current item.
[0067] S22, extracting each item information from the historical session information, querying the neighborhood of each item information to form a neighborhood node set, and generating an undirected global graph based on the neighborhood node set and the timestamp corresponding to each item information;
[0068] It can be understood that the content of each search in the historical session information, that is, the project information, is extracted, and the search content adjacent to each search content is arranged, and each search content is regarded as a point to form a neighborhood point set, several points form a line, and several lines form an undirected global graph, and the undirected global graph is formed according to the search time corresponding to each point.
[0069] S3, extracting node features from the temporal session graph, aggregating neighbor node information in the undirected global graph, and sequentially propagating the neighbor node information to generate project candidate states, and generating a final candidate state based on the project candidate states;
[0070] Specifically, step S3 includes steps S31 to S33:
[0071] S31, extracting spatial structural features in the time series conversation graph, and extracting node features based on time information in the time series conversation graph and the spatial structural features;
[0072] S32, arranging the neighbor node information in the undirected global graph according to an ordered list, and aggregating the arranged neighbor node information using an aggregation function to generate a project candidate state;
[0073] S33, deleting useless information in the candidate states of the project based on the aggregation function to obtain a final candidate state;
[0074] It can be understood that, considering the situation of the edges in the time-series conversation graph, the spatial structural features in the time-series conversation graph are extracted, and the features of each edge are obtained according to the numbering of each edge and the situation of the edge, and then the node features are extracted. The neighbor node information is arranged according to the arrangement table of the search content adjacent to each search content, and then aggregated through the aggregation function, and the neighborhood node information is propagated in sequence to generate the project candidate state, and the useless information in the project candidate state is deleted through the aggregation function, such as irrelevant advertisements that are clicked once in the middle and not clicked in subsequent times, and finally the final candidate state is obtained.
[0075] In this embodiment, the aggregation process of the aggregation function is expressed as follows:
[0076] ;
[0077] ;
[0078] ;
[0079] ;
[0080] ;
[0081] Where, Representation node The intermediate representation obtained by aggregating neighbor information, Indicates the neighbor node information, represents the weight coefficient, represents the time step, Represents the information of each node in the time series session graph, represents the transposed matrix, represents the hidden state matrix of the node, represents the bias term, represents the output of the update gate, represents the sigmoid activation function, 、 Represent the two weight matrices of the update gate, Representation node exist The hidden state of the layer, represents the output of the reset gate, 、 Represent the two weight matrices of the reset gate, represents the candidate hidden state, represents the hyperbolic tangent activation function, 、 Represent two weight matrices of candidate states, Indicates the amount of information that the reset gate adjusts the old state, Indicates The final hidden state of the layer, Indicates the proportion of retaining the old state, Indicates the ratio of the update gate to control the new state.
[0082] S4, calculating the correlation between the neighbor node information in the final candidate state, and generating user dynamic interest information based on the correlation;
[0083] Specifically, step S4 includes steps S41 to S42:
[0084] S41, designing a neighborhood-aware attention mechanism, and calculating the correlation between the neighbor node information based on the neighborhood-aware attention mechanism;
[0085] S42, describing the degree of association through an association score, and generating the user dynamic interest information through combining the association score with the neighbor node information;
[0086] It should be explained that the neighborhood-aware attention mechanism enhances the ability to capture local contextual information by explicitly modeling the relationship between local neighborhoods in the input sequence. The correlation between neighboring node information in the final candidate state is calculated and described by the correlation score. In this embodiment, the calculation expression is:
[0087] ;
[0088] ;
[0089] Where, Representation node With node The correlation score between represents the query vector, represents the transposed matrix, represents a leaky rectified linear unit, represents the weight matrix, represents the aggregated feature vector, represents element-wise multiplication, Represents edge features, Representation node The weight coefficient of represents the normalization factor.
[0090] S5, constructing an in-degree time interval matrix and an out-degree time interval matrix, calculating weights between the node features based on the in-degree time interval matrix and the out-degree time interval matrix to generate user current interest information, and obtaining user interest categories based on the final candidate state;
[0091] Specifically, step S5 includes steps S51 to S53:
[0092] S51, constructing an adjacency matrix of two time intervals to obtain an in-degree time interval matrix and an out-degree time interval matrix;
[0093] It should be explained that in order to fully obtain the granularity information of the click time interval between items, an adjacency matrix of two time intervals is constructed to obtain an in-degree time interval matrix and an out-degree time interval matrix.
[0094] S52: Calculate weights between the node features based on the in-degree time interval matrix and the out-degree time interval matrix using a linear interpolation method, and generate user current interest information based on the weights and the time series conversation graph;
[0095] S53, sorting the session information in the final candidate state to obtain a session information table, and obtaining the user interest category according to the session information table;
[0096] It should be explained that in order to reduce the complexity of the calculation, the weights between node features are calculated based on the in-degree time interval matrix and the out-degree time interval matrix using linear interpolation. The specific expression is:
[0097] ;
[0098] Where, Representation node To Node The time interval weight, Representation node With node The time interval between Representation node To Node The longest time interval, Representation node To Node The shortest time interval;
[0099] It is understandable that the user's current interest information can be obtained through the weight of the features, and the user's interest categories can be obtained by sorting some session information in the final candidate state and according to the session information table and the position of the time information and session information in the session information table.
[0100] S6, constructing a prediction model, and training the prediction model using a cross-entropy loss function to obtain a trained prediction model, inputting the user dynamic interest information into the trained prediction model for prediction, and generating a set of candidate recommendation items;
[0101] It should be explained that, in this embodiment, the prediction expression of the prediction model is:
[0102] ;
[0103] Where, represents the predicted probability, represents the exponential function, Indicates the conversation representation, For all nodes Perform summation;
[0104] The expression of the trained prediction model is:
[0105] ;
[0106] Where, represents the prediction error of the predicted probability, represents the true label, represents the sum of the loss values of all samples. represents the number of samples, represents the complement of the true label, represents the complement of the predicted probabilities.
[0107] It is understandable that various interesting contents are recommended based on the trained prediction model, and the recommendation probability of each content is obtained, and then the various contents are arranged according to the recommendation probability to obtain a set of recommended items.
[0108] S7, establishing an association relationship between the user's current interest information and the user's interest categories, and linearly fusing the association relationship and the candidate recommendation item set to generate a combined recommendation representation;
[0109] Specifically, step S7 includes steps S71 to S72:
[0110] S71, obtaining a co-occurrence representation based on the user interest categories, and obtaining a sequential representation of the user interest categories through the session information table in the final candidate state;
[0111] S72, linearly fusing the co-occurrence representation and the sequence representation to generate a combined recommendation representation;
[0112] It needs to be explained that similar interests appear in user interest categories, such as mobile game and computer game searches, so as to obtain a co-occurrence representation of user interests, and through the time information of the session information table in the final candidate state, the user's interest content in different time periods can be obtained, thereby generating a sequential representation. By linearly fusing the interest content of different time periods and the interests of multiple searches, and fusing them through common features, a combined recommendation representation can be generated to accurately recommend the content of interest to the user.
[0113] In summary, the conversation recommendation method in the above-mentioned embodiment of the present invention constructs a time-series conversation graph and an undirected global graph through timestamps. When extracting features, it can avoid ignoring time information, which causes the recommended content to fail to meet the user's dynamic interest changes. By calculating the correlation between the neighbor node information in the final candidate state, the final output conversation recommendation is more in line with the user's changing needs. In addition, the current interest information generated by the weights in the node features calculated by two time interval matrices, and the combined recommendation representation generated by linearly fusing the association relationship and the candidate recommendation items can recommend content that meets the user's interests based on a longer conversation sequence.
[0114] Example 2
[0115] The present invention also proposes a conversation recommendation system, see Figure 2 , which shows a conversation system in a second embodiment of the present invention, the system includes:
[0116] Acquisition module 10, used to obtain the user's single session information and historical session information;
[0117] A first construction module 20 is configured to construct a time-series session graph of the single session information and an undirected global graph of the historical session information based on timestamps;
[0118] An extraction module 30 is configured to extract node features from the temporal session graph, aggregate neighbor node information from the undirected global graph, and sequentially propagate the neighbor node information to generate candidate states for items, and generate a final candidate state based on the candidate states for items;
[0119] A calculation module 40 is configured to calculate the correlation between the neighbor node information in the final candidate state, and generate user dynamic interest information based on the correlation;
[0120] A second construction module 50 is configured to construct an in-degree time interval matrix and an out-degree time interval matrix, calculate weights between the node features based on the in-degree time interval matrix and the out-degree time interval matrix to generate user current interest information, and obtain user interest categories based on the final candidate state;
[0121] A third construction module 60 is configured to construct a prediction model, train the prediction model using a cross-entropy loss function to obtain a trained prediction model, input the user's dynamic interest information into the trained prediction model for prediction, and generate a set of candidate recommendation items.
[0122] The establishing module 70 is configured to establish an association relationship between the user's current interest information and the user's interest categories, and linearly fuse the association relationship and the candidate recommendation item set to generate a combined recommendation representation.
[0123] In some optional embodiments, the first building module 20 includes:
[0124] a conversion unit, configured to convert the single session information into a time-series session graph with a timestamp based on the time information of the single session information;
[0125] The first extraction unit is used to extract each item information in the historical session information, query the neighborhood of each item information to form a neighborhood node set, and generate an undirected global graph according to the neighborhood node set and the timestamp corresponding to each item information.
[0126] In some optional embodiments, the extraction module 30 includes:
[0127] A second extraction unit is configured to extract spatial structural features from the time series conversation graph, and extract node features based on time information in the time series conversation graph and the spatial structural features;
[0128] an arrangement and aggregation unit, configured to arrange the neighbor node information in the undirected global graph according to an ordered list, and aggregate the arranged neighbor node information through an aggregation function to generate a project candidate state;
[0129] a pruning unit, configured to prune useless information from the candidate states of the items based on the aggregation function to obtain final candidate states;
[0130] The expression of the aggregation function is:
[0131] ;
[0132] ;
[0133] ;
[0134] ;
[0135] ;
[0136] Where, Representation node The intermediate representation obtained by aggregating neighbor information, Indicates the neighbor node information, represents the weight coefficient, represents the time step, Represents the information of each node in the time series session graph, represents the transposed matrix, represents the hidden state matrix of the node, represents the bias term, represents the output of the update gate, represents the sigmoid activation function, 、 Represent the two weight matrices of the update gate, Representation node exist The hidden state of the layer, represents the output of the reset gate, 、 Represent the two weight matrices of the reset gate, represents the candidate hidden state, represents the hyperbolic tangent activation function, 、 Represent two weight matrices of candidate states, Indicates the amount of information that the reset gate adjusts the old state, Indicates The final hidden state of the layer, Indicates the proportion of retaining the old state, Indicates the ratio of the update gate to control the new state.
[0137] In some optional embodiments, the calculation module 40 includes:
[0138] A first computing unit is configured to design a neighborhood-aware attention mechanism, and to calculate the correlation between the neighbor node information based on the neighborhood-aware attention mechanism;
[0139] The description generating unit is configured to describe the association degree through an association score, and generate the user dynamic interest information through the association score combined with the neighbor node information.
[0140] In some optional embodiments, the second building block 50 includes:
[0141] A construction unit, used for constructing an adjacency matrix of two time intervals to obtain an in-degree time interval matrix and an out-degree time interval matrix;
[0142] A second calculation unit is configured to calculate weights between the node features based on the in-degree time interval matrix and the out-degree time interval matrix by a linear interpolation method, and generate user current interest information based on the weights and the time series conversation graph;
[0143] A sorting unit is configured to sort the session information in the final candidate state to obtain a session information table, and obtain the user interest category according to the session information table.
[0144] In some optional embodiments, the establishing module 70 includes:
[0145] a first generating unit, configured to obtain a co-occurrence representation based on the user interest categories, and obtain a sequential representation of the user interest categories through a session information table in the final candidate state;
[0146] The second generating unit is configured to linearly fuse the co-occurrence representation and the sequential representation to generate a combined recommendation representation.
[0147] The functions or operation steps implemented when the above modules and units are executed are substantially the same as those in the above method embodiments and will not be repeated here.
[0148] The implementation principle and technical effects of the conversation recommendation system provided in the embodiment of the present invention are the same as those of the aforementioned method embodiment. For the sake of brief description, any matters not mentioned in the system embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0149] Example 3
[0150] The present invention also provides an electronic device, see Figure 3 , shown is an electronic device in a third embodiment of the present invention.
[0151] The electronic device may include a processor 81 and a memory 82 storing computer program instructions.
[0152] Specifically, the processor 81 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the present application.
[0153] Memory 82 may include a large-capacity memory for data or instructions. By way of example, and not limitation, memory 82 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 82 may include removable or non-removable (or fixed) media. Where appropriate, memory 82 may be internal or external to the data processing device. In certain embodiments, memory 82 is non-volatile memory. In certain embodiments, memory 82 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM) or a flash memory (FLASH), or a combination of two or more of these. Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), where the DRAM can be a fast page mode dynamic random access memory (FPMDRAM), an extended data out dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0154] The memory 82 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 81 .
[0155] The processor 81 implements the conversation recommendation method of the first embodiment by reading and executing computer program instructions stored in the memory 82 .
[0156] In some embodiments, the electronic device may further include a communication interface 83 and a bus 80. Figure 3 As shown, the processor 81, the memory 82, and the communication interface 83 are connected via a bus 80 and communicate with each other.
[0157] The communication interface 83 is used to implement communication between the various modules, devices, units and / or equipment in this application. The communication interface 83 can also implement data communication with other components such as: external devices, image / data acquisition equipment, databases, external storage, and image / data processing workstations.
[0158] The bus 80 includes hardware, software, or both, and couples the components of the device to each other. The bus 80 includes, but is not limited to, at least one of the following: a data bus, an address bus, a control bus, an expansion bus, and a local bus. By way of example and not limitation, bus 80 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 InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel 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 Bus (VLB) bus, or other suitable buses, or a combination of two or more of these. Bus 80 may include one or more buses, where appropriate. Although this application describes and illustrates a particular bus, this application contemplates any suitable bus or interconnect.
[0159] The electronic device can obtain the conversation recommendation system and execute the conversation recommendation method of the first embodiment.
[0160] In addition, in conjunction with the conversation recommendation method in the first embodiment, the present application may provide a storage medium for implementation. The storage medium stores computer program instructions; when the computer program instructions are executed by a processor, the conversation recommendation method in the first embodiment is implemented.
[0161] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0162] The above-described embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A conversation recommendation method, characterized in that: The method comprises: Get the user's single session information and historical session information; Constructing a time-series session graph of the single session information and an undirected global graph of the historical session information based on the timestamp; Extracting node features from the temporal session graph, aggregating neighbor node information in the undirected global graph, and sequentially propagating the neighbor node information to generate project candidate states, and generating a final candidate state based on the project candidate states; Calculating the correlation between the neighbor node information in the final candidate state, and generating user dynamic interest information based on the correlation; Constructing an in-degree time interval matrix and an out-degree time interval matrix, calculating weights between the node features based on the in-degree time interval matrix and the out-degree time interval matrix to generate user current interest information, and obtaining user interest categories according to the final candidate state; Constructing a prediction model, and training the prediction model through a cross-entropy loss function to obtain a trained prediction model, inputting the user dynamic interest information into the trained prediction model for prediction to generate a set of candidate recommendation items; An association relationship between the user's current interest information and the user's interest category is established, and the association relationship and the candidate recommendation item set are linearly fused to generate a combined recommendation representation.
2. The conversation recommendation method according to claim 1, wherein: The step of constructing the time-series session graph of the single session information and the undirected global graph of the historical session information based on the timestamp includes: Converting the single session information into a time-series session graph with a timestamp based on the time information of the single session information; Each item information in the historical session information is extracted, and the neighborhood of each item information is queried to form a neighborhood node set, and an undirected global graph is generated according to the neighborhood node set and the timestamp corresponding to each item information.
3. The conversation recommendation method according to claim 1, wherein: The steps of extracting node features from the temporal session graph, aggregating neighbor node information in the undirected global graph, and sequentially propagating the neighbor node information to generate project candidate states, and generating a final candidate state based on the project candidate states include: Extracting spatial structural features from the time-series conversation graph, and extracting node features based on time information in the time-series conversation graph and the spatial structural features; Arranging the neighbor node information in the undirected global graph according to an ordered list, and aggregating the arranged neighbor node information through an aggregation function to generate a project candidate state; Useless information in the candidate states of the items is deleted based on the aggregation function to obtain a final candidate state.
4. The conversation recommendation method according to claim 3, wherein: The expression of the aggregation function is: ; ; ; ; ; Where, Representation node The intermediate representation obtained by aggregating neighbor information, Indicates the neighbor node information, represents the weight coefficient, represents the time step, Represents the information of each node in the time series session graph, represents the transposed matrix, represents the hidden state matrix of the node, represents the bias term, represents the output of the update gate, represents the sigmoid activation function, 、 Represent the two weight matrices of the update gate, Representation node exist The hidden state of the layer, represents the output of the reset gate, 、 Represent the two weight matrices of the reset gate, represents the candidate hidden state, represents the hyperbolic tangent activation function, 、 Represent two weight matrices of candidate states, Indicates the amount of information that the reset gate adjusts the old state, Indicates The final hidden state of the layer, Indicates the proportion of retaining the old state, Indicates the ratio of the update gate to control the new state.
5. The conversation recommendation method according to claim 1, wherein: The step of calculating the correlation between the neighbor node information in the final candidate state and generating user dynamic interest information based on the correlation comprises: Designing a neighborhood-aware attention mechanism, and calculating the correlation between the neighbor node information based on the neighborhood-aware attention mechanism; The degree of association is described by an association score, and the user dynamic interest information is generated by combining the association score with the neighbor node information.
6. The conversation recommendation method according to claim 1, wherein: The steps of constructing an in-degree time interval matrix and an out-degree time interval matrix, calculating weights between the node features based on the in-degree time interval matrix and the out-degree time interval matrix to generate user current interest information, and obtaining user interest categories based on the final candidate state include: Construct the adjacency matrix of the two time intervals to obtain the in-degree time interval matrix and the out-degree time interval matrix; Calculating weights between the node features based on the in-degree time interval matrix and the out-degree time interval matrix by linear interpolation, and generating user current interest information based on the weights and the time series conversation graph; The session information in the final candidate state is sorted to obtain a session information table, and the user interest category is obtained according to the session information table.
7. The conversation recommendation method according to claim 1, wherein: The step of establishing an association relationship between the user's current interest information and the user's interest categories, and linearly fusing the association relationship and the candidate recommendation item set to generate a combined recommendation representation includes: Obtaining a co-occurrence representation based on the user interest categories, and obtaining a sequential representation of the user interest categories through the session information table in the final candidate state; The co-occurrence representation and the sequential representation are linearly fused to generate a combined recommendation representation.
8. A conversation recommendation system, characterized in that The system comprises: The acquisition module is used to obtain the user's single session information and historical session information; A first building module is configured to build a time-series session graph of the single session information and an undirected global graph of the historical session information based on timestamps; An extraction module is configured to extract node features from the temporal session graph, aggregate neighbor node information from the undirected global graph, and sequentially propagate the neighbor node information to generate candidate states for items, and generate a final candidate state based on the candidate states for items; A calculation module, configured to calculate the correlation between the neighbor node information in the final candidate state, and generate user dynamic interest information based on the correlation; A second construction module is configured to construct an in-degree time interval matrix and an out-degree time interval matrix, calculate weights between the node features based on the in-degree time interval matrix and the out-degree time interval matrix to generate user current interest information, and obtain user interest categories based on the final candidate state; A third construction module is configured to construct a prediction model, train the prediction model using a cross-entropy loss function to obtain a trained prediction model, input the user dynamic interest information into the trained prediction model for prediction, and generate a set of candidate recommendation items; The establishing module is used to establish an association relationship between the user's current interest information and the user's interest category, and linearly fuse the association relationship and the candidate recommendation item set to generate a combined recommendation representation.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the conversation recommendation method according to any one of claims 1 to 7 is implemented.
10. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the conversation recommendation method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Multi-granularity session recommendation method fusing user interest state
CN114169968A
Session recommendation method fusing historical information and related device
CN119691161A