摘 要:現有基于會話的推薦算法主要通過挖掘單個目標會話的項目轉換關系進行推薦,對來自其他不同會話中項目之間的復雜轉換信息考慮較少。為此,提出一種融合全局和近鄰協同信息的會話推薦算法SFGN-GNN,同時考慮來自全局與近鄰會話的協同信息,以充分挖掘用戶偏好。通過學習會話表示來表達用戶偏好,先按目標會話與近鄰會話的成對項目轉移關系構建近鄰圖,依據所有會話中的成對項目轉移關系構建全局圖,再利用圖神經網絡獲取目標會話節點近鄰級和全局級的項目表示,采用融合門融合得到會話級項目表示,并在其中嵌入項目在目標會話中的位置信息和時間信息,然后通過軟注意力機制得到最終的會話表示,最后經過softmax函數預測下一個可能交互的項目。在兩個數據集上的實驗驗證了SFGN-GNN算法有效性。
關鍵詞: 圖神經網絡; 會話推薦; 協同信息; 注意力機制; 信息融合
中圖分類號: TP391 文獻標志碼: A 文章編號: 1001-3695(2023)06-009-1660-06
doi: 10.19734/j.issn.1001-3695.2022.12.0629
Session-based recommendation algorithm fusing global and neighbor collaboration information
Wang Lunkang Gao Maoting
(College of Information Engineering, Shanghai Maritime University, Shanghai 201306, China)
Abstract:
Existing session-based recommendation algorithms mainly recommend by mining the item conversion relationship of a single target session, and take less account of the complex conversion information between items from other different sessions. This paper proposed a session-based recommendation algorithm fusing global and neighbor collaboration information (SFGN-GNN), which simultaneously considered the collaboration information from neighbor and global sessions to fully exploit user preference. The algorithm expressed user preference by learning session representation. Firstly, it built the neighbor graph according to the pairwise item transfer relationship between the target session and neighbor session, and built the global graph according to the pairwise item transfer relationship in all sessions. Then, it used the graph neural network to obtain the neighbor-level and global-level item representations of the target session node. Next, it used the fusion gate to obtain the session-level item representation, and embedded the position information and time information of the item in the target session. Afterward, it obtained the final session representation by using the soft attention mechanism. Finally, it predicted the next possible interaction item by softmax function. Experiments on two datasets demonstrate the effectiveness of SFGN-GNN algorithm.
Key words:graph neural network; session-based recommendation; collaboration information; attention mechanism; information-fusion
0 引言
推薦系統通過向用戶推薦有用的內容,成為解決信息過載的重要手段,在各種在線平臺中發揮著越來越重要的作用。傳統推薦算法[1,2]主要依據用戶基本信息和歷史交互信息,然而在許多移動流媒體應用場景(抖音、Bilibili等)中,對于新用戶或者身份未知的用戶,無法獲取他們的歷史行為挖掘其偏好,導致推薦效果欠佳。因此,基于會話的推薦系統(session-based recommendation system,SRS)通過給定的匿名行為序列,挖掘用戶的偏好,從而預測用戶的后續操作,以其在匿名推薦場景中的高實用性而備受關注。
基于相似度[3,4]和馬爾可夫鏈[5~9]是解決SRS任務的兩種傳統方法。前者嚴重依賴于目標會話項目的共現信息,忽略了會話中項目的順序模式;后者引入順序性,根據目標會話中用戶的前一個動作預測下一個動作,但通常側重于對兩個相鄰項的順序轉換進行建模,導致遠距離項目的轉換被忽略。近年來,深度學習方法廣泛應用到SRS中[10~21],并取得較好的效果。Hidasi等人[10]將RNN應用于SRS,提出GRU4Rec模型,采用多層門控循環單元 (GRU) 對項目交互序列進行建模。Jannach等人[12]提出KNN-RNN方法,在基于相似度方法上集成GRU4Rec模型,提取會話內的順序性。Li等人[13]提出NARM模型,將注意力機制結合到堆棧GRU編碼器中,同時捕捉順序模式和用戶的長期偏好。Liu等人[14]放棄會話中的序列特征,提出基于注意力機制的短期記憶網絡STAMP,同時捕捉用戶的長期偏好和短期偏好。然而,與基于馬爾可夫鏈的方法類似,基于RNN的方法側重于對相鄰項目的順序轉換進行建模,難以捕捉項目復雜的轉換關系。
1 圖神經網絡
2 模型框架與算法描述
2.1 問題說明
2.2 模型框架
基于圖神經網絡的會話推薦一般經過會話圖構建、項目嵌入表示學習、目標會話表示生成、項目預測四步[10]。SFGN-GNN算法按此構建。
在會話圖構建模塊中,因為目標會話中蘊涵的信息有限,所以同時考慮來自全局與近鄰會話的協同信息,根據目標會話與全局會話近鄰檢索得到的k個近鄰會話構建近鄰圖,根據全局會話的全局信息過濾得到ε近鄰集合構建全局圖,以便從全局與近鄰會話中挖掘協同信息。在項目嵌入表示學習模塊中,為獲取兩個級別的項目嵌入表示,在近鄰圖中用基于雙通道的SGCN[23]得到目標會話項目的近鄰級表示;在全局圖中,引入注意力機制,以項目近鄰級表示作為輸入,從全局圖中捕獲與目標會話相關度更高的節點,用GNN得到目標會話項目的全局級表示。在目標會話表示生成模塊中,為對兩個級別的項目嵌入表示的依賴關系建模,并從中提取重要信息以獲得會話表示,融合近鄰級與全局級嵌入表示得到項目會話級嵌入表示,在其中嵌入項目在目標會話中的位置信息和時間信息,再通過軟注意力機制學習目標會話內每個項目的權重信息,加權目標會話內的會話級嵌入表示得到最終的會話表示,綜合考慮每個項目的重要性程度。最后,經過預測模塊得到項目得分,選擇得分高的項目進行推薦。算法模型如圖1所示。
2.3 會話圖構建模塊
會話圖構建模塊分別完成近鄰圖和全局圖的構建。
2.3.1 近鄰圖構建
參照文獻[16]的方法,對給定目標會話和全局會話,先近鄰檢索得到與目標會話相近鄰的前k個近鄰會話,再在圖結構中對目標會話和近鄰會話共同建模,構建有向近鄰圖。近鄰圖構建流程如圖2所示。
2.3.2 全局圖構建
2.4 項目嵌入表示學習模塊
根據已構建的近鄰圖和全局圖,分別通過近鄰級和全局級項目表示學習部分來獲取目標會話節點近鄰級和全局級的項目表示。
2.4.1 近鄰級項目表示學習
2.4.2 全局級項目表示學習
2.5 目標會話表示生成模塊
2.5.1 信息融合
2.5.2 注意力機制
2.6 預測模塊
3 實驗與分析
為驗證SFGN-GNN算法的有效性,在兩個公開數據集上進行以下四組實驗:與基線模型的對比實驗、對近鄰圖中近鄰系數k的分析實驗、會話表示學習模塊中不同融合方法的比較實驗和消融實驗。最后進行算法的實例分析。
3.1 數據集與預處理
3.2 評價指標
3.3 對比方法
3.4 參數設置
3.5 結果分析
3.6 實例分析
為了更直觀地表現SFGN-GNN模型的有效性和準確性,本文隨機從數據集Diginetica的測試集中選取了一段會話進行實例分析。所選會話長度為15,其中前14個項目所組成的會話作為目標會話,最后1個項目作為待預測項目(即真實值)。此處選擇SR-GNN和GCE-GNN兩個代表性方法作為SFGN-GNN的實例對比實驗,因為SR-GNN是第一個考慮把圖神經網絡融入會話推薦算法中的方法,GCE-GNN是基線方法中針對數據集Diginetica效果最好的方法。前20個推薦結果如表5所示。
從表中可以看出,GCE-GNN和SFGN-GNN模型所給出的前20個推薦結果都正確地預測出了18715號項目(粗體處),SR-GNN未能正確預測,說明了SFGN-GNN模型的有效性。SFGN-GNN所預測出正確項目的排名為第10,GCE-GNN所預測出正確項目的排名為第17,SFGN-GNN相比GCE-GNN的預測結果有更高的排名,說明了SFGN-GNN模型的準確性。
4 結束語
本文提出融合全局和近鄰協同信息的會話推薦算法,綜合考慮近鄰與全局協同信息,從而豐富了目標會話的信息。利用SGCN和GNN提取會話節點近鄰級嵌入表示和全局級嵌入表示并融合,還嵌入位置與時間信息通過注意力機制衡量目標會話內每個項目對整體會話的貢獻度,從而生成更好的目標會話表示,使推薦更為精確。本文將項目轉移看做成對關系,忽略了項目之間復雜的高階信息。因此,下一步研究可以通過超圖重新構建全局會話,挖掘目標會話的高階協同信息,以達到提升推薦準確度的目的。
參考文獻:
[1]Jin Rong,Chai J Y,Si Luo. An automatic weighting scheme for collaborative filtering [C]// Proc of the 27th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval. New York: ACM Press,2004: 337-344.
[2]Linden G,Smith B,York J,et al. Amazon. com recommendations: item-to-item collaborative filtering [J]. IEEE Internet Computing,2003,7(1): 76-80.
[3]Sarwar B,Karypis G,Konstan J,et al. Item-based collaborative filtering recommendation algorithms [C]// Proc of the 10th International World Wide Web Conference.New York:ACM Press,2001:285-295.
[4]Bonnin G,Jannach D. Automated generation of music playlists: survey and experiments [J]. ACM Computing Surveys,2015,26:1-35.
[5]Shani G,Heckerman D,Brafman R I,et al. An MDP-based recommender system [J]. Journal of Machine Learning Research,2005,21: 1265-1295.
[6]Zimdars A,Chichering D M,Meek C. Using temporal data for making recommendations [C]// Proc of the 17th Conference on Uncertainty in Artificial Intelligence. San Francisco,CA: Morgan Kaufmann, 2001: 580-588.
[7]Mobasher B,Dai Honghua,Luo Tao,et al. Using sequential and non-sequential patterns in predictive web usage mining tasks [C]// Proc of IEEE International Conference on Data Mining. Piscataway,NJ: IEEE Press,2002: 669-672.
[8]Tavako M,Brefeld U. Factored MDPs for detecting topics of user sessions [C]// Proc of ACM Conference on Recommender Systems. New York: ACM Press,2014: 33-40.
[9]Rendle S,Freudenthaler C,Schmidt-thieme L. Factorizing persona-lized Markov chains for next-basket recommendation [C]// Proc of the 19th International Conference on World Wide Web. New York: ACM Press,2010: 811-820.
[10]Hidasi B,Karatzoglou A,Baltrunas L,et al. Session-based recommendations with recurrent neural networks [C]// Proc of International Conference on Learning Representations.[S.l.]:ICLR Press,2016:1-10.
[11]陶玉合,高榕,邵雄凱,等. 基于膠囊圖卷積的解纏繞會話感知推薦方法 [J]. 計算機應用研究,2023,40(1): 122-128. (Tao Yuhe,Gao Rong,Shao Xiongkai,et al. Capsule-based graph convolutio-nal disentanglement for session-aware recommendation [J]. Application Research of Computers,2023,40(1): 122-128.)
[12]Jannach D,Ludewig M. When recurrent neural networks meet the neighborhood for session-based recommendation [C]// Proc of the 11th ACM Conference on Recommender Systems. New York: ACM Press,2017: 306-310.
[13]Li Jing,Ren Pengjie,Chen Zhumin,et al. Neural attentive session-based recommendation [C]// Proc of ACM Conference on Information and Knowledge Management.[S.l.]:CIKM Press,2017:1419-1428.
[14]Liu Qiao,Zeng Yifu,Mokhosi R,et al. STAMP: short-term attention/memory priority model for session-based recommendation [C]// Proc of the 24th ACM SIGKDD International Conference on Knowledge Discovery amp; Data Mining. New York: ACM Press,2018: 1831-1839.
[15]Wu Shu,Tang Yuyuan,Zhu Yanqiao,et al. Session-based recommendation with graph neural networks [C]// Proc of AAAI Conference on Artificial Intelligence.Palo Alto,CA:AAAI Press,2019:346-353.
[16]Zheng Yujia,Liu Siyi,Li Zekun,et al. DGTN: dual-channel graph transition network for session-based recommendation [C]// Proc of International Conference on Data Mining Workshops. Piscataway,NJ: IEEE Press,2020: 236-242.
[17]Wang Ziyang,Wei Wei,Cong Gao,et al.Global context enhanced graph neural networks for session-based recommendation [C]// Proc of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval.New York:ACM Press,2020:169-178.
[18]Deng Zhihong,Wang Changdong,Huang Ling,et al. G3SR: global graph guided session-based recommendation [J]. IEEE Trans on Neural Networks and Learning Systems,2022,1-14.
[19]Xia Xin,Yin Hongzhi,Yu Junliang,et al. Self-supervised hypergraph convolutional networks for session-based recommendation[C]// Proc of AAAI Conference on Artificial Intelligence. 2021:4503-4511.
[20]何倩倩,孫靜宇,曾亞竹. 基于鄰域感知圖神經網絡的會話推薦 [J]. 計算機工程與應用,2022,58(9): 107-115. (He Qianqian,Sun Jingyu,Zeng Yazhu. Neighborhood awareness graph neural networks for session-based recommendation [J]. Computer Enginee-ring and Applications,2022,58(9): 107-115.)
[21]黨偉超,姚志宇,白尚旺,等. 基于圖模型和注意力模型的會話推薦方法 [J]. 計算機應用,2022,42(11): 3610-3616. (Dang Weichao,Yao Zhiyu,Bai Shangwang,et al. Session recommendation method based on graph model and attention model [J]. Journal of Computer Applications,2022,42(11): 3610-3616.)
[22]Kipf T N,Welling M. Semi-supervised classification with graph convo-lutional networks [C]//Proc of International Conference on Learning Representations.[S.l.]: ICLR Press,2017: 1-14.
[23]Wu F,Souza A,Zhang Tianyi,et al. Simplifying graph convolutional networks [C]// Proc of International Conference on Machine Lear-ning. [S.l.]: PMLR,2019: 6861-6871.
[24]Tang Jiaxi,Wang Ke. Personalized top-n sequential recommendation via convolutional sequence embedding [C]// Proc of the 11th ACM International Conference on Web Search and Data Mining. New York: ACM Press,2018: 565-573.