隨著電子商務的迅速發展,消費者雖然能獲得日益增多的商品選擇,不過這也同時導致他們面臨訊息過載的挑戰,而推薦系統的出現能有效緩解這個問題。推薦系統可以進一步細分為不同的推薦任務,其中,下一個購物籃推薦任務主要是從用戶的購物籃歷史序列資料中,捕捉用戶的購買偏好,進而為用戶推薦下一個購物籃的商品。 然而,過去的購物籃推薦方法大多僅在學習用戶的購買歷史後,直接向用戶推薦相同大小的下一個購物籃,卻忽略了不同用戶可能因消費習慣或經濟能力,而導致籃子大小有所不同。因此,本研究提出了一種搭配籃子大小的下一個購物籃推薦模型NBR-WBS。此模型先是透過注意力機制與長短期記憶分別為購物籃與購物籃大小進行編碼,接著將兩者的嵌入一起輸入到Transformer中進行多任務學習,以獲得購物籃的最終狀態向量。隨後,我們將該向量輸入到各別組件中進行特定任務的預測,並根據兩項任務的預測結果,為用戶進行動態大小的購物籃推薦。在本研究中,我們對三個真實世界的資料集進行了實驗,結果顯示我們所提出的方法在推薦性能上優於其他在下一個購物籃推薦任務的現有方法。;With the rapid development of e-commerce, consumers benefit from an increasing variety of products but also face the challenge of information overload. Recommendation systems can effectively address this issue by helping users filter through the abundance of choices. These systems include various tasks, such as session-based recommendation, sequential recommendation, and the next basket recommendation task. Among them, the next basket recommendation task aims to capture users′ purchasing preferences from their historical basket sequences and recommend items for their next basket. However, most of the previous basket recommendation methods merely recommend the same size basket based on the user′s purchase history, ignoring that different users may have varying basket sizes due to consumption habits or economic capability. Therefore, in this study, we propose a next basket recommendation model that incorporates basket size prediction, named NBR-WBS (Next Basket Recommendation with Basket Size). This model first encodes the baskets and basket sizes separately using an attention mechanism and Long Short-Term Memory (LSTM), respectively. The embeddings of both are then input into a Transformer for multi-task learning (MTL) to obtain the final state vector of the basket. Subsequently, we input this vector into specific components for task prediction. Based on the results of these two tasks, we recommend dynamically sized baskets to users. Our experiments on three real-world datasets demonstrate that our proposed method outperforms existing methods regarding recommendation performance for the next basket recommendation task.